Пожалуйста, используйте с осторожностью.
+ +آیا مطمئن هستید که میخواهید احراز هویت را غیر فعال کنید?
+این ویژگی برای کسانی است که لایه امنیتی شخص ثالث دیگر بر روی این آدرس فعال کردهاند، مانند Cloudflare Access.
+لطفا از این امکان با دقت استفاده کنید.
+ +Сигурни ли сте, че желаете да изключите удостоверяването?
Използва се в случаите, когато има настроен алтернативен метод за удостоверяване преди Uptime Kuma, например Cloudflare Access.
@@ -350,8 +356,9 @@ import TwoFADialog from "../components/TwoFADialog.vue"; dayjs.extend(utc); dayjs.extend(timezone); -import { timezoneList } from "../util-frontend"; +import { timezoneList, setPageLocale } from "../util-frontend"; import { useToast } from "vue-toastification"; + const toast = useToast(); export default { @@ -387,6 +394,7 @@ export default { "$i18n.locale"() { localStorage.locale = this.$i18n.locale; + setPageLocale() }, }, diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 4f00e08f3..7050313e6 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -197,7 +197,7 @@ diff --git a/src/util-frontend.js b/src/util-frontend.js index a393ff5ca..0b33bfd39 100644 --- a/src/util-frontend.js +++ b/src/util-frontend.js @@ -2,6 +2,7 @@ import dayjs from "dayjs"; import timezone from "dayjs/plugin/timezone"; import utc from "dayjs/plugin/utc"; import timezones from "timezones-list"; +import { localeDirection, currentLocale } from "./i18n"; dayjs.extend(utc); dayjs.extend(timezone); @@ -48,3 +49,9 @@ export function timezoneList() { return result; } + +export function setPageLocale() { + const html = document.documentElement + html.setAttribute('lang', currentLocale() ) + html.setAttribute('dir', localeDirection() ) + } \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 58580547c..6be31f5e8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,6 +2,9 @@ import legacy from "@vitejs/plugin-legacy" import vue from "@vitejs/plugin-vue" import { defineConfig } from "vite" +const postCssScss = require("postcss-scss") +const postcssRTLCSS = require('postcss-rtlcss'); + // https://vitejs.dev/config/ export default defineConfig({ plugins: [ @@ -10,5 +13,12 @@ export default defineConfig({ targets: ["ie > 11"], additionalLegacyPolyfills: ["regenerator-runtime/runtime"] }) - ] + ], + css: { + postcss: { + "parser": postCssScss, + "map": false, + "plugins": [postcssRTLCSS] + } + }, })