This commit is contained in:
2020-06-14 23:26:21 +00:00
parent 3858fe5c7f
commit 124511e117
3 changed files with 41 additions and 30 deletions

View File

@@ -337,37 +337,39 @@ export default {
}, },
remove() { remove() {
let vm = this; let vm = this;
window.$gz.dialog.confirmGeneric("ResetToDefault").then(dialogResult => { window.$gz.dialog
if (dialogResult == true) { .confirmGeneric("ResetToDefault", "warning")
//do the delete .then(dialogResult => {
vm.formState.loading = true; if (dialogResult == true) {
//No need to delete a new record, just abandon it... //do the delete
if (vm.templateId && vm.templateId != 0) { vm.formState.loading = true;
let url = API_BASE_URL + vm.templateId; //No need to delete a new record, just abandon it...
if (vm.templateId && vm.templateId != 0) {
let url = API_BASE_URL + vm.templateId;
window.$gz.form.deleteAllErrorBoxErrors(vm); window.$gz.form.deleteAllErrorBoxErrors(vm);
window.$gz.api window.$gz.api
.remove(url) .remove(url)
.then(res => { .then(res => {
if (res.error) { if (res.error) {
vm.formState.serverError = res.error; vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm); window.$gz.form.setErrorBoxErrors(vm);
} else { } else {
//trigger reload of form //trigger reload of form
this.getDataFromApi(); this.getDataFromApi();
} }
}) })
.catch(function handleGetDataFromAPIError(error) { .catch(function handleGetDataFromAPIError(error) {
//Update the form status //Update the form status
window.$gz.form.setFormState({ window.$gz.form.setFormState({
vm: vm, vm: vm,
loading: false loading: false
});
window.$gz.errorHandler.handleFormError(error, vm);
}); });
window.$gz.errorHandler.handleFormError(error, vm); }
});
} }
} });
});
} }
} }
}; };

View File

@@ -349,7 +349,16 @@ export default {
//Only no key or expired trial are here, not expired purchase //Only no key or expired trial are here, not expired purchase
//so safe to erase //so safe to erase
let dialogResult = await window.$gz.dialog.confirmGeneric( let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning" "AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
); );
if (dialogResult == false) { if (dialogResult == false) {
return; return;

View File

@@ -355,7 +355,7 @@ function clickHandler(menuItem) {
break; break;
case "backupnow": case "backupnow":
window.$gz.dialog window.$gz.dialog
.confirmGeneric("AreYouSureBackupNow") .confirmGeneric("AreYouSureBackupNow", "warning")
.then(dialogResult => { .then(dialogResult => {
if (dialogResult == true) { if (dialogResult == true) {
m.vm.backupNow(); m.vm.backupNow();