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>
<tr> <tr>
<th>{{ $t('firmwareinfo.FirmwareUpdate') }}</th> <th>{{ $t('firmwareinfo.FirmwareUpdate') }}</th>
<td v-if="modelAllowVersionInfo"> <td>
<a v-if="systemStatus.update_url !== undefined" :href="systemStatus.update_url" target="_blank" v-tooltip <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')"> :title="$t('firmwareinfo.FirmwareUpdateHint')">
<span class="badge" :class="systemStatus.update_status"> <span class="badge" :class="systemStatus.update_status">
{{ systemStatus.update_text }} {{ systemStatus.update_text }}
</span> </span>
</a> </a>
<span v-else class="badge" :class="systemStatus.update_status"> <span v-else-if="modelAllowVersionInfo" class="badge" :class="systemStatus.update_status">
{{ systemStatus.update_text }} {{ systemStatus.update_text }}
</span> </span>
</td> </label>
<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')" />
</div> </div>
</td> </td>
</tr> </tr>

View File

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