This commit is contained in:
2020-06-12 18:53:48 +00:00
parent c81b55c000
commit e6f3d324e2
2 changed files with 66 additions and 15 deletions

View File

@@ -8,11 +8,16 @@
<template v-if="showLicenseUi() == 'revoked'">
Revoked license ui</template
>
<template v-if="showLicenseUi() == 'need'">
<template
v-if="
showLicenseUi() == 'needcantrial' ||
showLicenseUi() == 'neednotrial'
"
>
<v-col cols="12">
<h3 class="mb-6 ml-1">{{ $ay.t("NoLicenseTitle") }}</h3>
<v-expansion-panels focusable>
<v-expansion-panel>
<v-expansion-panel v-if="showLicenseUi() == 'needcantrial'">
<v-expansion-panel-header>{{
$ay.t("StartEvaluation")
}}</v-expansion-panel-header>
@@ -71,8 +76,9 @@
></v-text-field>
</v-col>
<v-col cols="12">
{{ sendRequestDisabled() }}
<v-btn :disabled="sendRequestDisabled()"
<v-btn
:disabled="sendRequestDisabled()"
@click="sendRequest()"
>$ay.t('SendRequest')</v-btn
>
</v-col>
@@ -159,9 +165,9 @@ export default {
},
licenseState: 0,
request: {
Email: null,
Company: null,
Contact: null
Email: "cardjohn@ayanova.com",
Company: "Super TestCo",
Contact: "Test Testerson"
},
obj: {},
formState: {
@@ -215,9 +221,14 @@ export default {
}
*/
let licenseState = window.$gz.store.state.globalSettings.licenseStatus;
//LICENSE STATUS: NONE, EXPIREDTRIAL, EXPIREDPURCHASE
if (licenseState == 0 || licenseState == 2 || licenseState == 4) {
return "need";
//LICENSE STATUS: NONE, EXPIREDTRIAL
if (licenseState == 0 || licenseState == 2) {
return "needcantrial";
}
//LICENSE STATUS: EXPIREDPURCHASE
if (licenseState == 4) {
return "neednotrial";
}
//LICENSE STATE: REVOKED
if (licenseState == 5) {
@@ -240,6 +251,32 @@ export default {
"requestemail"
]);
},
async sendRequest() {
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"
);
if (dialogResult == false) {
return;
}
//call erase
let r = await window.$gz.api.upsertEx(
"license/permanently-erase-all-data",
"I understand"
);
//send request
r = await window.$gz.api.upsertEx("license/trialRequest", vm.request);
console.log(r);
//then another message box saying watch your email to verify
} catch (error) {
window.$gz.errorHandler.handleFormError(error, vm);
}
},
translation() {
return window.$gz.translation;
},
@@ -463,7 +500,8 @@ function fetchTranslatedText(vm) {
"LicenseContactName",
"LicenseEmail",
"RequestEvaluationLicense",
"LicenseEmailVerficationHint"
"LicenseEmailVerficationHint",
"AdminEraseDatabaseWarning" //preexisting
]);
}