feat: 支持自定义 webhook 模板,支持发送测试信息 (#551)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2025-12-05 00:21:36 +08:00
committed by GitHub
parent e76673d076
commit 7ef38a38ed
7 changed files with 114 additions and 13 deletions

View File

@@ -229,6 +229,10 @@ class ApiClient {
return this.get<string>(`/video-sources/${type}/default-path`, { name });
}
async testNotifier(notifier: Notifier): Promise<ApiResponse<boolean>> {
return this.post<boolean>('/config/notifiers/ping', notifier);
}
async getConfig(): Promise<ApiResponse<Config>> {
return this.get<Config>('/config');
}
@@ -283,6 +287,7 @@ const api = {
evaluateVideoSourceRules: (type: string, id: number) =>
apiClient.evaluateVideoSourceRules(type, id),
getDefaultPath: (type: string, name: string) => apiClient.getDefaultPath(type, name),
testNotifier: (notifier: Notifier) => apiClient.testNotifier(notifier),
getConfig: () => apiClient.getConfig(),
updateConfig: (config: Config) => apiClient.updateConfig(config),
getDashboard: () => apiClient.getDashboard(),