-
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
1 parent
3f3e585
commit fb54cfd
Showing
7 changed files
with
153 additions
and
4 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
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 |
---|---|---|
@@ -1,6 +1,46 @@ | ||
<script lang="ts" setup> | ||
import { onMounted, ref } from 'vue'; | ||
import ApexDonut from './components/ApexDonut.vue'; | ||
import { makeHttpReq } from '@/http/makeHttpReq'; | ||
import { showError } from '@/helper/toastnotification'; | ||
type ResponseType = Array<number> | ||
const loading = ref(false) | ||
const serverData = ref<ResponseType>([] as ResponseType) | ||
async function getChartData() { | ||
try { | ||
loading.value = true | ||
const data = await makeHttpReq<undefined, ResponseType>('chartdata', 'GET') | ||
serverData.value = data | ||
loading.value = false | ||
} catch (error) { | ||
showError((error as Error).message) | ||
loading.value = false | ||
} | ||
} | ||
onMounted(async()=>{ | ||
await getChartData() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="container"> | ||
<h1>Dashboard</h1> | ||
|
||
<div class="row"> | ||
<div class="col-md-4"> | ||
<div v-if="serverData.length>0"> | ||
<ApexDonut :data="serverData"/> | ||
</div> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
<template> | ||
<apexchart | ||
height="155" | ||
type="donut" | ||
:options="options" | ||
:series="series" | ||
></apexchart> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
export default defineComponent({ | ||
name: 'ApexDonut', | ||
props: { | ||
data: { type: Array, required: true }, | ||
}, | ||
data() { | ||
return { | ||
options: { | ||
title: { | ||
text: '', | ||
align: 'left', | ||
}, | ||
chart: { | ||
id: 'apex-donut', | ||
}, | ||
states: { | ||
hover: { | ||
filter: 'none' | ||
} | ||
}, | ||
theme: { | ||
palette: 'palette2' | ||
}, | ||
labels: ['Income','Expenses'], | ||
colors: [ ], | ||
markers: { | ||
size: 5, | ||
hover: { | ||
sizeOffset: 6, | ||
}, | ||
}, | ||
// xaxis: { | ||
// categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998], | ||
// }, | ||
}, | ||
series: this.$props.data, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
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,15 @@ | ||
<template> | ||
<br> | ||
<br> | ||
<br> | ||
<div align="center"> | ||
|
||
Your account has been blocked, please contact admin : <a>[email protected]</a> | ||
|
||
<br> | ||
<br> | ||
<br> | ||
<a href="/">Go to the login page</a> | ||
</div> | ||
|
||
</template> |