This commit is contained in:
@@ -35,20 +35,29 @@ export default {
|
||||
|
||||
//global menu items
|
||||
|
||||
//Logout
|
||||
//LOGOUT
|
||||
that.appBar.menuItems.push({
|
||||
title: that.$gzlocale.get("Logout"),
|
||||
icon: "sign-out-alt",
|
||||
color: "pink",
|
||||
key: "app:logout"
|
||||
key: "app||logout"
|
||||
});
|
||||
|
||||
//Insert help item
|
||||
//divider
|
||||
that.appBar.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
//HELP
|
||||
that.appBar.menuItems.push({
|
||||
title: that.$gzlocale.get("MenuHelp"),
|
||||
icon: "question-circle",
|
||||
key: "app:help",
|
||||
data: that.appBar.helpUrl
|
||||
key: "app||help||" + that.appBar.helpUrl
|
||||
});
|
||||
|
||||
//ABOUT
|
||||
that.appBar.menuItems.push({
|
||||
title: that.$gzlocale.get("HelpAboutAyaNova"),
|
||||
icon: "info-circle",
|
||||
key: "app||nav||about"
|
||||
});
|
||||
},
|
||||
///////////////////////////////
|
||||
@@ -77,21 +86,29 @@ export default {
|
||||
// Deal with a menu change request
|
||||
// called from App.vue
|
||||
handleClick(that, menuitem) {
|
||||
//Key will start with the string "app:" if it's a global application command that should be handled here,
|
||||
//Key will start with the string "app||" if it's a global application command that should be handled here,
|
||||
//otherwise it's a local command for a local form only
|
||||
//If there is any extended information required for the command it will be in the "data" key of the menu item (e.g. the url in a app:help link)
|
||||
//If there is any extended information required for the command it will be in the key after the command portion of the menu item (e.g. the url in a app||help link)
|
||||
//split a key into component parts, part one is the responsible party, part two is the command, part three to part * are all extra info
|
||||
//each part is separated by a double pipe symbol ||
|
||||
|
||||
//Handle different items
|
||||
if (!menuitem.disabled && menuitem.key.startsWith("app:")) {
|
||||
switch (menuitem.key) {
|
||||
case "app:help":
|
||||
var helpurl = that.$store.state.helpUrl + menuitem.data;
|
||||
if (!menuitem.disabled && menuitem.key.startsWith("app||")) {
|
||||
var keyparts = menuitem.key.split("||");
|
||||
var cmd = keyparts[1];
|
||||
var data = keyparts[2] ? keyparts[2] : null;
|
||||
switch (cmd) {
|
||||
case "help":
|
||||
var helpurl = that.$store.state.helpUrl + data;
|
||||
window.open(helpurl, "_blank");
|
||||
break;
|
||||
case "app:logout":
|
||||
case "logout":
|
||||
processLogout();
|
||||
that.$router.replace({ name: "login" });
|
||||
break;
|
||||
case "nav":
|
||||
that.$router.replace({ name: data });
|
||||
break;
|
||||
default:
|
||||
alert(
|
||||
"gzmenu:handleClick - unrecognized command [" + menuitem.key + "]"
|
||||
|
||||
@@ -70,9 +70,10 @@ export default function initialize() {
|
||||
addNavItem(locale.get("Operations"), "cogs", "ops");
|
||||
}
|
||||
|
||||
//MOVED TO MENU OUT OF NAV
|
||||
//Everyone can see about and logout
|
||||
addNavItem(locale.get("HelpAboutAyaNova"), "info-circle", "/about");
|
||||
addNavItem(locale.get("Logout"), "sign-out-alt", "/login");
|
||||
// addNavItem(locale.get("HelpAboutAyaNova"), "info-circle", "/about");
|
||||
// addNavItem(locale.get("Logout"), "sign-out-alt", "/login");
|
||||
})
|
||||
.catch(function handleIntializeError(error) {
|
||||
store.commit("logItem", "Initialize::() ltfetch -> error" + error);
|
||||
|
||||
Reference in New Issue
Block a user