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
..
2025-06-09 13:43:50 +08:00
2025-07-14 21:54:53 +08:00
2023-04-22 20:39:27 +08:00
2025-04-04 17:37:27 +08:00
2025-07-13 14:00:12 +08:00
2024-12-28 20:43:26 +08:00
2025-06-11 12:38:51 +08:00
2025-05-06 01:36:23 +08:00
2025-05-06 01:36:23 +08:00
2023-04-22 20:39:27 +08:00
2025-06-22 17:52:48 +08:00