This commit is contained in:
@@ -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
|
todo: Administration - License
|
||||||
- view
|
- view
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
:error-messages="form().serverErrors(this, 'backupTime')"
|
:error-messages="form().serverErrors(this, 'backupTime')"
|
||||||
v-model="obj.backupTime"
|
v-model="obj.backupTime"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
ref="backupTime"
|
ref="backupTime"
|
||||||
@input="fieldValueChanged('backupTime')"
|
@input="fieldValueChanged('backupTime')"
|
||||||
></gz-time-picker>
|
></gz-time-picker>
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
<v-checkbox
|
<v-checkbox
|
||||||
v-model="obj.backupAttachments"
|
v-model="obj.backupAttachments"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
:label="$ay.t('BackupAttachments')"
|
:label="$ay.t('BackupAttachments')"
|
||||||
ref="backupAttachments"
|
ref="backupAttachments"
|
||||||
:error-messages="form().serverErrors(this, 'backupAttachments')"
|
:error-messages="form().serverErrors(this, 'backupAttachments')"
|
||||||
@@ -34,6 +36,7 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.backupSetsToKeep"
|
v-model="obj.backupSetsToKeep"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
:label="$ay.t('BackupSetsToKeep')"
|
:label="$ay.t('BackupSetsToKeep')"
|
||||||
ref="backupSetsToKeep"
|
ref="backupSetsToKeep"
|
||||||
:rules="[form().integerValid(this, 'backupSetsToKeep')]"
|
:rules="[form().integerValid(this, 'backupSetsToKeep')]"
|
||||||
@@ -63,7 +66,12 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in backupFileList" :key="item.id">
|
<tr v-for="item in backupFileList" :key="item.id">
|
||||||
<td>
|
<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>
|
||||||
<td>{{ item.created }}</td>
|
<td>{{ item.created }}</td>
|
||||||
<td>{{ item.length }}</td>
|
<td>{{ item.length }}</td>
|
||||||
@@ -223,7 +231,9 @@ export default {
|
|||||||
this.languageName,
|
this.languageName,
|
||||||
this.hour12
|
this.hour12
|
||||||
),
|
),
|
||||||
url: window.$gz.api.backupDownloadUrl(o.name),
|
url: vm.formState.readOnly
|
||||||
|
? null
|
||||||
|
: window.$gz.api.backupDownloadUrl(o.name),
|
||||||
name: o.name,
|
name: o.name,
|
||||||
length: o.length
|
length: o.length
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ export default {
|
|||||||
let vm = this;
|
let vm = this;
|
||||||
initForm(vm)
|
initForm(vm)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
vm.rights = window.$gz.role.getRights(window.$gz.type.ServerJob);
|
||||||
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
vm.formState.ready = true;
|
vm.formState.ready = true;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
vm.getDataFromApi();
|
vm.getDataFromApi();
|
||||||
@@ -188,17 +190,20 @@ function generateMenu(vm) {
|
|||||||
surface: false,
|
surface: false,
|
||||||
key: FORM_KEY + ":copylog",
|
key: FORM_KEY + ":copylog",
|
||||||
vm: vm
|
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);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,13 @@
|
|||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<v-row>
|
<v-row>
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<v-radio-group
|
<v-radio-group
|
||||||
v-model="obj.serverState"
|
v-model="obj.serverState"
|
||||||
:mandatory="true"
|
:mandatory="true"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
>
|
>
|
||||||
<v-radio :label="$ay.t('ServerStateOpen')" value="Open"></v-radio>
|
<v-radio :label="$ay.t('ServerStateOpen')" value="Open"></v-radio>
|
||||||
<v-radio
|
<v-radio
|
||||||
@@ -21,6 +23,7 @@
|
|||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="obj.reason"
|
v-model="obj.reason"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
:label="$ay.t('ServerStateReason')"
|
:label="$ay.t('ServerStateReason')"
|
||||||
:error-messages="form().serverErrors(this, 'reason')"
|
:error-messages="form().serverErrors(this, 'reason')"
|
||||||
ref="reason"
|
ref="reason"
|
||||||
@@ -51,7 +54,7 @@ export default {
|
|||||||
initForm(vm)
|
initForm(vm)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
vm.rights = window.$gz.role.getRights(window.$gz.type.ServerState);
|
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);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
vm.getDataFromApi();
|
vm.getDataFromApi();
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user