diff --git a/src/components/service.tsx b/src/components/service.tsx index c2405bc..ac54d9f 100644 --- a/src/components/service.tsx +++ b/src/components/service.tsx @@ -54,6 +54,7 @@ interface ServiceCardProps { const serviceFormSchema = z.object({ cover: z.coerce.number().int().min(0), + display_index: z.coerce.number().int(), duration: z.coerce.number().int().min(30), enable_show_in_service: asOptionalField(z.boolean()), enable_trigger_task: asOptionalField(z.boolean()), @@ -87,6 +88,7 @@ export const ServiceCard: React.FC = ({ data, mutate }) => { : { type: 1, cover: 0, + display_index: 0, name: "", target: "", max_latency: 0.0, @@ -172,6 +174,19 @@ export const ServiceCard: React.FC = ({ data, mutate }) => { )} /> + ( + + {t("Weight")} + + + + + + )} + /> row.id, + accessorFn: (row) => `${row.id}(${row.display_index ?? 0})`, }, { header: t("Name"), diff --git a/src/types/api.ts b/src/types/api.ts index 5bed115..6c2c648 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -577,6 +577,8 @@ export interface ModelServerTaskResponse { export interface ModelService { cover: number created_at: string + /** 展示排序,越大越靠前 */ + display_index: number duration: number enable_show_in_service: boolean enable_trigger_task: boolean @@ -600,6 +602,8 @@ export interface ModelService { export interface ModelServiceForm { cover: number + /** 展示排序,越大越靠前 */ + display_index: number duration: number enable_show_in_service?: boolean enable_trigger_task?: boolean