From 52075a0acda4947ca394f8f0154dce286986132a Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 13:41:21 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=205f-iii=20=E2=80=94=20?= =?UTF-8?q?inbound=20add/edit=20modal=20+=20delete/clone/reset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires up the inbound CRUD flows. The protocol-specific and transport- specific forms are still ahead in 5f-iii-b — for now the modal exposes those as JSON textareas so users can both edit existing inbounds without losing settings and create new ones from default templates. - InboundFormModal.vue: tabbed modal with a full Basics tab (enable, remark, protocol, listen, port, total GB, traffic reset, expiry date) and three JSON-edit tabs (Settings, Stream, Sniffing). Add mode stamps a fresh template per protocol via Inbound.Settings.getSettings(protocol); changing the protocol in add mode restamps the JSON. Edit mode pretty-prints the existing JSON so the user sees the same fields they save back. - POST /panel/api/inbounds/add or /panel/api/inbounds/update/:id on submit; on success the parent refreshes the list and the modal closes. Malformed JSON in any of the three textareas surfaces a message.error and aborts the save without losing user input. - InboundsPage.vue: wires the row action menu to real handlers — edit (opens the modal in edit mode), delete, reset-traffic, clone, reset-clients, del-depleted-clients all go through Modal.confirm and refresh on success. General actions menu wires reset-inbounds / reset-clients / del-depleted-clients the same way. Remaining actions (qrcode/info/import/export/copyClients) still toast as "coming soon" — those land in 5f-iv and 5f-v. - Adds dayjs ^1.11.20 dep for the a-date-picker v-model interop. Co-Authored-By: Claude Opus 4.7 --- frontend/package-lock.json | 1 + frontend/package.json | 1 + .../src/pages/inbounds/InboundFormModal.vue | 326 ++++++++++++++++++ frontend/src/pages/inbounds/InboundsPage.vue | 170 ++++++++- 4 files changed, 488 insertions(+), 10 deletions(-) create mode 100644 frontend/src/pages/inbounds/InboundFormModal.vue diff --git a/frontend/package-lock.json b/frontend/package-lock.json index a019bb0e..66d89ca4 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -11,6 +11,7 @@ "@ant-design/icons-vue": "^7.0.1", "ant-design-vue": "^4.2.6", "axios": "^1.7.9", + "dayjs": "^1.11.20", "moment": "^2.30.1", "otpauth": "^9.5.1", "qrious": "^4.0.2", diff --git a/frontend/package.json b/frontend/package.json index 147cdd22..c59727f5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "@ant-design/icons-vue": "^7.0.1", "ant-design-vue": "^4.2.6", "axios": "^1.7.9", + "dayjs": "^1.11.20", "moment": "^2.30.1", "otpauth": "^9.5.1", "qrious": "^4.0.2", diff --git a/frontend/src/pages/inbounds/InboundFormModal.vue b/frontend/src/pages/inbounds/InboundFormModal.vue new file mode 100644 index 00000000..0535720c --- /dev/null +++ b/frontend/src/pages/inbounds/InboundFormModal.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/frontend/src/pages/inbounds/InboundsPage.vue b/frontend/src/pages/inbounds/InboundsPage.vue index 57ba0740..f33a1b7a 100644 --- a/frontend/src/pages/inbounds/InboundsPage.vue +++ b/frontend/src/pages/inbounds/InboundsPage.vue @@ -1,6 +1,6 @@ @@ -145,6 +288,13 @@ function onRowAction({ key }) { + +