Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/app/api/tasks/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from 'next/server';
import { updateTask, deleteTask, getTask, getScheduledTask, deleteScheduledTask } from '@/lib/db';
import { updateTask, deleteTask, getTask, getScheduledTask, deleteScheduledTask, updateScheduledTask } from '@/lib/db';
import type { TaskResponse, ErrorResponse, UpdateTaskRequest } from '@/types';
import type { ScheduledTask } from '@/types';

interface RouteContext {
params: Promise<{ id: string }>;
Expand Down Expand Up @@ -37,9 +38,17 @@ export async function PATCH(request: NextRequest, context: RouteContext) {
const { id } = await context.params;

try {
const body: UpdateTaskRequest = await request.json();
const existing = getTask(id);
const body: UpdateTaskRequest & Partial<ScheduledTask> = await request.json();

// Try scheduled task first
const scheduledTask = getScheduledTask(id);
if (scheduledTask) {
const updated = updateScheduledTask(id, body);
return NextResponse.json({ task: scheduledTask });
}

// Fall back to regular task
const existing = getTask(id);
if (!existing) {
return NextResponse.json<ErrorResponse>(
{ error: 'Task not found' },
Expand Down
11 changes: 11 additions & 0 deletions src/app/scheduled-tasks/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client";

import { ScheduledTasksManager } from "@/components/scheduled-tasks/ScheduledTasksManager";

export default function ScheduledTasksPage() {
return (
<div className="flex h-full flex-col">
<ScheduledTasksManager />
</div>
);
}
3 changes: 3 additions & 0 deletions src/components/layout/NavRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Gear,
WifiHigh,
Terminal,
Clock,
} from "@/components/ui/icon";
import { Button } from "@/components/ui/button";
import {
Expand All @@ -35,6 +36,7 @@ const navItems = [
{ href: "/skills", label: "Skills", icon: Lightning },
{ href: "/mcp", label: "MCP", icon: Plug },
{ href: "/cli-tools", label: "CLI Tools", icon: Terminal },
{ href: "/scheduled-tasks", label: "Scheduled Tasks", icon: Clock },
{ href: "/gallery", label: "Gallery", icon: Image },
{ href: "/bridge", label: "Bridge", icon: WifiHigh },
] as const;
Expand All @@ -50,6 +52,7 @@ export function NavRail({ onToggleChatList, hasUpdate, readyToInstall, skipPermi
'Gallery': 'gallery.title',
'Bridge': 'nav.bridge',
'CLI Tools': 'nav.cliTools',
'Scheduled Tasks': 'nav.scheduledTasks',
};
const isChatRoute = pathname === "/chat" || pathname.startsWith("/chat/");
const isSettingsActive = pathname === "/settings" || pathname.startsWith("/settings/");
Expand Down
Loading