Skip to content

Commit 4d40f7b

Browse files
committed
[경고 규칙] UI 버그 수정 및 개선(1.긴 모달 짤림, 2.최상단배너 닫힘 버튼 생성, 3.액션 버튼 버그)
1 parent 8efc305 commit 4d40f7b

4 files changed

Lines changed: 39 additions & 10 deletions

File tree

ui/src/components/header/AutoAlertBanner.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@
5050
<a-button size="small" @click.stop="goToAlertRulesMenu">
5151
{{ tr('label.goto.the.alertRules') }}
5252
</a-button>
53+
54+
<a-button
55+
size="small"
56+
type="text"
57+
:aria-label="tr('label.close')"
58+
@click.stop="markAllAsRead"
59+
>
60+
<template #icon>
61+
<CloseOutlined />
62+
</template>
63+
</a-button>
5364
</a-space>
5465
</div>
5566
</div>
@@ -643,7 +654,7 @@ import {
643654
nextTick,
644655
getCurrentInstance
645656
} from 'vue'
646-
import { ExclamationCircleFilled, SoundOutlined, PauseCircleOutlined, LinkOutlined } from '@ant-design/icons-vue'
657+
import { ExclamationCircleFilled, SoundOutlined, PauseCircleOutlined, LinkOutlined, CloseOutlined } from '@ant-design/icons-vue'
647658
import { message } from 'ant-design-vue'
648659
import { api } from '@/api'
649660
import MarkdownIt from 'markdown-it'
@@ -656,6 +667,7 @@ export default {
656667
SoundOutlined,
657668
PauseCircleOutlined,
658669
LinkOutlined,
670+
CloseOutlined,
659671
RuleSilenceModal: defineAsyncComponent(() => import('@/views/infra/RuleSilenceModal.vue')),
660672
RulePauseModal: defineAsyncComponent(() => import('@/views/infra/RulePauseModal.vue'))
661673
},

ui/src/components/page/GlobalLayout.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,13 @@ body.dark-mode .banner-spacer::before {
527527
/* 배너 높이만큼 밑으로 내려서 겹치지 않게 처리 */
528528
top: calc(24px + var(--autoBannerHeight, 0px)) !important;
529529
}
530+
531+
/* 일반 모달은 최상단 경고 배너보다 항상 위에 렌더링 */
532+
.ant-modal-root,
533+
.ant-modal-mask,
534+
.ant-modal-wrap {
535+
z-index: 2147483655 !important;
536+
}
530537
@media (max-width: 768px) {
531538
/* 1. 사이드바를 공중에 띄워서 공간 차지를 못하게 만듦 */
532539
.ant-layout.layout.mobile .sticky-sidebar {

ui/src/components/view/ListView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ export default {
914914
},
915915
handleContextAction (action) {
916916
this.closeContextQuickView()
917-
this.$parent.execAction(action)
917+
this.$parent.execAction(action, false)
918918
},
919919
generateRowKeyValue (record) {
920920
return record.uid || (record.metadata && record.metadata.rule_uid) || record.id || record.name || record.usageType

ui/src/views/AutogenView.vue

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
</a-affix>
142142

143143
<div v-show="showAction">
144-
<keep-alive v-if="currentAction.component && (!currentAction.groupAction || selectedRowKeys.length === 0 || (this.selectedRowKeys.length > 0 && currentAction.api === 'destroyVirtualMachine'))">
144+
<keep-alive v-if="currentAction.component && (!currentAction.invokedAsGroupAction || (this.selectedRowKeys.length > 0 && currentAction.api === 'destroyVirtualMachine'))">
145145
<a-modal
146146
:visible="showAction"
147147
:closable="true"
@@ -418,7 +418,7 @@
418418
:maskClosable="false"
419419
:footer="null"
420420
style="top: 20px;"
421-
:width="currentAction.groupAction ? modalWidth : '30vw'"
421+
:width="currentAction.invokedAsGroupAction ? modalWidth : '30vw'"
422422
:ok-button-props="getOkProps()"
423423
ok-text="111"
424424
:cancel-button-props="getCancelProps()"
@@ -438,7 +438,7 @@
438438
</template>
439439
<a-spin :spinning="actionLoading" v-ctrl-enter="handleSubmit">
440440
<span v-if="currentAction.message">
441-
<div v-if="selectedRowKeys.length > 0 && currentAction.groupAction">
441+
<div v-if="selectedRowKeys.length > 0 && currentAction.invokedAsGroupAction">
442442
<a-alert
443443
v-if="['delete-outlined', 'DeleteOutlined', 'poweroff-outlined', 'PoweroffOutlined'].includes(currentAction.icon)"
444444
type="error">
@@ -462,7 +462,7 @@
462462
</template>
463463
</a-alert>
464464
</div>
465-
<div v-if="selectedRowKeys.length > 0 && currentAction.groupAction">
465+
<div v-if="selectedRowKeys.length > 0 && currentAction.invokedAsGroupAction">
466466
<a-divider />
467467
<a-table
468468
v-if="selectedRowKeys.length > 0"
@@ -990,6 +990,13 @@ export default {
990990
},
991991
'$store.getters.listAllProjects' (oldVal, newVal) {
992992
this.fetchData()
993+
},
994+
showAction (visible) {
995+
if (visible) {
996+
this.clearAutoRefresh()
997+
} else if (!this.dataView) {
998+
this.scheduleAutoRefresh()
999+
}
9931000
}
9941001
},
9951002
computed: {
@@ -1091,7 +1098,7 @@ export default {
10911098
return 'inline-flex'
10921099
},
10931100
getOkProps () {
1094-
if (this.selectedRowKeys.length > 0 && this.currentAction?.groupAction) {
1101+
if (this.selectedRowKeys.length > 0 && this.currentAction?.invokedAsGroupAction) {
10951102
} else {
10961103
return { props: { type: 'primary' } }
10971104
}
@@ -1137,7 +1144,7 @@ export default {
11371144
downloadLink.click()
11381145
},
11391146
getCancelProps () {
1140-
if (this.selectedRowKeys.length > 0 && this.currentAction?.groupAction) {
1147+
if (this.selectedRowKeys.length > 0 && this.currentAction?.invokedAsGroupAction) {
11411148
return { props: { type: 'primary' } }
11421149
} else {
11431150
return { props: { type: 'default' } }
@@ -1589,7 +1596,10 @@ export default {
15891596
this.$router.push({ name: action.api, query })
15901597
return
15911598
}
1592-
this.currentAction = action
1599+
this.currentAction = {
1600+
...action,
1601+
invokedAsGroupAction: !!isGroupAction
1602+
}
15931603
this.currentAction.params = store.getters.apis[this.currentAction.api].params
15941604
this.resource = action.resource
15951605
this.$emit('change-resource', this.resource)
@@ -1855,7 +1865,7 @@ export default {
18551865
handleSubmit (e) {
18561866
if (this.actionLoading) return
18571867
this.promises = []
1858-
if (!this.dataView && this.currentAction.groupAction && this.selectedRowKeys.length > 0) {
1868+
if (!this.dataView && this.currentAction.invokedAsGroupAction && this.selectedRowKeys.length > 0) {
18591869
if (this.selectedRowKeys.length > 0) {
18601870
this.bulkColumns = this.chosenColumns
18611871
this.selectedItems = this.selectedItems.map(v => ({ ...v, status: 'InProgress' }))

0 commit comments

Comments
 (0)