Move to independent route

This commit is contained in:
Douglas Barone 2022-06-15 18:53:41 +00:00
parent 88b7bef469
commit d94dd3895e
5 changed files with 75 additions and 93 deletions

View File

@ -44,7 +44,7 @@ export default {
}, },
height: { height: {
type: Number, type: Number,
default: 250 default: 200
}, },
cssClasses: { cssClasses: {
default: '', default: '',

View File

@ -61,7 +61,7 @@ export default {
}, },
height: { height: {
type: Number, type: Number,
default: 250 default: 200
}, },
cssClasses: { cssClasses: {
default: '', default: '',

View File

@ -73,7 +73,7 @@ export default {
methods: { methods: {
shouldShowGroup({ items }) { shouldShowGroup({ items }) {
return items.some(item => return items.some(item =>
this.$route.matched.some(route => route.name === item.route.name) this.$route.matched.some(route => route.name == item.route.name)
) )
} }
} }

View File

@ -193,18 +193,6 @@ const routes = [
/* webpackChunkName: "access-points" */ '../views/AccessPoints/index.vue' /* webpackChunkName: "access-points" */ '../views/AccessPoints/index.vue'
), ),
children: [ children: [
{
path: ':id/clients',
name: 'access-point-clients',
meta: {
title: 'Clientes conectados',
roles: ['superAdmin']
},
component: () =>
import(
/* webpackChunkName: "access-point-clients" */ '../views/AccessPoints/clients.vue'
)
},
{ {
path: ':id/edit', path: ':id/edit',
name: 'access-point-edit', name: 'access-point-edit',
@ -220,6 +208,19 @@ const routes = [
] ]
}, },
{
path: '/access-points/:id/clients',
name: 'access-point-clients',
meta: {
title: 'Clientes conectados',
roles: ['superAdmin']
},
component: () =>
import(
/* webpackChunkName: "access-point-clients" */ '../views/AccessPoints/clients.vue'
)
},
{ {
path: '/wifi-users', path: '/wifi-users',
name: 'wifi-users', name: 'wifi-users',

View File

@ -1,11 +1,5 @@
<template> <template>
<div> <div>
<v-dialog
v-model="showDialog"
fullscreen
transition="dialog-bottom-transition"
scrollable
>
<v-card v-if="!accessPoint"> <v-card v-if="!accessPoint">
<v-skeleton-loader <v-skeleton-loader
type="table-heading, list-item-two-line, image, table-tfoot" type="table-heading, list-item-two-line, image, table-tfoot"
@ -14,6 +8,9 @@
<v-card v-else :loading="!accessPoint"> <v-card v-else :loading="!accessPoint">
<v-card-title class="font-weight-regular"> <v-card-title class="font-weight-regular">
<v-btn class="ml-1" icon @click="() => $router.back()">
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<div> <div>
<ApIcon class="mr-2" :controller="accessPoint.controller" /> <ApIcon class="mr-2" :controller="accessPoint.controller" />
{{ accessPoint.name || accessPoint.hostname }} {{ accessPoint.name || accessPoint.hostname }}
@ -22,6 +19,7 @@
<v-divider /> <v-divider />
{{ accessPoint.local }} {{ accessPoint.local }}
</small> </small>
<br />
</div> </div>
<v-spacer /> <v-spacer />
<v-text-field <v-text-field
@ -34,12 +32,9 @@
outlined outlined
dense dense
/> />
<v-btn class="ml-1" icon @click="showDialog = false">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-card-title> </v-card-title>
<v-divider /> <v-divider />
<v-card-text> <v-card-text>
<v-container fluid> <v-container fluid>
<v-row> <v-row>
@ -61,19 +56,11 @@
<AccessPointClientsDataTable <AccessPointClientsDataTable
:wifi-devices="accessPoint.wifiDevices" :wifi-devices="accessPoint.wifiDevices"
:filter="filter" :filter="filter"
paginate
/> />
</v-card-text> </v-card-text>
<v-divider /> <v-divider />
<v-card-actions>
<v-icon small left>mdi-account-group</v-icon>
{{ accessPoint.wifiDevices.length }} clientes conectados
<v-spacer />
<v-btn color="primary" text @click="showDialog = false">
Voltar
</v-btn>
</v-card-actions>
</v-card> </v-card>
</v-dialog>
</div> </div>
</template> </template>
@ -94,15 +81,9 @@ export default {
AccessPointSignalStrengthChart AccessPointSignalStrengthChart
}, },
data: () => ({ data: () => ({
showDialog: true,
filter: '' filter: ''
}), }),
watch: { watch: {},
showDialog() {
this.filter = ''
this.$router.back()
}
},
apollo: { apollo: {
accessPoint: { accessPoint: {