Skip to content

Commit

Permalink
feature: 脚本已下线版本可以禁用 #1374
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx authored and jsonwan committed Sep 26, 2022
1 parent 84ed689 commit cd48797
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/frontend/src/domain/model/script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ export default class Script extends BaseModel {
return !this.version;
}

/**
* @desc 是否可禁用
* @returns { Boolean }
*/
get isBanable () {
return [
Script.STATUS_ONLINE,
Script.STATUS_OFFLINE,
].includes(this.status);
}

/**
* @desc tag 显示文本
* @returns { String }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
</auth-button>
</jb-popover-confirm>
<jb-popover-confirm
v-if="scriptInfo.isOnline"
v-if="scriptInfo.isBanable"
key="offline"
style="margin-left: auto;"
:title="$t('script.确定禁用该版本?')"
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/views/script-manage/version/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
</auth-button>
</jb-popover-confirm>
<jb-popover-confirm
v-if="row.isOnline"
v-if="row.isBanable"
class="mr10"
:title="$t('script.确定禁用该版本?')"
:content="$t('script.一旦禁用成功,不可恢复!且线上引用该版本的作业步骤都会无法执行,请务必谨慎操作!')"
Expand Down

0 comments on commit cd48797

Please sign in to comment.