mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
perf: Workbench shortcut command execution and stop buttons switch each other
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
>
|
||||
<el-tooltip :content="item.tip" :disabled="!item.tip" placement="top">
|
||||
<el-button
|
||||
v-if="item.type ==='button'"
|
||||
:disabled="item.disabled"
|
||||
v-if="item.type ==='button' && !item.isVisible"
|
||||
:type="item.el&&item.el.type"
|
||||
size="mini"
|
||||
@click="item.callback()"
|
||||
|
@@ -102,7 +102,7 @@ export default {
|
||||
align: 'left',
|
||||
icon: 'fa fa-play',
|
||||
tip: this.$t('RunCommand'),
|
||||
disabled: this.$store.getters.currentOrgIsRoot,
|
||||
isVisible: this.$store.getters.currentOrgIsRoot,
|
||||
el: {
|
||||
type: 'primary'
|
||||
},
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
align: 'left',
|
||||
icon: 'fa fa-stop',
|
||||
tip: this.$t('StopJob'),
|
||||
disabled: true,
|
||||
isVisible: true,
|
||||
el: {
|
||||
type: 'danger'
|
||||
},
|
||||
@@ -391,7 +391,7 @@ export default {
|
||||
|
||||
setCostTimeInterval() {
|
||||
this.toolbar.left.run.icon = 'fa fa-spinner fa-spin'
|
||||
this.toolbar.left.run.disabled = true
|
||||
this.toolbar.left.run.isVisible = true
|
||||
this.executionInfo.cancel = setInterval(() => {
|
||||
this.executionInfo.timeCost += 0.1
|
||||
}, 100)
|
||||
@@ -469,8 +469,8 @@ export default {
|
||||
clearInterval(this.executionInfo.cancel)
|
||||
this.toolbar.left.run.icon = 'fa fa-play'
|
||||
}
|
||||
this.toolbar.left.run.disabled = this.executionInfo.status === 'running'
|
||||
this.toolbar.left.stop.disabled = this.executionInfo.status !== 'running'
|
||||
this.toolbar.left.run.isVisible = this.executionInfo.status === 'running'
|
||||
this.toolbar.left.stop.isVisible = this.executionInfo.status !== 'running'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user