1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Update system

This commit is contained in:
2020-06-19 18:03:52 +02:00
parent 0d10a93bf8
commit 42e0353393
15 changed files with 197 additions and 31 deletions

View File

@ -78,7 +78,7 @@
</div>
<div v-if="selectedTab === 'update'" class="panel-body py-4">
<!-- -->
<ModalSettingsUpdate />
</div>
<div v-if="selectedTab === 'about'" class="panel-body py-4">
@ -101,10 +101,14 @@
<script>
import { mapActions, mapGetters } from 'vuex';
import localesNames from '@/i18n/supported-locales';
import ModalSettingsUpdate from '@/components/ModalSettingsUpdate';
const { shell } = require('electron');
export default {
name: 'ModalSettings',
components: {
ModalSettingsUpdate
},
data () {
return {
isUpdate: false,

View File

@ -0,0 +1,84 @@
<template>
<div class="empty">
<div class="empty-icon">
<i class="material-icons md-48">system_update_alt</i>
</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',
downloadPercentage: 'application/getDownloadProgress'
}),
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">
.empty{
color: $body-font-color;
}
</style>

View File

@ -70,10 +70,12 @@ export default {
case 'char':
case 'varchar':
case 'text':
case 'mediumtext':
return val.substring(0, 128);
case 'date':
return moment(val).format('YYYY-MM-DD');
case 'datetime':
case 'timestamp':
return moment(val).format('YYYY-MM-DD HH:mm:ss.SSS');
case 'blob':
case 'mediumblob':