feat: pending identity sorting, face detail modal, video player fps, processor counts

This commit is contained in:
2026-06-24 02:02:33 +08:00
parent 7855983dc1
commit f915aaf794
9 changed files with 1479 additions and 324 deletions

View File

@@ -110,7 +110,9 @@ function buildHttpRequest(cmd: string, args: Record<string, any>): { url: string
return { url: `/api/v1/identity/${a.uuid}/faces?page_size=${a.perPage || 100}`, method: 'GET' }
}
case 'get_traces': {
return { url: `/api/v1/identity/${a.uuid}/traces?page_size=${a.perPage || 50}`, method: 'GET' }
let url = `/api/v1/identity/${a.uuid}/traces?page_size=${a.perPage || 50}`
if (a.page) url += `&page=${a.page}`
return { url, method: 'GET' }
}
case 'get_face_candidates': {
return { url: `/api/v1/faces/candidates?page=${a.page || 1}&page_size=${a.perPage || 100}`, method: 'GET' }
@@ -179,6 +181,11 @@ function buildHttpRequest(cmd: string, args: Record<string, any>): { url: string
case 'delete_identity': {
return { url: `/api/v1/identity/${a.uuid}`, method: 'DELETE' }
}
case 'create_identity_from_face': {
const body: any = { name: a.name }
if (a.traceIds) body.trace_ids = a.traceIds
return { url: `/api/v1/file/${a.fileUuid}/pending-person`, method: 'POST', body }
}
// --- Identity Operations ---
case 'merge_identities': {
@@ -264,11 +271,23 @@ function buildHttpRequest(cmd: string, args: Record<string, any>): { url: string
if (a.deleteOutputFiles != null) body.delete_output_files = a.deleteOutputFiles
return { url: '/api/v1/unregister', method: 'POST', body }
}
case 'ingest_file': {
return { url: `/api/v1/file/${a.fileUuid}/checkin`, method: 'POST' }
}
case 'checkout_file': {
return { url: `/api/v1/file/${a.fileUuid}/checkout`, method: 'POST' }
}
// --- File Detail ---
case 'get_file_info': {
return { url: `/api/v1/file/${a.uuid}`, method: 'GET' }
}
case 'get_processor_counts': {
return { url: `/api/v1/file/${a.uuid}/processor-counts`, method: 'GET' }
}
case 'get_progress': {
return { url: `/api/v1/progress/${a.fileUuid}`, method: 'POST', body: {} }
}
// --- Search History ---
case 'get_search_history': {
@@ -320,6 +339,8 @@ export function transformResponse(cmd: string, data: any): any {
modified_time: f.modified_time || '',
isRegistered: f.is_registered ?? false,
status: f.status || '',
registrationTime: f.registration_time || null,
ingested: f.ingested ?? (f.status === 'completed'),
}))
}
case 'get_people': {
@@ -345,17 +366,21 @@ export function transformResponse(cmd: string, data: any): any {
}))
}
case 'get_traces': {
const traces = data.traces || data.data || data || []
return traces.map((t: any) => ({
trace_id: t.trace_id,
file_uuid: t.file_uuid || '',
frame_count: t.frame_count || 0,
first_frame: t.first_frame || 0,
last_frame: t.last_frame || 0,
first_sec: t.first_sec || 0,
last_sec: t.last_sec || 0,
avg_confidence: t.avg_confidence || 0,
}))
const traces = data.traces || data.data || []
return {
total: data.total || traces.length || 0,
traces: traces.map((t: any) => ({
trace_id: t.trace_id,
file_uuid: t.file_uuid || '',
frame_count: t.frame_count || 0,
first_frame: t.first_frame || 0,
last_frame: t.last_frame || 0,
first_sec: t.first_sec || 0,
last_sec: t.last_sec || 0,
avg_confidence: t.avg_confidence || 0,
face_id: t.face_id ?? null,
})),
}
}
case 'get_face_candidates': {
const candidates = data.candidates || data.data || data || []
@@ -411,7 +436,9 @@ export function transformResponse(cmd: string, data: any): any {
message: data.message ?? '',
}
}
case 'unregister_file': {
case 'unregister_file':
case 'ingest_file':
case 'checkout_file': {
return {
success: data.success ?? false,
file_uuid: data.file_uuid ?? '',
@@ -440,6 +467,14 @@ export function transformResponse(cmd: string, data: any): any {
case 'merge_redo':
case 'merge_history':
return data
case 'create_identity_from_face': {
const respData = data.data || data
return {
success: data.success ?? false,
identity_uuid: respData.identity_uuid ?? respData.uuid ?? '',
name: respData.name ?? '',
}
}
default:
return data
}