Background
I use Node Red old dashboard extensively, and have built a number of dynamically generated UIs using UI Template nodes. For example, a lighting control panel that enumerates lights within a "zone", then displays sliders for each light in that zone.
I'd like to get to work installing Dashboard 2.0 and leveraging some of the new technologies there (which I personally I have no idea about yet...)
Questions
-
Can I run old Dashboard concurrently with Dashboard 2.0? (This would allow me to actually build for Dashboard 2.0 whilst still being able to turn the lights / heating on!)
-
Can you look at the below code and screenshot, and tell me if I can achieve this kind of thing in Dashboard 2.0, maybe with some pointers?
Here are the main things I need to do:
- Implement sliders, buttons, colour pickers
- Loop through JS objects / arrays etc and display the output in CSS divs / tables etc.
- Conditionally display things based on incoming messages, e.g. if msg.toggle is true, then show some control or conditional CSS etc
... so here's an example of what I would need to port:
<div class="slider-container">
<div ng-repeat="(key, value) in msg.fixturesettings" class="slider-row">
<div class="slider-label"><div class="slider-label-text">{{value.label}} <span style="slider-val">(<span ng-if="value.controltype != '1_non_dim'">{{value.setting.brightness}}</span><span ng-if="value.controltype == '1_non_dim'">{{(value.setting.state === true) ? 'On' : 'Off'}}</span>)</span></div></div>
<div class="slider-colpick"><div ng-if="value.controltype != '3_RGB'" class="no-color-picker">(W)</div><input ng-if="value.controltype == '3_RGB'" class="picker" type="color" ng-model="value.colour" ng-change="send({sysaction: 'col', topic: key, colour: value.colour, zone: msg.zoneid})" /></div>
<div class="slider-slider">
<div ng-if="value.controltype == '1_non_dim'"><md-switch ng-model="value.setting.state" ng-change="send({sysaction: 'switch', topic: key, state: value.setting.state, zone:msg.zoneid})"></md-switch></div>
<div ng-if="value.controltype != '1_non_dim'"><md-slider min="0" max="100" step="{{value.resolution}}" ng-model="value.setting.brightness" ng-change="send({sysaction: 'bri', topic: key, brightness: value.setting.brightness, zone:msg.zoneid})"></md-slider></div>
</div>
</div>
</div>