fix(web): resolve dashboard widget errors and deployment config
All checks were successful
ci/woodpecker/push/web Pipeline was successful
All checks were successful
ci/woodpecker/push/web Pipeline was successful
- Add workspace ID to ActiveProjectsWidget API calls (fixes 401/403) - Add ORCHESTRATOR_URL and ORCHESTRATOR_API_KEY to web service in swarm compose (fixes 503 on orchestrator proxy routes) - Add internal network to web service for orchestrator connectivity - Update .env.example domain examples to single-level subdomains - Fix version display on login page from v0.1 to v0.0.20 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -326,7 +326,7 @@ function LoginPageContent(): ReactElement {
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex justify-center">
|
||||
<AuthStatusPill label="Mosaic v0.1" tone="neutral" />
|
||||
<AuthStatusPill label="Mosaic v0.0.20" tone="neutral" />
|
||||
</div>
|
||||
</AuthCard>
|
||||
</AuthShell>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useState, useEffect } from "react";
|
||||
import { FolderOpen, Bot, Activity, Clock, AlertCircle, CheckCircle2 } from "lucide-react";
|
||||
import type { WidgetProps } from "@mosaic/shared";
|
||||
import { apiPost } from "@/lib/api/client";
|
||||
import { useWorkspaceId } from "@/lib/hooks";
|
||||
|
||||
interface ActiveProject {
|
||||
id: string;
|
||||
@@ -34,6 +35,7 @@ interface AgentSession {
|
||||
}
|
||||
|
||||
export function ActiveProjectsWidget({ id: _id, config: _config }: WidgetProps): React.JSX.Element {
|
||||
const workspaceId = useWorkspaceId();
|
||||
const [projects, setProjects] = useState<ActiveProject[]>([]);
|
||||
const [agentSessions, setAgentSessions] = useState<AgentSession[]>([]);
|
||||
const [isLoadingProjects, setIsLoadingProjects] = useState(true);
|
||||
@@ -48,7 +50,11 @@ export function ActiveProjectsWidget({ id: _id, config: _config }: WidgetProps):
|
||||
try {
|
||||
setProjectsError(null);
|
||||
// Use API client to ensure CSRF token is included
|
||||
const data = await apiPost<ActiveProject[]>("/api/widgets/data/active-projects");
|
||||
const data = await apiPost<ActiveProject[]>(
|
||||
"/api/widgets/data/active-projects",
|
||||
undefined,
|
||||
workspaceId ?? undefined
|
||||
);
|
||||
setProjects(data);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch active projects:", error);
|
||||
@@ -67,7 +73,7 @@ export function ActiveProjectsWidget({ id: _id, config: _config }: WidgetProps):
|
||||
return (): void => {
|
||||
clearInterval(interval);
|
||||
};
|
||||
}, []);
|
||||
}, [workspaceId]);
|
||||
|
||||
// Fetch agent chains
|
||||
useEffect(() => {
|
||||
@@ -75,7 +81,11 @@ export function ActiveProjectsWidget({ id: _id, config: _config }: WidgetProps):
|
||||
try {
|
||||
setAgentsError(null);
|
||||
// Use API client to ensure CSRF token is included
|
||||
const data = await apiPost<AgentSession[]>("/api/widgets/data/agent-chains");
|
||||
const data = await apiPost<AgentSession[]>(
|
||||
"/api/widgets/data/agent-chains",
|
||||
undefined,
|
||||
workspaceId ?? undefined
|
||||
);
|
||||
setAgentSessions(data);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch agent sessions:", error);
|
||||
@@ -94,7 +104,7 @@ export function ActiveProjectsWidget({ id: _id, config: _config }: WidgetProps):
|
||||
return (): void => {
|
||||
clearInterval(interval);
|
||||
};
|
||||
}, []);
|
||||
}, [workspaceId]);
|
||||
|
||||
const getStatusIcon = (status: string): React.JSX.Element => {
|
||||
const statusUpper = status.toUpperCase();
|
||||
|
||||
Reference in New Issue
Block a user