feat(clients): orphan cleanup + export/import via CodeMirror modals

Add three client-management actions to the Clients page More menu:

- Delete unattached clients: removes every client with no inbound
  attachment, cascading its traffic rows, IP log, and external links
  (POST /clients/delOrphans).
- Export clients: shows the {client, inboundIds} list in a read-only
  CodeMirror viewer with copy/download (GET /clients/export returns the
  array in the standard envelope).
- Import clients: pastes that JSON into an editable CodeMirror editor,
  mirroring Import an Inbound (POST /clients/import takes a { data }
  body). Attached clients go through the create-and-attach path; items
  with no inboundIds are restored as bare records; existing emails are
  never overwritten and are reported as skipped.

Document the new endpoints in api-docs and translate the new strings
into all supported languages.
This commit is contained in:
MHSanaei
2026-06-21 23:06:10 +02:00
parent 0483273839
commit 0b0b6250d6
19 changed files with 736 additions and 14 deletions
+10 -1
View File
@@ -828,6 +828,12 @@
"delDepleted": "حذف اتمام‌یافته‌ها",
"delDepletedConfirmTitle": "حذف کلاینت‌های اتمام‌یافته؟",
"delDepletedConfirmContent": "هر کلاینتی که سهمیه ترافیک‌اش تمام شده یا تاریخ انقضایش گذشته است حذف می‌شود. این عمل غیرقابل بازگشت است.",
"exportClients": "خروجی گرفتن از کلاینت‌ها",
"importClients": "ورود کلاینت‌ها",
"import": "ورود",
"delOrphans": "حذف کلاینت‌های بدون اینباند",
"delOrphansConfirmTitle": "حذف کلاینت‌های بدون اینباند؟",
"delOrphansConfirmContent": "هر کلاینتی که به هیچ اینباندی متصل نیست، همراه با رکورد ترافیک‌اش حذف می‌شود. این عمل غیرقابل بازگشت است.",
"auth": "احراز",
"hysteriaAuth": "احراز Hysteria",
"uuid": "UUID",
@@ -850,7 +856,10 @@
"bulkCreatedMixed": "{ok} ساخته شد، {failed} ناموفق",
"bulkAdjusted": "{count} کلاینت تنظیم شد",
"bulkAdjustedMixed": "{ok} تنظیم، {skipped} رد شد",
"delDepleted": "{count} کلاینت اتمام‌یافته حذف شد"
"delDepleted": "{count} کلاینت اتمام‌یافته حذف شد",
"delOrphans": "{count} کلاینت بدون اینباند حذف شد",
"imported": "{count} کلاینت وارد شد",
"importedMixed": "{ok} وارد شد، {failed} رد شد"
}
},
"groups": {