Some changes for the GUI

This commit is contained in:
Félix Aime
2021-02-19 13:20:18 +01:00
parent 6790b17f86
commit 8d64b3bc9a
3 changed files with 35 additions and 39 deletions

View File

@@ -2,7 +2,7 @@
<div class="controls" v-if="display">
<i class="off-icon" v-on:click="action('shutdown')" v-if="off_available"></i>
<i class="quit-icon" v-on:click="action('quit')" v-if="quit_available"></i>
<i :class="[ update_available ? 'update-icon' :'no-update-icon' ]" @click="$router.push({ name: 'update' })"></i>
<i class="update-icon" v-if="update_available&&update_possible" @click="$router.push({ name: 'update' })"></i>
</div>
</template>
<script>
@@ -14,7 +14,7 @@ export default {
return {
display: true,
update_available: false,
update_possible: true,
update_possible: false,
quit_available: false,
off_available: false
}
@@ -33,11 +33,14 @@ export default {
.then(response => {
if(response.data.status) {
if(response.data.message == "A new version is available"){
// Allow to show the warning chip.
this.update_available = true
this.update_possible = true
} else if(response.data.message == "This is the latest version"){
this.update_available = false
this.update_possible = true
// Pass the versions as "global vars" through window variable.
window.current_version = response.data.current_version
window.next_version = response.data.next_version
}
} else {
this.update_possible = false