Alisa/web/src/components/ListViewElement.vue

115 lines
3 KiB
Vue
Raw Normal View History

<template>
2024-07-11 15:05:18 +02:00
<v-sheet elevation="4" width="96vw" rounded="lg" class="mt-3">
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-title>
<div class="mr-3">
2024-07-11 21:07:31 +02:00
{{ license.name }}
</div>
<div
class="mr-3 d-flex align-self-center"
style="align-items: center"
>
<KeyRound class="mr-1" />
2024-07-11 21:07:31 +02:00
{{ license.key }}
</div>
<div
class="mr-3 d-flex align-self-center"
style="align-items: center"
>
<CalendarCheck />
2024-07-11 15:05:18 +02:00
<span>
{{
2024-07-11 21:07:31 +02:00
license.start
? new Date(license.start).toLocaleDateString()
2024-07-11 15:59:10 +02:00
: "Indefinitely"
2024-07-11 15:05:18 +02:00
}}
</span>
</div>
<div
class="mr-3 d-flex align-self-center"
style="align-items: center"
>
<CalendarX />
2024-07-11 15:05:18 +02:00
<span>
{{
2024-07-11 21:07:31 +02:00
license.end
? new Date(license.end).toLocaleDateString()
2024-07-11 15:59:10 +02:00
: "Indefinitely"
2024-07-11 15:05:18 +02:00
}}
</span>
</div>
<div
class="mr-3 d-flex align-self-center"
style="align-items: center"
>
<img
src="../assets/doublekey.svg"
alt="logo"
class="logo mr-1"
width="24"
/>
2024-07-11 21:07:31 +02:00
<span v-if="license.amount == null || license.amount == undefined">
<Infinity />
</span>
<span v-else>
2024-07-11 21:07:31 +02:00
{{ license.amount }}
</span>
</div>
</v-expansion-panel-title>
<v-expansion-panel-text>
2024-07-11 13:25:39 +02:00
Notes:
2024-07-11 15:18:33 +02:00
<div class="flex-nowrap d-flex" no-gutters>
<div
class="flex-grow-1 overflow-x-auto border-e-md align-self-end"
2024-07-11 15:05:18 +02:00
cols="10"
2024-07-11 10:59:22 +02:00
>
2024-07-11 21:07:31 +02:00
{{ license.note }}
2024-07-11 15:18:33 +02:00
</div>
2024-07-11 10:59:22 +02:00
2024-07-11 15:20:21 +02:00
<div align="end">
2024-07-11 15:05:18 +02:00
<!-- -->
<!-- EDIT SECTION -->
<!-- -->
2024-07-11 21:07:31 +02:00
<UpdateDialog :license="license" />
2024-07-11 15:05:18 +02:00
<!-- -->
<!-- DELETE BTN -->
<!-- -->
2024-07-11 21:46:35 +02:00
<DeleteDialog :license="license" />
2024-07-11 15:18:33 +02:00
</div>
</div>
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
</v-sheet>
</template>
<script setup lang="ts">
2024-07-11 21:07:31 +02:00
import { License } from "@/types";
2024-07-11 21:46:35 +02:00
import { Infinity, KeyRound, CalendarCheck, CalendarX } from "lucide-vue-next";
2024-07-11 21:07:31 +02:00
import UpdateDialog from "./UpdateDialog.vue";
2024-07-11 21:46:35 +02:00
import DeleteDialog from "./DeleteDialog.vue";
2024-07-11 21:07:31 +02:00
const { license } = defineProps<{
license: License;
/*id: string;
2024-07-11 15:05:18 +02:00
licenseName: string;
licenseKey: string;
startDate: Date | null;
endDate: Date | null;
amount?: number;
2024-07-11 21:07:31 +02:00
notes?: string;*/
2024-07-11 15:05:18 +02:00
}>();
</script>
<style scoped>
.values {
display: flex;
align-items: center;
}
</style>