This commit is contained in:
2020-06-18 19:59:45 +00:00
parent a3850e6c8a
commit c1b8acfbb7
3 changed files with 38 additions and 16 deletions

View File

@@ -278,7 +278,7 @@ export default {
purchaseLink() {
return (
"https://www.ayanova.com/purchase_AyaNova_online.htm?dbid=" +
this.currentLicenseInfo.serverDbId
window.$gz.store.state.globalSettings.serverDbId
);
},
helpRestore() {
@@ -382,6 +382,26 @@ export default {
async fetchKey() {
let vm = this;
try {
//check if we're still on the same "page" or the server has a different license
//It might have been just installed by the server on it's own so check if we are not working with the most current license
let currentServerLicenseInfo = await window.$gz.api.get("license");
if (currentServerLicenseInfo.error) {
throw currentServerLicenseInfo.error;
}
currentServerLicenseInfo = currentServerLicenseInfo.data.license;
console.log("cached:", vm.currentLicenseInfo);
console.log("at server:", currentServerLicenseInfo);
if (
currentServerLicenseInfo.keySerial != vm.currentLicenseInfo.keySerial
) {
//the license has changed behind the scenes so act like it was a successful fetch
await window.$gz.dialog.displayLTModalNotificationMessage(
"NewLicenseInstalled"
);
vm.$router.push("/login");
return;
}
//call fetch key on server
let r = await window.$gz.api.upsertEx("license");
//r should just be a string response unless there is an error in which case it's an object
@@ -475,6 +495,11 @@ function clickHandler(menuItem) {
case "erase":
m.vm.erase();
break;
case "copydbid":
window.$gz.util.copyToClipboard(
window.$gz.store.state.globalSettings.serverDbId
);
break;
default:
window.$gz.eventBus.$emit(
@@ -500,6 +525,14 @@ function generateMenu(vm) {
menuItems: []
};
//copy dbid
menuOptions.menuItems.push({
title: vm.$ay.t("CopyDbId"),
icon: "fa-copy",
key: FORM_KEY + ":copydbid",
vm: vm
});
if (vm.rights.change) {
//Trigger license check
menuOptions.menuItems.push({
@@ -535,14 +568,11 @@ 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);
}
@@ -581,7 +611,8 @@ function fetchTranslatedText(vm) {
"NewLicenseInstalled",
"NewLicenseNotFound",
"HelpReleaseKey",
"HelpRestore"
"HelpRestore",
"CopyDbId"
]);
}

View File

@@ -147,7 +147,7 @@ export default {
supportLink() {
return (
"https://contact.ayanova.com/contact?dbid=" +
window.$gz.store.state.globalSettings.dbId
window.$gz.store.state.globalSettings.serverDbId
);
},
async generate() {