Feature: Allow enabling and disabling of the version check

Fix #1787
This commit is contained in:
Thomas Basler 2024-03-12 18:35:19 +01:00
parent 9634c93a3c
commit bd8d93bf92
2 changed files with 14 additions and 14 deletions

View File

@ -28,20 +28,20 @@
</tr>
<tr>
<th>{{ $t('firmwareinfo.FirmwareUpdate') }}</th>
<td v-if="modelAllowVersionInfo">
<a v-if="systemStatus.update_url !== undefined" :href="systemStatus.update_url" target="_blank" v-tooltip
<td>
<div class="form-check form-check-inline form-switch">
<input v-model="modelAllowVersionInfo" class="form-check-input" type="checkbox" role="switch" v-tooltip :title="$t('firmwareinfo.FrmwareUpdateAllow')" />
<label class="form-check-label">
<a v-if="modelAllowVersionInfo && systemStatus.update_url !== undefined" :href="systemStatus.update_url" target="_blank" v-tooltip
:title="$t('firmwareinfo.FirmwareUpdateHint')">
<span class="badge" :class="systemStatus.update_status">
{{ systemStatus.update_text }}
</span>
</a>
<span v-else class="badge" :class="systemStatus.update_status">
<span v-else-if="modelAllowVersionInfo" class="badge" :class="systemStatus.update_status">
{{ systemStatus.update_text }}
</span>
</td>
<td v-else>
<div class="form-check form-switch">
<input v-model="modelAllowVersionInfo" class="form-check-input" type="checkbox" role="switch" v-tooltip :title="$t('firmwareinfo.FrmwareUpdateAllow')" />
</label>
</div>
</td>
</tr>

View File

@ -96,8 +96,8 @@ export default defineComponent({
},
watch: {
allowVersionInfo(allow: Boolean) {
localStorage.setItem("allowVersionInfo", allow ? "1" : "0");
if (allow) {
localStorage.setItem("allowVersionInfo", this.allowVersionInfo ? "1" : "0");
this.getUpdateInfo();
}
}