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()
@ -2208,4 +2206,4 @@ def startThreads():
if __name__ == "__main__":
startThreads()
app.run(host=app_ip, debug=False, port=app_port)
app.run(host=app_ip, debug=False, port=app_port)

View file

@ -369,8 +369,12 @@ export default {
keys: ["name", "id", "allowed_ip"]
});
const result = this.wireguardConfigurationStore.searchString ?
fuse.search(this.wireguardConfigurationStore.searchString).map(x => x.item) : this.configurationPeers;
const result = this.wireguardConfigurationStore.searchString ?
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,17 +95,18 @@ 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">
</div>
<button
<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": "配置"
}
}
}