t0ng7u
a36ce199ba
✨ feat: implement backend channel duplication & streamline frontend copy flow
Add a dedicated backend endpoint to clone an existing channel (including its key) and
replace all previous front-end cloning logic with a single API call.
Backend
• controller/channel.go
– add CopyChannel: safely clone a channel, reset balance/usage, append name suffix,
preserve key, create abilities, return new ID.
– supports optional query params: `suffix`, `reset_balance`.
• router/api-router.go
– register POST /api/channel/copy/:id (secured by AdminAuth).
• model interaction uses BatchInsertChannels to ensure transactional integrity.
Frontend
• ChannelsTable.js
– simplify copySelectedChannel: call /api/channel/copy/{id} and refresh list.
– remove complex field-manipulation & key-fetching logic.
– improved error handling.
Security & stability
• All cloning done server-side; sensitive key never exposed to client.
• Route inherits existing admin middleware.
• Graceful JSON responses with detailed error messages.
2025-07-14 21:54:53 +08:00
..
2024-12-29 16:50:26 +08:00
2025-07-12 15:14:55 +08:00
2025-07-12 14:20:59 +08:00
2025-07-14 21:54:53 +08:00
2025-06-15 03:12:34 +08:00
2024-11-18 18:52:14 +08:00
2025-06-18 18:00:49 +08:00
2025-03-15 19:10:12 +08:00
2024-11-18 18:52:14 +08:00
2025-04-28 11:25:04 +08:00
2025-06-12 17:25:25 +08:00
2025-06-18 21:23:06 +08:00
2025-07-06 10:23:38 +08:00
2025-03-11 22:00:31 +08:00
2025-06-18 18:00:49 +08:00
2025-07-10 15:02:40 +08:00
2025-06-18 18:00:49 +08:00
2025-06-19 08:57:34 +08:00
2025-06-21 20:24:52 +08:00
2025-06-13 20:51:20 +08:00
2025-07-10 17:49:53 +08:00
2025-06-13 12:28:26 +08:00
2025-07-03 13:10:25 +08:00
2025-06-27 17:08:20 +08:00
2024-09-25 17:15:59 +08:00
2025-06-22 16:35:30 +08:00
2025-06-20 17:48:55 +08:00
2025-06-15 02:54:54 +08:00
2024-01-13 01:32:23 +08:00
2025-07-07 14:26:37 +08:00
2025-02-10 20:52:33 +08:00