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);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<v-layout row>
|
||||
<v-flex>
|
||||
<v-card>
|
||||
<v-toolbar>
|
||||
<!-- <v-toolbar>
|
||||
<v-avatar size="64px" tile>
|
||||
<img :src="require('../assets/bw-logo.svg')" alt="AyaNova">
|
||||
</v-avatar>
|
||||
@@ -11,7 +11,7 @@
|
||||
<v-btn large icon to="/log">
|
||||
<v-icon>fa-glasses</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
</v-toolbar>-->
|
||||
<v-list two-line subheader>
|
||||
<v-subheader>{{ this.$gzlocale.get("ClientApp")}}</v-subheader>
|
||||
<v-list-tile avatar>
|
||||
@@ -106,6 +106,13 @@
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
import aboutInfo from "../api/aboutinfo";
|
||||
|
||||
function clickHandler(item) {
|
||||
if (!item.disabled && !item.key.startsWith("app||")) {
|
||||
alert("about.vue::context click: " + item.key);
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
beforeCreate() {
|
||||
this.$gzlocale.fetch([
|
||||
@@ -128,10 +135,19 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
isMain: true,
|
||||
isMain: false,
|
||||
icon: "fa-info-circle",
|
||||
title: this.$gzlocale.get("HelpAboutAyaNova")
|
||||
title: this.$gzlocale.get("HelpAboutAyaNova"),
|
||||
menuItems: [
|
||||
{
|
||||
title: this.$gzlocale.get("log"),
|
||||
icon: "glasses",
|
||||
surface: true,
|
||||
key: "app||nav||log"
|
||||
}
|
||||
]
|
||||
});
|
||||
this.$gzevent.$on("menu-click", clickHandler);
|
||||
|
||||
this.clientInfo.version = aboutInfo.version;
|
||||
this.$gzapi
|
||||
@@ -143,6 +159,9 @@ export default {
|
||||
throw error;
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$gzevent.$off("menu-click", clickHandler);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
serverInfo: { license: { license: {} } },
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<script>
|
||||
/* xeslint-disable */
|
||||
function clickHandler(item) {
|
||||
if (!item.disabled && !item.key.startsWith("app:")) {
|
||||
if (!item.disabled && !item.key.startsWith("app||")) {
|
||||
alert("inventory-widget-edit.vue::context click: " + item.key);
|
||||
}
|
||||
}
|
||||
@@ -185,19 +185,19 @@ export default {
|
||||
title: this.$gzlocale.get("Save"),
|
||||
icon: "save",
|
||||
surface: true,
|
||||
key: "save"
|
||||
key: "inventory-widget-edit||save"
|
||||
},
|
||||
{
|
||||
title: this.$gzlocale.get("Delete"),
|
||||
icon: "trash-alt",
|
||||
surface: true,
|
||||
key: "delete"
|
||||
key: "inventory-widget-edit||delete"
|
||||
},
|
||||
{ divider: true, inset: false },
|
||||
{
|
||||
title: this.$gzlocale.get("Duplicate"),
|
||||
icon: "clone",
|
||||
key: "duplicate"
|
||||
key: "inventory-widget-edit||duplicate"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user