I see every element has a fixed height of 48px - why ? (and paddings are everywhere for some reason)
Can this be overruled ? Thinking of text - this should be a max line-height of 1.5*fontsize
On Dashboard 1 you can tweek data in the widget config - setting number of decimal places, formatting dates etc using the Value format field. This seems to be missing from D2.
I guess these are Angular functions, is there no equivalent in the D2 libraries?
export default {
data() {
// define variables available component-wide
// (in <template> and component functions)
return {
count: 0,
btnText : ['On', 'Off'],
btnState: 0,
}
},
watch: {
// watch for any changes of "count"
count: function () {
if (this.count % 5 === 0) {
this.send({topic: 'Once', payload: 'Multiple of 5'})
}
this.send(this.btnState)
this.toggle()
}
},
However, I only get payload out of both send functions (topic & this.btn are ignored) I obviously have a misunderstanding somewhere. Would someone please point me in the right direction to get these working.
Edit
OK, I worked it out.
The send function actually sends a msg.payload, and having payload as the key in a sent Object means that any other keys are ignored, so if the Object was {topic: 'Anything', mode: 'On'} I get a msg.payload with keys topic & mode (NOT msg.topic which is "").
Similarly if this.btnState is either 0 or 1 and I send {payload: this.btnState} (or {anyKey: this.btnState}) I get an output of 0 or 1, but just sending this.btnState only sends the 1.
Guys, I'm going to collaborate here and leave a button that I'm developing. I work with home automation in Brazil and we set up 100% node ui-templat panels.. I hope Vue.js doesn't give me so many nights of sleep. My battle has been to make each ui-template node in the project an isolated component that reacts and issues messages as well as making it fully customizable so that my clients can have the look they request. I gave some suggestions for developers of difficulties I have had over years of learning about dash node-red.
I will leave here a small example of what we have assembled here, which ranges from simple buttons to complex time-phased activation elements or data received and sent by devices integrated with node-red via MQTT and zigbee devices. I hope to collaborate and learn from you. Panel shown is from the old version of dash and I'm trying to replicate it in the new project..
A lot of this is driven by the default styling for Vuetify, which I've not (yet) overridden. Also scope for including the general padding/sizing values in the ui-theme too, which is fairly barebones at the moment. Issue for this UI Theme - Include padding/sizing metrics.
Inherited from how Dashbaord 1.0 did things. As a first target for us, it was to reproduce this, there could be scope for having widgets bound to a page instead - issues & feature requests on GH welcome.
You can write your own CSS to override this in ui-template node, for example:
Thanks for finding @Buckskin - found this issue myself after releasing 0.10.0 - tracked here
Appreciate the feedback @diegodamaceno I think having easier access to the ui-theme config nodes here is a definite must-have, but given that we architect things with themes differently to Dashboard 1.0, I hope this particular case should be easier for us to handle.
I'm probably doing something wrong, but I can't get this to work. I would also like to change the background. In fact, nothing that changes the appearance is working on my instance.