fix: model repo subdir layout, no-window engine launch, deploy progress, engine path auto-repair

This commit is contained in:
Xianren Studio
2026-08-13 17:04:40 +08:00
parent 7f0edbd0a1
commit 4718e41433
10 changed files with 217 additions and 10 deletions
+18
View File
@@ -181,6 +181,8 @@ export default function ChatPage() {
const engineRunning = useStore((s) => s.engine?.running ?? false);
const engineModel = useStore((s) => s.engine?.model ?? null);
const deployStates = useStore((s) => s.deployStates);
const deployProgress = useStore((s) => s.deployProgress);
const selectedIsRemote = useMemo(
() => models.find((m) => m.id === selectedModelId)?.kind === "remote",
[models, selectedModelId],
@@ -338,6 +340,22 @@ export default function ChatPage() {
</button>
</div>
)}
{deployStates[selectedModelId] === "loading" ? (
<div className="mt-2">
<div className="h-1.5 overflow-hidden rounded-full bg-panel-2">
<div
className="h-full rounded-full bg-gradient-to-r from-accent to-accent-2 transition-all duration-300"
style={{
width: `${deployProgress[selectedModelId]?.percent ?? 8}%`,
}}
/>
</div>
<div className="mt-1 text-[10px] text-slate-400">
{deployProgress[selectedModelId]?.stage ?? "启动引擎进程"}{" "}
{deployProgress[selectedModelId]?.percent ?? 8}%
</div>
</div>
) : null}
<div className="mt-1 truncate text-xs text-slate-500">{engineLabel}</div>
<div className="mt-4 border-t border-border pt-3">
+16 -3
View File
@@ -13,6 +13,7 @@ export default function ModelsPage() {
const refreshModels = useStore((s) => s.refreshModels);
const engine = useStore((s) => s.engine);
const deployStates = useStore((s) => s.deployStates);
const deployProgress = useStore((s) => s.deployProgress);
const [showRemoteForm, setShowRemoteForm] = useState(false);
const [scanning, setScanning] = useState(false);
const [remote, setRemote] = useState({
@@ -249,6 +250,7 @@ export default function ModelsPage() {
engineRunning={engine?.running ?? false}
deployed={engine?.model === m.file_name}
deployState={deployStates[m.id]}
deployProgress={deployProgress[m.id]}
onDeploy={handleDeploy}
onStop={handleStopEngine}
/>
@@ -276,6 +278,7 @@ function DeployButton({
engineRunning,
deployed,
deployState,
deployProgress,
onDeploy,
onStop,
}: {
@@ -283,6 +286,7 @@ function DeployButton({
engineRunning: boolean;
deployed: boolean;
deployState?: string;
deployProgress?: { percent: number; stage: string };
onDeploy: (id: string) => void;
onStop: () => void;
}) {
@@ -303,10 +307,19 @@ function DeployButton({
);
}
if (deployState === "loading") {
const p = deployProgress ?? { percent: 8, stage: "启动引擎进程" };
return (
<button className="btn-secondary !px-3 !py-1 text-xs" disabled>
</button>
<div className="w-36">
<div className="h-1.5 overflow-hidden rounded-full bg-panel-2">
<div
className="h-full rounded-full bg-gradient-to-r from-accent to-accent-2 transition-all duration-300"
style={{ width: `${p.percent}%` }}
/>
</div>
<div className="mt-1 truncate text-[10px] text-slate-400">
{p.stage} {p.percent}%
</div>
</div>
);
}
return (