@5minds/node-red-dashboard-2-processcube-ui-page-navigation 1.0.4-extend-documentation-b8283e-m4b4f4kc → 1.0.4-feature-4b905c-m62dcy1o
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,14 +48,13 @@
|
|
|
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</label>
|
|
52
|
+
<input type="text" id="node-input-pagename" placeholder="Name of Page" />
|
|
53
53
|
</div>
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<script type="text/markdown" data-help-name="ui-page-navigation">
|
|
57
|
-
A
|
|
58
|
-
It builds on the same foundation but introduces enhanced filtering capabilities for both events and pages.
|
|
57
|
+
A Note to listen on events for the page navigation.
|
|
59
58
|
|
|
60
59
|
## Outputs
|
|
61
60
|
|
|
@@ -1,8 +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.
|
|
5
|
-
config.page = '';
|
|
4
|
+
const pageName = config.pagename;
|
|
6
5
|
|
|
7
6
|
function addConnectionCredentials(RED, msg, conn, config) {
|
|
8
7
|
if (config.includeClientData) {
|
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.0.4-
|
|
3
|
+
"version": "1.0.4-feature-4b905c-m62dcy1o",
|
|
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 s={name:"DBUIEvent",inject:["$socket","$dataTracker"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})}},data(){return{page:null}},computed:{...i.mapState("ui",["pages"])},watch:{"$route.meta.id":{handler(e,a){const o=this.createPayload(this.pages[a]);this.$socket.emit("ui-event",this.id,{topic:"$pageleave",payload:o});const
|
|
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 s={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.getProperty("pagename")}},watch:{"$route.meta.id":{handler(e,a){console.log(this.pagename());const o=this.createPayload(this.pages[a]);this.$socket.emit("ui-event",this.id,{topic:"$pageleave",payload:o});const n=this.createPayload(this.pages[e]);this.$socket.emit("ui-event",this.id,{topic:"$pageview",payload:n})}}},created(){this.$dataTracker(this.id),this.page=this.pages[this.$route.meta.id],this.pageview()},unmounted(){this.pageleave()},methods:{pageview(){this.trigger("$pageview")},pageleave(){this.trigger("$pageleave")},trigger(e){console.log(this.pagename());const a=this.createPayload(this.page);this.$socket.emit("ui-event",this.id,{topic:e,payload:a})},createPayload(e){return e={...e},e._groups=e._users,delete e._users,{page:e,query:this.$route.query}}}};t.UIPageNavigation=s,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -15,10 +15,15 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
computed: {
|
|
17
17
|
...mapState('ui', ['pages']),
|
|
18
|
+
pagename () {
|
|
19
|
+
// use the globally available "getProperty" function
|
|
20
|
+
return this.getProperty('pagename')
|
|
21
|
+
}
|
|
18
22
|
},
|
|
19
23
|
watch: {
|
|
20
24
|
'$route.meta.id': {
|
|
21
25
|
handler(val, oldVal) {
|
|
26
|
+
console.log(this.pagename());
|
|
22
27
|
// this only fire if we switch between two pages of the same layout type,
|
|
23
28
|
// the full component isn't torn down, so we can watch for changes
|
|
24
29
|
const oldMsg = this.createPayload(this.pages[oldVal]);
|
|
@@ -52,6 +57,7 @@ export default {
|
|
|
52
57
|
this.trigger('$pageleave');
|
|
53
58
|
},
|
|
54
59
|
trigger(evt) {
|
|
60
|
+
console.log(this.pagename());
|
|
55
61
|
const payload = this.createPayload(this.page);
|
|
56
62
|
this.$socket.emit('ui-event', this.id, {
|
|
57
63
|
topic: evt,
|