Config UI: move generic meters to top (#12281)

This commit is contained in:
Michael Geers 2024-02-15 21:05:13 +01:00 • committed by GitHub
parent 01017789fe
commit 6f9c3384a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 9 deletions

View file

@ -44,6 +44,16 @@
:disabled="!isNew"
class="form-select w-100"
>
<option
v-for="option in genericOptions"
:key="option.name"
:value="option.template"
>
{{ option.name }}
</option>
<option v-if="genericOptions.length" disabled>
──────────
</option>
<option
v-for="option in templateOptions"
:key="option.name"
@ -52,6 +62,7 @@
{{ option.name }}
</option>
</select>
{{ templateName }}
</FormRow>
<p v-if="loadingTemplate">Loading ...</p>
<Modbus
@ -198,7 +209,10 @@ export default {
return this.type || this.selectedType;
},
templateOptions() {
return this.products;
return this.products.filter((p) => p.group !== "generic");
},
genericOptions() {
return this.products.filter((p) => p.group === "generic");
},
templateParams() {
const params = this.template?.Params || [];

View file

@ -1,8 +1,8 @@
template: sunspec-battery-control
products:
- description:
de: Sunspec Batterie (Model 802)
en: Sunspec Battery (Model 802)
de: SunSpec Batterie (Model 802)
en: SunSpec Battery (Model 802)
capabilities: ["battery-control"]
group: generic
params:

View file

@ -2,8 +2,8 @@ template: sunspec-hybrid
covers: ["sunspec-hybrid-inverter"]
products:
- description:
de: Hybridwechselrichter
en: Hybrid Inverter
de: SunSpec Hybridwechselrichter
en: SunSpec Hybrid Inverter
group: generic
params:
- name: usage

View file

@ -1,8 +1,8 @@
template: sunspec-inverter-control
products:
- description:
de: Sunspec Batterie (Model 124)
en: Sunspec Battery (Model 124)
de: SunSpec Batterie (Model 124)
en: SunSpec Battery (Model 124)
capabilities: ["battery-control"]
group: generic
params:

View file

@ -1,8 +1,8 @@
template: sunspec-inverter
products:
- description:
de: Wechselrichter
en: Inverter
de: SunSpec Wechselrichter
en: SunSpec Inverter
group: generic
params:
- name: usage