Skip to content

Commit 72e1ad1

Browse files
committed
fix grey area issue
1 parent 8dd5bda commit 72e1ad1

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

ui/public/config.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,15 @@
9797
"basicZoneEnabled": true,
9898
"multipleServer": false,
9999
"allowSettingTheme": true,
100-
"docHelpMappings": {}
100+
"docHelpMappings": {},
101+
"announcementBanner": {
102+
"enabled": true,
103+
"showIcon": false,
104+
"closable": true,
105+
"persistDismissal": true,
106+
"type": "info",
107+
"message": "🤔 <strong>Sample Announcement</strong>: New Feature Available: Check out our latest dashboard improvements! <a href='/features'>Learn more</a>",
108+
"startDate": "2025-06-01T00:00:00Z",
109+
"endDate": "2025-07-16T00:00:00Z"
110+
}
101111
}

ui/src/components/header/AnnouncementBanner.vue

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
// under the License.
1717

1818
<template>
19-
<div v-if="showBanner" class="announcement-banner-container">
19+
<a-affix v-if="showBanner" class="announcement-banner-container">
2020
<a-alert
21-
:type="bannerConfig.type || 'info'"
21+
:type="bannerConfig.type || 'default'"
2222
:show-icon="bannerConfig.showIcon !== false"
2323
:closable="bannerConfig.closable !== false"
2424
:banner="true"
2525
@close="handleClose"
26-
:style="[ bannerConfig.type === 'error' ? { border: '1px solid #ffa39e' } : bannerConfig.type === 'warning' ? { border: '1px solid #ffe58f' } : { border: '1px solid #b7eb8f' }]"
26+
:style="[ { border: borderColor }]"
2727
>
2828
<template #message>
2929
<div class="banner-content" v-html="sanitizedMessage" :style="[$store.getters.darkMode ? { color: 'rgba(255, 255, 255, 0.65)' } : { color: '#888' }]" />
3030
</template>
3131
</a-alert>
32-
</div>
32+
</a-affix>
3333
</template>
3434

3535
<script>
@@ -59,6 +59,16 @@ export default {
5959
FORBID_ATTR: ['onclick', 'onload', 'onerror', 'onmouseover', 'onfocus', 'onblur']
6060
})
6161
return cleanHTML
62+
},
63+
borderColor () {
64+
const colorMap = {
65+
error: '#ffa39e',
66+
warning: '#ffe58f',
67+
success: '#b7eb8f',
68+
info: '#b3cde3'
69+
}
70+
const color = colorMap[this.bannerConfig.type]
71+
return color ? `1px solid ${color}` : '0px'
6272
}
6373
},
6474
mounted () {
@@ -122,15 +132,14 @@ export default {
122132
.announcement-banner-container {
123133
z-index: 1000;
124134
top: 0;
125-
position: relative;
126135
margin: 0;
127136
width: 100%;
128137
justify-content: center;
129138
align-items: center;
130139
}
131140
132141
.banner-content {
133-
line-height: 2.0;
142+
line-height: 1.7;
134143
text-align: center
135144
}
136145
</style>

0 commit comments

Comments
 (0)