From 2a0da9bc86ad4c59836c4d9e07e1cb818ad0dc9a Mon Sep 17 00:00:00 2001 From: utchoang Date: Mon, 31 May 2021 16:34:28 +0700 Subject: [PATCH 01/17] add button toggle dark mode --- ui/public/locales/en.json | 1 + ui/src/components/header/UserMenu.vue | 14 ++++++++++++-- ui/src/components/page/GlobalLayout.vue | 13 +++++++++++++ ui/src/layouts/UserLayout.vue | 14 +++++++++++++- ui/src/store/getters.js | 3 ++- ui/src/store/modules/user.js | 17 +++++++++++++++-- ui/src/store/mutation-types.js | 1 + 7 files changed, 57 insertions(+), 6 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 15d90bc0ae55..29c62f5830c1 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -646,6 +646,7 @@ "label.daily": "Daily", "label.dashboard": "Dashboard", "label.dashboard.endpoint": "Dashboard endpoint", +"label.dark.mode": "Dark mode", "label.data.disk": "Data Disk", "label.data.disk.offering": "Data Disk Offering", "label.date": "Date", diff --git a/ui/src/components/header/UserMenu.vue b/ui/src/components/header/UserMenu.vue index 33335c6efd15..b9cb5d25270e 100644 --- a/ui/src/components/header/UserMenu.vue +++ b/ui/src/components/header/UserMenu.vue @@ -40,14 +40,21 @@ :checked="$store.getters.usebrowsertimezone" /> - + + + + {{ $t('label.dark.mode') }} + + + + {{ $t('label.help') }} - + {{ $t('label.logout') }} @@ -75,6 +82,9 @@ export default { toggleUseBrowserTimezone () { this.$store.dispatch('SetUseBrowserTimezone', !this.$store.getters.usebrowsertimezone) }, + toggleDarkMode () { + this.$store.dispatch('SetDarkMode', !this.$store.getters.darkMode) + }, handleLogout () { return this.Logout({}).then(() => { this.$router.push('/user/login') diff --git a/ui/src/components/page/GlobalLayout.vue b/ui/src/components/page/GlobalLayout.vue index 0ddf934b8682..da8572a95165 100644 --- a/ui/src/components/page/GlobalLayout.vue +++ b/ui/src/components/page/GlobalLayout.vue @@ -129,6 +129,13 @@ export default { }, mainMenu (newMenu) { this.menus = newMenu.find((item) => item.path === '/').children + }, + '$store.getters.darkMode' (darkMode) { + if (darkMode) { + document.body.classList.add('dark') + } else { + document.body.classList.remove('dark') + } } }, created () { @@ -136,6 +143,9 @@ export default { this.collapsed = !this.sidebarOpened }, mounted () { + if (this.$store.getters.darkMode) { + document.body.classList.add('dark') + } const userAgent = navigator.userAgent if (userAgent.indexOf('Edge') > -1) { this.$nextTick(() => { @@ -146,6 +156,9 @@ export default { }) } }, + beforeDestroy () { + document.body.classList.remove('dark') + }, methods: { ...mapActions(['setSidebar']), toggle () { diff --git a/ui/src/layouts/UserLayout.vue b/ui/src/layouts/UserLayout.vue index f5bb5a482c98..2aea7aed3dc8 100644 --- a/ui/src/layouts/UserLayout.vue +++ b/ui/src/layouts/UserLayout.vue @@ -45,11 +45,24 @@ export default { data () { return {} }, + watch: { + '$store.getters.darkMode' (darkMode) { + if (darkMode) { + document.body.classList.add('dark') + } else { + document.body.classList.remove('dark') + } + } + }, mounted () { document.body.classList.add('userLayout') + if (this.$store.getters.darkMode) { + document.body.classList.add('dark') + } }, beforeDestroy () { document.body.classList.remove('userLayout') + document.body.classList.remove('dark') } } @@ -57,7 +70,6 @@ export default { diff --git a/ui/src/views/iam/AddUser.vue b/ui/src/views/iam/AddUser.vue index 8ef88eb64cee..7237e0a340e8 100644 --- a/ui/src/views/iam/AddUser.vue +++ b/ui/src/views/iam/AddUser.vue @@ -23,7 +23,7 @@ {{ $t('label.username') }} - + {{ $t('label.password') }} - + {{ $t('label.confirmpassword') }} - + {{ $t('label.email') }} - + {{ $t('label.firstname') }} - + {{ $t('label.lastname') }} - + {{ $t('label.domain') }} - + {{ $t('label.account') }} - + {{ $t('label.timezone') }} - + {{ $t('label.samlentity') }} - + {{ $t('label.currentpassword') }} - + {{ $t('label.new.password') }} - + {{ $t('label.confirmpassword') }} - + {{ $t('label.name') }} - + {{ $t('label.description') }} - + {{ $t('label.based.on') }} - + {{ $t('label.type') }} - + {{ $t('label.role') }} - + {{ $t('label.' + field.name) }} - + diff --git a/ui/src/views/iam/EditUser.vue b/ui/src/views/iam/EditUser.vue index e9662b1cb4a0..3e79844aa076 100644 --- a/ui/src/views/iam/EditUser.vue +++ b/ui/src/views/iam/EditUser.vue @@ -23,7 +23,7 @@ {{ $t('label.username') }} - + {{ $t('label.email') }} - + {{ $t('label.firstname') }} - + {{ $t('label.lastname') }} - + {{ $t('label.timezone') }} - + {{ $t('label.rules.file') }} - + {{ $t('label.name') }} - + {{ $t('label.description') }} - + {{ $t('label.type') }} - + {{ $t('label.forced') }} - + {{ $t('label.semanticversion') }} - + {{ $t('label.name') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.url') }} - + {{ $t('label.checksum') }} - + {{ $t('label.mincpunumber') }} - + {{ $t('label.minmemory') }} - + {{ $t('label.scope') }} - + {{ $t('label.hypervisor') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.podid') }} - + {{ $t('label.clusterid') }} - + {{ $t('label.name') }} - + @@ -122,7 +122,7 @@ {{ $t('label.protocol') }} - + {{ $t('label.server') }} - + @@ -151,7 +151,7 @@ {{ $t('label.path') }} - + @@ -181,7 +181,7 @@ {{ $t('label.vcenterdatacenter') }} - + @@ -190,7 +190,7 @@ {{ $t('label.vcenterdatastore') }} - + @@ -200,7 +200,7 @@ {{ $t('label.providername') }} - + {{ $t('label.ismanaged') }} - + @@ -227,7 +227,7 @@ {{ $t('label.capacitybytes') }} - + @@ -236,7 +236,7 @@ {{ $t('label.capacityiops') }} - + @@ -245,7 +245,7 @@ {{ $t('label.url') }} - + @@ -278,7 +278,7 @@ {{ $t('label.storagetags') }} - + {{ $t('label.root.certificate') }} - + {{ $t('label.intermediate.certificate') + ` ${index + 1} ` }} - + {{ $t('label.server.certificate') }} - + {{ $t('label.pkcs.private.certificate') }} - + {{ $t('label.domain.suffix') }} - + {{ $t('label.traffictype') }} - + {{ $t('label.kvmnetworklabel') }} - + {{ $t('label.vmwarenetworklabel') }} - + {{ $t('label.xennetworklabel') }} - + {{ $t('label.hypervnetworklabel') }} - + {{ $t('label.ovm3networklabel') }} - + {{ $t('label.perform.fresh.checks') }} - + diff --git a/ui/src/views/network/CreateIsolatedNetworkForm.vue b/ui/src/views/network/CreateIsolatedNetworkForm.vue index 135e6bc3ff16..74c3b87e3ec2 100644 --- a/ui/src/views/network/CreateIsolatedNetworkForm.vue +++ b/ui/src/views/network/CreateIsolatedNetworkForm.vue @@ -27,7 +27,7 @@ {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.domain') }} - + {{ $t('label.networkofferingid') }} - + {{ $t('label.vlan') }} - + {{ $t('label.vpcid') }} - + {{ $t('label.externalid') }} - + {{ $t('label.gateway') }} - + {{ $t('label.netmask') }} - + {{ $t('label.networkdomain') }} - + {{ $t('label.account') }} - + {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.domain') }} - + {{ $t('label.networkofferingid') }} - + {{ $t('label.vlan') }} - + {{ $t('label.bypassvlanoverlapcheck') }} - + @@ -156,7 +156,7 @@ {{ $t('label.isolatedpvlantype') }} - + {{ $t('label.isolatedpvlanid') }} - + {{ $t('label.account') }} - + {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.physicalnetworkid') }} - + {{ $t('label.vlan') }} - + {{ $t('label.bypassvlanoverlapcheck') }} - + @@ -127,7 +127,7 @@ {{ $t('label.isolatedpvlantype') }} - + {{ $t('label.isolatedpvlanid') }} - + {{ $t('label.domain') }} - + {{ $t('label.subdomainaccess') }} - + @@ -224,7 +224,7 @@ {{ $t('label.account') }} - + {{ $t('label.projectid') }} - + {{ $t('label.networkofferingid') }} - + {{ $t('label.ip4gateway') }} - + {{ $t('label.ip4netmask') }} - + {{ $t('label.startipv4') }} - + {{ $t('label.endipv4') }} - + {{ $t('label.ip6gateway') }} - + {{ $t('label.ip6cidr') }} - + {{ $t('label.startipv6') }} - + {{ $t('label.endipv6') }} - + {{ $t('label.networkdomain') }} - + {{ $t('label.hideipaddressusage') }} - + @@ -863,7 +863,6 @@ export default { .tagsTitle { font-weight: 500; - color: rgba(0, 0, 0, 0.85); margin-bottom: 12px; } diff --git a/ui/src/views/network/CreateVlanIpRange.vue b/ui/src/views/network/CreateVlanIpRange.vue index 60f638ee4230..f5290b81b02e 100644 --- a/ui/src/views/network/CreateVlanIpRange.vue +++ b/ui/src/views/network/CreateVlanIpRange.vue @@ -38,7 +38,7 @@ {{ $t('label.gateway') }} - + {{ $t('label.netmask') }} - + {{ $t('label.startipv4') }} - + {{ $t('label.endipv4') }} - + {{ $t('label.ip6cidr') }} - + {{ $t('label.ip6gateway') }} - + {{ $t('label.startipv6') }} - + {{ $t('label.endipv6') }} - + {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.cidr') }} - + {{ $t('label.networkdomain') }} - + {{ $t('label.vpcofferingid') }} - + {{ $t('label.start') }} - + diff --git a/ui/src/views/network/CreateVpnCustomerGateway.vue b/ui/src/views/network/CreateVpnCustomerGateway.vue index 666bece867b4..845fffb25566 100644 --- a/ui/src/views/network/CreateVpnCustomerGateway.vue +++ b/ui/src/views/network/CreateVpnCustomerGateway.vue @@ -21,7 +21,7 @@ {{ $t('label.name') }} - + {{ $t('label.gateway') }} - + {{ $t('label.cidrlist') }} - + {{ $t('label.ipsecpsk') }} - + {{ $t('label.ikeversion') }} - + {{ $t('label.ikelifetime') }} - + {{ $t('label.esplifetime') }} - + {{ $t('label.dpd') }} - + {{ $t('label.splitconnections') }} - + {{ $t('label.forceencap') }} - + {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.systemvmtype') }} - + {{ $t('label.storagetype') }} - + {{ $t('label.provisioningtype') }} - + {{ $t('label.cachemode') }} - + {{ $t('label.cpunumber') }} - + {{ $t('label.cpuspeed') }} - + {{ $t('label.mincpunumber') }} - + {{ $t('label.maxcpunumber') }} - + {{ $t('label.memory.mb') }} - + {{ $t('label.minmemory') }} - + {{ $t('label.maxmemory') }} - + {{ $t('label.networkrate') }} - + {{ $t('label.root.disk.size') }} - + {{ $t('label.diskbytesreadrate') }} - + {{ $t('label.diskbyteswriterate') }} - + {{ $t('label.diskiopsreadrate') }} - + {{ $t('label.diskiopswriterate') }} - + {{ $t('label.iscustomizeddiskiops') }} - + @@ -467,7 +467,7 @@ {{ $t('label.diskiopsmin') }} - + {{ $t('label.diskiopsmax') }} - + {{ $t('label.hypervisorsnapshotreserve') }} - + {{ $t('label.offerha') }} - + @@ -536,7 +536,7 @@ {{ $t('label.hosttags') }} - + {{ $t('label.storagetags') }} - + {{ $t('label.limitcpuuse') }} - + @@ -579,7 +579,7 @@ {{ $t('label.isvolatile') }} - + @@ -588,7 +588,7 @@ {{ $t('label.deploymentplanner') }} - + {{ $t('label.domain') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.vmware.storage.policy') }} - + {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.storagetype') }} - + {{ $t('label.provisioningtype') }} - + {{ $t('label.customdisksize') }} - + @@ -107,7 +107,7 @@ {{ $t('label.disksize') }} - + {{ $t('label.diskbytesreadrate') }} - + {{ $t('label.diskbyteswriterate') }} - + {{ $t('label.diskiopsreadrate') }} - + {{ $t('label.diskiopswriterate') }} - + {{ $t('label.iscustomizeddiskiops') }} - + @@ -237,7 +237,7 @@ {{ $t('label.diskiopsmin') }} - + {{ $t('label.diskiopsmax') }} - + {{ $t('label.hypervisorsnapshotreserve') }} - + {{ $t('label.writecachetype') }} - + {{ $t('label.storagetags') }} - + {{ $t('label.domainid') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.vmware.storage.policy') }} - + {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.networkrate') }} - + {{ $t('label.guestiptype') }} - + {{ $t('label.ispersistent') }} - + @@ -106,7 +106,7 @@ {{ $t('label.specifyvlan') }} - + @@ -115,7 +115,7 @@ {{ $t('label.vpc') }} - + @@ -195,7 +195,7 @@ {{ $t('label.supportedservices') }} - +
@@ -217,7 +217,7 @@ {{ $t('label.serviceofferingid') }} - + {{ $t('label.conservemode') }} - + @@ -335,7 +335,7 @@ {{ $t('label.tags') }} - + {{ $t('label.availability') }} - + {{ $t('label.egressdefaultpolicy') }} - + {{ $t('label.domainid') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.enable.network.offering') }} - + diff --git a/ui/src/views/offering/AddVpcOffering.vue b/ui/src/views/offering/AddVpcOffering.vue index cbe2db18cadb..730f5a31f4ca 100644 --- a/ui/src/views/offering/AddVpcOffering.vue +++ b/ui/src/views/offering/AddVpcOffering.vue @@ -26,7 +26,7 @@ {{ $t('label.name') }} - + {{ $t('label.displaytext') }} - + {{ $t('label.supportedservices') }} - +
@@ -87,7 +87,7 @@ {{ $t('label.domainid') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.enable.vpc.offering') }} - + diff --git a/ui/src/views/offering/ImportBackupOffering.vue b/ui/src/views/offering/ImportBackupOffering.vue index 370b908798b4..c05c9fa4a9e3 100644 --- a/ui/src/views/offering/ImportBackupOffering.vue +++ b/ui/src/views/offering/ImportBackupOffering.vue @@ -25,7 +25,7 @@ {{ $t('label.name') }} - + {{ $t('label.description') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.externalid') }} - + {{ $t('label.allowuserdrivenbackups') }} - + {{ $t('label.account') }} - + {{ $t('label.email') }} - + {{ $t('label.project.role') }} - + {{ $t('label.roletype') }} - + {{ $t('label.user') }} - + {{ $t('label.email') }} - + {{ $t('label.project.role') }} - + {{ $t('label.roletype') }} - + {{ $t('label.name') }} - + {{ $t('label.zoneid') }} - + {{ $t('label.diskoffering') }} - + {{ $t('label.sizegb') }} - + - +
- + {{ $t('label.new.tag') }}
@@ -422,7 +426,6 @@ export default { .tagsTitle { font-weight: 500; - color: rgba(0, 0, 0, 0.85); margin-bottom: 12px; } diff --git a/ui/src/views/storage/TakeSnapshot.vue b/ui/src/views/storage/TakeSnapshot.vue index c6de71f4bca4..f491b165bf6e 100644 --- a/ui/src/views/storage/TakeSnapshot.vue +++ b/ui/src/views/storage/TakeSnapshot.vue @@ -62,13 +62,17 @@ @keyup.enter="handleInputConfirm" compact> - + - + {{ $t('label.new.tag') }} @@ -261,7 +265,6 @@ export default { .tagsTitle { font-weight: 500; - color: rgba(0, 0, 0, 0.85); margin-bottom: 12px; } diff --git a/ui/src/views/storage/UploadLocalVolume.vue b/ui/src/views/storage/UploadLocalVolume.vue index 7a37182bbec5..aae46d3eebca 100644 --- a/ui/src/views/storage/UploadLocalVolume.vue +++ b/ui/src/views/storage/UploadLocalVolume.vue @@ -48,7 +48,7 @@ {{ $t('label.name') }} - + {{ $t('label.zone') }} - + {{ $t('label.format') }} - + {{ $t('label.volumechecksum') }} - + Date: Wed, 2 Jun 2021 09:06:51 +0700 Subject: [PATCH 03/17] restructure the style dark mode file --- ui/src/style/dark-mode.less | 545 ++++++++++++++++++------------------ ui/src/views/auth/Login.vue | 6 +- 2 files changed, 283 insertions(+), 268 deletions(-) diff --git a/ui/src/style/dark-mode.less b/ui/src/style/dark-mode.less index f96dc1c37564..ecc1f2cf2d9d 100644 --- a/ui/src/style/dark-mode.less +++ b/ui/src/style/dark-mode.less @@ -17,8 +17,7 @@ @primary-color: #1890ff; @dark-background-color: #090c10; -// @dark-secondary-bgColor: #161b22; -@dark-secondary-bgColor: #141414; +@dark-secondary-bgColor: #161b22; @dark-text-color-1: rgba(255, 255, 255, 0.25); @dark-text-color-2: rgba(255, 255, 255, 0.45); @dark-text-color-3: rgba(255, 255, 255, 0.65); @@ -32,13 +31,12 @@ .dark { background: @dark-background-color; - .user-layout, .ant-layout { - background: @dark-background-color; + h1, h2, h3, h4, h5, h6 { + color: @dark-text-color-3; } - .user-layout .ant-input-affix-wrapper .ant-input-prefix, - .user-layout .ant-input-affix-wrapper .ant-input-suffix { - color: @dark-text-color-3; + .user-layout, .ant-layout { + background: @dark-background-color; } .layout.ant-layout .header { @@ -46,23 +44,48 @@ box-shadow: 0 1px 4px #090c10; } - .sider.light .logo { - background-color: @dark-secondary-bgColor; - box-shadow: 1px 1px 0px 0px #e8e8e8; + .layout.ant-layout .trigger, + .layout.ant-layout .header .user-menu .action, + .layout.ant-layout .top-nav-header-index .user-menu .action, + .ant-tabs { + color: @dark-text-color-3; + } + + .ant-layout-footer { + background: @dark-secondary-bgColor; + color: @dark-text-color-3; + + .footer { + .line { + a { + color: @dark-text-color-3; + + &:hover { + color: @dark-text-color-4; + } + } + } + + .copyright { + color: @dark-text-color-3; + } + } } .sider.light { background: @dark-secondary-bgColor; - + + .logo { + background-color: @dark-secondary-bgColor; + box-shadow: 1px 1px 0px 0px @dark-border-color; + } + + .ant-menu-light, .ant-menu-submenu > .ant-menu { background: @dark-secondary-bgColor; } } - - .sider.light .ant-menu-light { - background: @dark-secondary-bgColor; - } - + .ant-menu-submenu-popup.ant-menu-light, .ant-menu-light > .ant-menu { background: @dark-secondary-bgColor; @@ -74,9 +97,13 @@ .ant-menu-vertical-right .ant-menu-item, .ant-menu-inline .ant-menu-item, .ant-menu-vertical .ant-menu-submenu-title:not(:hover), - .ant-menu-vertical-left .ant-menu-submenu-title, - .ant-menu-vertical-right .ant-menu-submenu-title, - .ant-menu-inline .ant-menu-submenu-title:not(:hover), + .ant-menu-vertical-left .ant-menu-submenu-title:not(:hover), + .ant-menu-vertical-right .ant-menu-submenu-title:not(:hover), + .ant-menu-inline .ant-menu-submenu-title:not(:hover) + { + color: @dark-text-color-3; + } + .kubernet-icon path { color: @dark-text-color-3; @@ -95,95 +122,68 @@ .ant-card { background: @dark-secondary-bgColor; + color: @dark-text-color-3; &-head, &-bottom, &-body { color: @dark-text-color-3; border-color: @dark-border-color; } - } - - .ant-layout-footer { - background: @dark-secondary-bgColor; - color: @dark-text-color-3; - - .footer { - .line { - a { - color: @dark-text-color-3; - - &:hover { - color: @dark-text-color-4; - } - } - } - .copyright { + .ant-progress-circle { + .ant-progress-text { color: @dark-text-color-3; } } - } - - .ant-breadcrumb a:not(:hover), - .ant-breadcrumb-separator { - color: @dark-text-color-3; - } - - .ant-breadcrumb > span:last-child, - .ant-breadcrumb > span:last-child a { - color: @dark-text-color-4; - } - .ant-btn:not(.ant-btn-primary, .ant-btn-danger) { - color: @dark-text-color-3; - background-color: transparent; - border-color: @dark-border-color; + &-bordered { + border-color: @dark-border-color; + } } - .ant-input, - .ant-select-selection, - .ant-input-group-addon, - .ant-checkbox-inner, - .ant-radio-inner { - background-color: transparent; - background-image: none; + .chart-card-footer { border-color: @dark-border-color; - color: @dark-text-color-3; } - .ant-checkbox-wrapper { + .vm-info-card .resource-detail-item__details a, + .vm-info-card .resource-detail-item a { color: @dark-text-color-3; } - .ant-switch { - color: @light-text-color-3; - background-color: @dark-text-color-2; - - &-checked { - background-color: #1890ff; + .ant-breadcrumb { + a:not(:hover), &-separator { + color: @dark-text-color-3; } - &-loading-icon, &:after { - background-color: @dark-secondary-bgColor; + span:last-child, span:last-child a { + color: @dark-text-color-4; } } - .ant-dropdown-menu-item > a:hover { - .ant-switch:not(.ant-switch-checked) { - background-color: @light-text-color-3; + .ant-btn { + &:not(.ant-btn-primary, .ant-btn-danger) { + color: @dark-text-color-3; + background-color: transparent; + border-color: @dark-border-color; } - } - - .layout.ant-layout .trigger, - .layout.ant-layout .header .user-menu .action, - .layout.ant-layout .top-nav-header-index .user-menu .action, - .ant-tabs { - color: @dark-text-color-3; - } - .ant-input-affix-wrapper .ant-input-prefix, - .ant-input-affix-wrapper .ant-input-suffix, - .ant-input-password-icon { - color: @dark-text-color-3; + &-primary-disabled, + &-primary.disabled, + &-primary[disabled], + &-primary-disabled:hover, + &-primary.disabled:hover, + &-primary[disabled]:hover, + &-primary-disabled:focus, + &-primary.disabled:focus, + &-primary[disabled]:focus, + &-primary-disabled:active, + &-primary.disabled:active, + &-primary[disabled]:active, + &-primary-disabled.active, + &-primary.disabled.active, + &-primary[disabled].active { + color: @dark-text-color-3; + background-color: transparent; + } } .has-error .ant-input-affix-wrapper .ant-input, @@ -192,192 +192,173 @@ background-image: none; } - .ant-btn-primary-disabled, - .ant-btn-primary.disabled, - .ant-btn-primary[disabled], - .ant-btn-primary-disabled:hover, - .ant-btn-primary.disabled:hover, - .ant-btn-primary[disabled]:hover, - .ant-btn-primary-disabled:focus, - .ant-btn-primary.disabled:focus, - .ant-btn-primary[disabled]:focus, - .ant-btn-primary-disabled:active, - .ant-btn-primary.disabled:active, - .ant-btn-primary[disabled]:active, - .ant-btn-primary-disabled.active, - .ant-btn-primary.disabled.active, - .ant-btn-primary[disabled].active { + .ant-badge-status-text { color: @dark-text-color-3; - background-color: transparent; - } - - .ant-dropdown-menu { - background-color: @dark-secondary-bgColor; - border: 1px solid @dark-border-color; } - - .ant-dropdown-menu-item:not(.ant-dropdown-menu-item-selected, :hover), .ant-dropdown-menu-submenu-title, - .ant-dropdown-menu-item > a:not(:hover), - .ant-dropdown-menu-submenu-title > a:not(:hover) { + .ant-table { color: @dark-text-color-3; - } - .ant-card { - color: @dark-text-color-3; + &-thead { + background-color: @dark-secondary-bgColor; - .ant-progress-circle .ant-progress-text, - h1, h2, h3, h4, h5, h6 { - color: @dark-text-color-3; + tr th { + color: @dark-text-color-3; + background-color: @dark-secondary-bgColor; + border-color: @dark-border-color; + + .ant-table-column-has-actions.ant-table-column-has-sorters:hover, + .ant-table-column-has-actions.ant-table-column-has-sorters:hover, + .ant-table-column-has-actions.ant-table-column-has-sorters:hover .ant-table-filter-icon, + .ant-table-column-has-actions.ant-table-column-has-sorters:hover .anticon-filter { + background-color: @dark-background-color; + } + } + + & > tr:hover.ant-table-row-selected > td, + & > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, + & > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td { + background-color: transparent; + } } - } - .ant-table, .ant-badge-status-text { - color: @dark-text-color-3; - } + &-tbody { + & > tr > td { + border-color: @dark-border-color; + } - .ant-table-thead { - background-color: @dark-secondary-bgColor; - } + & > tr.ant-table-row-selected td, + & > tr:hover.ant-table-row-selected > td, + & > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, + & > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td { + background-color: transparent; + } - .ant-table-thead tr th { - color: @dark-text-color-3; - background-color: @dark-secondary-bgColor; - border-color: @dark-border-color; - } + & > tr > th.ant-table-column-sort { + background-color: @dark-background-color; + } + } - .ant-table-small { - border-color: @dark-border-color; - } + &-footer { + background-color: @dark-secondary-bgColor; + color: @dark-text-color-3; + border-color: @dark-border-color; - .ant-table-tbody > tr > td { - border-color: @dark-border-color; - } + &::before { + background-color: @dark-border-color; + } + } - .light-row, .dark-row { - background-color: @dark-secondary-bgColor; - } + &-header { + background-color: @dark-secondary-bgColor; + } - .ant-table-thead > tr > th.ant-table-column-has-actions.ant-table-column-has-sorters:hover, - .ant-table-thead > tr > th.ant-table-column-has-actions.ant-table-column-has-sorters:hover, - .ant-table-thead > tr > th.ant-table-column-has-actions.ant-table-column-has-sorters:hover .ant-table-filter-icon, - .ant-table-thead > tr > th.ant-table-column-has-actions.ant-table-column-has-sorters:hover .anticon-filter { - background-color: @dark-background-color; - } + &-small { + border-color: @dark-border-color; + } - .ant-table-tbody > tr.ant-table-row-selected td, - .ant-table-thead > tr:hover.ant-table-row-selected > td, - .ant-table-tbody > tr:hover.ant-table-row-selected > td, - .ant-table-thead > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, - .ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, - .ant-table-thead > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, - .ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td { - background-color: transparent; - } + tr.ant-table-expanded-row, + tr.ant-table-expanded-row:hover { + background-color: @dark-background-color; + } - .ant-table-thead>tr>th.ant-table-column-sort, - tr.ant-table-expanded-row, - tr.ant-table-expanded-row:hover { - background-color: @dark-background-color; - } + &-placeholder { + border-color: @dark-border-color; + background-color: @dark-secondary-bgColor; + } - .ant-table-placeholder { - border-color: @dark-border-color; - background-color: @dark-secondary-bgColor; - } + &-row-expand-icon { + border-color: @dark-text-color-3; + color: @dark-text-color-3; + background-color: transparent; + } - .ant-table-footer { - background-color: @dark-secondary-bgColor; - color: @dark-text-color-3; - border-color: @dark-border-color; - } + &-filter-dropdown { + background-color: @dark-secondary-bgColor; - .ant-table-footer::before { - background-color: @dark-border-color; + &-btns { + border-color: @dark-border-color; + } + } } - .ant-table-header { + .light-row, .dark-row { background-color: @dark-secondary-bgColor; } - .ant-table-row-expand-icon { - border-color: @dark-text-color-3; + .ant-pagination { color: @dark-text-color-3; - background-color: transparent; - } - .ant-table-filter-dropdown { - background-color: @dark-secondary-bgColor; + &-prev, &-next, &-jump-prev, &-jump-next, &-prev a, &-next a { + color: @dark-text-color-3; + } - &-btns { - border-color: @dark-border-color; + &-disabled a, + &-disabled:hover a, + &-disabled:focus a, + &-disabled .ant-pagination-item-link, + &-disabled:hover .ant-pagination-item-link, + &-disabled:focus .ant-pagination-item-link { + color: @dark-text-color-1; } - } - .ant-pagination, - .ant-pagination-prev, - .ant-pagination-next, - .ant-pagination-jump-prev, - .ant-pagination-jump-next, - .ant-pagination-prev a, - .ant-pagination-next a { - color: @dark-text-color-3; - } + &-item { + a:not(:hover) { + color: @dark-text-color-3; + } - .ant-pagination-disabled a, - .ant-pagination-disabled:hover a, - .ant-pagination-disabled:focus a, - .ant-pagination-disabled .ant-pagination-item-link, - .ant-pagination-disabled:hover .ant-pagination-item-link, - .ant-pagination-disabled:focus .ant-pagination-item-link { - color: @dark-text-color-1; - } + &-active { + background-color: transparent; + } + } - .ant-pagination-item a:not(:hover) { - color: @dark-text-color-3; + &-options-quick-jumper input { + background-color: transparent; + background-image: none; + border-color: @dark-border-color; + color: @dark-text-color-3; + } } - .ant-pagination-item-active { - background-color: transparent; - } + .ant-popover { + &-message { + color: @dark-text-color-3; + } - .ant-pagination-options-quick-jumper input { - background-color: transparent; - background-image: none; - border-color: @dark-border-color; - color: @dark-text-color-3; - } + &-inner-content { + color: @dark-text-color-3; + background-color: @dark-secondary-bgColor; + border: 1px solid @dark-border-color; + box-shadow: + 0 3px 6px -4px @light-text-color-3, + 0 6px 16px 0 @light-text-color-2, + 0 9px 28px 8px @light-text-color-1; + } - .ant-popover-message { - color: @dark-text-color-3; - } + &-placement { + &-bottom > .ant-popover-content > .ant-popover-arrow, + &-bottomLeft > .ant-popover-content > .ant-popover-arrow, + &-bottomRight > .ant-popover-content > .ant-popover-arrow { + border-top-color: @dark-border-color; + border-left-color: @dark-border-color; + } - .ant-popover-inner-content { - color: @dark-text-color-3; - background-color: @dark-secondary-bgColor; - border: 1px solid @dark-border-color; - box-shadow: - 0 3px 6px -4px @light-text-color-3, - 0 6px 16px 0 @light-text-color-2, - 0 9px 28px 8px @light-text-color-1; + &-top > .ant-popover-content > .ant-popover-arrow, + &-topLeft > .ant-popover-content > .ant-popover-arrow, + &-topRight > .ant-popover-content > .ant-popover-arrow { + border-right-color: @dark-border-color; + border-bottom-color: @dark-border-color; + } + } } - .ant-list-item-meta-title { + .ant-list-item { color: @dark-text-color-3; - } - - .ant-popover-placement-bottom>.ant-popover-content>.ant-popover-arrow, - .ant-popover-placement-bottomLeft>.ant-popover-content>.ant-popover-arrow, - .ant-popover-placement-bottomRight>.ant-popover-content>.ant-popover-arrow { - border-top-color: @dark-border-color; - border-left-color: @dark-border-color; - } + border-color: @dark-border-color; - .ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow, - .ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow, - .ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow { - border-right-color: @dark-border-color; - border-bottom-color: @dark-border-color; + &-meta-title, &-meta-description { + color: @dark-text-color-3; + } } .ant-tag { @@ -387,15 +368,6 @@ color: @dark-text-color-3; } - .ant-list-item { - color: @dark-text-color-3; - border-color: @dark-border-color; - } - - .ant-list-item-meta-description { - color: @dark-text-color-3; - } - .ant-avatar { background-color: transparent; background-image: none; @@ -413,28 +385,35 @@ .ant-modal { color: @dark-text-color-3; - } - .ant-modal-content { - box-shadow: - 0 3px 6px -4px @light-text-color-3, - 0 6px 16px 0 @light-text-color-2, - 0 9px 28px 8px @light-text-color-1; - } + &-content { + background-color: @dark-secondary-bgColor; + box-shadow: + 0 3px 6px -4px @light-text-color-3, + 0 6px 16px 0 @light-text-color-2, + 0 9px 28px 8px @light-text-color-1; + } - .ant-modal-content, .ant-modal-header { - background-color: @dark-secondary-bgColor; - } + &-header { + background-color: @dark-secondary-bgColor; + border-color: @dark-border-color; + } - .ant-modal-header, .ant-modal-footer { - border-color: @dark-border-color; - } + &-footer { + border-color: @dark-border-color; + } - .ant-modal-confirm-body .ant-modal-confirm-title, - .ant-modal-title, .ant-modal-close-x { - color: @dark-text-color-3; + &-confirm-body &-confirm-title, + &-title, &-close-x { + color: @dark-text-color-3; + } } + .ant-input, + .ant-select-selection, + .ant-input-group-addon, + .ant-checkbox-inner, + .ant-radio-inner, .ant-radio-button-wrapper, .ant-input-number, .ant-time-picker-input { @@ -443,6 +422,52 @@ color: @dark-text-color-3; } + .ant-checkbox-wrapper { + color: @dark-text-color-3; + } + + .ant-switch { + color: @light-text-color-3; + background-color: @dark-text-color-2; + + &-checked { + background-color: #1890ff; + } + + &-loading-icon, &:after { + background-color: @dark-secondary-bgColor; + } + } + + .ant-dropdown-menu { + background-color: @dark-secondary-bgColor; + border: 1px solid @dark-border-color; + + &-item > a:hover { + .ant-switch:not(.ant-switch-checked) { + background-color: @light-text-color-3; + } + } + + &-item:not(.ant-dropdown-menu-item-selected, :hover), + &-submenu-title, + &-item > a:not(:hover), + &-submenu-title > a:not(:hover) { + color: @dark-text-color-3; + } + } + + .user-layout .ant-input-affix-wrapper .ant-input-prefix, + .user-layout .ant-input-affix-wrapper .ant-input-suffix { + color: @dark-text-color-3; + } + + .ant-input-affix-wrapper .ant-input-prefix, + .ant-input-affix-wrapper .ant-input-suffix, + .ant-input-password-icon { + color: @dark-text-color-3; + } + .ant-input-number-handler-wrap { background-color: @dark-secondary-bgColor; } @@ -476,9 +501,7 @@ } .ant-form-item, - .ant-radio-wrapper, - .vm-info-card .resource-detail-item__details a, - .vm-info-card .resource-detail-item a { + .ant-radio-wrapper { color: @dark-text-color-3; } @@ -533,10 +556,6 @@ border-color: @dark-border-color; } - .ant-card-bordered { - border-color: @dark-border-color; - } - .ant-steps-item-wait .ant-steps-item-icon > .ant-steps-icon .ant-steps-icon-dot { background-color: @dark-text-color-3; } @@ -619,9 +638,5 @@ .ant-collapse .ant-collapse-item-disabled>.ant-collapse-header>.arrow { color: @dark-text-color-1; } - - .chart-card-footer { - border-color: @dark-border-color; - } } diff --git a/ui/src/views/auth/Login.vue b/ui/src/views/auth/Login.vue index 42c713721c7d..b16ecf559547 100644 --- a/ui/src/views/auth/Login.vue +++ b/ui/src/views/auth/Login.vue @@ -46,7 +46,7 @@ {rules: [{ required: true, message: $t('message.error.username') }, { validator: handleUsernameOrEmail }], validateTrigger: 'change'} ]" > - + @@ -61,7 +61,7 @@ {rules: [{ required: true, message: $t('message.error.password') }], validateTrigger: 'blur'} ]" > - +
@@ -75,7 +75,7 @@ {rules: [{ required: false, message: $t('message.error.domain') }], validateTrigger: 'change'} ]" > - +
From e87c6fb764a16ebf4d816f85861c84607c06cc69 Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 2 Jun 2021 09:19:47 +0700 Subject: [PATCH 04/17] fix collapse & login page --- ui/src/layouts/UserLayout.vue | 5 ++++- ui/src/style/dark-mode.less | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ui/src/layouts/UserLayout.vue b/ui/src/layouts/UserLayout.vue index 2aea7aed3dc8..5b7493cf8086 100644 --- a/ui/src/layouts/UserLayout.vue +++ b/ui/src/layouts/UserLayout.vue @@ -35,8 +35,10 @@ + + diff --git a/ui/src/components/view/SettingItem.vue b/ui/src/components/view/SettingItem.vue new file mode 100644 index 000000000000..fa458d62d4e0 --- /dev/null +++ b/ui/src/components/view/SettingItem.vue @@ -0,0 +1,185 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/components/widgets/Drawer.vue b/ui/src/components/widgets/Drawer.vue new file mode 100644 index 000000000000..8cfd59da8ce8 --- /dev/null +++ b/ui/src/components/widgets/Drawer.vue @@ -0,0 +1,170 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/layouts/UserLayout.vue b/ui/src/layouts/UserLayout.vue index 5b7493cf8086..e25bab4c8cbb 100644 --- a/ui/src/layouts/UserLayout.vue +++ b/ui/src/layouts/UserLayout.vue @@ -50,9 +50,9 @@ export default { watch: { '$store.getters.darkMode' (darkMode) { if (darkMode) { - document.body.classList.add('dark') + document.body.classList.add('dark-mode') } else { - document.body.classList.remove('dark') + document.body.classList.remove('dark-mode') } } }, @@ -60,12 +60,12 @@ export default { document.body.classList.add('userLayout') const darkMode = Vue.ls.get(DARK_MODE, false) if (this.$store.getters.darkMode || darkMode) { - document.body.classList.add('dark') + document.body.classList.add('dark-mode') } }, beforeDestroy () { document.body.classList.remove('userLayout') - document.body.classList.remove('dark') + document.body.classList.remove('dark-mode') } } diff --git a/ui/src/store/getters.js b/ui/src/store/getters.js index 22ae9626d838..07ef6c62cedf 100644 --- a/ui/src/store/getters.js +++ b/ui/src/store/getters.js @@ -37,7 +37,8 @@ const getters = { timezoneoffset: state => state.user.timezoneoffset, usebrowsertimezone: state => state.user.usebrowsertimezone, domainStore: state => state.user.domainStore, - darkMode: state => state.user.darkMode + darkMode: state => state.user.darkMode, + themeSetting: state => state.user.themeSetting } export default getters diff --git a/ui/src/store/modules/user.js b/ui/src/store/modules/user.js index dcf59f8327e3..2c178db8fed7 100644 --- a/ui/src/store/modules/user.js +++ b/ui/src/store/modules/user.js @@ -34,7 +34,8 @@ import { USE_BROWSER_TIMEZONE, ASYNC_JOB_IDS, DOMAIN_STORE, - DARK_MODE + DARK_MODE, + THEME_SETTING } from '@/store/mutation-types' const user = { @@ -53,7 +54,8 @@ const user = { timezoneoffset: 0.0, usebrowsertimezone: false, domainStore: {}, - darkMode: false + darkMode: false, + themeSetting: {} }, mutations: { @@ -112,6 +114,10 @@ const user = { SET_DARK_MODE (state, darkMode) { state.darkMode = darkMode Vue.ls.set(DARK_MODE, darkMode) + }, + SET_THEME_SETTING (state, setting) { + state.themeSetting = setting + Vue.ls.set(THEME_SETTING, setting) } }, @@ -139,6 +145,8 @@ const user = { commit('SET_USE_BROWSER_TIMEZONE', cachedUseBrowserTimezone) const darkMode = Vue.ls.get(DARK_MODE, false) commit('SET_DARK_MODE', darkMode) + const themeSetting = Vue.ls.get(THEME_SETTING, {}) + commit('SET_THEME_SETTING', themeSetting) commit('SET_APIS', {}) commit('SET_NAME', '') @@ -168,10 +176,12 @@ const user = { const cachedUseBrowserTimezone = Vue.ls.get(USE_BROWSER_TIMEZONE, false) const domainStore = Vue.ls.get(DOMAIN_STORE, {}) const darkMode = Vue.ls.get(DARK_MODE, false) + const themeSetting = Vue.ls.get(THEME_SETTING, {}) const hasAuth = Object.keys(cachedApis).length > 0 commit('SET_DOMAIN_STORE', domainStore) commit('SET_DARK_MODE', darkMode) + commit('SET_THEME_SETTING', themeSetting) if (hasAuth) { console.log('Login detected, using cached APIs') commit('SET_ZONES', cachedZones) @@ -350,6 +360,9 @@ const user = { }, SetDarkMode ({ commit }, darkMode) { commit('SET_DARK_MODE', darkMode) + }, + SetThemeSetting ({ commit }, setting) { + commit('SET_THEME_SETTING', setting) } } } diff --git a/ui/src/store/mutation-types.js b/ui/src/store/mutation-types.js index 7c0f946db8f6..bc4b214c8330 100644 --- a/ui/src/store/mutation-types.js +++ b/ui/src/store/mutation-types.js @@ -34,6 +34,7 @@ export const TIMEZONE_OFFSET = 'TIMEZONE_OFFSET' export const USE_BROWSER_TIMEZONE = 'USE_BROWSER_TIMEZONE' export const DOMAIN_STORE = 'DOMAIN_STORE' export const DARK_MODE = 'DARK_MODE' +export const THEME_SETTING = 'THEME_SETTING' export const CONTENT_WIDTH_TYPE = { Fluid: 'Fluid', diff --git a/ui/src/style/dark-mode.less b/ui/src/style/dark-mode.less index 6cfdcb2d9682..67c4907b5e7d 100644 --- a/ui/src/style/dark-mode.less +++ b/ui/src/style/dark-mode.less @@ -33,7 +33,7 @@ @table-body-hover-bgColor: #262626; @disabled-bgColor: #555; -.dark { +.dark-mode { background: @dark-bgColor; h1, h2, h3, h4, h5, h6 { @@ -96,17 +96,28 @@ background: @dark-secondary-bgColor; } - .ant-menu-item:not(.ant-menu-item-selected, :hover) > a, - .ant-menu-vertical .ant-menu-item, - .ant-menu-vertical-left .ant-menu-item, - .ant-menu-vertical-right .ant-menu-item, - .ant-menu-inline .ant-menu-item, - .ant-menu-vertical .ant-menu-submenu-title:not(:hover), - .ant-menu-vertical-left .ant-menu-submenu-title:not(:hover), - .ant-menu-vertical-right .ant-menu-submenu-title:not(:hover), - .ant-menu-inline .ant-menu-submenu-title:not(:hover) - { - color: @dark-text-color-3; + .ant-menu { + &-vertical:not(.ant-menu-dark) { + .ant-menu-item, + .ant-menu-submenu-title:not(:hover), + .ant-menu-item:not(.ant-menu-item-selected, :hover) > a { + color: @dark-text-color-3; + } + } + + &-inline:not(.ant-menu-dark, .ant-menu-sub) { + .ant-menu-item, + .ant-menu-item > a:not(:hover), + .ant-menu-submenu-title:not(:hover) { + color: @dark-text-color-3; + } + } + + &-submenu:not(.ant-menu-dark, .ant-menu-submenu-inline) { + .ant-menu-item:not(.ant-menu-item-selected, :hover) > a { + color: @dark-text-color-3; + } + } } .kubernet-icon path @@ -864,5 +875,15 @@ } } } + + .drawer { + .content { + background-color: @dark-secondary-bgColor; + box-shadow: + 0 3px 6px -4px @box-shadow-1, + 0 6px 16px 0 @box-shadow-2, + 0 9px 28px 8px @box-shadow-3; + } + } } diff --git a/ui/src/style/vars.less b/ui/src/style/vars.less index 8ce8498bf503..0456685c1e37 100644 --- a/ui/src/style/vars.less +++ b/ui/src/style/vars.less @@ -90,6 +90,10 @@ a { box-shadow: 1px 1px 0px 0px #e8e8e8; } +.sider.dark .logo { + background-color: @project-nav-background-color; +} + .sider.light { background: @navigation-background-color; @@ -149,10 +153,6 @@ a { .ant-menu-submenu-title:hover { color: @primary-color; - - .custom-icon path { - color: @primary-color; - } } .ant-menu-submenu-vertical > .ant-menu-submenu-title .ant-menu-submenu-arrow::before, @@ -313,4 +313,25 @@ a { .ant-dropdown-menu-item > a:hover, .ant-dropdown-menu-submenu-title > a:hover { color: @primary-color; -} \ No newline at end of file +} + +.drawer { + .img-checkbox { + .check-icon.light { + color: #000; + } + .check-icon.dark { + color: #ffffff; + } + } + + .color-checkbox { + .check-icon { + color: #ffffff; + } + } + + .input-group .color-picker { + border-color: @primary-color; + } +} From a1c7b8ef459752a15fda979c9a1692b4f126e287 Mon Sep 17 00:00:00 2001 From: utchoang Date: Thu, 17 Jun 2021 13:22:54 +0700 Subject: [PATCH 09/17] add an alert for save the setting --- ui/public/locales/en.json | 3 ++- ui/src/components/view/Setting.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 4f55d1d0d834..148d3e11fe8f 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -2104,6 +2104,7 @@ "label.templatetype": "Template Type", "label.tftp.dir": "TFTP Directory", "label.tftpdir": "Tftp root directory", +"label.theme.alert": "The settings panel is only visible in the development environment, please save for the changes to take effect.", "label.theme.color": "Theme Color", "label.theme.cyan": "Cyan", "label.theme.dark": "Dark Style", @@ -2712,7 +2713,7 @@ "message.delete.vpn.customer.gateway": "Please confirm that you want to delete this VPN Customer Gateway", "message.delete.vpn.gateway": "Please confirm that you want to delete this VPN Gateway", "message.deleting.vm": "Deleting VM", -"message.deployasis": "Selected template is Deploy As-Is i.e., the VM is deployed by importing an OVA with vApps directly into vCenter. Root disk(s) resize is allowed only on stopped VMs for such templates.", +"message.deployasis": "Selected template is Deploy As-Is i.e., the VM is deployed by importing an OVA with vApps directly into vCenter. Root disk(s) resize is allowed only on stopped VMs for such templates.", "message.desc.add.new.lb.sticky.rule": "Add new LB sticky rule", "message.desc.advanced.zone": "For more sophisticated network topologies. This network model provides the most flexibility in defining guest networks and providing custom network offerings such as firewall, VPN, or load balancer support.", "message.desc.basic.zone": "Provide a single network where each VM instance is assigned an IP directly from the network. Guest isolation can be provided through layer-3 means such as security groups (IP address source filtering).", diff --git a/ui/src/components/view/Setting.vue b/ui/src/components/view/Setting.vue index 45d35e0035d3..62151e670ab8 100644 --- a/ui/src/components/view/Setting.vue +++ b/ui/src/components/view/Setting.vue @@ -110,6 +110,7 @@
+ Date: Thu, 17 Jun 2021 13:29:54 +0700 Subject: [PATCH 10/17] add `cursor: pointer` --- ui/src/components/view/Setting.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/src/components/view/Setting.vue b/ui/src/components/view/Setting.vue index 62151e670ab8..81ded4a9217d 100644 --- a/ui/src/components/view/Setting.vue +++ b/ui/src/components/view/Setting.vue @@ -359,6 +359,7 @@ export default { top: 0; right: 0; border: 1px solid; + cursor: pointer; .ant-input { opacity: 0; @@ -367,6 +368,7 @@ export default { position: absolute; top: 0; left: 0; + cursor: pointer; } } } From 76e6a163398672cbe50bfd3aead4f8a48f6a529a Mon Sep 17 00:00:00 2001 From: utchoang Date: Thu, 17 Jun 2021 15:07:34 +0700 Subject: [PATCH 11/17] hide drawer when init --- ui/src/components/page/GlobalLayout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/page/GlobalLayout.vue b/ui/src/components/page/GlobalLayout.vue index f5f782faeb6e..ebfd4c4f1a46 100644 --- a/ui/src/components/page/GlobalLayout.vue +++ b/ui/src/components/page/GlobalLayout.vue @@ -122,7 +122,7 @@ export default { return { collapsed: false, menus: [], - showSetting: true + showSetting: false } }, computed: { From 9a28534c0c0cbc573ba013c743d1effb268b98e0 Mon Sep 17 00:00:00 2001 From: utchoang Date: Thu, 8 Jul 2021 08:28:32 +0700 Subject: [PATCH 12/17] change id name of svg icon --- ui/src/assets/icons/dark.svg | 2 +- ui/src/assets/icons/light.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/assets/icons/dark.svg b/ui/src/assets/icons/dark.svg index 731e3f24c82e..9190c1d3bf80 100644 --- a/ui/src/assets/icons/dark.svg +++ b/ui/src/assets/icons/dark.svg @@ -19,7 +19,7 @@ - + diff --git a/ui/src/assets/icons/light.svg b/ui/src/assets/icons/light.svg index 80222c21483f..fbb1000c1d69 100644 --- a/ui/src/assets/icons/light.svg +++ b/ui/src/assets/icons/light.svg @@ -20,7 +20,7 @@ - + From b4a79e7ed0771c0606574c855f5733b7e9dcde0e Mon Sep 17 00:00:00 2001 From: utchoang Date: Sat, 17 Jul 2021 16:51:28 +0700 Subject: [PATCH 13/17] fix after merged 4.15 --- ui/src/views/iam/CreateRole.vue | 8 ++++---- ui/src/views/iam/ImportRole.vue | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/src/views/iam/CreateRole.vue b/ui/src/views/iam/CreateRole.vue index 9003b424b786..b7dfe1f8551c 100644 --- a/ui/src/views/iam/CreateRole.vue +++ b/ui/src/views/iam/CreateRole.vue @@ -26,7 +26,7 @@ {{ $t('label.name') }} - + {{ $t('label.description') }} - + {{ $t('label.type') }} - + {{ $t('label.role') }} - + {{ $t('label.name') }} - + {{ $t('label.description') }} - + {{ $t('label.type') }} - + {{ $t('label.forced') }} - + Date: Wed, 28 Jul 2021 10:26:51 +0700 Subject: [PATCH 14/17] edit active color menu item --- ui/src/style/dark-mode.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/style/dark-mode.less b/ui/src/style/dark-mode.less index 67c4907b5e7d..51a1036e348f 100644 --- a/ui/src/style/dark-mode.less +++ b/ui/src/style/dark-mode.less @@ -107,7 +107,7 @@ &-inline:not(.ant-menu-dark, .ant-menu-sub) { .ant-menu-item, - .ant-menu-item > a:not(:hover), + .ant-menu-item:not(.ant-menu-item-selected) > a:not(:hover), .ant-menu-submenu-title:not(:hover) { color: @dark-text-color-3; } From 5a7b5832c3aff94c148fa381314866e3ff926fa7 Mon Sep 17 00:00:00 2001 From: utchoang Date: Tue, 3 Aug 2021 14:01:11 +0700 Subject: [PATCH 15/17] fix plaholder color, project chart color & reset setting --- ui/public/locales/en.json | 1 + ui/src/components/view/Setting.vue | 35 ++++++++++++++----- ui/src/style/dark-mode.less | 11 +++++- .../views/dashboard/UsageDashboardChart.vue | 2 +- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 6a13d008ee18..2b991fd15fbe 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1790,6 +1790,7 @@ "label.reservedsystemnetmask": "Reserved system netmask", "label.reservedsystemstartip": "Start Reserved system IP", "label.reset": "Reset", +"label.reset.to.default": "Reset to default", "label.reset.ssh.key.pair": "Reset SSH Key Pair", "label.reset.ssh.key.pair.on.vm": "Reset SSH Key Pair on VM", "label.reset.vpn.connection": "Reset VPN connection", diff --git a/ui/src/components/view/Setting.vue b/ui/src/components/view/Setting.vue index 81ded4a9217d..e95a1a8588de 100644 --- a/ui/src/components/view/Setting.vue +++ b/ui/src/components/view/Setting.vue @@ -21,7 +21,7 @@ {{ $t('label.save.setting') }} + {{ $t('label.reset.to.default') }}
@@ -141,7 +145,8 @@ export default { navTextColorPick: this.$store.getters.themeSetting['@navigation-text-color'] || this.$config.theme['@navigation-text-color'], projectNavBgColorPick: this.$store.getters.themeSetting['@project-nav-background-color'] || this.$config.theme['@project-nav-background-color'], projectNavTextColorPick: this.$store.getters.themeSetting['@project-nav-text-color'] || this.$config.theme['@project-nav-text-color'], - uiSettings: {} + uiSettings: {}, + originalSetting: {} } }, computed: { @@ -219,19 +224,15 @@ export default { }, methods: { fetchData () { + this.originalSetting = Object.assign({}, this.$config.theme) this.layoutMode = 'light' if (this.$store.getters.darkMode) { this.layoutMode = 'dark' } this.uiSettings = this.$config.theme }, - switchLayoutMode (e) { - this.layoutMode = e.target.value - if (this.layoutMode === 'dark') { - this.$store.dispatch('SetDarkMode', true) - } else if (this.layoutMode === 'light') { - this.$store.dispatch('SetDarkMode', false) - } + switchLayoutMode () { + this.$store.dispatch('SetDarkMode', (this.layoutMode === 'dark')) }, switchColor (e) { this.colorPick = e.target.value @@ -255,6 +256,21 @@ export default { this.$message.success(this.$t('label.success')) }, 1000) }, + resetSetting () { + this.layoutMode = 'light' + this.colorPick = this.originalSetting['@primary-color'] + this.navBgColorPick = this.originalSetting['@navigation-background-color'] + this.navTextColorPick = this.originalSetting['@navigation-text-color'] + this.projectNavBgColorPick = this.originalSetting['@project-nav-background-color'] + this.projectNavTextColorPick = this.originalSetting['@project-nav-text-color'] + + this.$store.dispatch('SetThemeSetting', {}) + this.switchLayoutMode() + + this.$config.theme = this.originalSetting + window.less.modifyVars(this.$config.theme) + this.$message.success(this.$t('label.success')) + }, formatConfig (obj, dep) { dep = dep || 1 const LN = '\n' @@ -384,6 +400,7 @@ export default { &-btn { width: 100%; + margin-bottom: 5px; } } diff --git a/ui/src/style/dark-mode.less b/ui/src/style/dark-mode.less index 51a1036e348f..b8fe2c7e2bb1 100644 --- a/ui/src/style/dark-mode.less +++ b/ui/src/style/dark-mode.less @@ -885,5 +885,14 @@ 0 9px 28px 8px @box-shadow-3; } } -} + ::placeholder { + color: @dark-text-color-1; + } + + .ant-card.usage-dashboard-chart-card.usage-chart-text { + h1, h2, h3, h4, h5, h6 { + color: initial; + } + } +} \ No newline at end of file diff --git a/ui/src/views/dashboard/UsageDashboardChart.vue b/ui/src/views/dashboard/UsageDashboardChart.vue index 1430d2d37017..be46d1b2f61e 100644 --- a/ui/src/views/dashboard/UsageDashboardChart.vue +++ b/ui/src/views/dashboard/UsageDashboardChart.vue @@ -24,7 +24,7 @@ v-for="stat in stats" :key="stat.type"> From 5403877b2945c33ae1eb364c5994370db9077833 Mon Sep 17 00:00:00 2001 From: utchoang Date: Tue, 10 Aug 2021 09:03:50 +0700 Subject: [PATCH 16/17] fix event change color picker & error input focus color --- ui/src/components/view/Setting.vue | 8 ++++---- ui/src/style/dark-mode.less | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/src/components/view/Setting.vue b/ui/src/components/view/Setting.vue index e95a1a8588de..6ad97097d371 100644 --- a/ui/src/components/view/Setting.vue +++ b/ui/src/components/view/Setting.vue @@ -59,7 +59,7 @@ :disabled="layoutMode === 'dark'" type="color" v-model="navBgColorPick" - @change="(e) => updateSetting('@navigation-background-color', e.target.value)" /> + @blur="(e) => updateSetting('@navigation-background-color', e.target.value)" /> @@ -71,7 +71,7 @@ :disabled="layoutMode === 'dark'" type="color" v-model="navBgColorPick" - @change="(e) => updateSetting('@navigation-text-color', e.target.value)" /> + @blur="(e) => updateSetting('@navigation-text-color', e.target.value)" /> @@ -90,7 +90,7 @@ + @blur="(e) => updateSetting('@project-nav-background-color', e.target.value)" /> @@ -101,7 +101,7 @@ + @blur="(e) => updateSetting('@project-nav-text-color', e.target.value)" /> diff --git a/ui/src/style/dark-mode.less b/ui/src/style/dark-mode.less index b8fe2c7e2bb1..d2670296ab95 100644 --- a/ui/src/style/dark-mode.less +++ b/ui/src/style/dark-mode.less @@ -208,7 +208,9 @@ } .has-error .ant-input-affix-wrapper .ant-input, - .has-error .ant-input-affix-wrapper .ant-input:hover { + .has-error .ant-input-affix-wrapper .ant-input:hover, + .has-error .ant-input, + .has-error .ant-input:hover { background-color: transparent; background-image: none; } From 9b88a4c04891b355d9975d418eb3ac3d1fa8a8b7 Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 11 Aug 2021 11:53:13 +0700 Subject: [PATCH 17/17] fix empty data color --- ui/src/style/dark-mode.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/style/dark-mode.less b/ui/src/style/dark-mode.less index d2670296ab95..10534f7a27a0 100644 --- a/ui/src/style/dark-mode.less +++ b/ui/src/style/dark-mode.less @@ -897,4 +897,8 @@ color: initial; } } + + .ant-empty-normal { + color: @dark-text-color-3; + } } \ No newline at end of file