From 5c272adca1e597f5622e4cbf21a52b7e0b97dbcd Mon Sep 17 00:00:00 2001 From: Sylvaner Date: Wed, 6 May 2020 12:54:49 +0200 Subject: [PATCH] =?UTF-8?q?Editeur=20avanc=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dash/package-lock.json | 40 +++++++- src/dash/package.json | 1 + src/dash/src/components/Dash.vue | 3 +- src/dash/src/components/DashEditor.vue | 102 ++++++++++++++++++++ src/dash/src/components/DashPreferences.vue | 9 +- src/dash/src/components/GridDash.vue | 1 - src/dash/src/libs/Communication.js | 2 +- src/dash/src/router.js | 7 ++ src/dash/yarn.lock | 9 +- 9 files changed, 165 insertions(+), 9 deletions(-) create mode 100644 src/dash/src/components/DashEditor.vue diff --git a/src/dash/package-lock.json b/src/dash/package-lock.json index 8666e1b70..3ae63f43d 100644 --- a/src/dash/package-lock.json +++ b/src/dash/package-lock.json @@ -1332,6 +1332,8 @@ }, "@vue/cli-plugin-babel": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-babel/-/cli-plugin-babel-4.3.1.tgz", + "integrity": "sha512-tBqu0v1l4LfWX8xuJmofpp+8xQzKddFNxdLmeVDOX/omDBQX0qaVDeMUtRxxSTazI06SKr605SnUQoa35qwbvw==", "dev": true, "requires": { "@babel/core": "^7.9.0", @@ -1345,6 +1347,8 @@ }, "@vue/cli-plugin-eslint": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-4.3.1.tgz", + "integrity": "sha512-5UEP93b8C/JQs9Rnuldsu8jMz0XO4wNXG0lL/GdChYBEheKCyXJXzan7qzEbIuvUwG3I+qlUkGsiyNokIgXejg==", "dev": true, "requires": { "@vue/cli-shared-utils": "^4.3.1", @@ -1372,6 +1376,8 @@ }, "@vue/cli-service": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@vue/cli-service/-/cli-service-4.3.1.tgz", + "integrity": "sha512-CsNGfHe+9oKZdRwJmweQ0KsMYM27ssg1eNQqRKL/t+IgDLO3Tu86uaOOCLn4ZAaU5oxxpq4aSFvz+A0YxQRSWw==", "dev": true, "requires": { "@intervolga/optimize-cssnano-plugin": "^1.0.5", @@ -2046,6 +2052,8 @@ }, "babel-eslint": { "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -4161,6 +4169,8 @@ }, "eslint": { "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -4275,6 +4285,8 @@ }, "eslint-plugin-vue": { "version": "6.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-6.2.2.tgz", + "integrity": "sha512-Nhc+oVAHm0uz/PkJAWscwIT4ijTrK5fqNqz9QB1D35SbbuMG1uB6Yr5AJpvPSWg+WOw7nYNswerYh0kOk64gqQ==", "dev": true, "requires": { "natural-compare": "^1.4.0", @@ -9351,6 +9363,8 @@ }, "sass": { "version": "1.26.3", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.3.tgz", + "integrity": "sha512-5NMHI1+YFYw4sN3yfKjpLuV9B5l7MqQ6FlkTcC4FT+oHbBRUZoSjHrrt/mE0nFXJyY2kQtU9ou9HxvFVjLFuuw==", "dev": true, "requires": { "chokidar": ">=2.0.0 <4.0.0" @@ -9475,6 +9489,8 @@ }, "sass-loader": { "version": "8.0.2", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-8.0.2.tgz", + "integrity": "sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ==", "dev": true, "requires": { "clone-deep": "^4.0.1", @@ -11078,10 +11094,14 @@ "dev": true }, "vue": { - "version": "2.6.11" + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz", + "integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==" }, "vue-cli-plugin-vuetify": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.0.5.tgz", + "integrity": "sha512-jtxcidjLT5f1H9QLYKLFjo/ZG42ud4pI9bK3WNO5DXyhiMDMTwSZ7b3NcJVRH7tKYbv5/ty0VPdDGlf4w22AMA==", "dev": true, "requires": { "semver": "^7.1.2", @@ -11127,6 +11147,14 @@ "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", "dev": true }, + "vue-json-editor": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vue-json-editor/-/vue-json-editor-1.4.0.tgz", + "integrity": "sha512-HejLwRk4TYpjehvEWVPpiwg+Wmh2E7XAtiT43PVKElTSaqdyytuyTNrzgJ1xRFhGCnYwyh1xyGsZulcpNF/wwg==", + "requires": { + "vue": "^2.2.6" + } + }, "vue-loader": { "version": "15.9.1", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.1.tgz", @@ -11168,6 +11196,8 @@ }, "vue-template-compiler": { "version": "2.6.11", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz", + "integrity": "sha512-KIq15bvQDrcCjpGjrAhx4mUlyyHfdmTaoNfeoATHLAiWB+MU3cx4lOzMwrnUh9cCxy0Lt1T11hAFY6TQgroUAA==", "dev": true, "requires": { "de-indent": "^1.0.2", @@ -11181,10 +11211,14 @@ "dev": true }, "vuetify": { - "version": "2.2.21" + "version": "2.2.21", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.2.21.tgz", + "integrity": "sha512-xUgU7Cxpm6qZd1xY3I0NsJbdEErSPgb1iT4qeGOLD8uTGyXXc3IwYEpXqb2nH577RdeT0cTNpzM/NyNf2Fmpvw==" }, "vuetify-loader": { "version": "1.4.3", + "resolved": "https://registry.npmjs.org/vuetify-loader/-/vuetify-loader-1.4.3.tgz", + "integrity": "sha512-fS0wRil682Ebsj2as+eruBoMPKaQYDhu/fDAndnTItzSY4RK4LOEIsssVL4vD6QY8dvUgoGL84SUQ6vGr777CA==", "dev": true, "requires": { "loader-utils": "^1.2.0" @@ -11848,4 +11882,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/dash/package.json b/src/dash/package.json index 92045ebc8..65eaf2c7b 100644 --- a/src/dash/package.json +++ b/src/dash/package.json @@ -12,6 +12,7 @@ "axios": "^0.19.2", "core-js": "^3.6.4", "vue": "^2.6.11", + "vue-json-editor": "^1.4.0", "vue-router": "^3.1.6", "vuetify": "^2.2.11", "vuex": "^3.1.3" diff --git a/src/dash/src/components/Dash.vue b/src/dash/src/components/Dash.vue index 41cf06494..e19991860 100644 --- a/src/dash/src/components/Dash.vue +++ b/src/dash/src/components/Dash.vue @@ -123,8 +123,9 @@ export default { this.$store.commit("saveToLocalStorage", this.dashId); this.$store.commit("initWidgets", result.data.widgetsData); this.initialized = true; + } else { + this.startWizard(); } - this.startWizard(); }, () => { this.startWizard(); diff --git a/src/dash/src/components/DashEditor.vue b/src/dash/src/components/DashEditor.vue new file mode 100644 index 000000000..bb83a0e72 --- /dev/null +++ b/src/dash/src/components/DashEditor.vue @@ -0,0 +1,102 @@ + + + \ No newline at end of file diff --git a/src/dash/src/components/DashPreferences.vue b/src/dash/src/components/DashPreferences.vue index f758d5607..ef62567d7 100644 --- a/src/dash/src/components/DashPreferences.vue +++ b/src/dash/src/components/DashPreferences.vue @@ -21,12 +21,17 @@ Fenêtre de configuration du dash - + mdi-plusNouveau - + + + mdi-plusEditeur avancé + + + mdi-deleteSupprimer diff --git a/src/dash/src/components/GridDash.vue b/src/dash/src/components/GridDash.vue index f1485a5a4..aa246cf63 100644 --- a/src/dash/src/components/GridDash.vue +++ b/src/dash/src/components/GridDash.vue @@ -29,7 +29,6 @@ export default { computed: { gridData: { get() { - console.log(this.value); return this.value; }, set(newValue) { diff --git a/src/dash/src/libs/Communication.js b/src/dash/src/libs/Communication.js index 8fe751c82..500daaf63 100644 --- a/src/dash/src/libs/Communication.js +++ b/src/dash/src/libs/Communication.js @@ -22,9 +22,9 @@ export default { callbackFunc(response.data); }) .catch(error => { + console.log(error); if (error.response !== undefined && error.response.status === 403) { localStorage.removeItem("token"); - // this.router.push("/login"); } else { if (errorCallbackFunc !== undefined) { errorCallbackFunc(error.response); diff --git a/src/dash/src/router.js b/src/dash/src/router.js index 8063f0af5..b92ca37ad 100644 --- a/src/dash/src/router.js +++ b/src/dash/src/router.js @@ -1,6 +1,7 @@ import Vue from "vue"; import Router from "vue-router"; import Dash from "@/components/Dash" +import DashEditor from "@/components/DashEditor" Vue.use(Router); @@ -11,6 +12,12 @@ export default new Router({ name: "dash", component: Dash, props: true + }, + { + path: "/editor/:dashId(\\d+)", + name: "dash-editor", + component: DashEditor, + props: true } ] }); diff --git a/src/dash/yarn.lock b/src/dash/yarn.lock index c7b094186..790922328 100644 --- a/src/dash/yarn.lock +++ b/src/dash/yarn.lock @@ -8054,6 +8054,13 @@ vue-hot-reload-api@^2.3.0: resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz#532955cc1eb208a3d990b3a9f9a70574657e08f2" integrity sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog== +vue-json-editor@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/vue-json-editor/-/vue-json-editor-1.4.0.tgz#becc398f9f101d3775afea7e0dae2fd00dd0d2fd" + integrity sha512-HejLwRk4TYpjehvEWVPpiwg+Wmh2E7XAtiT43PVKElTSaqdyytuyTNrzgJ1xRFhGCnYwyh1xyGsZulcpNF/wwg== + dependencies: + vue "^2.2.6" + vue-loader@^15.9.1: version "15.9.1" resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.9.1.tgz#bd2ab8f3d281e51d7b81d15390a58424d142243e" @@ -8091,7 +8098,7 @@ vue-template-es2015-compiler@^1.9.0: resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825" integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== -vue@^2.6.11: +vue@^2.2.6, vue@^2.6.11: version "2.6.11" resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5" integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==