feat: add redis gateway protection and task recovery

This commit is contained in:
wlx committed 2026-09-08 18:02:45 +08:00
1 parent cbc7317aa8
commit 473479fc4c
17 files changed
+272 -10

No files matched your search

+12
View File
@@ -200,6 +200,18 @@ class HttpCatalogClient {
return payload.task
}
async listTasks(apiKey: string, limit = 50) {
const payload = await this.request<{ tasks: AsyncTaskResult[] }>(`/v1/tasks?limit=${Math.max(1, Math.min(limit, 100))}`, {
headers: { Authorization: `Bearer ${apiKey}` },
})
return payload.tasks
}
async listSessionTasks(limit = 50) {
const payload = await this.request<{ tasks: AsyncTaskResult[] }>(`/api/tasks?limit=${Math.max(1, Math.min(limit, 100))}`)
return payload.tasks
}
async listAdminModels() {
return this.request<{ models: CatalogModel[] }>('/api/admin/models')
}
+6
View File
@@ -97,6 +97,12 @@ onMounted(async () => {
overview.value = overviewResult
overviewLoaded.value = true
catalogConnected.value = true
try {
const sessionTasks = await catalogClient.listSessionTasks()
tasks.value = sessionTasks.map((task) => mapAsyncTask(task, catalogModels.value.find((model) => model.id === task.model) || emptyModel))
} catch {
// The Java task recovery endpoint is optional while older control-plane nodes are being migrated.
}
} catch {
catalogModels.value = []
keys.value = []