Better restrictions
This commit is contained in:
parent
caa958b34a
commit
60a0e793ac
|
@ -14,7 +14,13 @@
|
|||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-progress-linear class="mb-4" :indeterminate="loading || !accessPoint" />
|
||||
<v-card v-if="accessPoint" :elevation="0" class="ma-2" :disabled="loading">
|
||||
<v-form :disabled="!userInSameCampus">
|
||||
<v-card
|
||||
v-if="accessPoint"
|
||||
:elevation="0"
|
||||
class="ma-2"
|
||||
:disabled="loading"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="name"
|
||||
label="Nome"
|
||||
|
@ -30,7 +36,7 @@
|
|||
clearable
|
||||
/>
|
||||
<v-textarea v-model="notes" label="Observações" outlined clearable />
|
||||
<v-card-actions>
|
||||
<v-card-actions v-if="userInSameCampus">
|
||||
<v-btn color="error darken-1" icon @click="onDeleteAccessPoint">
|
||||
<v-icon>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
|
@ -45,10 +51,16 @@
|
|||
Cancelar
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
<v-card-actions v-else>
|
||||
<v-alert color="info" outlined icon="mdi-information">
|
||||
Você só pode alterar APs do seu campus.
|
||||
</v-alert>
|
||||
</v-card-actions>
|
||||
<v-alert v-for="error in errors" :key="error" class="mt-4" type="error">
|
||||
{{ error }}
|
||||
</v-alert>
|
||||
</v-card>
|
||||
</v-form>
|
||||
</v-navigation-drawer>
|
||||
</template>
|
||||
|
||||
|
@ -148,7 +160,22 @@ Continuar?`
|
|||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
userInSameCampus() {
|
||||
return this.me.campus == this.accessPoint.subnetInfo.shortName
|
||||
}
|
||||
},
|
||||
apollo: {
|
||||
me: {
|
||||
cachePolicy: 'cache-and-network',
|
||||
query: gql`
|
||||
{
|
||||
me {
|
||||
campus
|
||||
}
|
||||
}
|
||||
`
|
||||
},
|
||||
accessPoint: {
|
||||
cachePolicy: 'cache-and-network',
|
||||
query: gql`
|
||||
|
@ -161,6 +188,10 @@ Continuar?`
|
|||
mac
|
||||
local
|
||||
notes
|
||||
|
||||
subnetInfo {
|
||||
shortName
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
|
|
Loading…
Reference in New Issue
Block a user