Add read-only support and UI indicators for MikroTik dynamic peers (#733)
Docker / Build and Push (push) Canceled after 0s
github-pages / deploy (push) Canceled after 0s
Test / make test (push) Canceled after 0s
Docker / release (push) Canceled after 0s

* Add dynamic Mikrotik peer support & UI/i18n

Introduce handling for dynamically created Mikrotik peers: add Dynamic/IsDynamic fields to domain, peer and interface models and API models; include "dynamic" in Mikrotik queries; skip updates/deletes for dynamic peers; sync dynamic flag when restoring state. Prevent modifying/deleting dynamic peers in manager. UI: disable selection/edit for dynamic peers and show badge. Implement Mikrotik interface hook execution. Add i18n keys/translations for dynamic-peer messages across languages.

* Fix Mikrotik hooks implementation and UI visibility
This commit is contained in:
Ondřej Zmatlík
2026-08-27 09:47:23 +02:00
committed by GitHub
parent 4a9bcd1b82
commit 87aef1c8ff
25 changed files with 1121 additions and 990 deletions
@@ -72,6 +72,14 @@ const isBackendValid = computed(() => {
return valid
})
const isHookSupported = computed(() => {
if (!formData.value.Backend) return false;
let availableBackends = settings.Setting('AvailableBackends') || [];
let backend = availableBackends.find(b => b.Id === formData.value.Backend);
if (!backend) return false;
return backend.Type === 'local' || backend.Type === 'mikrotik';
})
// functions
watch(() => props.visible, async (newValue, oldValue) => {
@@ -499,7 +507,7 @@ async function del() {
</div>
</div>
</fieldset>
<fieldset v-if="formData.Backend==='local'">
<fieldset v-if="isHookSupported">
<legend class="mt-4">{{ $t('modals.interface-edit.header-hooks') }}</legend>
<div class="form-group">
<label class="form-label mt-4">{{ $t('modals.interface-edit.pre-up.label') }}</label>
+4 -2
View File
@@ -138,7 +138,9 @@
"peer-expiring": "Peer läuft ab am",
"peer-connected": "Verbunden",
"peer-not-connected": "Nicht verbunden",
"peer-handshake": "Letzter Handshake:"
"peer-handshake": "Letzter Handshake:",
"peer-dynamic": "Dynamischer Peer",
"peer-dynamic-no-edit": "Dieser Peer wurde dynamisch erstellt und kann nicht bearbeitet oder gelöscht werden."
},
"users": {
"headline": "Benutzerverwaltung",
@@ -648,4 +650,4 @@
}
}
}
}
}
+4 -2
View File
@@ -138,7 +138,9 @@
"peer-expiring": "Peer is expiring at",
"peer-connected": "Connected",
"peer-not-connected": "Not Connected",
"peer-handshake": "Last handshake:"
"peer-handshake": "Last handshake:",
"peer-dynamic": "Dynamic Peer",
"peer-dynamic-no-edit": "This peer is dynamically created and cannot be edited or deleted."
},
"users": {
"headline": "User Administration",
@@ -648,4 +650,4 @@
}
}
}
}
}
+4 -2
View File
@@ -153,7 +153,9 @@
"peer-expiring": "El peer expira en",
"peer-connected": "Conectado",
"peer-not-connected": "No conectado",
"peer-handshake": "Último handshake:"
"peer-handshake": "Último handshake:",
"peer-dynamic": "Peer dinámico",
"peer-dynamic-no-edit": "Este peer se ha creado de forma dinámica y no se puede editar ni eliminar."
},
"users": {
"headline": "Administración de usuarios",
@@ -636,4 +638,4 @@
}
}
}
}
}
+4 -2
View File
@@ -126,7 +126,9 @@
"peer-expiring": "Le pair expire le",
"peer-connected": "Connecté",
"peer-not-connected": "Non connecté",
"peer-handshake": "Dernière négociation :"
"peer-handshake": "Dernière négociation :",
"peer-dynamic": "Peer dynamique",
"peer-dynamic-no-edit": "Ce peer est créé dynamiquement et ne peut être ni modifié ni supprimé."
},
"users": {
"headline": "Administration des utilisateurs",
@@ -514,4 +516,4 @@
}
}
}
}
}
+4 -2
View File
@@ -138,7 +138,9 @@
"peer-expiring": "ピアの有効期限:",
"peer-connected": "接続中",
"peer-not-connected": "未接続",
"peer-handshake": "最終ハンドシェイク:"
"peer-handshake": "最終ハンドシェイク:",
"peer-dynamic": "動的ピア",
"peer-dynamic-no-edit": "このピアは動的に作成されており、編集または削除することはできません。"
},
"users": {
"headline": "ユーザー管理",
@@ -648,4 +650,4 @@
}
}
}
}
}
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -128,7 +128,9 @@
"peer-expiring": "Peer expira em",
"peer-connected": "Conectado",
"peer-not-connected": "Não Conectado",
"peer-handshake": "Último handshake:"
"peer-handshake": "Último handshake:",
"peer-dynamic": "Peer Dinâmico",
"peer-dynamic-no-edit": "Este peer é criado dinamicamente e não pode ser editado ou excluído."
},
"users": {
"headline": "Administração de Utilizadores",
@@ -553,4 +555,4 @@
}
}
}
}
}
+4 -2
View File
@@ -134,7 +134,9 @@
"peer-expiring": "Пир истекает в",
"peer-connected": "Подключено",
"peer-not-connected": "Не подключено",
"peer-handshake": "Последнее рукопожатие:"
"peer-handshake": "Последнее рукопожатие:",
"peer-dynamic": "Динамический пир",
"peer-dynamic-no-edit": "Этот пир создан динамически и не может быть изменен или удален."
},
"users": {
"headline": "Администрирование пользователей",
@@ -628,4 +630,4 @@
}
}
}
}
}
+4 -2
View File
@@ -126,7 +126,9 @@
"peer-expiring": "Пір припиняє дію о",
"peer-connected": "Підключено",
"peer-not-connected": "Не підключено",
"peer-handshake": "Останнє рукостискання:"
"peer-handshake": "Останнє рукостискання:",
"peer-dynamic": "Динамічний пір",
"peer-dynamic-no-edit": "Цей пір створено динамічно і його не можна редагувати або видаляти."
},
"users": {
"headline": "Адміністрування користувачів",
@@ -514,4 +516,4 @@
}
}
}
}
}
+4 -2
View File
@@ -125,7 +125,9 @@
"peer-expiring": "Peer sẽ hết hạn vào",
"peer-connected": "Đã kết nối",
"peer-not-connected": "Chưa kết nối",
"peer-handshake": "Lần bắt tay cuối cùng:"
"peer-handshake": "Lần bắt tay cuối cùng:",
"peer-dynamic": "Peer động",
"peer-dynamic-no-edit": "Peer này được tạo động và không thể chỉnh sửa hoặc xóa."
},
"users": {
"headline": "Quản trị Người dùng",
@@ -492,4 +494,4 @@
}
}
}
}
}
+458 -457
View File
@@ -1,496 +1,497 @@
{
"languages": {
"zh": "中文"
"languages": {
"zh": "中文"
},
"general": {
"pagination": {
"size": "每页显示数量",
"all": "全部 (较慢)"
},
"general": {
"pagination": {
"size": "每页显示数量",
"all": "全部 (较慢)"
},
"search": {
"placeholder": "搜索...",
"button": "搜索"
},
"select-all": "全选",
"yes": "是",
"no": "否",
"cancel": "取消",
"close": "关闭",
"save": "保存",
"delete": "删除"
"search": {
"placeholder": "搜索...",
"button": "搜索"
},
"login": {
"headline": "请登录",
"username": {
"label": "用户名",
"placeholder": "请输入用户名"
"select-all": "全选",
"yes": "",
"no": "否",
"cancel": "取消",
"close": "关闭",
"save": "保存",
"delete": "删除"
},
"login": {
"headline": "请登录",
"username": {
"label": "用户名",
"placeholder": "请输入用户名"
},
"password": {
"label": "密码",
"placeholder": "请输入密码"
},
"button": "登录"
},
"menu": {
"home": "首页",
"interfaces": "接口",
"users": "用户",
"lang": "切换语言",
"profile": "个人资料",
"login": "登录",
"logout": "注销"
},
"home": {
"headline": "WireGuard® VPN Portal",
"info-headline": "更多信息",
"abstract": "WireGuard® 是一种极其简单但又快速现代的 VPN,采用先进的加密技术。它旨在比 IPsec 更快、更简单、更轻量、更实用,同时避免了大量的麻烦。它的性能显著优于 OpenVPN。",
"installation": {
"box-header": "WireGuard 安装",
"headline": "安装",
"content": "客户端软件的安装说明可在官方 WireGuard 网站上找到。",
"button": "打开说明"
},
"about-wg": {
"box-header": "关于 WireGuard",
"headline": "关于",
"content": "WireGuard® 是一种极其简单但又快速现代的 VPN,采用先进的加密技术。",
"button": "更多"
},
"about-portal": {
"box-header": "关于 WireGuard Portal",
"headline": "WireGuard Portal",
"content": "WireGuard Portal 是一个简单的基于网页的 WireGuard 配置平台。",
"button": "更多"
},
"profiles": {
"headline": "VPN 配置文件",
"abstract": "您可以通过您的用户个人资料访问并下载个人 VPN 配置。",
"content": "要查找您所有的配置文件,请点击下面的按钮。",
"button": "打开我的个人资料"
},
"admin": {
"headline": "后台管理",
"abstract": "在后台管理,您可以管理 WireGuard 节点和服务器接口,以及允许登录 WireGuard Portal 的用户。",
"content": "",
"button-admin": "打开服务器管理",
"button-user": "打开用户管理"
}
},
"interfaces": {
"headline": "接口管理",
"headline-peers": "当前 VPN 节点",
"headline-endpoints": "当前节点",
"no-interface": {
"default-selection": "没有可用接口",
"headline": "未找到接口...",
"abstract": "点击上面的加号按钮以创建新的 WireGuard 接口。"
},
"no-peer": {
"headline": "没有可用节点",
"abstract": "当前没有可用的节点与所选的 WireGuard 接口关联。"
},
"table-heading": {
"name": "名称",
"user": "用户",
"ip": "IP 地址",
"endpoint": "节点",
"status": "状态"
},
"interface": {
"headline": "接口状态",
"backend": "后端",
"key": "公钥",
"endpoint": "公开节点",
"port": "监听端口",
"peers": "启用节点",
"total-peers": "节点总数",
"endpoints": "启用节点",
"total-endpoints": "节点总数",
"ip": "IP 地址",
"default-allowed-ip": "默认允许的 IP",
"dns": "DNS 服务器",
"mtu": "MTU",
"default-keep-alive": "默认心跳包间隔",
"button-show-config": "显示配置",
"button-download-config": "下载配置",
"button-store-config": "为 wg-quick 保存配置",
"button-edit": "编辑接口"
},
"button-add-interface": "添加接口",
"button-add-peer": "添加节点",
"button-add-peers": "添加多个节点",
"button-show-peer": "显示节点",
"button-edit-peer": "编辑节点",
"peer-disabled": "节点已禁用,原因: ",
"peer-expiring": "节点将在以下时间过期: ",
"peer-connected": "已连接",
"peer-not-connected": "未连接",
"peer-handshake": "最后一次握手: ",
"peer-dynamic": "动态对等节点",
"peer-dynamic-no-edit": "此对等节点是动态创建的,无法编辑或删除。"
},
"users": {
"headline": "用户管理",
"table-heading": {
"id": "ID",
"email": "电子邮件",
"firstname": "名",
"lastname": "姓",
"sources": "来源",
"peers": "节点",
"admin": "管理员"
},
"no-user": {
"headline": "没有可用用户",
"abstract": "当前没有用户注册 WireGuard 门户。"
},
"button-add-user": "添加用户",
"button-show-user": "显示用户",
"button-edit-user": "编辑用户",
"user-disabled": "用户已禁用, 原因: ",
"user-locked": "账户已锁定, 原因: ",
"admin": "用户具有管理员权限",
"no-admin": "用户没有管理员权限"
},
"profile": {
"headline": "我的 VPN 节点列表",
"table-heading": {
"name": "名称",
"ip": "IP 地址",
"stats": "状态",
"interface": "服务器接口"
},
"no-peer": {
"headline": "没有可用节点",
"abstract": "当前没有与您的用户个人资料关联的节点。"
},
"peer-connected": "已连接",
"button-add-peer": "添加节点",
"button-show-peer": "显示节点",
"button-edit-peer": "编辑节点"
},
"modals": {
"user-view": {
"headline": "用户账户: ",
"tab-user": "信息",
"tab-peers": "节点",
"headline-info": "用户信息: ",
"headline-notes": "备注: ",
"email": "电子邮件",
"firstname": "名",
"lastname": "姓",
"phone": "电话号码",
"department": "部门",
"disabled": "账户已禁用",
"locked": "账户已锁定",
"no-peers": "用户没有关联的节点。",
"peers": {
"name": "名称",
"interface": "接口",
"ip": "IP 地址"
}
},
"user-edit": {
"headline-edit": "编辑用户: ",
"headline-new": "新用户",
"header-general": "常规",
"header-personal": "用户信息",
"header-notes": "备注",
"header-state": "状态",
"identifier": {
"label": "标识符",
"placeholder": "唯一用户标识符"
},
"source": {
"label": "来源",
"placeholder": "用户来源"
},
"password": {
"label": "密码",
"placeholder": "请输入密码"
"placeholder": "一个复杂的密码",
"description": "留空保持当前密码不变。"
},
"button": "登录"
},
"menu": {
"home": "首页",
"interfaces": "接口",
"users": "用户",
"lang": "切换语言",
"profile": "个人资料",
"login": "登录",
"logout": "注销"
},
"home": {
"headline": "WireGuard® VPN Portal",
"info-headline": "更多信息",
"abstract": "WireGuard® 是一种极其简单但又快速现代的 VPN,采用先进的加密技术。它旨在比 IPsec 更快、更简单、更轻量、更实用,同时避免了大量的麻烦。它的性能显著优于 OpenVPN。",
"installation": {
"box-header": "WireGuard 安装",
"headline": "安装",
"content": "客户端软件的安装说明可在官方 WireGuard 网站上找到。",
"button": "打开说明"
"email": {
"label": "电子邮件",
"placeholder": "电子邮件地址"
},
"about-wg": {
"box-header": "关于 WireGuard",
"headline": "关于",
"content": "WireGuard® 是一种极其简单但又快速现代的 VPN,采用先进的加密技术。",
"button": "更多"
"phone": {
"label": "电话",
"placeholder": "电话号码"
},
"about-portal": {
"box-header": "关于 WireGuard Portal",
"headline": "WireGuard Portal",
"content": "WireGuard Portal 是一个简单的基于网页的 WireGuard 配置平台。",
"button": "更多"
"department": {
"label": "部门",
"placeholder": "部门"
},
"profiles": {
"headline": "VPN 配置文件",
"abstract": "您可以通过您的用户个人资料访问并下载个人 VPN 配置。",
"content": "要查找您所有的配置文件,请点击下面的按钮。",
"button": "打开我的个人资料"
"firstname": {
"label": "名",
"placeholder": "名"
},
"lastname": {
"label": "姓",
"placeholder": "姓"
},
"notes": {
"label": "备注",
"placeholder": ""
},
"disabled": {
"label": "禁用 (无法连接 WireGuard 和登录)"
},
"locked": {
"label": "锁定 (无法登录,但 WireGuard 仍然可以连接)"
},
"admin": {
"headline": "后台管理",
"abstract": "在后台管理,您可以管理 WireGuard 节点和服务器接口,以及允许登录 WireGuard Portal 的用户。",
"content": "",
"button-admin": "打开服务器管理",
"button-user": "打开用户管理"
"label": "管理"
}
},
"interfaces": {
"headline": "接口管理",
"headline-peers": "当前 VPN 节点",
"headline-endpoints": "当前节点",
"no-interface": {
"default-selection": "没有可用接口",
"headline": "未找到接口...",
"abstract": "点击上面的加号按钮以创建新的 WireGuard 接口。"
},
"no-peer": {
"headline": "没有可用节点",
"abstract": "当前没有可用的节点与所选的 WireGuard 接口关联。"
},
"table-heading": {
"name": "名称",
"user": "用户",
"ip": "IP 地址",
"endpoint": "节点",
"status": "状态"
},
"interface": {
"headline": "接口状态",
"backend": "后端",
"key": "公钥",
"endpoint": "公开节点",
"port": "监听端口",
"peers": "启用节点",
"total-peers": "节点总数",
"endpoints": "启用节点",
"total-endpoints": "节点总数",
"ip": "IP 地址",
"default-allowed-ip": "默认允许的 IP",
"dns": "DNS 服务器",
"mtu": "MTU",
"default-keep-alive": "默认心跳包间隔",
"button-show-config": "显示配置",
"button-download-config": "下载配置",
"button-store-config": "为 wg-quick 保存配置",
"button-edit": "编辑接口"
},
"button-add-interface": "添加接口",
"button-add-peer": "添加节点",
"button-add-peers": "添加多个节点",
"button-show-peer": "显示节点",
"button-edit-peer": "编辑节点",
"peer-disabled": "节点已禁用,原因: ",
"peer-expiring": "节点将在以下时间过期: ",
"peer-connected": "已连接",
"peer-not-connected": "未连接",
"peer-handshake": "最后一次握手: "
"confirm-delete": "确定要删除用户“{id}”吗?",
"interface-view": {
"headline": "接口配置: "
},
"users": {
"headline": "用户管理",
"table-heading": {
"id": "ID",
"email": "电子邮件",
"firstname": "",
"lastname": "",
"sources": "来源",
"peers": "节点",
"admin": "管理员"
"interface-edit": {
"headline-edit": "编辑接口: ",
"headline-new": "新接口",
"tab-interface": "接口",
"tab-peerdef": "节点默认值",
"header-general": "常规",
"header-network": "网络",
"header-crypto": "加密",
"header-hooks": "接口 Hooks",
"header-peer-hooks": "Hooks",
"header-state": "状态",
"identifier": {
"label": "标识符",
"placeholder": "唯一接口标识符"
},
"no-user": {
"headline": "没有可用用户",
"abstract": "当前没有用户注册 WireGuard 门户。"
"mode": {
"label": "接口模式",
"server": "服务器模式",
"client": "客户端模式",
"any": "未知模式"
},
"button-add-user": "添加用户",
"button-show-user": "显示用户",
"button-edit-user": "编辑用户",
"user-disabled": "用户已禁用, 原因: ",
"user-locked": "账户已锁定, 原因: ",
"admin": "用户具有管理员权限",
"no-admin": "用户没有管理员权限"
},
"profile": {
"headline": "我的 VPN 节点列表",
"table-heading": {
"name": "名称",
"ip": "IP 地址",
"stats": "状态",
"interface": "服务器接口"
"display-name": {
"label": "显示名称",
"placeholder": "接口的描述性名称"
},
"no-peer": {
"headline": "没有可用节点",
"abstract": "当前没有与您的用户个人资料关联的节点。"
"private-key": {
"label": "私钥",
"placeholder": "私钥"
},
"peer-connected": "已连接",
"button-add-peer": "添加节点",
"button-show-peer": "显示节点",
"button-edit-peer": "编辑节点"
},
"modals": {
"user-view": {
"headline": "用户账户: ",
"tab-user": "信息",
"tab-peers": "节点",
"headline-info": "用户信息: ",
"headline-notes": "备注: ",
"email": "电子邮件",
"firstname": "名",
"lastname": "姓",
"phone": "电话号码",
"department": "部门",
"disabled": "账户已禁用",
"locked": "账户已锁定",
"no-peers": "用户没有关联的节点。",
"peers": {
"name": "名称",
"interface": "接口",
"ip": "IP 地址"
}
"public-key": {
"label": "公钥",
"placeholder": "公钥"
},
"user-edit": {
"headline-edit": "编辑用户: ",
"headline-new": "新用户",
"header-general": "常规",
"header-personal": "用户信息",
"header-notes": "备注",
"header-state": "状态",
"identifier": {
"label": "标识符",
"placeholder": "唯一用户标识符"
},
"source": {
"label": "来源",
"placeholder": "用户来源"
},
"password": {
"label": "密码",
"placeholder": "一个复杂的密码",
"description": "留空保持当前密码不变。"
},
"email": {
"label": "电子邮件",
"placeholder": "电子邮件地址"
},
"phone": {
"label": "电话",
"placeholder": "电话号码"
},
"department": {
"label": "部门",
"placeholder": "部门"
},
"firstname": {
"label": "名",
"placeholder": "名"
},
"lastname": {
"label": "姓",
"placeholder": "姓"
},
"notes": {
"label": "备注",
"placeholder": ""
},
"disabled": {
"label": "禁用 (无法连接 WireGuard 和登录)"
},
"locked": {
"label": "锁定 (无法登录,但 WireGuard 仍然可以连接)"
},
"admin": {
"label": "管理员"
}
"ip": {
"label": "IP 地址",
"placeholder": "IP 地址 (CIDR 格式)"
},
"confirm-delete": "确定要删除用户“{id}”吗?",
"interface-view": {
"headline": "接口配置: "
"listen-port": {
"label": "监听端口",
"placeholder": "监听端口"
},
"interface-edit": {
"headline-edit": "编辑接口: ",
"headline-new": "新接口",
"tab-interface": "接口",
"tab-peerdef": "节点默认值",
"header-general": "常规",
"header-network": "网络",
"header-crypto": "加密",
"header-hooks": "接口 Hooks",
"header-peer-hooks": "Hooks",
"header-state": "状态",
"identifier": {
"label": "标识符",
"placeholder": "唯一接口标识符"
},
"mode": {
"label": "接口模式",
"server": "服务器模式",
"client": "客户端模式",
"any": "未知模式"
},
"display-name": {
"label": "显示名称",
"placeholder": "接口的描述性名称"
},
"private-key": {
"label": "私钥",
"placeholder": "私钥"
},
"public-key": {
"label": "公钥",
"placeholder": "公钥"
},
"ip": {
"label": "IP 地址",
"placeholder": "IP 地址 (CIDR 格式)"
},
"listen-port": {
"label": "监听端口",
"placeholder": "监听端口"
},
"dns": {
"label": "DNS 服务器",
"placeholder": "应使用的 DNS 服务器"
},
"dns-search": {
"label": "DNS 搜索域",
"placeholder": "DNS 搜索前缀"
},
"mtu": {
"label": "MTU",
"placeholder": "接口 MTU (0 = 保持默认)"
},
"firewall-mark": {
"label": "防火墙掩码",
"placeholder": "应用于出站流量的防火墙掩码 (0 = 自动)"
},
"routing-table": {
"label": "路由表",
"placeholder": "路由表 ID",
"description": "特殊情况: off = 不管理路由, 0 = 自动"
},
"pre-up": {
"label": "启动前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-up": {
"label": "启动后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"pre-down": {
"label": "停止前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-down": {
"label": "停止后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"disabled": {
"label": "接口已禁用"
},
"save-config": {
"label": "自动保存 wg-quick 配置"
},
"defaults": {
"endpoint": {
"label": "服务器地址",
"placeholder": "服务器地址",
"description": "节点将连接到服务器的地址。"
},
"networks": {
"label": "IP 地址",
"placeholder": "IP 地址",
"description": "节点将从这些子网获取 IP 地址。"
},
"allowed-ip": {
"label": "允许的 IP 地址",
"placeholder": "默认允许的 IP 地址"
},
"mtu": {
"label": "MTU",
"placeholder": "客户端 MTU (0 = 保持默认)"
},
"keep-alive": {
"label": "心跳包间隔",
"placeholder": "持久保持连接 (0 = 默认)"
}
},
"button-apply-defaults": "应用节点默认值",
"button-create-default-peers": "创建默认节点",
"confirm-delete": "确定要删除接口“{id}”吗?"
"dns": {
"label": "DNS 服务器",
"placeholder": "应使用的 DNS 服务器"
},
"peer-view": {
"headline-peer": "节点: ",
"headline-endpoint": "节点: ",
"section-info": "节点信息",
"section-status": "当前状态",
"section-config": "配置",
"identifier": "标识符",
"ip": "IP 地址",
"user": "关联用户",
"notes": "备注",
"expiry-status": "过期时间",
"disabled-status": "禁用时间",
"traffic": "流量",
"connection-status": "连接状态",
"upload": "上传字节 (服务器到节点)",
"download": "下载字节 (节点到服务器)",
"pingable": "连通状态",
"handshake": "最后握手",
"connected-since": "首次成功连接",
"endpoint": "节点地址",
"button-download": "下载配置",
"button-email": "通过电子邮件发送配置"
"dns-search": {
"label": "DNS 搜索域",
"placeholder": "DNS 搜索前缀"
},
"peer-edit": {
"headline-edit-peer": "编辑节点: ",
"headline-edit-endpoint": "编辑节点: ",
"headline-new-peer": "创建节点",
"headline-new-endpoint": "创建节点",
"header-general": "常规",
"header-network": "网络",
"header-crypto": "加密",
"header-hooks": "Hooks (在节点执行)",
"header-state": "状态",
"display-name": {
"label": "显示名称",
"placeholder": "节点的描述性名称"
},
"linked-user": {
"label": "关联用户",
"placeholder": "拥有此节点的用户账户"
},
"private-key": {
"label": "私钥",
"placeholder": "私钥"
},
"public-key": {
"label": "公钥",
"placeholder": "公钥"
},
"preshared-key": {
"label": "预共享密钥",
"placeholder": "可选的预共享密钥"
},
"endpoint-public-key": {
"label": "节点公钥",
"placeholder": "远程节点的公钥"
},
"mtu": {
"label": "MTU",
"placeholder": "接口 MTU (0 = 保持默认)"
},
"firewall-mark": {
"label": "防火墙掩码",
"placeholder": "应用于出站流量的防火墙掩码 (0 = 自动)"
},
"routing-table": {
"label": "路由表",
"placeholder": "路由表 ID",
"description": "特殊情况: off = 不管理路由, 0 = 自动"
},
"pre-up": {
"label": "启动前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-up": {
"label": "启动后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"pre-down": {
"label": "停止前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-down": {
"label": "停止后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"disabled": {
"label": "接口已禁用"
},
"save-config": {
"label": "自动保存 wg-quick 配置"
},
"defaults": {
"endpoint": {
"label": "节点地址",
"placeholder": "远程节点的地址"
"label": "服务器地址",
"placeholder": "服务器地址",
"description": "节点将连接到服务器的地址。"
},
"ip": {
"networks": {
"label": "IP 地址",
"placeholder": "IP 地址(CIDR 格式)"
"placeholder": "IP 地址",
"description": "节点将从这些子网获取 IP 地址。"
},
"allowed-ip": {
"label": "允许的 IP 地址",
"placeholder": "允许的 IP 地址(CIDR 格式)"
},
"extra-allowed-ip": {
"label": "额外允许的 IP 地址",
"placeholder": "额外允许的 IP 地址(服务器端)",
"description": "这些 IP 将作为允许的 IP 添加到远程 WireGuard 接口。"
},
"dns": {
"label": "DNS 服务器",
"placeholder": "要使用的 DNS 服务器"
},
"dns-search": {
"label": "DNS 搜索域",
"placeholder": "DNS 搜索前缀"
},
"keep-alive": {
"label": "心跳包间隔",
"placeholder": "持久保持连接 (0 = 默认)"
"placeholder": "默认允许的 IP 地址"
},
"mtu": {
"label": "MTU",
"placeholder": "客户端 MTU (0 = 保持默认)"
},
"pre-up": {
"label": "启动前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-up": {
"label": "启动后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"pre-down": {
"label": "停止前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-down": {
"label": "停止后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"disabled": {
"label": "节点已禁用"
},
"ignore-global": {
"label": "忽略全局设置"
},
"expires-at": {
"label": "过期日期"
},
"confirm-delete": "确定要删除对等点“{id}”吗?"
},
"peer-multi-create": {
"headline-peer": "创建多个节点",
"headline-endpoint": "创建多个节点",
"identifiers": {
"label": "用户标识符",
"placeholder": "用户标识符",
"description": "要为其创建节点 的用户标识符(用户名)。"
},
"prefix": {
"headline-peer": "节点: ",
"headline-endpoint": "节点: ",
"label": "显示名称前缀",
"placeholder": "前缀",
"description": "添加到节点 显示名称的前缀。"
"keep-alive": {
"label": "心跳包间隔",
"placeholder": "持久保持连接 (0 = 默认)"
}
},
"button-apply-defaults": "应用节点默认值",
"button-create-default-peers": "创建默认节点",
"confirm-delete": "确定要删除接口“{id}”吗?"
},
"peer-view": {
"headline-peer": "节点: ",
"headline-endpoint": "节点: ",
"section-info": "节点信息",
"section-status": "当前状态",
"section-config": "配置",
"identifier": "标识符",
"ip": "IP 地址",
"user": "关联用户",
"notes": "备注",
"expiry-status": "过期时间",
"disabled-status": "禁用时间",
"traffic": "流量",
"connection-status": "连接状态",
"upload": "上传字节 (服务器到节点)",
"download": "下载字节 (节点到服务器)",
"pingable": "连通状态",
"handshake": "最后握手",
"connected-since": "首次成功连接",
"endpoint": "节点地址",
"button-download": "下载配置",
"button-email": "通过电子邮件发送配置"
},
"peer-edit": {
"headline-edit-peer": "编辑节点: ",
"headline-edit-endpoint": "编辑节点: ",
"headline-new-peer": "创建节点",
"headline-new-endpoint": "创建节点",
"header-general": "常规",
"header-network": "网络",
"header-crypto": "加密",
"header-hooks": "Hooks (在节点执行)",
"header-state": "状态",
"display-name": {
"label": "显示名称",
"placeholder": "节点的描述性名称"
},
"linked-user": {
"label": "关联用户",
"placeholder": "拥有此节点的用户账户"
},
"private-key": {
"label": "私钥",
"placeholder": "私钥"
},
"public-key": {
"label": "公钥",
"placeholder": "公钥"
},
"preshared-key": {
"label": "预共享密钥",
"placeholder": "可选的预共享密钥"
},
"endpoint-public-key": {
"label": "节点公钥",
"placeholder": "远程节点的公钥"
},
"endpoint": {
"label": "节点地址",
"placeholder": "远程节点的地址"
},
"ip": {
"label": "IP 地址",
"placeholder": "IP 地址(CIDR 格式)"
},
"allowed-ip": {
"label": "允许的 IP 地址",
"placeholder": "允许的 IP 地址(CIDR 格式)"
},
"extra-allowed-ip": {
"label": "额外允许的 IP 地址",
"placeholder": "额外允许的 IP 地址(服务器端)",
"description": "这些 IP 将作为允许的 IP 添加到远程 WireGuard 接口。"
},
"dns": {
"label": "DNS 服务器",
"placeholder": "要使用的 DNS 服务器"
},
"dns-search": {
"label": "DNS 搜索域",
"placeholder": "DNS 搜索前缀"
},
"keep-alive": {
"label": "心跳包间隔",
"placeholder": "持久保持连接 (0 = 默认)"
},
"mtu": {
"label": "MTU",
"placeholder": "客户端 MTU (0 = 保持默认)"
},
"pre-up": {
"label": "启动前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-up": {
"label": "启动后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"pre-down": {
"label": "停止前脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"post-down": {
"label": "停止后脚本",
"placeholder": "一个或多个用分号分隔的 bash 命令"
},
"disabled": {
"label": "节点已禁用"
},
"ignore-global": {
"label": "忽略全局设置"
},
"expires-at": {
"label": "过期日期"
},
"confirm-delete": "确定要删除对等点“{id}”吗?"
},
"peer-multi-create": {
"headline-peer": "创建多个节点",
"headline-endpoint": "创建多个节点",
"identifiers": {
"label": "用户标识符",
"placeholder": "用户标识符",
"description": "要为其创建节点 的用户标识符(用户名)。"
},
"prefix": {
"headline-peer": "节点: ",
"headline-endpoint": "节点: ",
"label": "显示名称前缀",
"placeholder": "前缀",
"description": "添加到节点 显示名称的前缀。"
}
}
}
}
+16 -4
View File
@@ -151,7 +151,9 @@ async function bulkDisable() {
function toggleSelectAll() {
peers.FilteredAndPaged.forEach(peer => {
peer.IsSelected = selectAll.value;
if (!peer.IsDynamic) {
peer.IsSelected = selectAll.value;
}
});
}
@@ -444,13 +446,17 @@ onMounted(async () => {
<tbody>
<tr v-for="peer in peers.FilteredAndPaged" :key="peer.Identifier">
<th scope="row">
<input class="form-check-input" type="checkbox" v-model="peer.IsSelected">
<input class="form-check-input" type="checkbox" v-model="peer.IsSelected" :disabled="peer.IsDynamic" :title="peer.IsDynamic ? $t('interfaces.peer-dynamic-no-edit') : ''">
</th>
<td class="text-center">
<span v-if="peer.Disabled" class="text-danger" :title="$t('interfaces.peer-disabled') + ' ' + peer.DisabledReason"><i class="fa fa-circle-xmark"></i></span>
<span v-if="!peer.Disabled && peer.ExpiresAt" class="text-warning" :title="$t('interfaces.peer-expiring') + ' ' + peer.ExpiresAt"><i class="fas fa-hourglass-end expiring-peer"></i></span>
</td>
<td><span v-if="peer.DisplayName" :title="peer.Identifier">{{peer.DisplayName}}</span><span v-else :title="peer.Identifier">{{ $filters.truncate(peer.Identifier, 10)}}</span></td>
<td>
<span v-if="peer.DisplayName" :title="peer.Identifier">{{peer.DisplayName}}</span>
<span v-else :title="peer.Identifier">{{ $filters.truncate(peer.Identifier, 10)}}</span>
<span v-if="peer.IsDynamic" class="badge bg-info-subtle text-info-emphasis ms-1 border border-info-subtle" :title="$t('interfaces.peer-dynamic')"><i class="fa-solid fa-robot me-1"></i>{{ $t('interfaces.peer-dynamic') }}</span>
</td>
<td><span :title="peer.UserDisplayName">{{peer.UserIdentifier}}</span></td>
<td>
<span v-for="ip in peer.Addresses" :key="ip" class="badge bg-light me-1">{{ ip }}</span>
@@ -474,7 +480,13 @@ onMounted(async () => {
</td>
<td class="text-center">
<a href="#" :title="$t('interfaces.button-show-peer')" @click.prevent="viewedPeerId=peer.Identifier"><i class="fas fa-eye me-2"></i></a>
<a href="#" :title="$t('interfaces.button-edit-peer')" @click.prevent="editPeerId=peer.Identifier"><i class="fas fa-cog"></i></a>
<span v-if="peer.IsDynamic" :title="$t('interfaces.peer-dynamic-no-edit')" class="text-muted" style="cursor: not-allowed;">
<i class="fas fa-cog"></i>
</span>
<a v-else href="#" :title="$t('interfaces.button-edit-peer')" @click.prevent="editPeerId=peer.Identifier">
<i class="fas fa-cog"></i>
</a>
</td>
</tr>
</tbody>