feat(webui): show pulsing dot in header while open conversation runs
This commit is contained in:
@@ -9,6 +9,7 @@ import { ConfigDialog } from "@/app/components/ConfigDialog";
|
||||
import { ErrorLogBell } from "@/app/components/ErrorLogBell";
|
||||
import { ImageModelsDialog } from "@/app/components/ImageModelsDialog";
|
||||
import { LocaleSwitcher } from "@/app/components/LocaleSwitcher";
|
||||
import { RunningDot } from "@/app/components/RunningDot";
|
||||
import { SystemConfigDialog } from "@/app/components/system-config/SystemConfigDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
@@ -57,6 +58,7 @@ import {
|
||||
usePublicSystemConfig,
|
||||
} from "@/app/hooks/usePublicSystemConfig";
|
||||
import type { MainChatReporter } from "@/lib/asyncAgents";
|
||||
import { useRunningThreadIds } from "@/app/hooks/useThreads";
|
||||
import { localizedPath } from "@/lib/localePath";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
@@ -71,6 +73,9 @@ function HomePageInner({ authEnabled, isAdmin }: HomePageInnerProps) {
|
||||
const t = useTranslations("header");
|
||||
const publicConfig = usePublicSystemConfig();
|
||||
const [threadId, setThreadId] = useQueryState("threadId");
|
||||
const runningThreadIds = useRunningThreadIds();
|
||||
const currentThreadRunning =
|
||||
threadId !== null && runningThreadIds.has(threadId);
|
||||
const [sidebar, setSidebar] = useQueryState("sidebar");
|
||||
const [view, setView] = useQueryState("view");
|
||||
const [memoryTab, setMemoryTab] = useQueryState("memoryTab");
|
||||
@@ -328,11 +333,12 @@ function HomePageInner({ authEnabled, isAdmin }: HomePageInnerProps) {
|
||||
<h1 className="truncate text-sm font-semibold leading-tight sm:text-base">
|
||||
{publicConfig?.wordmark ?? DEFAULT_WORDMARK}
|
||||
</h1>
|
||||
<div className="-ml-2 -my-1">
|
||||
<div className="-my-1 -ml-2">
|
||||
<VersionBadge />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{currentThreadRunning && <RunningDot label={t("running")} />}
|
||||
</div>
|
||||
<div className="flex items-center gap-0.5">
|
||||
<Button
|
||||
@@ -462,7 +468,9 @@ function HomePageInner({ authEnabled, isAdmin }: HomePageInnerProps) {
|
||||
{t("imageModels")}
|
||||
</DropdownMenuItem>
|
||||
{isAdmin && (
|
||||
<DropdownMenuItem onSelect={() => setSystemConfigOpen(true)}>
|
||||
<DropdownMenuItem
|
||||
onSelect={() => setSystemConfigOpen(true)}
|
||||
>
|
||||
<ServerCog aria-hidden="true" />
|
||||
{t("systemConfig")}
|
||||
</DropdownMenuItem>
|
||||
@@ -656,7 +664,12 @@ function HomePageContent() {
|
||||
};
|
||||
}, [authEnabled]);
|
||||
|
||||
return <HomePageInner authEnabled={authEnabled} isAdmin={isAdmin} />;
|
||||
return (
|
||||
<HomePageInner
|
||||
authEnabled={authEnabled}
|
||||
isAdmin={isAdmin}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function HomePage() {
|
||||
|
||||
@@ -9,6 +9,7 @@ export default {
|
||||
systemConfig: "System config",
|
||||
language: "Language",
|
||||
newChat: "New chat",
|
||||
running: "Running",
|
||||
showNavigation: "Show navigation",
|
||||
hideNavigation: "Hide navigation",
|
||||
showResearch: "Show research",
|
||||
|
||||
@@ -9,6 +9,7 @@ export default {
|
||||
systemConfig: "系统配置",
|
||||
language: "语言",
|
||||
newChat: "新对话",
|
||||
running: "正在执行",
|
||||
showNavigation: "显示导航",
|
||||
hideNavigation: "隐藏导航",
|
||||
showResearch: "显示研究",
|
||||
|
||||
Reference in New Issue
Block a user