From 58bf1a2ca5151735f5b5f51611eae7ad3a7999c3 Mon Sep 17 00:00:00 2001 From: Matthieu Hostache Date: Tue, 19 May 2020 09:12:53 +0200 Subject: [PATCH] feat: Traefik Pilot WebUI --- webui/package-lock.json | 128 +++++++++++++----- webui/package.json | 1 + webui/quasar.conf.js | 6 +- webui/src/App.vue | 5 + webui/src/_directives/resize.js | 8 ++ webui/src/_helpers/APP.js | 3 +- webui/src/_middleware/Boot.js | 3 + webui/src/components/_commons/NavBar.vue | 67 +++++++-- webui/src/components/_commons/SidePanel.vue | 71 ++++++++++ .../platform/PlatformActionButton.vue | 20 +++ .../components/platform/PlatformAuthState.vue | 70 ++++++++++ .../platform/PlatformNotification.vue | 90 ++++++++++++ .../src/components/platform/PlatformPanel.vue | 106 +++++++++++++++ webui/src/pages/dashboard/Index.vue | 5 +- webui/src/store/index.js | 4 +- webui/src/store/platform/index.js | 27 ++++ 16 files changed, 564 insertions(+), 50 deletions(-) create mode 100644 webui/src/_directives/resize.js create mode 100644 webui/src/components/_commons/SidePanel.vue create mode 100644 webui/src/components/platform/PlatformActionButton.vue create mode 100644 webui/src/components/platform/PlatformAuthState.vue create mode 100644 webui/src/components/platform/PlatformNotification.vue create mode 100644 webui/src/components/platform/PlatformPanel.vue create mode 100644 webui/src/store/platform/index.js diff --git a/webui/package-lock.json b/webui/package-lock.json index 1956acaa2..ecca9afd0 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -7269,6 +7269,11 @@ "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", "dev": true }, + "iframe-resizer": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-4.2.10.tgz", + "integrity": "sha512-9T/AWavGI5Q7nw2ch7qatkKvhK6S11eatuSh0SXpPXN3MV0HtN97KyifWJSuMj47rD6jbqe1CXT91PLQbexvEQ==" + }, "ignore": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", @@ -9003,7 +9008,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -9024,12 +9030,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9044,17 +9052,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -9171,7 +9182,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -9183,6 +9195,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9197,6 +9210,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9204,12 +9218,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9228,6 +9244,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -9308,7 +9325,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -9320,6 +9338,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -9405,7 +9424,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -9441,6 +9461,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9460,6 +9481,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9503,12 +9525,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -14418,7 +14442,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -14439,12 +14464,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -14459,17 +14486,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -14586,7 +14616,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -14598,6 +14629,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -14612,6 +14644,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -14619,12 +14652,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -14643,6 +14678,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -14723,7 +14759,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -14735,6 +14772,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -14820,7 +14858,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -14856,6 +14895,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -14875,6 +14915,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -14918,12 +14959,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -15465,7 +15508,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -15486,12 +15530,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -15506,17 +15552,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -15633,7 +15682,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -15645,6 +15695,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -15659,6 +15710,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -15666,12 +15718,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -15690,6 +15744,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -15770,7 +15825,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -15782,6 +15838,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -15867,7 +15924,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -15903,6 +15961,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -15922,6 +15981,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -15965,12 +16025,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/webui/package.json b/webui/package.json index 87f79b181..6562fabee 100644 --- a/webui/package.json +++ b/webui/package.json @@ -21,6 +21,7 @@ "bowser": "^2.5.2", "chart.js": "^2.8.0", "dot-prop": "^5.2.0", + "iframe-resizer": "^4.2.10", "lodash.isequal": "4.5.0", "moment": "^2.24.0", "quasar": "^1.4.4", diff --git a/webui/quasar.conf.js b/webui/quasar.conf.js index 07eec1a8d..c7dc90513 100644 --- a/webui/quasar.conf.js +++ b/webui/quasar.conf.js @@ -118,11 +118,13 @@ module.exports = function (ctx) { env: process.env.APP_ENV === 'development' ? { // staging: APP_ENV: JSON.stringify(process.env.APP_ENV), - APP_API: JSON.stringify(process.env.APP_API || '/api') + APP_API: JSON.stringify(process.env.APP_API || '/api'), + PLATFORM_URL: JSON.stringify(process.env.PLATFORM_URL || 'https://pilot.traefik.io') } : { // production: APP_ENV: JSON.stringify(process.env.APP_ENV), - APP_API: JSON.stringify(process.env.APP_API || '/api') + APP_API: JSON.stringify(process.env.APP_API || '/api'), + PLATFORM_URL: JSON.stringify(process.env.PLATFORM_URL || 'https://pilot.traefik.io') }, uglifyOptions: { compress: { diff --git a/webui/src/App.vue b/webui/src/App.vue index 11a521bd6..688e9c440 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -1,14 +1,19 @@ + + diff --git a/webui/src/components/platform/PlatformActionButton.vue b/webui/src/components/platform/PlatformActionButton.vue new file mode 100644 index 000000000..5dc8669e8 --- /dev/null +++ b/webui/src/components/platform/PlatformActionButton.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/webui/src/components/platform/PlatformAuthState.vue b/webui/src/components/platform/PlatformAuthState.vue new file mode 100644 index 000000000..63472f184 --- /dev/null +++ b/webui/src/components/platform/PlatformAuthState.vue @@ -0,0 +1,70 @@ +