From bb183828a189ce5908d21304bbf1592ae074afc5 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Thu, 20 Feb 2020 12:30:16 +0800 Subject: [PATCH] fix: webui works with baseUrl --- komga-webui/package-lock.json | 22 +++++++++++ komga-webui/package.json | 1 + komga-webui/public/index.html | 7 +++- komga-webui/src/functions/urls.ts | 24 +++++++++--- komga-webui/src/main.ts | 7 ++++ komga-webui/src/plugins/http.plugin.ts | 3 +- komga-webui/src/public-path.js | 2 + komga-webui/src/router.ts | 3 +- komga-webui/src/types/urls.ts | 6 +++ komga-webui/vue.config.js | 33 ++++++++++++++++ komga/build.gradle.kts | 1 + .../web/SPAErrorViewResolver.kt | 18 --------- .../web/StaticResourceConfiguration.kt | 38 ++++++++++++++----- .../komga/interfaces/mvc/IndexController.kt | 21 ++++++++++ komga/src/main/resources/application-dev.yml | 4 ++ komga/src/main/resources/application.yml | 3 +- 16 files changed, 156 insertions(+), 37 deletions(-) create mode 100644 komga-webui/src/public-path.js create mode 100644 komga-webui/src/types/urls.ts create mode 100644 komga-webui/vue.config.js delete mode 100644 komga/src/main/kotlin/org/gotson/komga/infrastructure/web/SPAErrorViewResolver.kt create mode 100644 komga/src/main/kotlin/org/gotson/komga/interfaces/mvc/IndexController.kt diff --git a/komga-webui/package-lock.json b/komga-webui/package-lock.json index c24ae64d3..8b7703677 100644 --- a/komga-webui/package-lock.json +++ b/komga-webui/package-lock.json @@ -9272,6 +9272,16 @@ "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=", "dev": true }, + "html-webpack-inject-attributes-plugin": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-webpack-inject-attributes-plugin/-/html-webpack-inject-attributes-plugin-1.0.2.tgz", + "integrity": "sha512-q+SueBjlEkkT9wg8F1uyQjprZRhT5JrEC7paT5oYsCUOOUxwIrk2Wa7VSTKK9DSUila+diHlevSR24s7whYjMA==", + "dev": true, + "requires": { + "lodash.assign": "^4.2.0", + "lodash.foreach": "^4.5.0" + } + }, "html-webpack-plugin": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", @@ -11058,12 +11068,24 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true + }, "lodash.defaultsdeep": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz", "integrity": "sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==", "dev": true }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=", + "dev": true + }, "lodash.kebabcase": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", diff --git a/komga-webui/package.json b/komga-webui/package.json index a96c9f405..2417a36bc 100644 --- a/komga-webui/package.json +++ b/komga-webui/package.json @@ -43,6 +43,7 @@ "babel-eslint": "^10.0.1", "eslint": "^5.16.0", "eslint-plugin-vue": "^5.0.0", + "html-webpack-inject-attributes-plugin": "^1.0.2", "sass": "^1.24.4", "sass-loader": "^8.0.2", "ts-jest": "^23.0.0", diff --git a/komga-webui/public/index.html b/komga-webui/public/index.html index 21de1be26..bf7b78cf6 100644 --- a/komga-webui/public/index.html +++ b/komga-webui/public/index.html @@ -4,8 +4,13 @@ - Komga + +