mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
@@ -294,7 +294,7 @@ public interface Constant {
|
|||||||
/**
|
/**
|
||||||
* 版本号
|
* 版本号
|
||||||
*/
|
*/
|
||||||
public static final String VERSION = "0.8.5";
|
public static final String VERSION = "0.8.6";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无效固件URL
|
* 无效固件URL
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
}</route>
|
}</route>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { changeLanguage, getCurrentLanguage, getSupportedLanguages, t } from '@/i18n'
|
||||||
|
import type { Language } from '@/store/lang'
|
||||||
import { clearServerBaseUrlOverride, getEnvBaseUrl, getServerBaseUrlOverride, setServerBaseUrlOverride } from '@/utils'
|
import { clearServerBaseUrlOverride, getEnvBaseUrl, getServerBaseUrlOverride, setServerBaseUrlOverride } from '@/utils'
|
||||||
import { isMp } from '@/utils/platform'
|
import { isMp } from '@/utils/platform'
|
||||||
import { computed, onMounted, reactive, ref } from 'vue'
|
import { computed, onMounted, reactive, ref } from 'vue'
|
||||||
import { useToast } from 'wot-design-uni'
|
import { useToast } from 'wot-design-uni'
|
||||||
import { t, changeLanguage, getSupportedLanguages, getCurrentLanguage } from '@/i18n'
|
|
||||||
import type { Language } from '@/store/lang'
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'SettingsPage',
|
name: 'SettingsPage',
|
||||||
@@ -233,9 +233,9 @@ async function clearCache() {
|
|||||||
function showAbout() {
|
function showAbout() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: t('settings.aboutApp', { appName: import.meta.env.VITE_APP_TITLE }),
|
title: t('settings.aboutApp', { appName: import.meta.env.VITE_APP_TITLE }),
|
||||||
content: t('settings.aboutContent', {
|
content: t('settings.aboutContent', {
|
||||||
appName: import.meta.env.VITE_APP_TITLE,
|
appName: import.meta.env.VITE_APP_TITLE,
|
||||||
version: '0.8.5'
|
version: '0.8.6'
|
||||||
}),
|
}),
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
confirmText: t('common.confirm'),
|
confirmText: t('common.confirm'),
|
||||||
@@ -248,7 +248,7 @@ onMounted(async () => {
|
|||||||
loadServerBaseUrl()
|
loadServerBaseUrl()
|
||||||
}
|
}
|
||||||
getCacheInfo()
|
getCacheInfo()
|
||||||
|
|
||||||
// 动态设置导航栏标题为国际化文本
|
// 动态设置导航栏标题为国际化文本
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: t('settings.title')
|
title: t('settings.title')
|
||||||
@@ -283,9 +283,9 @@ onMounted(async () => {
|
|||||||
<view class="mb-[24rpx]">
|
<view class="mb-[24rpx]">
|
||||||
<view class="w-full rounded-[16rpx] border border-[#eeeeee] bg-[#f5f7fb] overflow-hidden">
|
<view class="w-full rounded-[16rpx] border border-[#eeeeee] bg-[#f5f7fb] overflow-hidden">
|
||||||
<wd-input v-model="baseUrlInput" type="text" clearable :maxlength="200"
|
<wd-input v-model="baseUrlInput" type="text" clearable :maxlength="200"
|
||||||
:placeholder="t('settings.enterServerUrl')"
|
:placeholder="t('settings.enterServerUrl')"
|
||||||
custom-class="!border-none !bg-transparent h-[64rpx] px-[24rpx] items-center"
|
custom-class="!border-none !bg-transparent h-[64rpx] px-[24rpx] items-center"
|
||||||
input-class="text-[28rpx] text-[#232338]" @input="validateUrl" @blur="validateUrl" />
|
input-class="text-[28rpx] text-[#232338]" @input="validateUrl" @blur="validateUrl" />
|
||||||
</view>
|
</view>
|
||||||
<text v-if="urlError" class="mt-[8rpx] block text-[24rpx] text-[#ff4d4f]">
|
<text v-if="urlError" class="mt-[8rpx] block text-[24rpx] text-[#ff4d4f]">
|
||||||
{{ urlError }}
|
{{ urlError }}
|
||||||
@@ -323,11 +323,11 @@ onMounted(async () => {
|
|||||||
class="flex items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]">
|
class="flex items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-[28rpx] text-[#232338] font-medium">
|
<text class="text-[28rpx] text-[#232338] font-medium">
|
||||||
{{ t('settings.totalCacheSize') }}
|
{{ t('settings.totalCacheSize') }}
|
||||||
</text>
|
</text>
|
||||||
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
||||||
{{ t('settings.appDataSize') }}
|
{{ t('settings.appDataSize') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="text-[28rpx] text-[#65686f] font-semibold">
|
<text class="text-[28rpx] text-[#65686f] font-semibold">
|
||||||
{{ cacheInfo.storageSize }}
|
{{ cacheInfo.storageSize }}
|
||||||
@@ -339,11 +339,11 @@ onMounted(async () => {
|
|||||||
class="flex items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx]">
|
class="flex items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx]">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-[28rpx] text-[#232338] font-medium">
|
<text class="text-[28rpx] text-[#232338] font-medium">
|
||||||
{{ t('settings.cacheClear') }}
|
{{ t('settings.cacheClear') }}
|
||||||
</text>
|
</text>
|
||||||
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
||||||
{{ t('settings.clearAllCache') }}
|
{{ t('settings.clearAllCache') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="cursor-pointer rounded-[24rpx] bg-[rgba(255,107,107,0.1)] px-[28rpx] py-[16rpx] text-[24rpx] text-[#ff6b6b] font-semibold transition-all duration-300 active:scale-95 active:bg-[#ff6b6b] active:text-white"
|
class="cursor-pointer rounded-[24rpx] bg-[rgba(255,107,107,0.1)] px-[28rpx] py-[16rpx] text-[24rpx] text-[#ff6b6b] font-semibold transition-all duration-300 active:scale-95 active:bg-[#ff6b6b] active:text-white"
|
||||||
@@ -359,8 +359,8 @@ onMounted(async () => {
|
|||||||
<view class="mb-[32rpx]">
|
<view class="mb-[32rpx]">
|
||||||
<view class="mb-[24rpx] flex items-center">
|
<view class="mb-[24rpx] flex items-center">
|
||||||
<text class="text-[32rpx] text-[#232338] font-bold">
|
<text class="text-[32rpx] text-[#232338] font-bold">
|
||||||
{{ t('settings.appInfo') }}
|
{{ t('settings.appInfo') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="border border-[#eeeeee] rounded-[24rpx] bg-[#fbfbfb] p-[32rpx]"
|
<view class="border border-[#eeeeee] rounded-[24rpx] bg-[#fbfbfb] p-[32rpx]"
|
||||||
@@ -370,11 +370,11 @@ onMounted(async () => {
|
|||||||
@click="showAbout">
|
@click="showAbout">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-[28rpx] text-[#232338] font-medium">
|
<text class="text-[28rpx] text-[#232338] font-medium">
|
||||||
{{ t('settings.aboutUs') }}
|
{{ t('settings.aboutUs') }}
|
||||||
</text>
|
</text>
|
||||||
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
||||||
{{ t('settings.appVersion') }}
|
{{ t('settings.appVersion') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<wd-icon name="arrow-right" custom-class="text-[32rpx] text-[#9d9ea3]" />
|
<wd-icon name="arrow-right" custom-class="text-[32rpx] text-[#9d9ea3]" />
|
||||||
</view>
|
</view>
|
||||||
@@ -385,24 +385,26 @@ onMounted(async () => {
|
|||||||
<view class="mb-[32rpx]">
|
<view class="mb-[32rpx]">
|
||||||
<view class="mb-[24rpx] flex items-center">
|
<view class="mb-[24rpx] flex items-center">
|
||||||
<text class="text-[32rpx] text-[#232338] font-bold">
|
<text class="text-[32rpx] text-[#232338] font-bold">
|
||||||
{{ t('settings.languageSettings') }}
|
{{ t('settings.languageSettings') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="border border-[#eeeeee] rounded-[24rpx] bg-[#fbfbfb] p-[32rpx]"
|
<view class="border border-[#eeeeee] rounded-[24rpx] bg-[#fbfbfb] p-[32rpx]"
|
||||||
style="box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);">
|
style="box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);">
|
||||||
<view class="flex cursor-pointer items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]" @click="showLanguageSheet = true">
|
<view
|
||||||
|
class="flex cursor-pointer items-center justify-between border border-[#eeeeee] rounded-[16rpx] bg-[#f5f7fb] p-[24rpx] transition-all active:bg-[#eef3ff]"
|
||||||
|
@click="showLanguageSheet = true">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-[32rpx] text-[#232338] font-medium">
|
<text class="text-[32rpx] text-[#232338] font-medium">
|
||||||
{{ t('settings.language') }}
|
{{ t('settings.language') }}
|
||||||
</text>
|
</text>
|
||||||
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
<text class="mt-[4rpx] block text-[24rpx] text-[#9d9ea3]">
|
||||||
{{ t('settings.selectLanguage') }}
|
{{ t('settings.selectLanguage') }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<text class="text-[32rpx] text-[#9d9ea3] font-semibold mr-[16rpx]">
|
<text class="text-[32rpx] text-[#9d9ea3] font-semibold mr-[16rpx]">
|
||||||
{{ supportedLanguages.find(lang => lang.code === currentLanguage)?.name }}
|
{{supportedLanguages.find(lang => lang.code === currentLanguage)?.name}}
|
||||||
</text>
|
</text>
|
||||||
<wd-icon name="arrow-right" custom-class="text-[32rpx] text-[#9d9ea3]" />
|
<wd-icon name="arrow-right" custom-class="text-[32rpx] text-[#9d9ea3]" />
|
||||||
</view>
|
</view>
|
||||||
@@ -411,19 +413,11 @@ onMounted(async () => {
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 语言选择弹窗 -->
|
<!-- 语言选择弹窗 -->
|
||||||
<wd-action-sheet
|
<wd-action-sheet v-model="showLanguageSheet" :title="t('settings.selectLanguage')" :close-on-click-modal="true">
|
||||||
v-model="showLanguageSheet"
|
|
||||||
:title="t('settings.selectLanguage')"
|
|
||||||
:close-on-click-modal="true"
|
|
||||||
>
|
|
||||||
<view class="language-sheet">
|
<view class="language-sheet">
|
||||||
<scroll-view scroll-y class="language-list">
|
<scroll-view scroll-y class="language-list">
|
||||||
<view
|
<view v-for="lang in supportedLanguages" :key="lang.code" class="language-item"
|
||||||
v-for="lang in supportedLanguages"
|
@click="handleLanguageChange(lang.code)">
|
||||||
:key="lang.code"
|
|
||||||
class="language-item"
|
|
||||||
@click="handleLanguageChange(lang.code)"
|
|
||||||
>
|
|
||||||
<text class="language-name">
|
<text class="language-name">
|
||||||
{{ lang.name }}
|
{{ lang.name }}
|
||||||
</text>
|
</text>
|
||||||
@@ -446,17 +440,21 @@ onMounted(async () => {
|
|||||||
.language-sheet {
|
.language-sheet {
|
||||||
.language-list {
|
.language-list {
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
|
|
||||||
.language-item {
|
.language-item {
|
||||||
padding: 30rpx 0;
|
padding: 30rpx 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
|
||||||
.language-name {
|
.language-name {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: #f5f7fb;
|
background-color: #f5f7fb;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from config.config_loader import load_config
|
|||||||
from config.settings import check_config_file
|
from config.settings import check_config_file
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
SERVER_VERSION = "0.8.5"
|
SERVER_VERSION = "0.8.6"
|
||||||
_logger_initialized = False
|
_logger_initialized = False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user