From f63ec0db18b709d14fe0eda29aa40bb8f31df5d1 Mon Sep 17 00:00:00 2001 From: admin8800 Date: Sun, 10 May 2026 16:12:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=BB=98=E8=AE=A4=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=92=8C=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 ++-- frontend/index.html | 2 +- frontend/src/locales/index.ts | 84 ++++++++++++++++----------------- frontend/src/plugins/vuetify.ts | 4 +- frontend/src/views/Login.vue | 3 +- frontend/src/views/Settings.vue | 2 +- service/setting.go | 2 +- 7 files changed, 52 insertions(+), 54 deletions(-) diff --git a/Dockerfile b/Dockerfile index e084dfc..ef50641 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,11 +38,10 @@ RUN if [ "$TARGETARCH" = "arm" ]; then export GOARM=7; [ "$TARGETVARIANT" = "v6" -tags "with_quic,with_grpc,with_utls,with_acme,with_gvisor,with_naive_outbound,with_purego,with_tailscale" \ -o sui main.go -FROM alpine -LABEL org.opencontainers.image.authors="alireza7@gmail.com" -ENV TZ=Asia/Tehran -WORKDIR /app +FROM alpine +ENV TZ=Asia/Shanghai +WORKDIR /app RUN set -ex && apk add --no-cache --upgrade bash tzdata ca-certificates nftables COPY --from=backend-builder /app/sui /app/libcronet.so /app/ COPY entrypoint.sh /app/ -ENTRYPOINT [ "./entrypoint.sh" ] \ No newline at end of file +ENTRYPOINT [ "./entrypoint.sh" ] diff --git a/frontend/index.html b/frontend/index.html index 1326d57..d7479f1 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,5 +1,5 @@ - + diff --git a/frontend/src/locales/index.ts b/frontend/src/locales/index.ts index 9005f59..9f805e0 100644 --- a/frontend/src/locales/index.ts +++ b/frontend/src/locales/index.ts @@ -1,42 +1,42 @@ -import { createI18n } from 'vue-i18n' -import en from './en' -import fa from './fa' -import vi from './vi' -import zhcn from './zhcn' -import zhtw from './zhtw' -import ru from './ru' - -export const i18n = createI18n({ - legacy: false, - locale: localStorage.getItem("locale") ?? 'en', - fallbackLocale: 'en', - messages: { - en: en, - fa: fa, - vi: vi, - zhHans: zhcn, - zhHant: zhtw, - ru: ru - }, -}) - -export const locale = (() => { - const l = i18n.global.locale.value - switch (l) { - case "zhHans": - return "zh-cn" - case "zhHant": - return "zh-tw" - default: - return l - } -})() - -export const languages = [ - { title: 'English', value: 'en' }, - { title: 'فارسی', value: 'fa' }, - { title: 'Tiếng Việt', value: 'vi' }, - { title: '简体中文', value: 'zhHans' }, - { title: '繁體中文', value: 'zhHant' }, - { title: 'Русский', value: 'ru' }, -] +import { createI18n } from 'vue-i18n' +import en from './en' +import fa from './fa' +import vi from './vi' +import zhcn from './zhcn' +import zhtw from './zhtw' +import ru from './ru' + +export const i18n = createI18n({ + legacy: false, + locale: localStorage.getItem("locale") ?? 'zhHans', + fallbackLocale: 'zhHans', + messages: { + en: en, + fa: fa, + vi: vi, + zhHans: zhcn, + zhHant: zhtw, + ru: ru + }, +}) + +export const locale = (() => { + const l = i18n.global.locale.value + switch (l) { + case "zhHans": + return "zh-cn" + case "zhHant": + return "zh-tw" + default: + return l + } +})() + +export const languages = [ + { title: 'English', value: 'en' }, + { title: 'فارسی', value: 'fa' }, + { title: 'Tiếng Việt', value: 'vi' }, + { title: '简体中文', value: 'zhHans' }, + { title: '繁體中文', value: 'zhHant' }, + { title: 'Русский', value: 'ru' }, +] diff --git a/frontend/src/plugins/vuetify.ts b/frontend/src/plugins/vuetify.ts index fdcde87..022b266 100644 --- a/frontend/src/plugins/vuetify.ts +++ b/frontend/src/plugins/vuetify.ts @@ -49,8 +49,8 @@ export default createVuetify({ }, }, locale: { - locale: localStorage.getItem("locale") ?? 'en', - fallback: 'en', + locale: localStorage.getItem("locale") ?? 'zhHans', + fallback: 'zhHans', messages: { en, fa, vi, zhHans, zhHant, ru }, }, }) diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue index b488d95..da8259b 100644 --- a/frontend/src/views/Login.vue +++ b/frontend/src/views/Login.vue @@ -96,7 +96,7 @@ const login = async () => { } } const changeLocale = (l: any) => { - locale.current.value = l ?? 'en' + locale.current.value = l ?? 'zhHans' localStorage.setItem('locale', locale.current.value) } const changeTheme = (th: string) => { @@ -108,4 +108,3 @@ const isActiveTheme = (th: string) => { return current == th } - \ No newline at end of file diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue index aa3b989..3d2dba6 100644 --- a/frontend/src/views/Settings.vue +++ b/frontend/src/views/Settings.vue @@ -162,7 +162,7 @@ const settings = ref({ webURI: "", sessionMaxAge: "0", trafficAge: "30", - timeLocation: "Asia/Tehran", + timeLocation: "Asia/Shanghai", subListen: "", subPort: "2096", subPath: "/sub/", diff --git a/service/setting.go b/service/setting.go index 8ff111c..0a54a06 100644 --- a/service/setting.go +++ b/service/setting.go @@ -52,7 +52,7 @@ var defaultValueMap = map[string]string{ "webURI": "", "sessionMaxAge": "0", "trafficAge": "30", - "timeLocation": "Asia/Tehran", + "timeLocation": "Asia/Shanghai", "subListen": "", "subPort": "2096", "subPath": "/sub/",