From 389536aff0156fea5ca283653c1068bce8bf2929 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Thu, 27 Feb 2020 23:30:04 +0300 Subject: [PATCH] Add dark theme for Web UI --- webui/src/App.vue | 7 +++++ webui/src/assets/middlewares-empty-dark.svg | 7 +++++ .../src/components/_commons/ChartDoughnut.vue | 3 +++ webui/src/components/_commons/NavBar.vue | 7 ++++- .../components/_commons/PanelMiddlewares.vue | 3 ++- webui/src/components/_commons/PanelTLS.vue | 3 ++- webui/src/components/_commons/SkeletonBox.vue | 18 +++++++++++++ webui/src/components/_commons/ToolBar.vue | 4 +++ .../src/components/_commons/ToolBarTable.vue | 2 +- webui/src/components/dashboard/PanelChart.vue | 10 ++++++- .../src/components/dashboard/PanelFeature.vue | 14 +++++++++- webui/src/css/sass/app.scss | 26 +++++++++++++++++++ 12 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 webui/src/assets/middlewares-empty-dark.svg diff --git a/webui/src/App.vue b/webui/src/App.vue index 9ad812eb8..11a521bd6 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -15,6 +15,13 @@ export default { // debug console.log('Quasar -> ', this.$q.version) + + this.$q.dark.set(localStorage.getItem('traefik-dark') === 'true') + }, + watch: { + '$q.dark.isActive' (val) { + localStorage.setItem('traefik-dark', val) + } } } diff --git a/webui/src/assets/middlewares-empty-dark.svg b/webui/src/assets/middlewares-empty-dark.svg new file mode 100644 index 000000000..05381932f --- /dev/null +++ b/webui/src/assets/middlewares-empty-dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/webui/src/components/_commons/ChartDoughnut.vue b/webui/src/components/_commons/ChartDoughnut.vue index 24b8f1f60..a8993154e 100644 --- a/webui/src/components/_commons/ChartDoughnut.vue +++ b/webui/src/components/_commons/ChartDoughnut.vue @@ -22,6 +22,9 @@ export default { // this.$data._chart.update() this.renderChart(this.chartdata, this.options) } + }, + '$q.dark.isActive' (val) { + this.renderChart(this.chartdata, this.options) } }, mounted () { diff --git a/webui/src/components/_commons/NavBar.vue b/webui/src/components/_commons/NavBar.vue index 8a474cc6d..3bf4c7b3b 100644 --- a/webui/src/components/_commons/NavBar.vue +++ b/webui/src/components/_commons/NavBar.vue @@ -13,13 +13,14 @@ + -
+