Skip to content

Commit

Permalink
fix(ui): hide OTA downgrades by default and fix icon
Browse files Browse the repository at this point in the history
Fixes #3342
  • Loading branch information
robertsLando committed Oct 16, 2023
1 parent cfd1dea commit 2cd17f7
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/components/nodes-table/OTAUpdates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,23 @@
class="ml-1"
>
</v-checkbox>
<v-checkbox
v-model="showDowngrades"
hide-details
dense
label="Show downgrades"
class="ml-1"
>
</v-checkbox>
</v-row>
</v-col>

<template v-if="fwUpdates.length > 0">
<template v-if="filteredUpdates.length > 0">
<v-col
cols="12"
sm="6"
md="4"
v-for="u in fwUpdates"
v-for="u in filteredUpdates"
:key="u.version"
>
<v-card dense elevation="5">
Expand All @@ -43,7 +51,9 @@
small
:color="u.downgrade ? 'warning' : 'success'"
@click="updateFirmware(u)"
><v-icon small>upload</v-icon>
><v-icon small>{{
u.downgrade ? 'download' : 'upload'
}}</v-icon>
{{ u.downgrade ? 'Downgrade' : 'Update' }}
</v-btn>
</v-card-title>
Expand Down Expand Up @@ -137,9 +147,16 @@ export default {
fwUpdates: [],
loading: false,
includePrereleases: false,
showDowngrades: false,
}
},
computed: {},
computed: {
filteredUpdates() {
return this.fwUpdates.filter(
(u) => !u.downgrade || (u.downgrade && this.showDowngrades)
)
},
},
mounted() {
this.checkUpdates()
},
Expand Down

0 comments on commit 2cd17f7

Please sign in to comment.