Skip to content

Commit 1a304cc

Browse files
author
Hoang Nguyen
authored
UI - Fixes UI bugs (#6162)
* fixes * remove console * fix hidden clear notification button * fixes * fixes * fixes navigation to ssh from comments
1 parent 1c238e1 commit 1a304cc

File tree

22 files changed

+172
-141
lines changed

22 files changed

+172
-141
lines changed

ui/src/components/header/HeaderNotice.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@
6868

6969
<script>
7070
import store from '@/store'
71-
import RenderIcon from '@/utils/renderIcon'
7271
7372
export default {
7473
name: 'HeaderNotice',
75-
components: { RenderIcon },
7674
data () {
7775
return {
7876
loading: false,

ui/src/components/menu/SMenu.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@
6161
</template>
6262

6363
<script>
64-
import RenderIcon from '@/utils/renderIcon'
6564
6665
export default {
6766
name: 'SMenu',
68-
components: { RenderIcon },
6967
props: {
7068
menu: {
7169
type: Array,

ui/src/components/page/GlobalLayout.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ export default {
209209
}, 16)
210210
})
211211
}
212+
const countNotify = this.$store.getters.countNotify
213+
this.showClear = false
214+
if (countNotify && countNotify > 0) {
215+
this.showClear = true
216+
}
212217
},
213218
beforeUnmount () {
214219
document.body.classList.remove('dark')

ui/src/components/page/PageHeader.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,9 @@
5151
</template>
5252

5353
<script>
54-
import RenderIcon from '@/utils/renderIcon'
5554
5655
export default {
5756
name: 'PageHeader',
58-
components: {
59-
RenderIcon
60-
},
6157
props: {
6258
title: {
6359
type: String,

ui/src/components/page/PageLayout.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,11 @@
5454
</template>
5555

5656
<script>
57-
import RenderIcon from '@/utils/renderIcon'
58-
5957
import PageHeader from './PageHeader'
6058
6159
export default {
6260
name: 'LayoutContent',
6361
components: {
64-
RenderIcon,
6562
PageHeader
6663
},
6764
// ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage']

ui/src/components/view/ActionButton.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,19 @@
8080

8181
<script>
8282
import { api } from '@/api'
83-
import RenderIcon from '@/utils/renderIcon'
8483
import Console from '@/components/widgets/Console'
8584
8685
export default {
8786
name: 'ActionButton',
8887
components: {
89-
RenderIcon,
9088
Console
9189
},
9290
data () {
9391
return {
9492
actionBadge: {}
9593
}
9694
},
97-
mounted () {
95+
created () {
9896
this.handleShowBadge()
9997
},
10098
props: {

ui/src/components/view/InfoCard.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@
697697

698698
<script>
699699
import { api } from '@/api'
700-
import RenderIcon from '@/utils/renderIcon'
701700
import Console from '@/components/widgets/Console'
702701
import OsLogo from '@/components/widgets/OsLogo'
703702
import Status from '@/components/widgets/Status'
@@ -714,8 +713,7 @@ export default {
714713
Status,
715714
TooltipButton,
716715
UploadResourceIcon,
717-
ResourceIcon,
718-
RenderIcon
716+
ResourceIcon
719717
},
720718
props: {
721719
resource: {

ui/src/components/view/ListView.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
</span>
9999

100100
<span v-if="record.hasannotations">
101-
<span v-if="record.id">
101+
<span v-if="record.id && $route.path !== '/ssh'">
102102
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
103103
<router-link :to="{ path: $route.path + '/' + record.id, query: { tab: 'comments' } }"><message-filled style="padding-left: 10px" size="small"/></router-link>
104104
</span>
@@ -398,7 +398,6 @@ import Status from '@/components/widgets/Status'
398398
import QuickView from '@/components/view/QuickView'
399399
import TooltipButton from '@/components/widgets/TooltipButton'
400400
import ResourceIcon from '@/components/view/ResourceIcon'
401-
import RenderIcon from '@/utils/renderIcon'
402401
403402
export default {
404403
name: 'ListView',
@@ -407,8 +406,7 @@ export default {
407406
Status,
408407
QuickView,
409408
TooltipButton,
410-
ResourceIcon,
411-
RenderIcon
409+
ResourceIcon
412410
},
413411
props: {
414412
columns: {
@@ -682,6 +680,9 @@ export default {
682680
return record.nic.filter(e => { return e.ip6address }).map(e => { return e.ip6address }).join(', ') || text
683681
},
684682
generateCommentsPath (record) {
683+
if (this.entityTypeToPath(record.entitytype) === 'ssh') {
684+
return '/' + this.entityTypeToPath(record.entitytype) + '/' + record.entityname
685+
}
685686
return '/' + this.entityTypeToPath(record.entitytype) + '/' + record.entityid
686687
},
687688
generateHumanReadableEntityType (record) {

ui/src/components/widgets/Breadcrumb.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@
6161
</template>
6262

6363
<script>
64-
import RenderIcon from '@/utils/renderIcon'
6564
6665
export default {
6766
name: 'Breadcrumb',
68-
components: { RenderIcon },
6967
props: {
7068
resource: {
7169
type: Object,

ui/src/components/widgets/TooltipButton.vue

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,46 @@
2020
<template #title v-if="tooltip">
2121
{{ tooltip }}
2222
</template>
23-
<a-button
24-
style="margin-left: -5px"
25-
v-if="copyResource"
26-
shape="circle"
27-
:size="size"
28-
:type="type"
29-
:danger="danger"
30-
:disabled="disabled"
31-
:class="buttonClass"
32-
:loading="loading"
33-
@click="handleClicked()"
34-
v-clipboard:copy="copyResource" >
35-
<template #icon v-if="icon"><render-icon :icon="icon" /></template>
36-
<template v-if="iconType && iconTwoToneColor">
37-
<render-icon :icon="iconType" :props="{ theme: 'twoTone', twoToneColor: iconTwoToneColor }" />
38-
</template>
39-
</a-button>
40-
<a-button
41-
v-else
42-
shape="circle"
43-
:size="size"
44-
:type="type"
45-
:danger="danger"
46-
:disabled="disabled"
47-
:class="buttonClass"
48-
:loading="loading"
49-
@click="handleClicked()" >
50-
<template #icon v-if="icon"><render-icon :icon="icon" /></template>
51-
<template v-if="iconType && iconTwoToneColor">
52-
<render-icon :icon="iconType" :props="{ theme: 'twoTone', twoToneColor: iconTwoToneColor }" />
53-
</template>
54-
</a-button>
23+
<span style="margin-right: 5px">
24+
<a-button
25+
v-if="copyResource"
26+
shape="circle"
27+
:size="size"
28+
:type="type"
29+
:danger="danger"
30+
:disabled="disabled"
31+
:class="buttonClass"
32+
:loading="loading"
33+
@click="handleClicked()"
34+
v-clipboard:copy="copyResource" >
35+
<template #icon v-if="icon"><render-icon :icon="icon" /></template>
36+
<template v-if="iconType && iconTwoToneColor">
37+
<render-icon :icon="iconType" :props="{ theme: 'twoTone', twoToneColor: iconTwoToneColor }" />
38+
</template>
39+
</a-button>
40+
<a-button
41+
v-else
42+
shape="circle"
43+
:size="size"
44+
:type="type"
45+
:danger="danger"
46+
:disabled="disabled"
47+
:class="buttonClass"
48+
:loading="loading"
49+
@click="handleClicked()" >
50+
<template #icon v-if="icon"><render-icon :icon="icon" /></template>
51+
<template v-if="iconType && iconTwoToneColor">
52+
<render-icon :icon="iconType" :props="{ theme: 'twoTone', twoToneColor: iconTwoToneColor }" />
53+
</template>
54+
</a-button>
55+
</span>
5556
</a-tooltip>
5657
</template>
5758

5859
<script>
59-
import RenderIcon from '@/utils/renderIcon'
6060
6161
export default {
6262
name: 'TooltipButton',
63-
components: { RenderIcon },
6463
props: {
6564
tooltip: {
6665
type: String,

0 commit comments

Comments
 (0)