Compare commits

...

2 commits

Author SHA1 Message Date
Donald Zou
d458a28337 Started working on localization 😏 2024-09-06 22:38:56 +08:00
Donald Zou
a102a780f8 Adjusted search functions 2024-09-06 17:15:38 +08:00
7 changed files with 40 additions and 12 deletions

View file

@ -1107,7 +1107,8 @@ class DashboardConfig:
"dashboard_refresh_interval": "60000",
"dashboard_sort": "status",
"dashboard_theme": "dark",
"dashboard_api_key": "false"
"dashboard_api_key": "false",
"dashboard_language": "en"
},
"Peers": {
"peer_global_DNS": "1.1.1.1",
@ -2125,13 +2126,10 @@ def API_Welcome_Finish():
"repeatNewPassword": data["repeatNewPassword"],
"currentPassword": "admin"
})
# updateEnableTotp, updateEnableTotpErr = DashboardConfig.SetConfig("Account", "enable_totp", data["enable_totp"])
if not updateUsername or not updatePassword:
return ResponseObject(False, f"{updateUsernameErr},{updatePasswordErr}".strip(","))
DashboardConfig.SetConfig("Other", "welcome_session", False)
return ResponseObject()

View file

@ -370,7 +370,11 @@ export default {
});
const result = this.wireguardConfigurationStore.searchString ?
fuse.search(this.wireguardConfigurationStore.searchString).map(x => x.item) : this.configurationPeers;
this.configurationPeers.filter(x => {
return x.name.includes(this.wireguardConfigurationStore.searchString) ||
x.id.includes(this.wireguardConfigurationStore.searchString) ||
x.allowed_ip.includes(this.wireguardConfigurationStore.searchString)
}) : this.configurationPeers;
if (this.dashboardConfigurationStore.Configuration.Server.dashboard_sort === "restricted"){
return result.slice().sort((a, b) => {

View file

@ -95,9 +95,10 @@ export default {
@click="this.downloadAllPeer()">
<i class="bi bi-download me-2"></i> Download All
</button>
<div class="flex-grow-1 mt-3 mt-md-0">
<div class="mt-3 mt-md-0 flex-grow-1">
<input class="form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100"
placeholder="Search..."
placeholder="Search Peers..."
id="searchPeers"
@keyup="this.debounce()"
v-model="this.searchString">
@ -105,7 +106,7 @@ export default {
<button
@click="this.showDisplaySettings = true"
class="btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm"
type="button" aria-expanded="false">
type="button" aria-expanded="false">
<i class="bi bi-filter-circle me-2"></i>
Display
</button>

View file

@ -28,7 +28,6 @@ const checkAuth = async () => {
const router = createRouter({
history: createWebHashHistory(),
routes: [
{
name: "Index",
path: '/',

View file

@ -0,0 +1,10 @@
[
{
"lang_id": "en",
"lang_name": "English"
},
{
"lang_id": "zh-cn",
"lang_name": "Chinese (Simplified)"
}
]

8
src/static/lang/en.json Normal file
View file

@ -0,0 +1,8 @@
{
"Index": {
"configurationList": {
"mainTitle": "WireGuard Configurations",
"addConfigurationBtn": "Configuration"
}
}
}

View file

@ -0,0 +1,8 @@
{
"Index": {
"configurationList": {
"mainTitle": "WireGuard 配置",
"addConfigurationBtn": "配置"
}
}
}