From a97cb90c4334ccf10413a928ee28d5877daecd6c Mon Sep 17 00:00:00 2001 From: NanamiAdmin Date: Tue, 5 May 2026 23:42:42 +0800 Subject: [PATCH] feat(settings): add webhook test functionality - Add test button to webhook settings dialog - Implement webhook test API endpoint - Replace alert with notification system - Style test button to match existing UI --- src/api/index.js | 4 +++- src/styles/common.css | 11 ++++++++++ src/views/Settings.vue | 46 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 505bc1f..1d07dcb 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -41,7 +41,9 @@ export const systemApi = { return api.get(url); }, setSettings: (settings) => - api.post('/system/settings/set', settings) + api.post('/system/settings/set', settings), + testWebhook: (webhookConfig) => + api.post('/system/webhook/test', webhookConfig) }; export const authApi = { diff --git a/src/styles/common.css b/src/styles/common.css index 15e76e2..88e6a2e 100644 --- a/src/styles/common.css +++ b/src/styles/common.css @@ -195,6 +195,7 @@ } .cancel-btn, +.test-btn, .submit-btn { font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif; flex: 1; @@ -218,6 +219,16 @@ background: var(--surface-hover); } +.test-btn { + background: var(--surface-hover); + color: var(--text-color); + border: 3px solid var(--border-color); +} + +.test-btn:hover { + background: var(--surface-hover-hover); +} + .submit-btn { background: var(--primary-color); color: white; diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 5d95dad..f6cdd38 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -116,6 +116,7 @@
+
@@ -126,6 +127,7 @@