# Dashboard 2.0 Pre-Alpha Available

**URL:** <https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142>\
**Category:** General\
**Tags:** dashboard-2\
**Created:** [28 July 2023 13:39 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142 "2023-07-28T13:39:33Z")\
**Posts on this page:** 20\
**Page:** 15

<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:** [7 December 2023 22:01 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/281 "2023-12-07T22:01:20Z")

</div>

Happy to help however I can.

---

<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:** [7 December 2023 22:05 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/282 "2023-12-07T22:05:06Z")

</div>

Latest article is published: [Building a Custom Video Player in Dashboard 2.0](https://flowfuse.com/blog/2023/12/dashboard-0-10-0/)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [8 December 2023 07:52 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/283 "2023-12-08T07:52:06Z")

</div>

> [@Paul-Reed](#):
>
> finding vue not as easy to work with as javascript 🤨

Hey Paul,  
I have to admit that this is also the case for me. VueJs is very popular, so it must be good so it will definately be a personal issue I have somewhere in my old brain. Or it must be that all the other web frameworks are even more worse 😉

I am in the situation where I have to do a massive amount of Node-RED related work in very few hours a week. So there is no chance I can additionaly start reading stuff about VueJS. But then it is kind of cryptic to me, with lots of magic happening. Too much magic for me. And for my brain it is very not-self-explaining. For me it is too far away from plain javascript. But again it will be my personal issue, so I _ **don't** _ want to start a discussion here about how good VueJs is!!!!

Imho it would be much easier for less technical users to understand if the Template node would look like this:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52239331c53769d6e01faf63dccce24654d3f89d.png)

And when you deploy this ui node, that the content of all the tabsheets is used to compose the format that VueJs needs. This way you are again working with HTML/CSS/Javascript like we are used to do. Although of course the html stuff will contain VueJs stuff, but it overall looks more plain vanilla. To me at least...

It is similar to the Function node then. The tabsheets in the Function node make it also easier to write Javascript, without having to worry were in your deployed node this code will end up.

---

<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:** [8 December 2023 08:18 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/284 "2023-12-08T08:18:17Z")

</div>

> [@BartButenaers](#):
>
> Imho it would be much easier for less technical users to understand if the Template node would look like this:

Funnily enough, that's the exact proposal I put forward to @Steve-Mcl when we first started discussing how we were going to parse the `ui-template` content and extend the underlying Vue component. Some complexities exist in that there are _a lot_ of tabs we could add (`html`, `data`, `watch`, `computed`, `mounted`, `unmounted`, `methods`), but we could trim to offer the basics.

I wouldn't be adverse to going in this direction at all as the default. With a toggle of "Advanced Mode" or something like that, which then allows for the current mode to be activated, where you have full reigns again.

I tried to write [Building a Custom Video Player in Dashboard 2.0 • FlowFuse](https://flowfuse.com/blog/2023/12/dashboard-0-10-0/) from the perspective of someone that's never touched VueJS before, and I've done the same with the [documentation](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html) for `ui-template` too. I think I may re-visit the docs though to be more Vue centric earlier.

I will also update the `ui-template` default value to include a Vue component framework with appropriate commentary to help with the onboarding.

---

<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:** [8 December 2023 08:22 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/285 "2023-12-08T08:22:43Z")

</div>

I have opened [UI Template - Tabbed interface for defining Component · Issue #419 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/419) to continue this discussion there

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 December 2023 08:33 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/286 "2023-12-08T08:33:28Z")

</div>

> [@joepavitt](#):
>
> > [@BartButenaers](#):
> >
> > Imho it would be much easier for less technical users to understand if the Template node would look like this:
> 
> Funnily enough, that's the exact proposal I put forward to @Steve-Mcl when we first started discussing how we were going to parse the `ui-template` content and extend the underlying Vue component

Hey @BartButenaers as Joe says, we did discuss this. Apart from making the node UI complex I felt those familiar with Vue would be frustrated at having to pull apart components into the separate tabs. Then there is the issue of "context switching" (brain context) having to switch tabs to update each part of your component - that will hamper mental comprehension.

However, there is 1 good reason to add this support... The js code will at least get the lovely Monaco completions (Monaco doesn't support autocomplete or Syntax helpers in embedded script)

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [8 December 2023 08:42 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/287 "2023-12-08T08:42:48Z")

</div>

Beside all fancy use cases, the Node-RED is awesome prototyping tool. It is of course hard to describe what the prototyping is cos it always depends but in many cases it is to put smallest pieces together to make something. That was/is great option in D1 ui\_template. You actually can use bare HTML/JavaScript/CSS combinations all in one place. That kind of prototype is easy to build, maintain, explain or even sell if you please. With Vue and with all that magic, all that will be lost. That's my sadness about the D2.

---

<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:** [8 December 2023 09:09 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/288 "2023-12-08T09:09:45Z")

</div>

> [@hotNipi](#):
>
> That kind of prototype is easy to build, maintain, explain or even sell if you please. With Vue and with all that magic, all that will be lost. That's my sadness about the D2.

Vue is optional here, you can continue to write raw JavaScript/CSS/HTML too - I did [mention that in the docs](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html#writing-raw-javascript), but no examples - I will add some this morning.

The only thing I'm not 100% sure on atm (which I need to resolve) is making the `send` function accessible, or the `onInput` functionality - how did Dashboard 1.0 handle this, without going via Angular?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [8 December 2023 09:15 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/289 "2023-12-08T09:15:46Z")

</div>

> [@Steve-Mcl](#):
>
> those familiar with Vue would be frustrated at having to pull apart components into the separate tabs

You are absolutely right. It could e.g. be useful to have an extra tabsheet _"Vue"_ at the end. And that there would be a checkbox above the tabs _"manually enter vue code"_:

- When _ **selected** _ only the last _"Vue"_ tabsheet is enabled and you can enter your vue code there manually.
- When _ **unselected** _ all the tabsheets are enabled. When you click on the last tabsheet, you see the generated vue code in a disabled editor.

Just thinking out loud, without thinking about the amount of work involved..

---

<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:** [8 December 2023 09:19 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/290 "2023-12-08T09:19:28Z")

</div>

> [@BartButenaers](#):
>
> When _ **unselected** _ all the tabsheets are enabled. When you click on the last tabsheet, you see the generated vue code in a disabled editor.

Whilst I understand the value of this, this bit is very complicated as we assemble client-side.

Everything else proposed - I agree with, hence opening the issue 🙂

---

<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:** [8 December 2023 09:25 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/291 "2023-12-08T09:25:11Z")

</div>

The other important point here too, there are **two** learning curves:

1. VueJS - Optional as you can just use raw JS, but will give you some nice formatting (e.g. `computed`) and organisation benefits.
2. Vuetify - Entirely optional, even when using VueJS. It gives the set of widgets _for those that want them_, but no requirement to use them, if you don't want to.

I'll make this clearer in the documentation too.

---

<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:** [8 December 2023 10:23 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/292 "2023-12-08T10:23:45Z")

</div>

> [@BartButenaers](#):
>
> Or it must be that all the other web frameworks are even more worse

That pretty much nails it Bart. They also messed up big-time (in my view) with the v2 -\> v3 transition and v3 seems to be going the same way as many of the other frameworks - getting ever more complex. At the same time, the native DOM is massively improving. I've not found a need for VueJS in my own projects now for a long time.

But side-track off, I will shut up now. 🙂

---

<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:** [8 December 2023 10:28 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/293 "2023-12-08T10:28:16Z")

</div>

> [@Steve-Mcl](#):
>
> I felt those familiar with Vue would be frustrated at having to pull apart components into the separate tabs.

I think that is correct.

> [@joepavitt](#):
>
> The only thing I'm not 100% sure on atm (which I need to resolve) is making the `send` function accessible, or the `onInput` functionality - how did Dashboard 1.0 handle this, without going via Angular?

I believe that these were deeply wrapped inside some Angular processing weren't they?

But I've already solved that problem for uibuilder, so feel free to rip that code. It isn't that complex though it does need some understanding and management of the [Socket.IO](http://Socket.IO) client.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 December 2023 10:42 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/294 "2023-12-08T10:42:57Z")

</div>

> [@TotallyInformation](#):
>
> > [@joepavitt](#):
> >
> > The only thing I'm not 100% sure on atm (which I need to resolve) is making the `send` function accessible, or the `onInput` functionality - how did Dashboard 1.0 handle this, without going via Angular?
> 
> I believe that these were deeply wrapped inside some Angular processing weren't they?
> 
> But I've already solved that problem for uibuilder, so feel free to rip that code. It isn't that complex though it does need some understanding and management of the [Socket.IO](http://Socket.IO) client.

We already have `send` functionality Julian. I believe what Joe is saying is there is (currently) no mechanism for non vue code to call `send`. I _think_ it is just a case of adding something to the window object and hooking it up to the existing mechanism D2.0 already has for `send`ing messages to Node-RED.

Apologies if that's what you were saying (I read your comment as "this is what uib does get messages to Node-RED via [Socket.io](http://Socket.io)")

---

<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:** [8 December 2023 10:49 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/295 "2023-12-08T10:49:52Z")

</div>

I'm about to put this in the docs too, but _already supported_ with `v0.10.0` would be something like this:

```html
<template>
    <button class="my-class" onclick="onClick()">My Button</button>
</template>

<script>
    // Write any raw JavaScript here
    window.onClick = function () {
        alert('Button has been clicked')
    }

    // we can still access the wrapping send() function to pass on data with:
    this.send('Component has loaded')

    // and even subscribe to the incoming msg's
    this.$socket.on('msg-input:' + this.id, function(msg) {
        // do stuff with the message
        alert('message received: ' + msg.payload)
    })
</script>

<style>
    /* define any styles here - supports raw CSS */
    .my-class {
        color: red;
    }
</style>

```

@Steve-Mcl note that `send()` does actually already work. No need to expose into `window`

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [8 December 2023 10:53 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/296 "2023-12-08T10:53:38Z")

</div>

That's cool. Whenever the power grid company decides to give us some electricity, I'll try it out.

---

<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:** [8 December 2023 11:49 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/297 "2023-12-08T11:49:21Z")

</div>

Just pushed `0.10.1` with a fix for loading external dependencies, as well as doc updates to lead with Raw JS and external dependencies _first_, then VueJS examples as a secondary:

> **[Text ui-template | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html)**
>
> Documentation for Node-RED Dashboard 2.0, a collection of nodes to build out data visualisations and dashboards in Node-RED

---

<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:** [8 December 2023 12:12 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/299 "2023-12-08T12:12:55Z")

</div>

Let's move this to [UI Template - Tabbed interface for defining Component · Issue #419 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/419) as to not flood the main forum thread

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [8 December 2023 12:23 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/300 "2023-12-08T12:23:59Z")

</div>

Everything for "raw metal lovers" is here and up 😃 Thank you @joepavitt and all contributors.

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

If you can draw it, it can be made 😛

---

<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:** [8 December 2023 17:25 UTC](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/301 "2023-12-08T17:25:45Z")

</div>

> [@Steve-Mcl](#):
>
> We already have `send` functionality Julian

Yes, I realised that Steve, wouldn't be much of a Dashboard without it. 😀

> [@Steve-Mcl](#):
>
> I believe what Joe is saying is there is (currently) no mechanism for non vue code to call `send`. I _think_ it is just a case of adding something to the window object and hooking it up to the existing mechanism D2.0 already has for `send`ing messages to Node-RED.

Yes, that's what I was suggesting, that it isn't too hard to do from a plain library. You _could_, of course, add a `send` function to `window` but I would personally avoid that, it really is better to just have a single object attached to `window` with utility functions attached to that. Especially with something as generically named as `send`.

> [@Steve-Mcl](#):
>
> Apologies if that's what you were saying (I read your comment as "this is what uib does get messages to Node-RED via [Socket.io](http://Socket.io)")

Not a problem. That is true, of course, but it was more about being able to make some utility methods available outside of Vue. Also of course, it would mean having a base platform for future features available separate from Vue as well.

[Previous page](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142.md?page=14)

[Next page](https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142.md?page=16)
