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