-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
823 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps(['licenseId']); | ||
import { | ||
CategoryScale, | ||
Chart as ChartJS, | ||
Legend, | ||
LineElement, | ||
LinearScale, | ||
PointElement, | ||
Title, | ||
Tooltip, | ||
} from 'chart.js'; | ||
import { Line } from 'vue-chartjs'; | ||
ChartJS.register( | ||
CategoryScale, | ||
LinearScale, | ||
PointElement, | ||
LineElement, | ||
Title, | ||
Tooltip, | ||
Legend, | ||
); | ||
interface QueryResult { | ||
rows: Rows[]; | ||
fields: Array<Array<string>>; | ||
} | ||
interface Rows { | ||
count: number; | ||
time: Date; | ||
action: string; | ||
} | ||
const { $client } = useNuxtApp(); | ||
const { data: licenses } = await $client.licenseUsage.getById.useQuery({ | ||
id: props.licenseId, | ||
}); | ||
const query: QueryResult = licenses.value; | ||
const rows: Rows[] = query.rows; | ||
console.log('rows', rows); | ||
// MAP | ||
const valueSuccess = rows | ||
.filter((item) => item.action === 'SUCCESS') | ||
.map((item) => item.count); | ||
const valueExpired = rows | ||
.filter((item) => item.action === 'EXPIRED') | ||
.map((item) => item.count); | ||
const labels = rows.map((x) => x.time); | ||
const chartOptions = { | ||
responsive: true, | ||
maintainAspectRatio: false, | ||
scales: { | ||
yAxes: [ | ||
{ | ||
display: true, | ||
type: 'time', | ||
time: { | ||
parser: 'MM/DD/YYYY', | ||
tooltipFormat: 'll', | ||
unit: 'day', | ||
unitStepSize: 1, | ||
displayFormats: { | ||
day: 'MM/DD/YYYY', | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
const chartData = { | ||
labels: labels, | ||
datasets: [ | ||
{ | ||
label: 'SUCCESS', | ||
backgroundColor: '#209a2a', | ||
data: valueSuccess, | ||
}, | ||
{ | ||
label: 'EXPIRED', | ||
backgroundColor: '#c1123a', | ||
data: valueExpired, | ||
}, | ||
], | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="relative isolate"> | ||
<div class="mx-auto max-w-7xl py-10"> | ||
<div class="px-4 sm:px-6 lg:px-8"> | ||
<Line | ||
id="LineChart" | ||
:options="chartOptions" | ||
:data="chartData" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
definePageMeta({ | ||
layout: 'dashboard', | ||
middleware: 'auth', | ||
}); | ||
useSeoMeta({ | ||
title: 'Customer - GetLicensed', | ||
}); | ||
</script> | ||
|
||
<template> | ||
<main> | ||
<header class="relative isolate"> | ||
<div class="absolute inset-0 -z-10 overflow-hidden" aria-hidden="true"> | ||
<div class="absolute left-16 top-full -mt-16 transform-gpu opacity-50 blur-3xl xl:left-1/2 xl:-ml-80"> | ||
<div class="aspect-[1154/678] w-[72.125rem] bg-gradient-to-br from-[#FF80B5] to-[#9089FC]" style="clip-path: polygon(100% 38.5%, 82.6% 100%, 60.2% 37.7%, 52.4% 32.1%, 47.5% 41.8%, 45.2% 65.6%, 27.5% 23.4%, 0.1% 35.3%, 17.9% 0%, 27.7% 23.4%, 76.2% 2.5%, 74.2% 56%, 100% 38.5%)" /> | ||
</div> | ||
<div class="absolute inset-x-0 bottom-0 h-px bg-gray-900/5" /> | ||
</div> | ||
|
||
<div class="mx-auto max-w-7xl px-4 py-10 sm:px-6 lg:px-8"> | ||
<div class="mx-auto flex max-w-2xl items-center justify-between gap-x-8 lg:mx-0 lg:max-w-none"> | ||
<div class="flex items-center gap-x-6"> | ||
<h1> | ||
<div class="mt-1 text-base font-semibold leading-6 text-gray-900">Customers</div> | ||
</h1> | ||
<div> | ||
<CustomerModal /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
<CustomerTable /> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,9 +33,5 @@ useSeoMeta({ | |
</div> | ||
</div> | ||
</header> | ||
|
||
<ProductTable /> | ||
<CustomerTable /> | ||
<LicenseTable /> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<script setup lang="ts"> | ||
definePageMeta({ | ||
layout: 'dashboard', | ||
middleware: 'auth', | ||
}); | ||
useSeoMeta({ | ||
title: 'License - GetLicensed', | ||
}); | ||
const { $client } = useNuxtApp(); | ||
const route = useRoute(); | ||
const { data: license } = await $client.license.getById.useQuery({ | ||
id: route.params.id.toString(), | ||
}); | ||
const toto = license.value; | ||
</script> | ||
|
||
|
||
<template> | ||
<main> | ||
<header class="relative isolate"> | ||
<div class="absolute inset-0 -z-10 overflow-hidden" aria-hidden="true"> | ||
<div class="absolute left-16 top-full -mt-16 transform-gpu opacity-50 blur-3xl xl:left-1/2 xl:-ml-80"> | ||
<div class="aspect-[1154/678] w-[72.125rem] bg-gradient-to-br from-[#FF80B5] to-[#9089FC]" style="clip-path: polygon(100% 38.5%, 82.6% 100%, 60.2% 37.7%, 52.4% 32.1%, 47.5% 41.8%, 45.2% 65.6%, 27.5% 23.4%, 0.1% 35.3%, 17.9% 0%, 27.7% 23.4%, 76.2% 2.5%, 74.2% 56%, 100% 38.5%)" /> | ||
</div> | ||
<div class="absolute inset-x-0 bottom-0 h-px bg-gray-900/5" /> | ||
</div> | ||
|
||
<div class="mx-auto max-w-7xl px-4 py-10 sm:px-6 lg:px-8"> | ||
<div class="mx-auto flex max-w-2xl items-center justify-between gap-x-8 lg:mx-0 lg:max-w-none"> | ||
<div class="flex items-center gap-x-6"> | ||
<h1> | ||
<div class="mt-1 text-base font-semibold leading-6 text-gray-900">License {{ toto?.name }} ({{ toto?.id }})</div> | ||
</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
<LicenseChart :licenseId="route.params.id.toString()" /> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="ts"> | ||
definePageMeta({ | ||
layout: 'dashboard', | ||
middleware: 'auth', | ||
}); | ||
useSeoMeta({ | ||
title: 'License - GetLicensed', | ||
}); | ||
</script> | ||
|
||
<template> | ||
<main> | ||
<header class="relative isolate"> | ||
<div class="absolute inset-0 -z-10 overflow-hidden" aria-hidden="true"> | ||
<div class="absolute left-16 top-full -mt-16 transform-gpu opacity-50 blur-3xl xl:left-1/2 xl:-ml-80"> | ||
<div class="aspect-[1154/678] w-[72.125rem] bg-gradient-to-br from-[#FF80B5] to-[#9089FC]" style="clip-path: polygon(100% 38.5%, 82.6% 100%, 60.2% 37.7%, 52.4% 32.1%, 47.5% 41.8%, 45.2% 65.6%, 27.5% 23.4%, 0.1% 35.3%, 17.9% 0%, 27.7% 23.4%, 76.2% 2.5%, 74.2% 56%, 100% 38.5%)" /> | ||
</div> | ||
<div class="absolute inset-x-0 bottom-0 h-px bg-gray-900/5" /> | ||
</div> | ||
|
||
<div class="mx-auto max-w-7xl px-4 py-10 sm:px-6 lg:px-8"> | ||
<div class="mx-auto flex max-w-2xl items-center justify-between gap-x-8 lg:mx-0 lg:max-w-none"> | ||
<div class="flex items-center gap-x-6"> | ||
<h1> | ||
<div class="mt-1 text-base font-semibold leading-6 text-gray-900">Licenses</div> | ||
</h1> | ||
|
||
<div> | ||
<LicenseModal /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
<LicenseTable /> | ||
</main> | ||
</template> |
Oops, something went wrong.