2020-06-19 18:03:52 +02:00
|
|
|
<template>
|
|
|
|
<div class="empty">
|
|
|
|
<div class="empty-icon">
|
2020-08-12 10:48:18 +02:00
|
|
|
<i class="mdi mdi-48px mdi-cloud-download" />
|
2020-06-19 18:03:52 +02:00
|
|
|
</div>
|
|
|
|
<p class="empty-title h5">
|
|
|
|
{{ updateMessage }}
|
|
|
|
</p>
|
|
|
|
<div v-if="updateStatus === 'downloading'">
|
|
|
|
<progress
|
|
|
|
class="progress"
|
|
|
|
:value="downloadPercentage"
|
|
|
|
max="100"
|
|
|
|
/>
|
|
|
|
<p class="empty-subtitle">
|
|
|
|
{{ downloadPercentage }}%
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="empty-action">
|
|
|
|
<button
|
|
|
|
v-if="['noupdate', 'checking', 'nocheck'].includes(updateStatus)"
|
|
|
|
class="btn btn-primary"
|
|
|
|
:class="{'loading': updateStatus === 'checking'}"
|
|
|
|
@click="checkForUpdates"
|
|
|
|
>
|
|
|
|
{{ $t('message.checkForUpdates') }}
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
v-if="updateStatus === 'downloaded'"
|
|
|
|
class="btn btn-primary"
|
|
|
|
@click="restartToUpdate"
|
|
|
|
>
|
|
|
|
{{ $t('message.restartToInstall') }}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import { ipcRenderer } from 'electron';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ModalSettingsUpdate',
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
updateStatus: 'application/getUpdateStatus',
|
2020-06-26 18:14:16 +02:00
|
|
|
downloadPercentage: 'application/getDownloadProgress'
|
2020-06-19 18:03:52 +02:00
|
|
|
}),
|
|
|
|
updateMessage () {
|
|
|
|
switch (this.updateStatus) {
|
|
|
|
case 'noupdate':
|
|
|
|
return this.$t('message.noUpdatesAvailable');
|
|
|
|
case 'checking':
|
|
|
|
return this.$t('message.checkingForUpdate');
|
|
|
|
case 'nocheck':
|
|
|
|
return this.$t('message.checkFailure');
|
|
|
|
case 'available':
|
|
|
|
return this.$t('message.updateAvailable');
|
|
|
|
case 'downloading':
|
|
|
|
return this.$t('message.downloadingUpdate');
|
|
|
|
case 'downloaded':
|
|
|
|
return this.$t('message.updateDownloaded');
|
|
|
|
default:
|
|
|
|
return this.updateStatus;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
checkForUpdates () {
|
|
|
|
ipcRenderer.send('checkForUpdates');
|
|
|
|
},
|
|
|
|
restartToUpdate () {
|
|
|
|
ipcRenderer.send('restartToUpdate');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2020-07-31 18:16:28 +02:00
|
|
|
.empty {
|
|
|
|
color: $body-font-color;
|
2020-06-19 18:03:52 +02:00
|
|
|
}
|
|
|
|
</style>
|