Skip to content

Commit

Permalink
Merge branch 'pr799' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Apr 12, 2023
2 parents 4b9d21a + d2d0790 commit 9d45c5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
21 changes: 9 additions & 12 deletions webapp/src/views/DeviceAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
<div class="col-sm-10">
<select class="form-select" id="inputPinProfile"
v-model="deviceConfigList.curPin.name">
<option v-for="device in pinMappingList" :value="device.name"
:key="device.name">
{{ device.name }}
<option v-for="device in pinMappingList" :value="device.name" :key="device.name">
{{ device.name === "Default" ? $t('deviceadmin.DefaultProfile') : device.name }}
</option>
</select>
</div>
Expand Down Expand Up @@ -63,8 +62,8 @@
</label>
<div class="col-sm-10">
<select class="form-select" v-model="deviceConfigList.display.rotation">
<option v-for="rotation in displayRotationList" :key="rotation.key" :value="rotation.key">
{{ rotation.value }}
<option v-for="(rotation, index) in displayRotationList" :key="index" :value="index">
{{ $t(`deviceadmin.` + rotation) }}
</option>
</select>
</div>
Expand Down Expand Up @@ -119,10 +118,10 @@ export default defineComponent({
alertType: "info",
showAlert: false,
displayRotationList: [
{ key: 0, value: this.$t('deviceadmin.rot0') },
{ key: 1, value: this.$t('deviceadmin.rot90') },
{ key: 2, value: this.$t('deviceadmin.rot180') },
{ key: 3, value: this.$t('deviceadmin.rot270') },
'rot0',
'rot90',
'rot180',
'rot270',
],
}
},
Expand All @@ -144,10 +143,8 @@ export default defineComponent({
this.pinMappingList = Array<Device>();
})
.finally(() => {
this.pinMappingList.push({
"name": this.$t('deviceadmin.DefaultProfile')
} as Device);
this.pinMappingList.sort((a, b) => (a.name < b.name) ? -1 : 1);
this.pinMappingList.splice(0, 0, { "name": "Default" } as Device);
this.pinMappingLoading = false;
});
},
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 in palevelList" :key="palevel.key" :value="palevel.key">
{{ palevel.value }}
<option v-for="(palevel, index) in palevelList" :key="index" :value="index">
{{ $t(`dtuadmin.` + palevel) }}
</option>
</select>
</div>
Expand Down Expand Up @@ -58,10 +58,10 @@ export default defineComponent({
dataLoading: true,
dtuConfigList: {} as DtuConfig,
palevelList: [
{ key: 0, value: this.$t('dtuadmin.Min') },
{ key: 1, value: this.$t('dtuadmin.Low') },
{ key: 2, value: this.$t('dtuadmin.High') },
{ key: 3, value: this.$t('dtuadmin.Max') },
'Min',
'Low',
'High',
'Max',
],
alertMessage: "",
alertType: "info",
Expand Down

0 comments on commit 9d45c5d

Please sign in to comment.