Skip to content

Commit

Permalink
webapp: Implement combo boxes again as objects
Browse files Browse the repository at this point in the history
1. Key  is a magic number which is used in the c++ backend
2. Based on the object model some further extension will be done soon
  • Loading branch information
tbnobody committed Apr 12, 2023
1 parent ebaccc9 commit 0f1b3f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions webapp/src/views/DeviceAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
</label>
<div class="col-sm-10">
<select class="form-select" v-model="deviceConfigList.display.rotation">
<option v-for="(rotation, index) in displayRotationList" :key="index" :value="index">
{{ $t(`deviceadmin.` + rotation) }}
<option v-for="rotation in displayRotationList" :key="rotation.key" :value="rotation.key">
{{ $t(`deviceadmin.` + rotation.value) }}
</option>
</select>
</div>
Expand Down Expand Up @@ -118,10 +118,10 @@ export default defineComponent({
alertType: "info",
showAlert: false,
displayRotationList: [
'rot0',
'rot90',
'rot180',
'rot270',
{ key: 0, value: 'rot0' },
{ key: 1, value: 'rot90' },
{ key: 2, value: 'rot180' },
{ key: 3, value: 'rot270' },
],
}
},
Expand Down
12 changes: 6 additions & 6 deletions webapp/src/views/DtuAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</label>
<div class="col-sm-10">
<select class="form-select" v-model="dtuConfigList.dtu_palevel">
<option v-for="(palevel, index) in palevelList" :key="index" :value="index">
{{ $t(`dtuadmin.` + palevel) }}
<option v-for="palevel in palevelList" :key="palevel.key" :value="palevel.key">
{{ $t(`dtuadmin.` + palevel.value) }}
</option>
</select>
</div>
Expand Down Expand Up @@ -58,10 +58,10 @@ export default defineComponent({
dataLoading: true,
dtuConfigList: {} as DtuConfig,
palevelList: [
'Min',
'Low',
'High',
'Max',
{ key: 0, value: 'Min' },
{ key: 1, value: 'Low' },
{ key: 2, value: 'High' },
{ key: 3, value: 'Max' },
],
alertMessage: "",
alertType: "info",
Expand Down

0 comments on commit 0f1b3f1

Please sign in to comment.