# How to enable and disable pages in dashboard 2.0?

**URL:** <https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [14 May 2024 15:10 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952 "2024-05-14T15:10:32Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![diegodamaceno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegodamaceno/32/85742_2.png) [@diegodamaceno](https://discourse.nodered.org/u/diegodamaceno)\
**Post date:** [15 May 2024 19:48 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/21 "2024-05-15T19:48:58Z")

</div>

In fact, these simple things make the use of the resource completely unfeasible. It completely loses its usefulness.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 May 2024 20:03 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/22 "2024-05-15T20:03:18Z")

</div>

That is why I suggested that you submit an issue.

---

<div class="post-metadata">

**Author:** ![diegodamaceno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegodamaceno/32/85742_2.png) [@diegodamaceno](https://discourse.nodered.org/u/diegodamaceno)\
**Post date:** [15 May 2024 20:20 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/23 "2024-05-15T20:20:46Z")

</div>

> <https://github.com/FlowFuse/node-red-dashboard/issues/866>
>
> \### Current Behavior
> 
> When sending a payload to "ui-control" to disable a page o…r make it invisible when accessing the same page using the page link, the resource is completely inoperative
> 
> \### Expected Behavior
> 
> When the payload is sent to "ui-control", disabling or making the page invisible, it must become inaccessible via the sidebar and any other method, including accessing the page via direct link. Access via direct link also cannot change the page's invisible or disabled status.
> 
> \### Steps To Reproduce
> 
> Using a normal inject connected to a function node with the desired usage information, it must be connected to a ui-control node to run the tests. Below is the suggested content of the function.
> 
> \`node.send({ payload: { pages: { enable: \['Casa'\] } } });\`
> 
> \### Environment
> 
> \- Dashboard version:
> \- Node-RED version:
> \- Node.js version:
> \- npm version:
> \- Platform/OS:
> \- Browser:
> 
> 
> \### Have you provided an initial effort estimate for this issue?
> 
> I have provided an initial effort estimate

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 May 2024 20:26 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/24 "2024-05-15T20:26:06Z")

</div>

> [@diegodamaceno](#):
>
> these simple things make the use of the resource completely unfeasible. It completely loses its usefulness.

It does not _completely_ lose its usefulness, it does disable or hide the page when accessed via the navigation panel, which is enough for many users.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [16 May 2024 09:03 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/25 "2024-05-16T09:03:38Z")

</div>

Just to add to Colin's explanation here - we've migrated this behaviour from Dashboard 1.0. This is the first time I've seen this requested, so will bare it in mind.

Generally the "disabled" and "visible" states refer to the side navigation for a page.

---

<div class="post-metadata">

**Author:** ![diegodamaceno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegodamaceno/32/85742_2.png) [@diegodamaceno](https://discourse.nodered.org/u/diegodamaceno)\
**Post date:** [16 May 2024 12:38 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/26 "2024-05-16T12:38:40Z")

</div>

This is a classic example of the consequences of facilitatory factors. When did you modify the links to be simpler and not big, undecorable numbers. They opened up the possibility of being remembered and accessed directly. I understand how 1.0 works, but I set up these panels for hotels, stores, hospitals and when you put the curious user to use them, they always thought more maliciously than the developers. There are many more things that I haven't listed here that are points for improvement. I'm not going to upload 1000 requests at once, I asked for one that focuses on creating several addressable outputs in the ui-template as we do in functions, this will greatly improve the flexibility and professionalism of the node. Here's a tip.

> <https://github.com/FlowFuse/node-red-dashboard/issues/867>
>
> \### Description
> 
> In order to reduce the number of nodes used for developing cont…rols, I suggest enabling multiple outputs for the ui-template node. This feature would bring immense flexibility in intelligently utilizing control resources for projects.
> 
> Despite being aware that culturally, users and developers of dashboards and their features greatly appreciate creating an observation environment, there are projects like mine that aim to utilize the dashboard for control purposes and its many possibilities alongside data observation.
> 
> Below, I provide an example of the suggestion.
> 
> !\[image\](https://github.com/FlowFuse/node-red-dashboard/assets/166838585/c03052c3-a73c-45d0-a2c4-3115f1cdd7d0)
> 
> !\[image\](https://github.com/FlowFuse/node-red-dashboard/assets/166838585/8f498b63-1129-496c-bfa8-3210990add40)
> 
> \`node.send(\[{payload: "ON"}, null\]);\`
> 
> 
> \### Have you provided an initial effort estimate for this issue?
> 
> I have provided an initial effort estimate

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 May 2024 14:10 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/27 "2024-05-16T14:10:17Z")

</div>

> [@diegodamaceno](#):
>
> This is a classic example of the consequences of facilitatory factors. When did you modify the links to be simpler and not big, undecorable numbers. They opened up the possibility of being remembered and accessed directly.

As a commercial offering to your customers, relying on incomprehensible URL's does not seem like a very safe approach. After all, you don't have to remember a URL, your browser will do that for you as will any number of other systems.

Defensive programming would be the correct approach here. Such that any attempt to reach a page that shouldn't be reachable is automatically redirected. Relying on a framework to do this seems doomed to failure at some point.

---

<div class="post-metadata">

**Author:** ![diegodamaceno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegodamaceno/32/85742_2.png) [@diegodamaceno](https://discourse.nodered.org/u/diegodamaceno)\
**Post date:** [16 May 2024 14:24 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/28 "2024-05-16T14:24:05Z")

</div>

But does giving the option to disable a page and keep the URL active make any sense? Even more meaningless is enabling the page when you access the URL with it disabled. Frankly, I have no reason to cut a resource in half. The feature should be called "Hide page in bar" and not "Disable page".

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [16 May 2024 16:19 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/29 "2024-05-16T16:19:54Z")

</div>

It's a fair assessment - although I do want to check on your solution - how does disabling the page resolve your problem? If it's disabled, then _nobody_ can access it?

---

<div class="post-metadata">

**Author:** ![diegodamaceno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegodamaceno/32/85742_2.png) [@diegodamaceno](https://discourse.nodered.org/u/diegodamaceno)\
**Post date:** [16 May 2024 16:43 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/30 "2024-05-16T16:43:40Z")

</div>

Considering practicality, disabling a page's visibility should be intrinsically linked to deactivating the page itself, just like deactivating a group or any other aspect. When a user wishes to hide a resource, it is essential that there be no alternative way to access it, except through logical means. Therefore, I propose eliminating the term "visibility" and consolidating all options into "enable" or "disable".

It's worth noting that, like myself, many developers may incorporate functionalities into elements that need to remain operational. In this regard, I suggest integrating the option to enable or disable access, rather than focusing on the internal processing of the element.

In the case of disabling a page, the corresponding link becomes inactive, redirecting to the first option in the selection list if accessed. Upon reactivating the page, the link's functionality is restored.

Another important detail is that this functionality should be able to update the page immediately. If I disable a page in the editor in any way, it should immediately disappear from the frontend and redirect to the first page in the page selection list.

It's also important to provide instructions on how to reactivate the page. I suggest that, instead of directing to the first page in order, the reactivated page should appear in the sidebar, and a notification should be displayed on the current page, similar to what happens when the system goes offline.

It's crucial to remember this point. In the old version 1.0, when the server was offline, the page remained visually intact, with just a simple background notification of connection loss. In version 2.0, it completely loses its characterization, giving a sense of chaos in the system.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10d318df8284a6b8b13426e8d5e1ebf6111de974.png)

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [16 May 2024 17:37 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/31 "2024-05-16T17:37:52Z")

</div>

> [@diegodamaceno](#):
>
> Considering practicality, disabling a page's visibility should be intrinsically linked to deactivating the page itself, just like deactivating a group or any other aspect

You haven't answered my question here though, what is the value of hiding/disabling a page if _nobody_ can then access it?

> [@diegodamaceno](#):
>
> It's crucial to remember this point. In the old version 1.0, when the server was offline, the page remained visually intact, with just a simple background notification of connection loss. In version 2.0, it completely loses its characterization, giving a sense of chaos in the system.

Can you expand here please - Dashboard 2.0 behaves exactly the same as Dashboard 1.0 in this regard.

---

<div class="post-metadata">

**Author:** ![diegodamaceno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegodamaceno/32/85742_2.png) [@diegodamaceno](https://discourse.nodered.org/u/diegodamaceno)\
**Post date:** [16 May 2024 21:42 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/32 "2024-05-16T21:42:32Z")

</div>

Ao implementar qualquer tipo de controle de acesso hierárquico no Node-RED, é essencial que o gestor tenha controle total sobre ele.

Durante esse processo, os grupos funcionam bem quando estão ocultos, mas uma página invisível com acesso via URL não tem sentido.

Se desejo criar uma automação para que uma página seja acessível apenas das 12:00 às 14:00, como posso fazer isso utilizando o Node-RED 2.0, considerando que o link está ativo o tempo todo?

Embora seja possível ocultar o grupo, a presença de uma brecha de acesso na página torna inútil desativá-la ou ocultá-la.

Quanto ao comportamento quando o sistema fica offline, está longe de ser o mesmo do antigo. No Node-RED 1.0, quando o sistema está offline, o fundo muda imediatamente e um aviso aparece no canto superior direito. No entanto, no Node-RED 2.0, quando o sistema está offline, o fundo retorna à matriz ou ao tema inicial sem título, sem grupos, apenas com cores primárias, como se estivesse carregando e não apresentasse erro.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f13d0a5d308305e6850ba1376d50c16d1a035bc.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 June 2024 21:42 UTC](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952/33 "2024-06-15T21:42:34Z")

</div>

Closed on 15 June 2024 21:42 UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/how-to-enable-and-disable-pages-in-dashboard-2-0/87952.md?page=1)
