first
This commit is contained in:
@@ -10,18 +10,24 @@ export const dashboardApi = {
|
||||
|
||||
export const runtimeApi = {
|
||||
status: () => http.get("/runtime/status"),
|
||||
readiness: () => http.get("/runtime/readiness"),
|
||||
preflight: () => http.get("/runtime/preflight"),
|
||||
cluster: () => http.get("/runtime/cluster"),
|
||||
action: (action: string) => http.post(`/runtime/actions/${action}`)
|
||||
};
|
||||
|
||||
export const settingsApi = {
|
||||
getSettings: () => http.get("/settings"),
|
||||
updateSettings: (payload: Record<string, unknown>) => http.put("/settings", payload),
|
||||
getCredentials: () => http.get("/settings/credentials"),
|
||||
updateCredentials: (payload: Record<string, unknown>) => http.put("/settings/credentials", payload),
|
||||
exportSettings: () => http.get("/settings/export"),
|
||||
importSettings: (payload: Record<string, unknown>) => http.post("/settings/import", payload),
|
||||
validateImportSettings: (payload: Record<string, unknown>) => http.post("/settings/validate-import", payload),
|
||||
backupSettings: () => http.post("/settings/backup"),
|
||||
getSettingsBackups: () => http.get("/settings/backups"),
|
||||
getJuziseoStatus: () => http.get("/settings/juziseo/status"),
|
||||
loginJuziseo: (payload: { email: string; password: string }) => http.post("/settings/juziseo/login", payload),
|
||||
backupDownloadUrl: (filename: string) =>
|
||||
`${(import.meta.env.VITE_API_BASE_URL || "http://127.0.0.1:8100/api/v1").replace(/\/api\/v1\/?$/, "")}/api/v1/settings/backups/download/${encodeURIComponent(filename)}`
|
||||
};
|
||||
@@ -30,6 +36,7 @@ export const importsApi = {
|
||||
summary: () => http.get("/imports/summary"),
|
||||
tasks: () => http.get("/imports/tasks"),
|
||||
retry: (taskId: string) => http.post(`/imports/tasks/${taskId}/retry`),
|
||||
createTextTask: (payload: { text: string; filename?: string }) => http.post("/imports/text", payload),
|
||||
upload: (formData: FormData) =>
|
||||
http.post("/imports/upload", formData, {
|
||||
headers: {
|
||||
@@ -40,6 +47,10 @@ export const importsApi = {
|
||||
|
||||
export const detectApi = {
|
||||
status: () => http.get("/detect/status"),
|
||||
activeJob: () => http.get("/detect/job/active"),
|
||||
queueSummary: (params?: Record<string, unknown>) => http.get("/detect/queue-summary", { params }),
|
||||
jobs: (params?: Record<string, unknown>) => http.get("/detect/jobs", { params }),
|
||||
jobDetail: (jobId: number) => http.get(`/detect/jobs/${jobId}`),
|
||||
start: () => http.post("/detect/start"),
|
||||
stop: () => http.post("/detect/stop")
|
||||
};
|
||||
@@ -47,6 +58,7 @@ export const detectApi = {
|
||||
export const domainsApi = {
|
||||
filters: () => http.get("/domains/filters"),
|
||||
list: (params?: Record<string, unknown>) => http.get("/domains", { params }),
|
||||
detail: (domainId: number) => http.get(`/domains/${domainId}`),
|
||||
batchUpdate: (payload: Record<string, unknown>) => http.post("/domains/batch-update", payload)
|
||||
};
|
||||
|
||||
@@ -59,3 +71,26 @@ export const logsApi = {
|
||||
latest: () => http.get("/logs/latest"),
|
||||
bundleUrl: () => `${(import.meta.env.VITE_API_BASE_URL || "http://127.0.0.1:8100/api/v1").replace(/\/api\/v1\/?$/, "")}/api/v1/logs/bundle`
|
||||
};
|
||||
|
||||
export const sensitiveWordsApi = {
|
||||
get: () => http.get("/sensitive-words"),
|
||||
save: (payload: { text: string }) => http.put("/sensitive-words", payload)
|
||||
};
|
||||
|
||||
export const jumingApi = {
|
||||
status: () => http.get("/juming/status"),
|
||||
preferences: () => http.get("/juming/preferences"),
|
||||
updatePreferences: (payload: Record<string, unknown>) => http.put("/juming/preferences", payload),
|
||||
login: (payload: { email: string; password: string }) => http.post("/juming/login", payload),
|
||||
loginJucha: () => http.post("/juming/jucha-login"),
|
||||
crawl: (payload: Record<string, unknown>) => http.post("/juming/crawl", payload),
|
||||
tasks: () => http.get("/juming/tasks"),
|
||||
retryTask: (taskId: string) => http.post(`/juming/tasks/${taskId}/retry`),
|
||||
stopTask: (taskId: string) => http.post(`/juming/tasks/${taskId}/stop`),
|
||||
uploadCookie: (formData: FormData) =>
|
||||
http.post("/juming/cookie/upload", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data"
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user