@5minds/node-red-dashboard-2-processcube-ui-page-navigation 1.1.0-develop-13ceaf-m624nwgx → 1.1.0-develop-dafb5d-m6252yg2
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
ui: { type: 'ui-base', value: '', required: true },
|
|
8
8
|
name: { value: '' },
|
|
9
9
|
event: { value: '', required: true },
|
|
10
|
-
|
|
10
|
+
pageName: { value: '', reqiured: false },
|
|
11
11
|
},
|
|
12
12
|
inputs: 0,
|
|
13
13
|
outputs: 1,
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
</select>
|
|
49
49
|
</div>
|
|
50
50
|
<div class="form-row">
|
|
51
|
-
<label for="node-input-
|
|
52
|
-
<input type="text" id="node-input-
|
|
51
|
+
<label for="node-input-pageName"><i class="fa fa-tag"></i> Page name</label>
|
|
52
|
+
<input type="text" id="node-input-pageName" placeholder="Name of Page" />
|
|
53
53
|
</div>
|
|
54
54
|
</script>
|
|
55
55
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = function (RED) {
|
|
2
2
|
function UIPageNavigation(config) {
|
|
3
3
|
// TODO: find a correct way to implement this. Only god knows why this is necessary and works
|
|
4
|
-
const pageName = config.
|
|
4
|
+
const pageName = config.pageName;
|
|
5
5
|
//config.page = '';
|
|
6
6
|
|
|
7
7
|
function addConnectionCredentials(RED, msg, conn, config) {
|
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-dafb5d-m6252yg2",
|
|
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(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{
|
|
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{pageName: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.pageName,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){console.log(JSON.stringify(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"})});
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
},
|
|
11
11
|
data() {
|
|
12
12
|
return {
|
|
13
|
-
|
|
13
|
+
pageName: null,
|
|
14
14
|
};
|
|
15
15
|
},
|
|
16
16
|
computed: {
|
|
@@ -42,7 +42,7 @@ 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
|
-
const pageFromConfig = this.props.
|
|
45
|
+
const pageFromConfig = this.props.pageName;
|
|
46
46
|
const currentPage = this.pages[this.$route.meta.id];
|
|
47
47
|
|
|
48
48
|
console.log(`created. pageFromConfig: ${pageFromConfig} currentPage: ${currentPage.name}`);
|
|
@@ -69,6 +69,7 @@ export default {
|
|
|
69
69
|
});
|
|
70
70
|
},
|
|
71
71
|
createPayload(page) {
|
|
72
|
+
console.log(JSON.stringify(page));
|
|
72
73
|
let pageForPayload = { ...page };
|
|
73
74
|
// re-map _users > _groups for better data readability
|
|
74
75
|
pageForPayload._groups = pageForPayload._users;
|