mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
remove unused files and refactor variable names and function names
This commit is contained in:
@ -8,12 +8,12 @@
|
||||
</p>
|
||||
<label class="input-label">Current version</label><br>
|
||||
<label class="version">1.0.0</label>
|
||||
<base-button :outline="true" size="large" color="theme" @click="checkUpdate">
|
||||
<font-awesome-icon :class="{'update': isUpdateAvail}" style="margin-right: 10px;" icon="sync-alt" />
|
||||
<base-button :outline="true" :disabled="isCheckingforUpdate" size="large" color="theme" @click="checkUpdate" >
|
||||
<font-awesome-icon :class="{'update': isCheckingforUpdate}" style="margin-right: 10px;" icon="sync-alt" />
|
||||
{{ $t('settings.update_app.check_update') }}
|
||||
</base-button>
|
||||
<hr>
|
||||
<div v-show="!isUpdating" v-if="isUpdateAvail" class="mt-4 content">
|
||||
<div v-show="!isUpdating" v-if="isUpdateAvailable" class="mt-4 content">
|
||||
<h3 class="page-title">{{ $t('settings.update_app.avail_update') }}</h3>
|
||||
<label class="input-label">{{ $t('settings.update_app.next_version') }}</label><br>
|
||||
<label class="version">{{ updateData.version }}</label>
|
||||
@ -41,8 +41,9 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
isShowProgressBar: false,
|
||||
isUpdateAvail: false,
|
||||
isUpdateAvailable: false,
|
||||
isUpdating: false,
|
||||
isCheckingforUpdate: false,
|
||||
progress: 10,
|
||||
interval: null,
|
||||
description: '',
|
||||
@ -64,22 +65,24 @@ export default {
|
||||
this.isUpdating = true
|
||||
const data = this.updateData
|
||||
let response = await axios.post('/api/update', data)
|
||||
console.log(response.data)
|
||||
this.isUpdating = false
|
||||
this.isUpdateAvail = false
|
||||
this.isUpdateAvailable = false
|
||||
},
|
||||
async checkUpdate () {
|
||||
try {
|
||||
this.isCheckingforUpdate = true
|
||||
let response = await axios.get('/api/check/update')
|
||||
console.log(response.data)
|
||||
this.isCheckingforUpdate = false
|
||||
|
||||
if (response.data) {
|
||||
this.updateData.isMinor = response.data.is_minor
|
||||
this.updateData.version = response.data.version
|
||||
this.description = response.data.description
|
||||
this.isUpdateAvailable = true
|
||||
}
|
||||
this.isUpdateAvail = true
|
||||
} catch (e) {
|
||||
this.isUpdateAvail = false
|
||||
this.isUpdateAvailable = false
|
||||
this.isCheckingforUpdate = false
|
||||
window.toastr['error']('Something went wrong')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user