This commit is contained in:
2020-06-06 23:08:43 +00:00
parent 6022f71b50
commit b83f37e7ca
4 changed files with 29 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ WIFI change 5g channel to 52,56,60 and 2g channel to 8
todo: bug - rights for ops limited in backup page not being checked so when adjust backup settings get not authorized error
todo: readonly not enough, sb disabled as well, check widget and anywhere readonly is set and examine to see if that's a good change
todo: Administration - License
- view

View File

@@ -14,6 +14,7 @@
:error-messages="form().serverErrors(this, 'backupTime')"
v-model="obj.backupTime"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
ref="backupTime"
@input="fieldValueChanged('backupTime')"
></gz-time-picker>
@@ -23,6 +24,7 @@
<v-checkbox
v-model="obj.backupAttachments"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('BackupAttachments')"
ref="backupAttachments"
:error-messages="form().serverErrors(this, 'backupAttachments')"
@@ -34,6 +36,7 @@
<v-text-field
v-model="obj.backupSetsToKeep"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('BackupSetsToKeep')"
ref="backupSetsToKeep"
:rules="[form().integerValid(this, 'backupSetsToKeep')]"
@@ -63,7 +66,12 @@
<tbody>
<tr v-for="item in backupFileList" :key="item.id">
<td>
<a :href="item.url">{{ item.name }}</a>
<template v-if="!formState.readOnly">
<a :href="item.url">{{ item.name }}</a>
</template>
<template v-else>
{{ item.name }}
</template>
</td>
<td>{{ item.created }}</td>
<td>{{ item.length }}</td>
@@ -223,7 +231,9 @@ export default {
this.languageName,
this.hour12
),
url: window.$gz.api.backupDownloadUrl(o.name),
url: vm.formState.readOnly
? null
: window.$gz.api.backupDownloadUrl(o.name),
name: o.name,
length: o.length
});

View File

@@ -40,6 +40,8 @@ export default {
let vm = this;
initForm(vm)
.then(() => {
vm.rights = window.$gz.role.getRights(window.$gz.type.ServerJob);
vm.formState.readOnly = !vm.rights.change;
vm.formState.ready = true;
window.$gz.eventBus.$on("menu-click", clickHandler);
vm.getDataFromApi();
@@ -188,17 +190,20 @@ function generateMenu(vm) {
surface: false,
key: FORM_KEY + ":copylog",
vm: vm
},
{
title: vm.$ay.t("OpsTestJob"),
icon: "fa-robot",
surface: false,
key: FORM_KEY + ":TEST_JOB",
vm: vm
}
]
};
if (vm.rights.change) {
menuOptions.menuItems.push({
title: vm.$ay.t("OpsTestJob"),
icon: "fa-robot",
surface: false,
key: FORM_KEY + ":TEST_JOB",
vm: vm
});
}
window.$gz.eventBus.$emit("menu-change", menuOptions);
}

View File

@@ -4,11 +4,13 @@
<v-form ref="form">
<v-row>
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-radio-group
v-model="obj.serverState"
:mandatory="true"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
>
<v-radio :label="$ay.t('ServerStateOpen')" value="Open"></v-radio>
<v-radio
@@ -21,6 +23,7 @@
<v-textarea
v-model="obj.reason"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('ServerStateReason')"
:error-messages="form().serverErrors(this, 'reason')"
ref="reason"
@@ -51,7 +54,7 @@ export default {
initForm(vm)
.then(() => {
vm.rights = window.$gz.role.getRights(window.$gz.type.ServerState);
// vm.formState.ready = true;
vm.formState.readOnly = !vm.rights.change;
window.$gz.eventBus.$on("menu-click", clickHandler);
vm.getDataFromApi();
})