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

22 files changed

+172
-141
lines changed

Diff for: ui/src/components/header/HeaderNotice.vue

-2
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,

Diff for: ui/src/components/menu/SMenu.vue

-2
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,

Diff for: ui/src/components/page/GlobalLayout.vue

+5
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')

Diff for: ui/src/components/page/PageHeader.vue

-4
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,

Diff for: ui/src/components/page/PageLayout.vue

-3
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']

Diff for: ui/src/components/view/ActionButton.vue

+1-3
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: {

Diff for: ui/src/components/view/InfoCard.vue

+1-3
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: {

Diff for: ui/src/components/view/ListView.vue

+5-4
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) {

Diff for: ui/src/components/widgets/Breadcrumb.vue

-2
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,

Diff for: ui/src/components/widgets/TooltipButton.vue

+33-34
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,

Diff for: ui/src/core/lazy_lib/icons_use.js

+2
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ import {
152152
UploadOutlined,
153153
WifiOutlined
154154
} from '@ant-design/icons-vue'
155+
import renderIcon from '@/utils/renderIcon'
155156

156157
export default {
157158
install: (app) => {
@@ -290,5 +291,6 @@ export default {
290291
app.component('UserOutlined', UserOutlined)
291292
app.component('UploadOutlined', UploadOutlined)
292293
app.component('WifiOutlined', WifiOutlined)
294+
app.component('renderIcon', renderIcon)
293295
}
294296
}

Diff for: ui/src/layouts/UserLayout.vue

+5
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ export default {
7878
if (layoutMode === 'dark') {
7979
document.body.classList.add('dark-mode')
8080
}
81+
const countNotify = this.$store.getters.countNotify
82+
this.showClear = false
83+
if (countNotify && countNotify > 0) {
84+
this.showClear = true
85+
}
8186
},
8287
beforeUnmount () {
8388
document.body.classList.remove('userLayout')

Diff for: ui/src/style/vars.less

+17-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
@box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15);
4848
@loading-color: @primary-color;
4949

50-
.ant-layout.ant-layout-has-sider>.ant-layout,
50+
// .ant-layout.ant-layout-has-sider>.ant-layout,
5151
.ant-layout.ant-layout-has-sider>.ant-layout-content {
5252
width: auto;
5353
}
@@ -171,6 +171,18 @@ a {
171171
fill: @navigation-text-color;
172172
}
173173

174+
.ant-menu-dark .ant-menu-item {
175+
.anticon .custom-icon {
176+
fill: @project-nav-text-color;
177+
}
178+
179+
&.ant-menu-item-selected {
180+
.anticon .custom-icon {
181+
fill: #fff;
182+
}
183+
}
184+
}
185+
174186
.ant-menu-item a {
175187
.anticon .custom-icon {
176188
transition: fill 0.3s ease-out;
@@ -180,6 +192,10 @@ a {
180192
}
181193
}
182194

195+
.ant-menu-dark .ant-menu-item:hover .anticon .custom-icon {
196+
fill: #fff;
197+
}
198+
183199
.ant-menu-item:hover,
184200
.ant-menu-item-active,
185201
.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open,

Diff for: ui/src/views/AutogenView.vue

+3
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,9 @@ export default {
11901190
})
11911191
}
11921192
}
1193+
if ('successMethod' in action) {
1194+
action.successMethod(this, result)
1195+
}
11931196
resolve(true)
11941197
},
11951198
errorMethod: () => {

Diff for: ui/src/views/auth/Login.vue

+2
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ export default {
282282
})
283283
},
284284
loginSuccess (res) {
285+
this.$notification.destroy()
286+
this.$store.commit('SET_COUNT_NOTIFY', 0)
285287
this.$router.push({ path: '/dashboard' }).catch(() => {})
286288
},
287289
requestFailed (err) {

Diff for: ui/src/views/compute/DeployVM.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,6 @@ export default {
16481648
handleSubmitAndStay (e) {
16491649
this.form.stayonpage = true
16501650
this.handleSubmit(e.domEvent)
1651-
this.form.stayonpage = false
16521651
},
16531652
handleSubmit (e) {
16541653
console.log('wizard submit')
@@ -1884,6 +1883,9 @@ export default {
18841883
}).catch(error => {
18851884
this.$notifyError(error)
18861885
this.loading.deploy = false
1886+
}).finally(() => {
1887+
this.form.stayonpage = false
1888+
this.loading.deploy = false
18871889
})
18881890
}).catch(err => {
18891891
this.formRef.value.scrollToField(err.errorFields[0].name)

0 commit comments

Comments
 (0)