This commit is contained in:
@@ -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"
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user