Skip to content

Commit 33df072

Browse files
M. Weberyadvr
authored andcommitted
dashboard: fix styling and enhancements (#8)
Refactoring, visual enhancements and extend readme. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent f8f0a99 commit 33df072

26 files changed

+286
-141
lines changed

ui/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Install tools and dependencies:
1212

1313
Build and run:
1414

15+
npm start
16+
or
1517
npm run serve
1618

1719
Production Build:

ui/src/components/page/GlobalLayout.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,30 @@ export default {
152152
}
153153
}
154154
</script>
155+
156+
<style lang="less">
157+
// Todo try to get this rules scoped
158+
.ant-drawer.drawer-sider {
159+
.sider {
160+
box-shadow: none;
161+
}
162+
163+
&.dark {
164+
.ant-drawer-content {
165+
background-color: rgb(0, 21, 41);
166+
}
167+
}
168+
169+
&.light {
170+
box-shadow: none;
171+
172+
.ant-drawer-content {
173+
background-color: #fff;
174+
}
175+
}
176+
177+
.ant-drawer-body {
178+
padding: 0
179+
}
180+
}
181+
</style>

ui/src/components/page/SHeaderNotice.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ export default {
4848
</script>
4949

5050
<style lang="less" scoped>
51-
.header-notice{
51+
.header-notice {
5252
display: inline-block;
5353
transition: all 0.3s;
54+
5455
span {
5556
vertical-align: initial;
5657
}

ui/src/components/tools/Breadcrumb.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export default {
4242
}
4343
</script>
4444

45-
<style scoped>
46-
45+
<style lang="less" scoped>
46+
.breadcrumb {
47+
.mobile & {
48+
display: none;
49+
}
50+
}
4751
</style>

ui/src/components/tools/HeaderNotice.vue

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
placement="bottomRight"
66
:autoAdjustOverflow="true"
77
:arrowPointAtCenter="true"
8-
overlayClassName="header-notice-wrapper"
8+
overlayClassName="ant-pro-header-notice__popover"
99
:overlayStyle="{ width: '300px', top: '50px' }">
1010
<template slot="content">
1111
<a-spin :spinning="loadding">
@@ -38,9 +38,9 @@
3838
</a-tabs>
3939
</a-spin>
4040
</template>
41-
<span @click="fetchNotice" class="header-notice">
41+
<span @click="fetchNotice" class="ant-pro-header-notice__opener">
4242
<a-badge count="12">
43-
<a-icon style="font-size: 16px; padding: 4px" type="bell" />
43+
<a-icon class="ant-pro-header-notice__icon" type="bell" />
4444
</a-badge>
4545
</span>
4646
</a-popover>
@@ -71,18 +71,34 @@ export default {
7171
}
7272
</script>
7373

74-
<style lang="css">
75-
.header-notice-wrapper {
76-
top: 50px !important;
77-
}
78-
</style>
7974
<style lang="less" scoped>
80-
.header-notice{
75+
.header-notice {
8176
display: inline-block;
8277
transition: all 0.3s;
8378
8479
span {
8580
vertical-align: initial;
8681
}
8782
}
83+
84+
.ant-pro-header-notice {
85+
86+
&__popover {
87+
top: 50px !important;
88+
}
89+
90+
&__opener {
91+
display: inline-block;
92+
transition: all 0.3s;
93+
94+
span {
95+
vertical-align: initial;
96+
}
97+
}
98+
99+
&__icon {
100+
font-size: 18px;
101+
padding: 4px;
102+
}
103+
}
88104
</style>

ui/src/components/tools/TranslationMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22

33
<a-dropdown>
4-
<span class="action ant-dropdown-link">
4+
<span class="action ant-dropdown-link ant-pro-translation-menu">
55
<a-icon type="global"></a-icon>
66
</span>
77
<a-menu slot="overlay" @click="onClick">

ui/src/components/tools/UserMenu.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,27 @@ export default {
7676
}
7777
}
7878
</script>
79+
80+
<style lang="less" scoped>
81+
.user-dropdown-menu {
82+
span {
83+
user-select: none;
84+
}
85+
}
86+
87+
.user-dropdown-menu-wrapper.ant-dropdown-menu {
88+
padding: 4px 0;
89+
90+
.ant-dropdown-menu-item {
91+
width: 160px;
92+
}
93+
94+
.ant-dropdown-menu-item > .anticon:first-child,
95+
.ant-dropdown-menu-item > a > .anticon:first-child,
96+
.ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title > a > .anticon:first-child {
97+
min-width: 12px;
98+
margin-right: 8px;
99+
}
100+
101+
}
102+
</style>

ui/src/components/tools/setting.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ const updateTheme = primaryColor => {
8787
}
8888
}
8989

90-
const updateColorWeak = colorWeak => {
91-
// document.body.className = colorWeak ? 'colorWeak' : '';
92-
colorWeak ? document.body.classList.add('colorWeak') : document.body.classList.remove('colorWeak')
90+
const updateInvertedMode = invertedMode => {
91+
invertedMode = true;
92+
console.log(invertedMode);
93+
invertedMode ? document.body.classList.add('layout-inverted-mode') : document.body.classList.remove('layout-inverted-mode')
9394
}
9495

95-
export { updateTheme, colorList, updateColorWeak }
96+
export { updateTheme, colorList, updateInvertedMode }

ui/src/config/defaultSettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
fixedHeader: true, // sticky header
77
fixSiderbar: true, // sticky siderbar
88
autoHideHeader: false, // auto hide header
9-
colorWeak: false,
9+
invertedMode: true,
1010
multiTab: false, // enable to have tab/route history stuff
1111
// CloudStack options
1212
apiBase: '/client/api',

ui/src/core/bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
DEFAULT_COLOR,
77
DEFAULT_THEME,
88
DEFAULT_LAYOUT_MODE,
9-
DEFAULT_COLOR_WEAK,
9+
DEFAULT_COLOR_INVERTED,
1010
SIDEBAR_TYPE,
1111
DEFAULT_FIXED_HEADER,
1212
DEFAULT_FIXED_HEADER_HIDDEN,
@@ -24,7 +24,7 @@ export default function Initializer () {
2424
store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
2525
store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
2626
store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
27-
store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
27+
store.commit('TOGGLE_INVERTED', Vue.ls.get(DEFAULT_COLOR_INVERTED, config.invertedMode))
2828
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
2929
store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab))
3030
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))

0 commit comments

Comments
 (0)