(This is a continuation from some of the thread.)
I've been continuing to work on my little dashboard using uibuilder and vuetify. I replace vue-svg-gauge by my own dependency-less and animation-less version and more importantly, started to split components up into "foo" and "foo-card", where foo is the raw component that can be placed anywhere and foo-card is the same component wrapped into a v-card in such a way that it can be "just" placed into a grid. The idea is that the "-card" components can be dropped into a grid from some config sent by node-red while the non-card components can be used to build custom stuff. My test page now looks as follows:
The second row of widgets is composed of an array of gauge-card
s. The third row has 4 more gauge-card
s with different options but the last card in that row is an explicit/custom card that includes 3 gauge
s (the gauge
component doesn't print value or title, it's the gauge-card
that adds this, the assuming being that in a custom setting one may want to format these text strings very differently).
In terms of html the four gauge-card
on the third row look like this:
<gauge-card title="bedroom" unit="°F" :value="nr.bedroom"
:gauge="{min:30, max:120, arc:90}"></gauge-card>
<gauge-card title="gh-air" unit="°F" :value="nr.gh_air"
:gauge="{min:30, max:120}"></gauge-card>
<gauge-card title="gh-air" unit="°F" :value="nr.gh_air"
style="grid-row:span 2" :gauge="{min:30, max:120, stretch:true}"></gauge-card>
<gauge-card title="gh-air" unit="°F" :value="nr.gh_air"
style="grid-row:span 2; grid-column:span 2" class="gauge-large"
:gauge="{min:30, max:120, stretch:true}"></gauge-card>
While the custom card with the three gauges looks like this:
<v-card style="grid-row:span 2">
<v-card-text class="d-flex py-1">
<span class="mx-auto">Three gauges</span>
</v-card-text>
<div class="d-flex">
<gauge v-bind="{min:30, max:120, arc:180}" :value="nr.bedroom"
style="width:80%; height:auto;" class="mx-auto mt-2"></gauge>
</div>
<div class="d-flex flex-row mt-5">
<gauge v-bind="{min:30, max:120, arc:90, color:'#0091ea'}" :value="nr.study"
style="width:80%; height:auto;" class="mx-1"></gauge>
<gauge v-bind="{min:30, max:120, arc:90, color:'#ffd600'}" :value="nr.gh_air"
style="width:80%; height:auto;" class="mr-1"></gauge>
</div>
</v-card>
The "orchard status" card is also a custom card that includes four of the stat
components that also make up the whole top row of widgets. I don't have a distinction between stat
and stat-card
yet, I probably should...
Overall this shaping up to be quite nice!
(A sample flow with the dashboard uibuilder stuff is in GitHub - tve/uibuilder-test: Node-Red Test Dashboard using uibuilder)