Reorganize charts

This commit is contained in:
Douglas Barone 2022-12-08 14:03:40 -04:00
parent c38af654fa
commit 590ac4870d
3 changed files with 64 additions and 6 deletions

View File

@ -58,6 +58,14 @@ export default {
plugins: { plugins: {
type: Array, type: Array,
default: () => [] default: () => []
},
suggestedMax0: {
type: Number,
default: 80
},
suggestedMax1: {
type: Number,
default: 80
} }
}, },
data: () => ({}), data: () => ({}),
@ -76,7 +84,7 @@ export default {
y: { y: {
beginAtZero: true, beginAtZero: true,
min: 0, min: 0,
suggestedMax: 80, suggestedMax: this.suggestedMax0,
title: { title: {
display: true, display: true,
@ -85,6 +93,7 @@ export default {
}, },
y1: { y1: {
beginAtZero: true, beginAtZero: true,
suggestedMax: this.suggestedMax1,
position: 'right', position: 'right',
title: { title: {
display: true display: true

View File

@ -46,7 +46,7 @@
<v-container> <v-container>
<v-row> <v-row>
<v-col :md="6"> <v-col :md="6">
<AccessPointClientsChart <ClientsChart
:chart-id="`ap-clients-chart-${accessPoint.id}`" :chart-id="`ap-clients-chart-${accessPoint.id}`"
:stats="accessPoint.stats" :stats="accessPoint.stats"
/> />
@ -76,7 +76,7 @@ import gql from 'graphql-tag'
import ApIcon from '@/components/ApIcon.vue' import ApIcon from '@/components/ApIcon.vue'
import AccessPointClientsDataTable from '@/components/dataTables/AccessPointClientsDataTable.vue' import AccessPointClientsDataTable from '@/components/dataTables/AccessPointClientsDataTable.vue'
import AccessPointClientsChart from '@/components/charts/AccessPointClientsChart.vue' import ClientsChart from '@/components/charts/ClientsChart.vue'
import AccessPointSignalStrengthChart from '@/components/charts/AccessPointSignalStrengthChart.vue' import AccessPointSignalStrengthChart from '@/components/charts/AccessPointSignalStrengthChart.vue'
export default { export default {
@ -84,7 +84,7 @@ export default {
components: { components: {
ApIcon, ApIcon,
AccessPointClientsDataTable, AccessPointClientsDataTable,
AccessPointClientsChart, ClientsChart,
AccessPointSignalStrengthChart AccessPointSignalStrengthChart
}, },
data: () => ({ data: () => ({

View File

@ -1,7 +1,56 @@
<template> <template>
<v-container>stat</v-container> <v-container>
<v-row>
<v-col v-for="subnet in subnets" :key="subnet.shortname" cols="4">
<v-card>
<v-card-title class="title font-weight-light text-sm-body-1">
{{ subnet.name }} - {{ subnet.cidr }}
<v-spacer />
<v-icon left> mdi-devices </v-icon>
{{ subnet.stats[0].clients }}
</v-card-title>
<v-card-text>
<ClientsChart
:stats="subnet.stats"
:subnet="subnet"
:suggested-max0="500"
:suggested-max1="500000000000"
:height="150"
/>
</v-card-text>
</v-card>
</v-col>
</v-row>
</v-container>
</template> </template>
<script> <script>
export default {} import ClientsChart from '@/components/charts/ClientsChart.vue'
import gql from 'graphql-tag'
export default {
components: { ClientsChart },
apollo: {
subnets: {
pollInterval: 5000,
debounce: 500,
cachePolicy: 'cache-and-network',
query: gql`
{
subnets {
shortName
name
cidr
stats {
timestamp
id
clients
avgUsage
sumUsage
}
}
}
`
}
}
}
</script> </script>