From 8fd1dc94bbed47881442f144115d10733fdf4616 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 17 May 2026 08:25:38 +0200 Subject: [PATCH] fix(clients): unbreak template parsing + stale i18n keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InboundFormModal: split the multi-line help string in the PortFallback section onto one line — Vue's template parser was bailing on Unterminated string constant because a single-quoted literal spanned two lines inside a {{ }} interpolation. - ClientInfoModal: t('disable') was missing at the root level, so vue-i18n returned the key path literally. Use t('disabled') which exists. - Linter cleanup elsewhere: pages.client.* references renamed to pages.clients.* to match the merged i18n block; whitespace normalisation in a few unrelated Vue templates. Co-Authored-By: Claude Opus 4.7 --- frontend/src/pages/api-docs/endpoints.js | 6 + .../src/pages/clients/ClientFormModal.vue | 21 ++-- .../src/pages/clients/ClientInfoModal.vue | 9 +- frontend/src/pages/clients/ClientsPage.vue | 115 ++++++++++++++---- frontend/src/pages/clients/useClients.js | 25 ++++ .../src/pages/inbounds/ClientBulkModal.vue | 20 +-- .../src/pages/inbounds/ClientFormModal.vue | 10 +- .../src/pages/inbounds/ClientRowTable.vue | 17 ++- .../src/pages/inbounds/CopyClientsModal.vue | 24 ++-- .../src/pages/inbounds/InboundFormModal.vue | 13 +- frontend/src/pages/inbounds/InboundList.vue | 55 +++++---- frontend/src/pages/xray/BalancerFormModal.vue | 5 +- frontend/src/pages/xray/OutboundFormModal.vue | 5 +- frontend/src/pages/xray/RuleFormModal.vue | 6 +- web/controller/client.go | 13 ++ web/service/client.go | 10 ++ web/translation/en-US.json | 40 +++++- 17 files changed, 268 insertions(+), 126 deletions(-) diff --git a/frontend/src/pages/api-docs/endpoints.js b/frontend/src/pages/api-docs/endpoints.js index 090246ec..0ad13d24 100644 --- a/frontend/src/pages/api-docs/endpoints.js +++ b/frontend/src/pages/api-docs/endpoints.js @@ -591,6 +591,12 @@ export const sections = [ body: '{\n "inboundIds": [5]\n}', response: '{\n "success": true\n}', }, + { + method: 'POST', + path: '/panel/api/clients/resetAllTraffics', + summary: 'Reset the up/down counters for every client globally. Quotas and expiry are not affected. Triggers an Xray restart if any counter actually moved.', + response: '{\n "success": true\n}', + }, ], }, diff --git a/frontend/src/pages/clients/ClientFormModal.vue b/frontend/src/pages/clients/ClientFormModal.vue index 725e3521..d6fa4a59 100644 --- a/frontend/src/pages/clients/ClientFormModal.vue +++ b/frontend/src/pages/clients/ClientFormModal.vue @@ -104,7 +104,7 @@ function regenerateSubId() { async function onSubmit() { if (!form.email || form.email.trim() === '') { - message.error(t('pages.inbounds.client.email') + ' *'); + message.error(t('pages.clients.email') + ' *'); return; } if (!isEdit.value && (!form.inboundIds || form.inboundIds.length === 0)) { @@ -158,12 +158,12 @@ async function onSubmit() { - - + + - + @@ -182,7 +182,7 @@ async function onSubmit() { - + @@ -201,7 +201,7 @@ async function onSubmit() { - + @@ -209,23 +209,22 @@ async function onSubmit() { - + - + - + - + diff --git a/frontend/src/pages/clients/ClientInfoModal.vue b/frontend/src/pages/clients/ClientInfoModal.vue index 5efb5f43..87303053 100644 --- a/frontend/src/pages/clients/ClientInfoModal.vue +++ b/frontend/src/pages/clients/ClientInfoModal.vue @@ -52,8 +52,7 @@ function close() {