|
17 | 17 |
|
18 | 18 | <template> |
19 | 19 | <div> |
20 | | - <a-affix v-if="alertCount > 0" > |
21 | | - <a-alert |
22 | | - v-if="this.$config.alertMessage && this.$config.alertMessage !== ''" |
23 | | - :type="this.$config.alertMessageType ? this.$config.alertMessageType : 'info'" |
24 | | - :showIcon="false" |
25 | | - banner |
26 | | - class="alertHeader" |
27 | | - closable |
28 | | - @close="closeCustomAlert()"> |
29 | | - <template #message> |
30 | | - <span v-html="$config.alertMessage"></span> |
31 | | - </template> |
32 | | - </a-alert> |
33 | | - |
34 | | - <a-alert |
35 | | - v-if="this.$store.getters.shutdownTriggered" |
36 | | - :message="$t('message.shutdown.triggered')" |
37 | | - type="error" |
38 | | - banner |
39 | | - :showIcon="false" |
40 | | - class="alertHeader" /> |
41 | | - |
| 20 | + <a-affix v-if="this.$store.getters.shutdownTriggered" > |
| 21 | + <a-alert :message="$t('message.shutdown.triggered')" type="error" banner :showIcon="false" class="shutdownHeader" /> |
42 | 22 | </a-affix> |
43 | 23 | <a-layout class="layout" :class="[device]"> |
44 | | - <a-affix style="z-index: 200" :offsetTop="alertCount * 25"> |
| 24 | + <a-affix style="z-index: 200" :offsetTop="this.$store.getters.shutdownTriggered ? 25 : 0"> |
45 | 25 | <template v-if="isSideMenu()"> |
46 | 26 | <a-drawer |
47 | 27 | v-if="isMobile()" |
|
104 | 84 | <!-- layout header --> |
105 | 85 | <a-affix style="z-index: 100"> |
106 | 86 | <global-header |
107 | | - :style="'margin-top: ' + alertCount * 25 + 'px;'" |
| 87 | + :style="this.$store.getters.shutdownTriggered ? 'margin-top: 25px;' : null" |
108 | 88 | :mode="layoutMode" |
109 | 89 | :menus="menus" |
110 | 90 | :theme="navTheme" |
@@ -164,8 +144,7 @@ export default { |
164 | 144 | collapsed: false, |
165 | 145 | menus: [], |
166 | 146 | showSetting: false, |
167 | | - showClear: false, |
168 | | - alertCount: 0 |
| 147 | + showClear: false |
169 | 148 | } |
170 | 149 | }, |
171 | 150 | computed: { |
@@ -224,7 +203,6 @@ export default { |
224 | 203 | const readyForShutdownPollingJob = setInterval(this.checkShutdown, 5000) |
225 | 204 | this.$store.commit('SET_READY_FOR_SHUTDOWN_POLLING_JOB', readyForShutdownPollingJob) |
226 | 205 | } |
227 | | - this.getNumberOfAlerts() |
228 | 206 | }, |
229 | 207 | mounted () { |
230 | 208 | const layoutMode = this.$config.theme['@layout-mode'] || 'light' |
@@ -282,20 +260,6 @@ export default { |
282 | 260 | api('readyForShutdown', {}).then(json => { |
283 | 261 | this.$store.dispatch('SetShutdownTriggered', json.readyforshutdownresponse.readyforshutdown.shutdowntriggered || false) |
284 | 262 | }) |
285 | | - }, |
286 | | - getNumberOfAlerts () { |
287 | | - this.alertCount = 0 |
288 | | - if (this.$store.getters.shutdownTriggered) { |
289 | | - this.alertCount++ |
290 | | - } |
291 | | - if (this.$config.alertMessage && this.$config.alertMessage !== '') { |
292 | | - this.alertCount++ |
293 | | - } |
294 | | - return this.alertCount |
295 | | - }, |
296 | | - closeCustomAlert () { |
297 | | - this.$config.alertMessage = '' |
298 | | - this.alertCount-- |
299 | 263 | } |
300 | 264 | } |
301 | 265 | } |
@@ -343,7 +307,7 @@ export default { |
343 | 307 | } |
344 | 308 | } |
345 | 309 |
|
346 | | -.alertHeader { |
| 310 | +.shutdownHeader { |
347 | 311 | font-weight: bold; |
348 | 312 | height: 25px; |
349 | 313 | text-align: center; |
|
0 commit comments