@5minds/node-red-dashboard-2-processcube-ui-page-navigation 1.1.0-develop-d0ba19-m623rryu → 1.1.0-develop-4e0cc8-m624ex04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@5minds/node-red-dashboard-2-processcube-ui-page-navigation",
|
|
3
|
-
"version": "1.1.0-develop-
|
|
3
|
+
"version": "1.1.0-develop-4e0cc8-m624ex04",
|
|
4
4
|
"description": "A node to handle the navigation between pages in the Node-RED Dashboard",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vuex")):typeof define=="function"&&define.amd?define(["exports","vuex"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i["ui-page-navigation"]={},i.vuex))})(this,function(i,a){"use strict";const o={name:"DBUIEvent",inject:["$socket","$dataTracker"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})}},data(){return{page:null}},computed:{...a.mapState("ui",["pages"])},watch:{"$route.meta.id":{handler(t,e){console.log(`route changed old: ${e} new:${t}`);const s=this.createPayload(this.pages[e]);this.$socket.emit("ui-event",this.id,{topic:"$pageleave",payload:s});const r=this.createPayload(this.pages[t]);this.$socket.emit("ui-event",this.id,{topic:"$pageview",payload:r})}}},created(){this.$dataTracker(this.id);const t=this.props.page,e=this.pages[this.$route.meta.id];console.log(`created. pageFromConfig: ${t} currentPage: ${e.name}`),t===e.name&&(console.log("created page "),this.pageview())},unmounted(){this.pageleave()},methods:{pageview(){this.trigger("$pageview")},pageleave(){this.trigger("$pageleave")},trigger(t){const e=this.createPayload(this.pages[this.$route.meta.id]);this.$socket.emit("ui-event",this.id,{topic:t,payload:e})},createPayload(t){let e={...t};return e._groups=e._users,delete e._users,{pageForPayload:e,query:this.$route.query}}}};i.UIPageNavigation=o,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -42,7 +42,11 @@ export default {
|
|
|
42
42
|
// can't do this in setup as we have custom onInput function
|
|
43
43
|
this.$dataTracker(this.id);
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const pageFromConfig = this.props.page;
|
|
46
|
+
const currentPage = this.pages[this.$route.meta.id];
|
|
47
|
+
|
|
48
|
+
console.log(`created. pageFromConfig: ${pageFromConfig} currentPage: ${currentPage.name}`);
|
|
49
|
+
if (pageFromConfig === currentPage.name) {
|
|
46
50
|
console.log(`created page `);
|
|
47
51
|
this.pageview();
|
|
48
52
|
}
|
|
@@ -58,7 +62,7 @@ export default {
|
|
|
58
62
|
this.trigger('$pageleave');
|
|
59
63
|
},
|
|
60
64
|
trigger(evt) {
|
|
61
|
-
const payload = this.createPayload(this.
|
|
65
|
+
const payload = this.createPayload(this.pages[this.$route.meta.id]);
|
|
62
66
|
this.$socket.emit('ui-event', this.id, {
|
|
63
67
|
topic: evt,
|
|
64
68
|
payload,
|