Skip to content

Commit

Permalink
feature: 部署策略执行被抑制时,主抑制策略增加超链接 (closed #889)
Browse files Browse the repository at this point in the history
  • Loading branch information
GONGONGONG authored and ZhuoZhuoCrayon committed Sep 9, 2022
1 parent d5e0564 commit bd1a9e2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontend/src/types/task/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export interface ITaskHost {
step?: string // 判断是否需要展示手动命令查看按钮
opType?: string
opTypeDisplay?: string
suppressedById?: number
}

export interface ITaskSolutions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,18 @@
prop="msg"
key="msg"
show-overflow-tooltip
min-width="400"
/>
min-width="400">
<template #default="{ row }">
<div class="col-execution">
<span
:class="['execut-text', { 'has-icon': row.suppressed_by_id }]"
@click.stop="$router.push({ name: 'pluginRule', query: { id: `${row.suppressed_by_id}` } })">
{{ row.msg | filterEmpty }}
<i v-if="row.suppressed_by_id" class="nodeman-icon nc-icon-audit filtered-icon" />
</span>
</div>
</template>
</bk-table-column>
<bk-table-column
v-else-if="isIgnoredTab && isManualType"
:label="$t('部署策略')"
Expand Down Expand Up @@ -979,5 +989,13 @@ export default class PerformPreview extends Mixins(HeaderRenderMixin, HeaderFilt
display: inline;
}
}
.col-execution {
&:hover .filtered-icon {
color: #3a84ff;
}
.has-icon {
cursor: pointer;
}
}
}
</style>
10 changes: 8 additions & 2 deletions frontend/src/views/plugin/plugin-rule/plugin-rule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,16 @@ export default class PluginRule extends Mixins(authorityMixin(), pollMixin) {
],
multiable: false,
}];
private queryIds: Array<string|number> = [];
private get selectedBiz() {
return MainStore.selectedBiz;
}
private created() {
const name = this.$route.params.name || this.$route.query.name as string;
this.searchSelectValue = name || '';
const { query = {}, params: { name = '', id = [] } } = this.$route;
this.searchSelectValue = name || query.name as string;
this.queryIds = (query.id ? [query.id] : id) as string[] ;
this.handleGetPluginRules();
}
Expand Down Expand Up @@ -259,6 +261,10 @@ export default class PluginRule extends Mixins(authorityMixin(), pollMixin) {
pagesize: limit,
ordering: '-enable,-update_time',
};
if (this.queryIds.length) {
params.conditions = [{ key: 'id', value: [...this.queryIds] }];
this.queryIds.splice(0, this.queryIds.length);
}
if (this.searchSelectValue) {
params.conditions = [{ key: 'query', value: this.searchSelectValue }];
}
Expand Down
16 changes: 13 additions & 3 deletions frontend/src/views/task/task-detail-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@
<span v-else :class="`execut-mark execut-${ row.status }`"></span>
<span
v-if="row.status === 'filtered' || row.status === 'ignored'"
:class="['execut-text', { 'has-icon': row.exception && row.exception === 'is_running' }]"
:class="[
'execut-text',
{ 'has-icon': row.suppressedById || (row.exception && row.exception === 'is_running') }
]"
:title="filteredTitle(row)"
@click.stop="handleRowView('filterrd', row)">
@click.stop="handleRowView(row.status, row)">
{{ `${titleStatusMap[row.status]} ` }}
({{ row.statusDisplay | filterEmpty }}
<i
v-if="row.exception && row.exception === 'is_running'"
v-if="row.suppressedById || (row.exception && row.exception === 'is_running')"
class="nodeman-icon nc-icon-audit filtered-icon">
</i>)
</span>
Expand Down Expand Up @@ -250,6 +253,13 @@ export default class TaskDeatailTable extends Mixins(HeaderRenderMixin) {
},
});
}
} else if (type === 'ignored') {
if (row.suppressedById) {
this.$router.push({
name: 'pluginRule',
query: { id: `${row.suppressedById}` },
});
}
}
}
// 分页
Expand Down

0 comments on commit bd1a9e2

Please sign in to comment.