Skip to content

Commit

Permalink
webapp: optimize placement of device profile doc buttons
Browse files Browse the repository at this point in the history
* remove empty container for device profile links. if a device profile
  has no links, no buttons are generated, but a row was still part of
  the DOM, adding spurious space between the select and the alert with
  the hint.
  • Loading branch information
schlimmchen authored and tbnobody committed Nov 1, 2024
1 parent bac7179 commit f1c095e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions webapp/src/views/DeviceAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,17 @@
</div>
</div>

<div class="row mb-3">
<div class="row mb-3" v-if="docLinks.length">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<div
class="btn-group mb-2 me-2"
v-for="(doc, index) in pinMappingList.find(
(i) => i.name === deviceConfigList.curPin.name
)?.links"
<div class="col-sm-10 d-flex gap-3">
<a
v-for="(doc, index) in docLinks"
:key="index"
:href="doc.url"
class="btn btn-primary"
target="_blank"
>{{ doc.name }}</a
>
<a :href="doc.url" class="btn btn-primary" target="_blank">{{ doc.name }}</a>
</div>
</div>
</div>

Expand Down Expand Up @@ -315,6 +314,12 @@ export default defineComponent({
this.deviceConfigList.led.every((v) => (v.brightness = this.deviceConfigList.led[0].brightness));
},
},
computed: {
docLinks() {
const mapping = this.pinMappingList.find((i) => i.name === this.deviceConfigList.curPin.name);
return mapping?.links || [];
},
},
methods: {
getLanguageList() {
this.languageLoading = true;
Expand Down

0 comments on commit f1c095e

Please sign in to comment.