feat: admin provider UI (types, hooks, guard, settings panel, conditional admin nav)
This commit is contained in:
@@ -15,6 +15,8 @@ import type {
|
||||
TranscodeSettings,
|
||||
TranscodeStats,
|
||||
ActivityEvent,
|
||||
ProviderConfig,
|
||||
ProviderTestResult,
|
||||
} from "@/lib/types";
|
||||
|
||||
const API_BASE =
|
||||
@@ -179,6 +181,36 @@ export const api = {
|
||||
admin: {
|
||||
activity: (token: string) =>
|
||||
request<ActivityEvent[]>("/admin/activity", { token }),
|
||||
|
||||
providers: {
|
||||
getProviders: (token: string) =>
|
||||
request<ProviderConfig[]>("/admin/providers", { token }),
|
||||
|
||||
updateProvider: (
|
||||
token: string,
|
||||
type: string,
|
||||
payload: { config_json: Record<string, string>; enabled: boolean },
|
||||
) =>
|
||||
request<ProviderConfig>(`/admin/providers/${type}`, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(payload),
|
||||
token,
|
||||
}),
|
||||
|
||||
deleteProvider: (token: string, type: string) =>
|
||||
request<void>(`/admin/providers/${type}`, { method: "DELETE", token }),
|
||||
|
||||
testProvider: (
|
||||
token: string,
|
||||
type: string,
|
||||
payload: { config_json: Record<string, string>; enabled: boolean },
|
||||
) =>
|
||||
request<ProviderTestResult>(`/admin/providers/${type}/test`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
token,
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
||||
schedule: {
|
||||
|
||||
Reference in New Issue
Block a user