# Prevent dashboard reload on re-deploy?

**URL:** <https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280>\
**Category:** Dashboard\
**Created:** [28 November 2018 23:26 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280 "2018-11-28T23:26:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [28 November 2018 23:26 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280/1 "2018-11-28T23:26:25Z")

</div>

I'm testing a full-screen kiosk app on one of my new Fire 7 tablets. The app is called "Fully Kiosk" and for EUR 5.70 it does motion detection to fade on and off the screen when someone walks past where it's mounted in the wall. It's really nice and although I've only been testing it for a day, I can already recommend this app to cover every use case required for a wall controller.

The app allows you to set a default web page to display. In our living room, I've set it to display the dashboard with ID=1.

Problem is, every time I re-deploy, the dashboard reloads into ID=0 (bedroom). The user then has to come out of the locked-down app, and relaunch the page. (There are no refresh buttons, as it's full screen...)

How can I avoid this?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 November 2018 00:30 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280/2 "2018-11-29T00:30:12Z")

</div>

Use the `Dashboard` tab in the sidebar and move the group you want to show at startup as the first in the list.  
 ![dash1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/946460ace92958fef3eded6a7fc615612f9083e4.jpeg)

So you end up with this:  
 ![dash2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4628ff34ae2fcbc189dc78ebb2fa5b4646b386de.jpeg)  
It should now be there forst to show when you open the dashboard.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [29 November 2018 01:29 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280/3 "2018-11-29T01:29:40Z")

</div>

@zenofmud Thanks, although I don't think I explained my question clearly enough.

I'm going to have the same problem with the bedroom controller, if I do that!

So is there a way for different instances of Dashboard to reset to different pages on re-deploy? Or for re-deploy to actually maintain the current page?

Right now I can't see how to make it usable in the use case of tablets in walls

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 November 2018 08:35 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280/4 "2018-11-29T08:35:44Z")

</div>

Have a look at what the ui\_control node emits on connect. If you can determine which device is connecting then you can then auto switch it back to the correct page

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [23 December 2018 02:18 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280/5 "2018-12-23T02:18:00Z")

</div>

I've tried the following:

- checking the output of `ui_control` node and pasting this into the input via a function node, like this:

This doesn't appear to work. The `ui_control` node help suggests I input the tab number as the msg.payload. Although this works, it does it for all connected clients, not just one based on its IP address.

Is there a way to change the current tab for just one single http connection (i.e. from one device only)?

---

<div class="post-metadata">

**Author:** ![hugobox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugobox/32/2948_2.png) [@hugobox](https://discourse.nodered.org/u/hugobox)\
**Post date:** [23 December 2018 05:36 UTC](https://discourse.nodered.org/t/prevent-dashboard-reload-on-re-deploy/5280/6 "2018-12-23T05:36:01Z")

</div>

I havn't tried the ui\_control change trick, but I have a flow that saves every opened dashboard client's URL in each browser's localstorage and can later reload the urls on command (for ex: automatically after a full deploy). You just have to duplicate and wire the ui\_template in between the link nodes for each tab you have. Note that the pass through option is disabled and should remain so as to not create an infinite loop.

```auto
[
    {
        "id": "d794432d.d34f9",
        "type": "ui_template",
        "z": "1f6b105a.a3f8d",
        "group": "",
        "name": "UI location TAB 0",
        "order": 2,
        "width": 0,
        "height": 0,
        "format": "<script>\n\n(function($scope) {\n$scope.$watch('msg', function() {\n if ($scope.msg){\n if ($scope.msg.payload == \"saveURL\"){\n localStorage.setItem(\"url\", window.location.href);\n console.log(\"saved url: \" + window.location.href)\n $scope.send({\"payload\": \"saved\"});\n }else if ($scope.msg.payload == \"loadURL\"){\n console.log(\"loading url: \" + localStorage.getItem(\"url\"))\n window.location.replace(localStorage.getItem(\"url\"));\n $scope.send({\"payload\": \"reloaded\"});\n location.reload();\n }\n }\n });\n \n})(scope);\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "templateScope": "local",
        "x": 1070,
        "y": 640,
        "wires": [
            [
                "480a0e68.8886b"
            ]
        ]
    },
    {
        "id": "a1cf71b2.6eab1",
        "type": "ui_template",
        "z": "1f6b105a.a3f8d",
        "group": "",
        "name": "UI location TAB 1",
        "order": 2,
        "width": 0,
        "height": 0,
        "format": "<script>\n\n(function($scope) {\n$scope.$watch('msg', function() {\n if ($scope.msg){\n if ($scope.msg.payload == \"saveURL\"){\n localStorage.setItem(\"url\", window.location.href);\n console.log(\"saved url: \" + window.location.href)\n $scope.send({\"payload\": \"saved\"});\n }else if ($scope.msg.payload == \"loadURL\"){\n console.log(\"loading url: \" + localStorage.getItem(\"url\"))\n window.location.replace(localStorage.getItem(\"url\"));\n $scope.send({\"payload\": \"reloaded\"});\n location.reload();\n }\n }\n });\n \n})(scope);\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "templateScope": "local",
        "x": 1070,
        "y": 680,
        "wires": [
            [
                "480a0e68.8886b"
            ]
        ]
    },
    {
        "id": "7b4b4d4a.b93b04",
        "type": "link in",
        "z": "1f6b105a.a3f8d",
        "name": "",
        "links": [
            "83ed580a.76f1a8",
            "480a0e68.8886b",
            "b9c016e3.20d6d8",
            "78d53945.cc8618"
        ],
        "x": 915,
        "y": 660,
        "wires": [
            [
                "d794432d.d34f9",
                "a1cf71b2.6eab1",
                "2580e102.4145be"
            ]
        ]
    },
    {
        "id": "480a0e68.8886b",
        "type": "link out",
        "z": "1f6b105a.a3f8d",
        "name": "",
        "links": [
            "7b4b4d4a.b93b04"
        ],
        "x": 1215,
        "y": 660,
        "wires": []
    },
    {
        "id": "8003c724.5f5358",
        "type": "inject",
        "z": "1f6b105a.a3f8d",
        "name": "",
        "topic": "",
        "payload": "saveURL",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 760,
        "y": 640,
        "wires": [
            [
                "78d53945.cc8618"
            ]
        ]
    },
    {
        "id": "48aefefd.d7044",
        "type": "inject",
        "z": "1f6b105a.a3f8d",
        "name": "",
        "topic": "",
        "payload": "loadURL",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 759,
        "y": 684,
        "wires": [
            [
                "78d53945.cc8618"
            ]
        ]
    },
    {
        "id": "78d53945.cc8618",
        "type": "link out",
        "z": "1f6b105a.a3f8d",
        "name": "",
        "links": [
            "7b4b4d4a.b93b04"
        ],
        "x": 875,
        "y": 660,
        "wires": []
    },
    {
        "id": "5ea4aaed.324674",
        "type": "comment",
        "z": "1f6b105a.a3f8d",
        "name": "Copy paste the template for each tab you want to control",
        "info": "",
        "x": 1030,
        "y": 600,
        "wires": []
    },
    {
        "id": "4d63bf8d.cd8ff",
        "type": "comment",
        "z": "1f6b105a.a3f8d",
        "name": "...",
        "info": "",
        "x": 1070,
        "y": 720,
        "wires": []
    },
    {
        "id": "2580e102.4145be",
        "type": "ui_template",
        "z": "1f6b105a.a3f8d",
        "group": "",
        "name": "UI location TAB x (last tab)",
        "order": 2,
        "width": 0,
        "height": 0,
        "format": "<script>\n\n(function($scope) {\n$scope.$watch('msg', function() {\n if ($scope.msg){\n if ($scope.msg.payload == \"saveURL\"){\n localStorage.setItem(\"url\", window.location.href);\n console.log(\"saved url: \" + window.location.href)\n $scope.send({\"payload\": \"saved\"});\n }else if ($scope.msg.payload == \"loadURL\"){\n console.log(\"loading url: \" + localStorage.getItem(\"url\"))\n window.location.replace(localStorage.getItem(\"url\"));\n $scope.send({\"payload\": \"reloaded\"});\n location.reload();\n }\n }\n });\n \n})(scope);\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "templateScope": "local",
        "x": 1080,
        "y": 760,
        "wires": [
            [
                "480a0e68.8886b"
            ]
        ]
    }
]
```
