@5minds/node-red-dashboard-2-processcube-ui-page-navigation 2.0.1 → 2.1.0-develop-fd8221-meblxjp4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 5Minds IT-Solutions GmbH & Co. KG
3
+ Copyright (c) [45 * 45] [5Minds IT-Solutions GmbH & Co. KG]
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
@@ -27,34 +27,29 @@ module.exports = function (RED) {
27
27
  }
28
28
  return msg;
29
29
  }
30
-
31
30
  const ui = page.getBase();
32
31
 
33
32
  const evts = {
34
- onSocket: {
35
- 'ui-event': function (conn, id, msg) {
36
- if (config.event != 'any' && config.event != msg.topic) return;
37
- if (pageName != '' && pageName != msg.payload.page.name) return;
38
- const wNode = RED.nodes.getNode(node.id);
39
- if (!wNode) {
40
- console.log('ui-page-navigation node not found', id);
41
- }
33
+ 'onSend': function (msg) {
34
+ console.log(`onSend: pageName ${pageName}, topic ${msg.topic}`);
35
+ if (config.event != 'any' && config.event != msg.topic) return;
36
+ if (pageName != '' && pageName != msg.payload.page.name) return;
37
+ const wNode = RED.nodes.getNode(node.id);
38
+ if (!wNode) {
39
+ console.log('ui-page-navigation node not found', id);
40
+ }
42
41
 
43
- if (wNode) {
44
- msg = addConnectionCredentials(RED, msg, conn, ui);
45
- wNode.send(msg);
46
- }
47
- },
42
+ if (wNode) {
43
+ wNode.send(msg);
44
+ }
48
45
  },
49
46
  };
50
47
 
51
48
  ui.register(null, null, node, config, evts);
52
49
 
53
50
  node.on('close', function (removed, done) {
54
- if (removed) {
55
- // handle node being removed
56
- ui.deregister(null, null, node);
57
- }
51
+ ui.deregister(null, null, node);
52
+
58
53
  done();
59
54
  });
60
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-dashboard-2-processcube-ui-page-navigation",
3
- "version": "2.0.1",
3
+ "version": "2.1.0-develop-fd8221-meblxjp4",
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(t,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vuex")):typeof define=="function"&&define.amd?define(["exports","vuex"],i):(t=typeof globalThis<"u"?globalThis:t||self,i(t["ui-page-navigation"]={},t.vuex))})(this,function(t,i){"use strict";const n={name:"DBUIEvent",inject:["$socket","$dataTracker"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})}},data(){return{page:null}},computed:{...i.mapState("ui",["pages"]),pagename(){return this.props.pagename}},watch:{"$route.meta.id":{handler(e,s){const a=this.pages[s],r=this.pages[e];console.log(`handler: ${a.name} ${r.name} --> ${this.pagename}`),this.trigger("$pageleave",a),this.trigger("$pageview",r)}}},created(){this.$dataTracker(this.id),this.page=this.pages[this.$route.meta.id],this.pageview()},unmounted(){this.pageleave()},methods:{pageview(){this.trigger("$pageview",this.page)},pageleave(){this.trigger("$pageleave",this.page)},trigger(e,s){const a=this.page.name==this.pagename;if(console.log(`trigger: fire ${a} ${e} ${s.name} ${this.pagename}`),!a)return;const r=this.createPayload(s);this.$socket.emit("ui-event",this.id,{topic:e,payload:r})},createPayload(e){return e={...e},e._groups=e._users,delete e._users,{page:e,query:this.$route.query}}}};t.UIPageNavigation=n,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(t,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vuex")):typeof define=="function"&&define.amd?define(["exports","vuex"],i):(t=typeof globalThis<"u"?globalThis:t||self,i(t["ui-page-navigation"]={},t.vuex))})(this,function(t,i){"use strict";const n={name:"DBUIEvent",inject:["$socket","$dataTracker"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})}},data(){return{page:null}},computed:{...i.mapState("ui",["pages"]),pagename(){return this.props.pagename}},watch:{"$route.meta.id":{handler(e,s){const a=this.pages[s],r=this.pages[e];console.log(`handler: ${a.name} ${r.name} --> ${this.pagename}`),this.trigger("$pageleave",a),this.trigger("$pageview",r)}}},created(){this.$dataTracker(this.id),this.page=this.pages[this.$route.meta.id],this.pageview()},unmounted(){this.pageleave()},methods:{pageview(){this.trigger("$pageview",this.page)},pageleave(){this.trigger("$pageleave",this.page)},trigger(e,s){const a=this.page.name==this.pagename;if(console.log(`trigger: fire ${a} ${e} ${s.name} ${this.pagename}`),!a)return;const r=this.createPayload(s);this.$socket.emit("widget-send",this.id,{topic:e,payload:r})},createPayload(e){return e={...e},e._groups=e._users,delete e._users,{page:e,query:this.$route.query}}}};t.UIPageNavigation=n,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
@@ -72,7 +72,7 @@ export default {
72
72
  }
73
73
 
74
74
  const payload = this.createPayload(page);
75
- this.$socket.emit('ui-event', this.id, {
75
+ this.$socket.emit('widget-send', this.id, {
76
76
  topic: evt,
77
77
  payload,
78
78
  });