Ver código fonte

add 排队中 状态

visuddhinanda 11 meses atrás
pai
commit
5163c6cf73

+ 6 - 12
dashboard-v4/dashboard/src/components/task/TaskStatus.tsx

@@ -65,18 +65,12 @@ const TaskStatus = ({ task }: IWidget) => {
           defaultMessage: "unknown",
         })}
       </Tag>
-      {task?.status === "running" ? (
-        progress && progress > 0 ? (
-          <div style={{ display: "inline-block", width: 80 }}>
-            <Tooltip title={`${progress}%`}>
-              <Progress percent={progress} size="small" showInfo={false} />
-            </Tooltip>
-          </div>
-        ) : task?.executor?.roles?.includes("ai") ? (
-          <>任务排队中</>
-        ) : (
-          <></>
-        )
+      {task?.status === "running" && task?.executor?.roles?.includes("ai") ? (
+        <div style={{ display: "inline-block", width: 80 }}>
+          <Tooltip title={`${progress}%`}>
+            <Progress percent={progress} size="small" showInfo={false} />
+          </Tooltip>
+        </div>
       ) : (
         <></>
       )}

+ 1 - 0
dashboard-v4/dashboard/src/locales/en-US/label.ts

@@ -67,6 +67,7 @@ const items = {
   "labels.task.status.closed": "closed",
   "labels.task.status.canceled": "canceled",
   "labels.task.status.expired": "expired",
+  "labels.task.status.queue": "queue",
   "labels.filter": "filter",
   "labels.participants": "participants",
   "labels.task.category": "task category",

+ 1 - 0
dashboard-v4/dashboard/src/locales/zh-Hans/label.ts

@@ -75,6 +75,7 @@ const items = {
   "labels.task.status.closed": "已关闭",
   "labels.task.status.canceled": "已取消",
   "labels.task.status.expired": "已过期",
+  "labels.task.status.queue": "排队中",
   "labels.filter": "过滤器",
   "labels.participants": "参与者",
   "labels.task.category": "任务类型",