Added update check in about tab

This commit is contained in:
RemixDev 2020-09-07 11:36:26 +02:00
parent 0a0351ca78
commit ea7f80e6aa
4 changed files with 34 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,11 @@
<template> <template>
<div id="about_tab" class="main_tabcontent"> <div id="about_tab" class="main_tabcontent">
<h2 class="page_heading">{{ $t('sidebar.about') }}</h2> <h2 class="page_heading">{{ $t('sidebar.about') }}</h2>
<ul>
<li>{{ $t('about.updates.currentVersion') }}: <span v-if="current">{{ current }}</span><span v-else>{{ $t('about.updates.versionNotAvailable') }}</span></li>
<li v-if="updateAvailable && latest">{{ $t('about.updates.updateAvailable', {version: latest}) }}</li>
</ul>
<ul> <ul>
<li v-html="$t('about.usesLibrary')"></li> <li v-html="$t('about.usesLibrary')"></li>
<li v-html="$t('about.thanks')"></li> <li v-html="$t('about.thanks')"></li>
@ -191,13 +196,28 @@ ul {
} }
</style> </style>
<script> <script>
import { socket } from '@/utils/socket'
import paypal from '@/assets/paypal.svg' import paypal from '@/assets/paypal.svg'
import ethereum from '@/assets/ethereum.svg' import ethereum from '@/assets/ethereum.svg'
export default { export default {
data: () => ({ data: () => ({
paypal, paypal,
ethereum ethereum,
}) current: null,
latest: null,
updateAvailable: false
}),
methods: {
initUpdate(data){
const { currentCommit, latestCommit, updateAvailable } = data
this.current = currentCommit
this.latest = latestCommit
this.updateAvailable = updateAvailable
}
},
mounted() {
socket.on('init_update', this.initUpdate)
}
} }
</script> </script>

View File

@ -41,6 +41,11 @@ const en = {
} }
}, },
about: { about: {
updates: {
currentVersion: 'Current Version',
versionNotAvailable: 'N/A',
updateAvailable: `You're not running the latest version available: {version}`
},
titles: { titles: {
usefulLinks: 'Useful Links', usefulLinks: 'Useful Links',
bugReports: 'Bug Reports', bugReports: 'Bug Reports',

View File

@ -41,6 +41,11 @@ const it = {
} }
}, },
about: { about: {
updates: {
currentVersion: 'Versione corrente',
versionNotAvailable: 'N/A',
updateAvailable: `Non stai usando l'ultima versione disponibile: {version}`
},
titles: { titles: {
usefulLinks: 'Link Utili', usefulLinks: 'Link Utili',
bugReports: 'Segnalazione di bug', bugReports: 'Segnalazione di bug',