This commit is contained in:
2019-04-16 22:12:44 +00:00
parent a35077298b
commit d475b8aff9
7 changed files with 24 additions and 20 deletions

View File

@@ -98,6 +98,13 @@ export default {
data() {
return {
drawer: null,
appBar: {
isMain: true,
icon: "",
title: "",
contextMenuItems: [],
mainMenuItems: []
},
items: [
{ header: "Today" },
{
@@ -131,8 +138,16 @@ export default {
},
mounted() {
//subscribe to context menu changes
var that = this;
this.$gzevent.$on("context-menu-change", function(ctx) {
alert("CLICK " + ctx);
that.appBar.isMain = ctx.isMain;
that.appBar.icon = ctx.icon;
that.appBar.title = ctx.title;
that.appBar.contextMenuItems = ctx.contextMenuItems
? ctx.contextMenuItems
: [];
//alert("CLICK " + ctx);
});
//redirect to login if not authenticated
if (!this.$store.state.authenticated) {
@@ -157,9 +172,7 @@ export default {
navItems() {
return this.$store.state.navItems;
},
appBar() {
return this.$store.state.appBar;
},
copyright() {
return aboutInfo.copyright;
},

View File

@@ -18,14 +18,7 @@ export default new Vuex.Store({
roles: 0,
localeText: {},
navItems: [],
logArray: [],
appBar: {
isMain: true,
icon: "",
title: "",
contextMenuItems: [],
mainMenuItems: []
}
logArray: []
},
mutations: {
login(state, data) {
@@ -65,9 +58,6 @@ export default new Vuex.Store({
state.logArray.length - MaxLogLength
);
}
},
setAppBar(state, data) {
state.appBar = data;
}
},
actions: {}

View File

@@ -127,11 +127,12 @@ export default {
]);
},
created() {
this.$store.commit("setAppBar", {
this.$gzevent.$emit("context-menu-change", {
isMain: true,
icon: "fa-info-circle",
title: this.$gzlocale.get("HelpAboutAyaNova")
});
this.clientInfo.version = aboutInfo.version;
this.$gzapi
.get("ServerInfo")

View File

@@ -10,7 +10,7 @@ export default {
HelloWorld
},
beforeCreate() {
this.$store.commit("setAppBar", {
this.$gzevent.$emit("context-menu-change", {
isMain: true,
icon: "fa-home",
title: this.$gzlocale.get("Home")

View File

@@ -171,7 +171,7 @@ export default {
});
},
created() {
this.$store.commit("setAppBar", {
this.$gzevent.$emit("context-menu-change", {
isMain: false,
icon: "fa-splotch",
title: this.$gzlocale.get("Widget")

View File

@@ -48,7 +48,7 @@ export default {
});
},
created() {
this.$store.commit("setAppBar", {
this.$gzevent.$emit("context-menu-change", {
isMain: true,
icon: "fa-dolly",
title: this.$gzlocale.get("Inventory")

View File

@@ -65,7 +65,7 @@ export default {
};
},
created() {
this.$store.commit("setAppBar", {
this.$gzevent.$emit("context-menu-change", {
isMain: true,
icon: "",
title: ""