web: added ids to listviewelement

This commit is contained in:
Mika 2024-07-11 18:51:03 +02:00
parent f38604adb9
commit 2a36ad52ec
4 changed files with 34 additions and 17 deletions

16
web/components.d.ts vendored
View file

@ -5,14 +5,14 @@
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
export {} export {}
declare module 'vue' { declare module "vue" {
export interface GlobalComponents { export interface GlobalComponents {
CategoryContainer: typeof import('./src/components/CategoryContainer.vue')['default'] CategoryContainer: typeof import("./src/components/CategoryContainer.vue")["default"];
Clipboard: typeof import('./src/components/Clipboard.vue')['default'] Clipboard: typeof import("./src/components/Clipboard.vue")["default"];
HeaderBar: typeof import('./src/components/HeaderBar.vue')['default'] HeaderBar: typeof import("./src/components/HeaderBar.vue")["default"];
ListViewElement: typeof import('./src/components/ListViewElement.vue')['default'] ListViewElement: typeof import("./src/components/ListViewElement.vue")["default"];
LoginPage: typeof import('./src/components/loginPage.vue')['default'] LoginPage: typeof import("./src/components/loginPage.vue")["default"];
MainPage: typeof import('./src/components/MainPage.vue')['default'] MainPage: typeof import("./src/components/MainPage.vue")["default"];
UsersDialog: typeof import('./src/components/NavBarIcons/UsersDialog.vue')['default'] UsersDialog: typeof import("./src/components/NavBarIcons/UsersDialog.vue")["default"];
} }
} }

View file

@ -1,8 +1,9 @@
<template> <template>
<div class="root"> <div class="mt-3">
<h2>{{ props.licenseGroupName }}:</h2> <h2>{{ props.licenseGroupName }}:</h2>
<li v-for="license in licenses" :key="license.id"> <li v-for="license in licenses" :key="license.id">
<ListViewElement <ListViewElement
:id="license.id"
:licenseName="license.name" :licenseName="license.name"
:licenseKey="license.key" :licenseKey="license.key"
:startDate="license.start ? new Date(license.start) : null" :startDate="license.start ? new Date(license.start) : null"
@ -31,10 +32,6 @@ const props = defineProps<{ licenseGroupName: string; licenses: License[] }>();
</script> </script>
<style scoped> <style scoped>
.root {
margin-top: 10px;
}
li { li {
list-style-type: none; list-style-type: none;
} }

View file

@ -104,6 +104,7 @@ import {
import { ref } from "vue"; import { ref } from "vue";
const props = defineProps<{ const props = defineProps<{
id: number;
licenseName: string; licenseName: string;
licenseKey: string; licenseKey: string;
startDate: Date | null; startDate: Date | null;
@ -111,9 +112,8 @@ const props = defineProps<{
amount?: number; amount?: number;
notes?: string; notes?: string;
}>(); }>();
//
// EDIT SECTION // EDIT SECTION
//
const edit = ref(false); const edit = ref(false);
</script> </script>

View file

@ -11,8 +11,16 @@
<span>Add/Delete/Manage users who have access to this tool</span> <span>Add/Delete/Manage users who have access to this tool</span>
</v-card-subtitle> </v-card-subtitle>
<v-card-text> <v-card-text>
<div>I am just a placeholder</div> <v-data-table
:headers="headers"
:items="items"
:items-per-page="10"
item-key="name"
class="elevation-5"
></v-data-table>
<v-divider class="border-opacity-50 mt-5" :thickness="2"></v-divider>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="blue darken-1" @click="users = false">Close</v-btn> <v-btn color="blue darken-1" @click="users = false">Close</v-btn>
@ -22,9 +30,21 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue";
import { Users } from "lucide-vue-next"; import { Users } from "lucide-vue-next";
import { defineComponent, ref, computed, watch } from "vue";
// Data Table values
const headers = ref([
{ title: "Name", value: "name" },
{ title: "Email", value: "email" },
{ title: "Actions", value: "actions", sortable: false },
]);
const items = ref([
{ name: "John Doe", email: "test@john.doe", actions: "Here CRUD" },
]);
// Dialog open state
const users = ref(false); const users = ref(false);
</script> </script>