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": "Auth",
"hysteriaAuth": "Hysteria Auth",
"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": {