From 91ff297fb69ae39e842df2bfa479d4bb22665cef Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Sat, 23 Mar 2024 20:30:56 +0300 Subject: [PATCH] Add i18n. Add lang. Add charts. Add theme switch --- webui/package-lock.json | 77 ++- webui/package.json | 5 +- webui/src/App.vue | 42 +- webui/src/components/ClientCharts.vue | 66 ++- webui/src/components/Header.vue | 46 +- webui/src/components/icons/IconChart.vue | 15 + webui/src/components/icons/IconUITheme.vue | 54 ++ webui/src/main.js | 10 +- webui/src/services/api.js | 22 + webui/src/store/store.js | 40 +- webui/src/utils/chartOptions.js | 36 +- webui/src/utils/i18n.js | 559 +++++++++++++++++++++ webui/tailwind.config.js | 35 +- 13 files changed, 956 insertions(+), 51 deletions(-) create mode 100644 webui/src/components/icons/IconChart.vue create mode 100644 webui/src/components/icons/IconUITheme.vue create mode 100644 webui/src/utils/i18n.js diff --git a/webui/package-lock.json b/webui/package-lock.json index a9211a3a..c6175953 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -8,11 +8,12 @@ "name": "webui", "version": "0.0.0", "dependencies": { - "apexcharts": "^3.45.1", + "apexcharts": "^3.48.0", "crypto-js": "^4.2.0", "pinia": "^2.1.7", "vue": "^3.3.11", - "vue3-apexcharts": "^1.4.4" + "vue-i18n": "^9.10.2", + "vue3-apexcharts": "^1.5.2" }, "devDependencies": { "@typescript-eslint/parser": "^7.3.1", @@ -560,6 +561,47 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, + "node_modules/@intlify/core-base": { + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.10.2.tgz", + "integrity": "sha512-HGStVnKobsJL0DoYIyRCGXBH63DMQqEZxDUGrkNI05FuTcruYUtOAxyL3zoAZu/uDGO6mcUvm3VXBaHG2GdZCg==", + "dependencies": { + "@intlify/message-compiler": "9.10.2", + "@intlify/shared": "9.10.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.10.2.tgz", + "integrity": "sha512-ntY/kfBwQRtX5Zh6wL8cSATujPzWW2ZQd1QwKyWwAy5fMqJyyixHMeovN4fmEyCqSu+hFfYOE63nU94evsy4YA==", + "dependencies": { + "@intlify/shared": "9.10.2", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/shared": { + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.10.2.tgz", + "integrity": "sha512-ttHCAJkRy7R5W2S9RVnN9KYQYPIpV2+GiS79T4EE37nrPyH6/1SrOh3bmdCRC1T3ocL8qCDx7x2lBJ0xaITU7Q==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1159,9 +1201,9 @@ } }, "node_modules/apexcharts": { - "version": "3.45.1", - "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.45.1.tgz", - "integrity": "sha512-pPjj/SA6dfPvR/IKRZF0STdfBGpBh3WRt7K0DFuW9P8erypYkX17EHu3/molPRfo2zSiQwTVpshHC5ncysqfkA==", + "version": "3.48.0", + "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.48.0.tgz", + "integrity": "sha512-Lhpj1Ij6lKlrUke8gf+P+SE6uGUn+Pe1TnCJ+zqrY0YMvbqM3LMb1lY+eybbTczUyk0RmMZomlTa2NgX2EUs4Q==", "dependencies": { "@yr/monotone-cubic-spline": "^1.0.3", "svg.draggable.js": "^2.2.2", @@ -3768,10 +3810,29 @@ "eslint": ">=6.0.0" } }, + "node_modules/vue-i18n": { + "version": "9.10.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.10.2.tgz", + "integrity": "sha512-ECJ8RIFd+3c1d3m1pctQ6ywG5Yj8Efy1oYoAKQ9neRdkLbuKLVeW4gaY5HPkD/9ssf1pOnUrmIFjx2/gkGxmEw==", + "dependencies": { + "@intlify/core-base": "9.10.2", + "@intlify/shared": "9.10.2", + "@vue/devtools-api": "^6.5.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue3-apexcharts": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/vue3-apexcharts/-/vue3-apexcharts-1.4.4.tgz", - "integrity": "sha512-TH89uZrxGjaDvkaYAISvj8+k6Bf1rUKFillc8oJirs5XZEPiwM1ELKZQ786wz0rfPqkSHHny2lqqUCK7Rw+LcQ==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/vue3-apexcharts/-/vue3-apexcharts-1.5.2.tgz", + "integrity": "sha512-rGbgUJDjtsyjfRF0uzwDjzt8+M7ICSRAbm1N9KCDiczW8BSpbEZuaEsJDJYnJuLFIIVXIGilYzIcjNBf6NbeYA==", "peerDependencies": { "apexcharts": "> 3.0.0", "vue": "> 3.0.0" diff --git a/webui/package.json b/webui/package.json index 0e767ac9..ebf6ae5c 100644 --- a/webui/package.json +++ b/webui/package.json @@ -10,11 +10,12 @@ "preview": "vite preview" }, "dependencies": { - "apexcharts": "^3.45.1", + "apexcharts": "^3.48.0", "crypto-js": "^4.2.0", "pinia": "^2.1.7", "vue": "^3.3.11", - "vue3-apexcharts": "^1.4.4" + "vue-i18n": "^9.10.2", + "vue3-apexcharts": "^1.5.2" }, "devDependencies": { "@typescript-eslint/parser": "^7.3.1", diff --git a/webui/src/App.vue b/webui/src/App.vue index 5e9f4cc5..3402b486 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -1,6 +1,6 @@ diff --git a/webui/src/components/ClientCharts.vue b/webui/src/components/ClientCharts.vue index 73bb8c3e..317a1408 100644 --- a/webui/src/components/ClientCharts.vue +++ b/webui/src/components/ClientCharts.vue @@ -1,22 +1,20 @@