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