feat: add labels ui page

This commit is contained in:
allanice001
2025-11-03 12:23:20 +00:00
parent 9d60b6cbfe
commit ee824a9c5a
30 changed files with 360 additions and 2005 deletions

29
ui/src/api/labels.ts Normal file
View File

@@ -0,0 +1,29 @@
import { withRefresh } from "@/api/with-refresh.ts"
import type { DtoCreateLabelRequest, DtoUpdateLabelRequest } from "@/sdk"
import { makeLabelsApi } from "@/sdkClient.ts"
const labels = makeLabelsApi()
export const labelsApi = {
listLabels: () =>
withRefresh(async () => {
return await labels.listLabels()
}),
createLabel: (body: DtoCreateLabelRequest) =>
withRefresh(async () => {
return await labels.createLabel({ body })
}),
getLabel: (id: string) =>
withRefresh(async () => {
return await labels.getLabel({ id })
}),
deleteLabel: (id: string) =>
withRefresh(async () => {
await labels.deleteLabel({ id })
}),
updateLabel: (id: string, body: DtoUpdateLabelRequest) =>
withRefresh(async () => {
return await labels.updateLabel({ id, body })
}),
}

View File

@@ -12,6 +12,10 @@ export const taintsApi = {
withRefresh(async () => {
return await taints.createTaint({ body })
}),
getTaint: (id: string) =>
withRefresh(async () => {
return await taints.getTaint({ id })
}),
deleteTaint: (id: string) =>
withRefresh(async () => {
await taints.deleteTaint({ id })