Added more chips

This commit is contained in:
Douglas Barone 2022-12-15 09:02:04 -04:00
parent c961d3570b
commit a26f576033
5 changed files with 40 additions and 8 deletions

View File

@ -1,12 +1,12 @@
{
"name": "ifms-pti-svr",
"version": "3.4.5",
"version": "3.4.6",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ifms-pti-svr",
"version": "3.4.5",
"version": "3.4.6",
"license": "ISC",
"dependencies": {
"@prisma/client": "^4.7.1",

View File

@ -1,6 +1,6 @@
{
"name": "ifms-pti-svr",
"version": "3.4.5",
"version": "3.4.6",
"description": "Servidor do Portal de TI do IFMS",
"main": "src/index.js",
"prisma": {

4
web/package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "ifms-pti",
"version": "3.4.5",
"version": "3.4.6",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ifms-pti",
"version": "3.4.5",
"version": "3.4.6",
"dependencies": {
"@mdi/font": "^6.9.96",
"apollo-link-ws": "^1.0.20",

View File

@ -1,6 +1,6 @@
{
"name": "ifms-pti",
"version": "3.4.5",
"version": "3.4.6",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

View File

@ -46,9 +46,28 @@
<v-tooltip top>
<template #activator="{ on }">
<v-chip outlined small v-on="on">
<v-icon left small>mdi-chart-bell-curve-cumulative</v-icon>
<v-chip outlined small class="mr-2" v-on="on">
<v-icon left small>mdi-arrow-down</v-icon>
{{ subnetLowestClients(subnet) }}
</v-chip>
</template>
<span>Menor quantidade de clientes no intervalo</span>
</v-tooltip>
<v-tooltip top>
<template #activator="{ on }">
<v-chip outlined small class="mr-2" v-on="on">
<v-icon left small>mdi-division</v-icon>
{{ subnetAvgClients(subnet) }}
</v-chip>
</template>
<span>Média de clientes no intervalo</span>
</v-tooltip>
<v-tooltip top>
<template #activator="{ on }">
<v-chip outlined small v-on="on">
<v-icon left small>mdi-devices</v-icon>
{{ subnet.stats[0].clients }}
</v-chip>
</template>
@ -144,10 +163,23 @@ export default {
return Math.max(max, stat.clients)
}, 0)
},
subnetLowestClients(subnet) {
return subnet.stats.reduce((min, stat) => {
return Math.min(min, stat.clients)
}, Number.MAX_VALUE)
},
subnetPeakUsage(subnet) {
return subnet.stats.reduce((max, stat) => {
return Math.max(max, stat.sumUsage)
}, 0)
},
subnetAvgClients(subnet) {
const avg =
subnet.stats.reduce((sum, stat) => {
return sum + stat.clients
}, 0) / subnet.stats.length
return Math.round(avg)
}
},
apollo: {