From 854911f39393feb3f90ae70684227ad15aaf99ee Mon Sep 17 00:00:00 2001 From: yibo Date: Fri, 30 Oct 2026 23:07:49 +0800 Subject: [PATCH] h3-console: 翻页加页码输入跳转和末页按钮;修 comfy_history 路径与后端摘要字段 --- h3-console/frontend/src/api.js | 2 +- h3-console/frontend/src/components/Sidebar.jsx | 36 +++++++++++++++++++++++++++++++----- h3-console/static/index.html | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------- 3 files changed, 96 insertions(+), 65 deletions(-) diff --git a/h3-console/frontend/src/api.js b/h3-console/frontend/src/api.js index 1d75877..6f089b3 100644 --- a/h3-console/frontend/src/api.js +++ b/h3-console/frontend/src/api.js @@ -107,7 +107,7 @@ export async function fetchBackends() { } export async function fetchComfyHistory(id) { - const res = await apiFetch(`/v1/videos/${id}/comfy-history`); + const res = await apiFetch(`/v1/videos/${id}/comfy_history`); if (!res.ok) throw new Error(await res.text()); return res.json(); } diff --git a/h3-console/frontend/src/components/Sidebar.jsx b/h3-console/frontend/src/components/Sidebar.jsx index e070a17..7b7c25f 100644 --- a/h3-console/frontend/src/components/Sidebar.jsx +++ b/h3-console/frontend/src/components/Sidebar.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { Plus, Search, ArrowUpDown, Trash2, KeyRound, - ChevronLeft, ChevronRight, Server, RefreshCw + ChevronLeft, ChevronRight, ChevronsRight, Server, RefreshCw } from 'lucide-react'; import JobCard from './JobCard'; import { fetchJobs, prioritizeJob, deleteJob, restoreJob, resetGpu } from '../api'; @@ -124,6 +124,13 @@ export default function Sidebar({ const totalPages = Math.max(1, Math.ceil(totalJobs / 20)); + // 跳到指定页(越界/非数字时夹到 1..totalPages) + const gotoPage = (v) => { + const n = Math.min(totalPages, Math.max(1, parseInt(v, 10) || 1)); + setPage(n); + loadJobs(n); + }; + return (