[taskboard] refactor tasks into full-page workspace
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
import { DispatchHistory } from "@/components/dispatch-history";
|
||||
import { listFailedTasks, listTaskEvents } from "@/lib/tasks";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function DispatchPage() {
|
||||
const [events, failedTasks] = await Promise.all([
|
||||
listTaskEvents(undefined, 50),
|
||||
listFailedTasks(),
|
||||
]);
|
||||
|
||||
return <DispatchHistory events={events} failedTasks={failedTasks} />;
|
||||
export default function DispatchPage() {
|
||||
redirect("/tasks/dispatch");
|
||||
}
|
||||
|
||||
9
app/tasks/dispatch/page.tsx
Normal file
9
app/tasks/dispatch/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { DispatchHistory } from "@/components/dispatch-history";
|
||||
import { listTaskEvents } from "@/lib/tasks";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function TasksDispatchPage() {
|
||||
const events = await listTaskEvents(undefined, 50);
|
||||
return <DispatchHistory events={events} />;
|
||||
}
|
||||
9
app/tasks/failures/page.tsx
Normal file
9
app/tasks/failures/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { FailureQueue } from "@/components/failure-queue";
|
||||
import { listFailedTasks } from "@/lib/tasks";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function TasksFailuresPage() {
|
||||
const failedTasks = await listFailedTasks();
|
||||
return <FailureQueue failedTasks={failedTasks} />;
|
||||
}
|
||||
14
app/tasks/layout.tsx
Normal file
14
app/tasks/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { TasksSubnav } from "@/components/tasks-subnav";
|
||||
|
||||
export default function TasksLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<div className="min-w-0">
|
||||
<TasksSubnav />
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
import { TasksClient } from "@/components/tasks-client";
|
||||
import { listFleetAgents } from "@/lib/agents";
|
||||
import { listTaskEvents, listTaskTemplates, listTasks } from "@/lib/tasks";
|
||||
import { listTaskTemplates, listTasks } from "@/lib/tasks";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function TasksPage() {
|
||||
const [tasks, agents, templates, events] = await Promise.all([
|
||||
const [tasks, agents, templates] = await Promise.all([
|
||||
listTasks(),
|
||||
listFleetAgents(),
|
||||
listTaskTemplates(),
|
||||
listTaskEvents(undefined, 12),
|
||||
]);
|
||||
return <TasksClient initialTasks={tasks} initialEvents={events} agents={agents} templates={templates} />;
|
||||
return <TasksClient initialTasks={tasks} agents={agents} templates={templates} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user