Skip to content

Commit

Permalink
feature: 部署策略执行被抑制时,主抑制策略增加超链接 (closed TencentBlueKing#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW committed Jul 19, 2022
1 parent fce9d05 commit b96ad92
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion apps/backend/subscription/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from functools import wraps
from typing import Any, Dict, List, Optional, Union

from django.conf import settings
from django.utils.translation import ugettext as _

from apps.backend.celery import app
Expand Down Expand Up @@ -326,7 +327,7 @@ def create_task(
"msg": _(
"当前{category_alias}({bk_obj_name} 级)"
"已被优先级更高的{suppressed_by_category_alias}【{suppressed_by_name}(ID: {suppressed_by_id})】"
"({suppressed_by_obj_name} 级)抑制"
'({suppressed_by_obj_name} 级)抑制, 点击跳转到 <a href="{link}" target="_blank">[策略页面]</a>'
).format(
category_alias=models.Subscription.CATEGORY_ALIAS_MAP[result["category"]],
bk_obj_name=constants.CmdbObjectId.OBJ_ID_ALIAS_MAP.get(
Expand All @@ -342,6 +343,8 @@ def create_task(
result["suppressed_by"]["bk_obj_id"],
constants.CmdbObjectId.OBJ_ID_ALIAS_MAP[constants.CmdbObjectId.CUSTOM],
),
link=f"{settings.BK_NODEMAN_HOST}/#/plugin-manager/rule?name"
f"={result['suppressed_by']['name']}",
),
}
)
Expand Down
3 changes: 3 additions & 0 deletions dev_log/2.2.19/xcwang_202207181027.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
feature:
- "部署策略执行被抑制时,主抑制策略增加超链接 (closed #889)"
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@
prop="msg"
key="msg"
show-overflow-tooltip
min-width="400"
/>
min-width="400">
<template #default="{ row }">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="row.msg"></span>
</template>
</bk-table-column>
<bk-table-column
v-else-if="isIgnoredTab && isManualType"
:label="$t('部署策略')"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/task/task-detail-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
:title="filteredTitle(row)"
@click.stop="handleRowView('filterrd', row)">
{{ `${titleStatusMap[row.status]} ` }}
({{ row.statusDisplay | filterEmpty }}
<!-- eslint-disable-next-line vue/no-v-html -->
(<span v-html="row.statusDisplay || '--'"></span>
<i
v-if="row.exception && row.exception === 'is_running'"
class="nodeman-icon nc-icon-audit filtered-icon">
Expand Down

0 comments on commit b96ad92

Please sign in to comment.