From 36dcc782ceb588b154ced7b1edb39912db4e65dd Mon Sep 17 00:00:00 2001 From: Kadxy <2230318258@qq.com> Date: Fri, 27 Sep 2024 03:29:34 +0800 Subject: [PATCH] kling --- app/pages/Kling.tsx | 120 +++++++++++++++++++++++------------ app/providers/kling/index.ts | 1 + 2 files changed, 82 insertions(+), 39 deletions(-) diff --git a/app/pages/Kling.tsx b/app/pages/Kling.tsx index 56385f7..ab9f011 100644 --- a/app/pages/Kling.tsx +++ b/app/pages/Kling.tsx @@ -13,10 +13,11 @@ import { } from "@ant-design/pro-components"; import { COL_SCROLL_STYLE, PRO_FORM_PROPS, SEGMENTED_PROPS } from "@/constant"; import { useAppConfig } from "@/app/store"; -import { Alert, Col, Divider, App, Segmented, Descriptions, Button, Space } from "antd"; +import { Alert, Col, Divider, App, Segmented, Descriptions, Button, Space, Popconfirm } from "antd"; import { Kling, KlingApiTypes, KlingTask } from "@/app/providers/kling"; import { renderCode, RenderSubmitter } from "../render"; import { beforeUpload, safeJsonStringify } from "../utils"; +import { ascetic } from "react-syntax-highlighter/dist/esm/styles/hljs"; const MODE_OPTIONS = [ { label: "Std-标准模式(高性能)", value: "std" }, @@ -688,7 +689,42 @@ const KlingPage = () => { copyable: true, }, { - title: "请求信息", + title: "任务状态", + dataIndex: ["latest_task_info", "task_status"], + valueEnum: { + processing: { text: "Processing", status: "Processing" }, + submitted: { text: "Submitted", status: "Processing" }, + succeed: { text: "Succeed", status: "Success" }, + failed: { text: "Failed", status: "Error" }, + }, + }, + { + title: "创建时间", + dataIndex: ["latest_task_info", "created_at"], + valueType: "dateTime", + }, + { + title: "更新时间", + dataIndex: ["latest_task_info", "updated_at"], + valueType: "dateTime", + }, + { + title: "视频预览", + render: (_, record) => { + if (record?.latest_task_info?.task_result?.videos?.[0]?.url) { + return ( +