This commit is contained in:
2020-06-15 19:43:52 +00:00
parent fbe1270f2e
commit ef6e504e20

View File

@@ -229,6 +229,7 @@ export default {
translations: []
},
licenseState: 0,
dbIsEmpty: false,
request: {
Email: null,
Company: null,
@@ -333,23 +334,25 @@ export default {
async sendEvaluationRequest() {
let vm = this;
try {
//Only no key or expired trial are here, not expired purchase
//so safe to erase
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
if (this.dbIsEmpty != true) {
//Need to erase database
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;
}
}
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;
}
//call erase
let r = await window.$gz.api.upsertEx(
"license/permanently-erase-all-data",
@@ -410,23 +413,25 @@ export default {
},
async erase() {
let vm = this;
try {
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
if (this.dbIsEmpty != true) {
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;
}
}
//call erase
let r = await window.$gz.api.upsertEx(
"license/permanently-erase-all-data",
@@ -530,6 +535,13 @@ function initForm(vm) {
}
vm.currentLicenseInfo = res.data.license;
await fetchTranslatedText(vm);
res = await window.$gz.api.get("license/database-empty");
if (res.error) {
throw res.error;
}
vm.dbIsEmpty = res.data;
// await populateSelectionLists(vm);
} catch (err) {
reject(err);