Skip to content

Commit

Permalink
fix: 🐛 Gnirehtet state
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 9, 2023
1 parent de3555b commit e5f78e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/Device/components/ControlBar/Gnirehtet/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<el-dropdown>
<div class="" :title="loadingText" @click="handleStart">
<div class="" :title="device.$gnirehtetLoadingText" @click="handleStart">
<slot :loading="device.$gnirehtetLoading" />
</div>

Expand All @@ -26,15 +26,14 @@ export default {
},
data() {
return {
loadingText: '',
}
},
methods: {
preferenceData(...args) {
return this.$store.preference.getData(...args)
},
async handleStart() {
this.loadingText = this.$t('device.control.gnirehtet.running')
this.device.$gnirehtetLoadingText = this.$t('device.control.gnirehtet.running')
this.device.$gnirehtetLoading = true
try {
Expand All @@ -47,11 +46,11 @@ export default {
catch (error) {
this.$message.warning(error.message || 'Start service failure')
this.device.$gnirehtetLoading = false
this.loadingText = ''
this.device.$gnirehtetLoadingText = ''
}
},
async handleStop() {
this.loadingText = this.$t('device.control.gnirehtet.stopping')
this.device.$gnirehtetLoadingText = this.$t('device.control.gnirehtet.stopping')
try {
await this.$gnirehtet.stop(this.device.id)
Expand All @@ -63,7 +62,7 @@ export default {
}
this.device.$gnirehtetLoading = false
this.loadingText = ''
this.device.$gnirehtetLoadingText = ''
},
},
}
Expand Down
1 change: 1 addition & 0 deletions src/components/Device/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ export default {
$recordLoading: false,
$stopLoading: false,
$gnirehtetLoading: false,
$gnirehtetLoadingText: '',
})) || []
console.log('getDeviceData.data', this.deviceList)
Expand Down

0 comments on commit e5f78e7

Please sign in to comment.