upgrade functionality for v2.0.10

This commit is contained in:
Čarodej
2022-03-30 13:36:28 +02:00
parent 621f6770c5
commit d362b37cd3
10 changed files with 229 additions and 71 deletions

View File

@@ -53,6 +53,18 @@
</div>
</div>
<!--New language strings alert-->
<div
v-if="true"
class="mb-6 flex items-center rounded-xl dark:bg-green-700/30 bg-green-200 p-5 shadow-card cursor-pointer"
@click="upgradeSystem"
>
<alert-octagon-icon size="18" class="vue-feather mr-4 shrink-0 dark:text-green-500 text-green-700" />
<p class="text-sm dark:text-green-500 text-green-700">
There is a new update that need upgrade some stuff on your backend. Please click on this box to upgrade.
</p>
</div>
<!--New language strings alert-->
<div
v-if="data.app.shouldUpgradeTranslations"
@@ -261,6 +273,21 @@ export default {
message: this.$t('popup_error.message'),
})
})
},
upgradeSystem() {
axios.get('/upgrade/system')
.then(() => {
events.$emit('toaster', {
type: 'success',
message: this.$t('Your app was upgraded successfully.'),
})
})
.catch(() => {
events.$emit('alert:open', {
title: this.$t('popup_error.title'),
message: this.$t('popup_error.message'),
})
})
}
},
created() {