- AI calendar tools now always available (moved from _CALDAV_TOOLS to _CORE_TOOLS); create/list/search/update/delete events go through the internal DB store first, with fire-and-forget CalDAV push sync when the user has CalDAV configured - Add EventEntry interface and typed API helpers (listEvents, createEvent, getEvent, updateEvent, deleteEvent) to client.ts - Install @fullcalendar/vue3, daygrid, timegrid, interaction, core packages - Add EventSlideOver.vue: create/edit/delete slide-over with title, start/end, all-day toggle, location, description, color picker, and project selector - Add CalendarView.vue: month/week/day FullCalendar with drag-drop and resize wired to PATCH /api/events/:id; click empty date opens create slide-over - Wire /calendar route, Calendar nav link in AppHeader, g+l keyboard shortcut Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
149 lines
3.6 KiB
TypeScript
149 lines
3.6 KiB
TypeScript
import { createRouter, createWebHistory } from "vue-router";
|
|
import HomeView from "@/views/HomeView.vue";
|
|
import { useAuthStore } from "@/stores/auth";
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: [
|
|
{
|
|
path: "/",
|
|
name: "home",
|
|
component: HomeView,
|
|
},
|
|
{
|
|
path: "/login",
|
|
name: "login",
|
|
component: () => import("@/views/LoginView.vue"),
|
|
meta: { public: true },
|
|
},
|
|
{
|
|
path: "/register",
|
|
name: "register",
|
|
component: () => import("@/views/RegisterView.vue"),
|
|
meta: { public: true },
|
|
},
|
|
{
|
|
path: "/forgot-password",
|
|
name: "forgot-password",
|
|
component: () => import("@/views/ForgotPasswordView.vue"),
|
|
meta: { public: true },
|
|
},
|
|
{
|
|
path: "/reset-password",
|
|
name: "reset-password",
|
|
component: () => import("@/views/ResetPasswordView.vue"),
|
|
meta: { public: true },
|
|
},
|
|
{
|
|
path: "/register-invite",
|
|
name: "register-invite",
|
|
component: () => import("@/views/RegisterInviteView.vue"),
|
|
meta: { public: true },
|
|
},
|
|
{
|
|
path: "/notes",
|
|
name: "notes",
|
|
component: () => import("@/views/NotesListView.vue"),
|
|
},
|
|
{
|
|
path: "/notes/new",
|
|
name: "note-new",
|
|
component: () => import("@/views/NoteEditorView.vue"),
|
|
},
|
|
{
|
|
path: "/notes/:id",
|
|
name: "note-view",
|
|
component: () => import("@/views/NoteViewerView.vue"),
|
|
},
|
|
{
|
|
path: "/notes/:id/edit",
|
|
name: "note-edit",
|
|
component: () => import("@/views/NoteEditorView.vue"),
|
|
},
|
|
{
|
|
path: "/graph",
|
|
name: "graph",
|
|
component: () => import("@/views/GraphView.vue"),
|
|
},
|
|
{
|
|
path: "/projects",
|
|
name: "projects",
|
|
component: () => import("@/views/ProjectListView.vue"),
|
|
},
|
|
{
|
|
path: "/projects/:id",
|
|
name: "project-view",
|
|
component: () => import("@/views/ProjectView.vue"),
|
|
},
|
|
{
|
|
path: "/workspace/:projectId",
|
|
name: "workspace",
|
|
component: () => import("@/views/WorkspaceView.vue"),
|
|
},
|
|
{
|
|
path: "/tasks",
|
|
name: "tasks",
|
|
component: () => import("@/views/TasksListView.vue"),
|
|
},
|
|
{
|
|
path: "/tasks/new",
|
|
name: "task-new",
|
|
component: () => import("@/views/TaskEditorView.vue"),
|
|
},
|
|
{
|
|
path: "/tasks/:id",
|
|
name: "task-edit",
|
|
component: () => import("@/views/TaskEditorView.vue"),
|
|
},
|
|
{
|
|
path: "/chat",
|
|
name: "chat",
|
|
component: () => import("@/views/ChatView.vue"),
|
|
},
|
|
{
|
|
path: "/chat/:id",
|
|
name: "chat-conversation",
|
|
component: () => import("@/views/ChatView.vue"),
|
|
},
|
|
{
|
|
path: "/shared",
|
|
name: "shared-with-me",
|
|
component: () => import("@/views/SharedWithMeView.vue"),
|
|
},
|
|
{
|
|
path: "/calendar",
|
|
name: "calendar",
|
|
component: () => import("@/views/CalendarView.vue"),
|
|
},
|
|
{
|
|
path: "/briefing",
|
|
name: "briefing",
|
|
component: () => import("@/views/BriefingView.vue"),
|
|
},
|
|
{
|
|
path: "/settings",
|
|
name: "settings",
|
|
component: () => import("@/views/SettingsView.vue"),
|
|
},
|
|
{ path: "/admin/users", redirect: "/settings" },
|
|
{ path: "/admin/logs", redirect: "/settings" },
|
|
],
|
|
});
|
|
|
|
router.beforeEach(async (to) => {
|
|
if (to.meta.public) return;
|
|
|
|
const authStore = useAuthStore();
|
|
|
|
// Wait for initial auth check if still loading
|
|
if (authStore.loading && !authStore.isAuthenticated) {
|
|
await authStore.checkAuth();
|
|
}
|
|
|
|
if (!authStore.isAuthenticated) {
|
|
return { name: "login", query: { redirect: to.fullPath } };
|
|
}
|
|
});
|
|
|
|
export default router;
|