cc-dashboard/src/static/assets/AppLayout-pKGDLFnX.js
Vadym Samoilenko 433512fc78 feat: task time slots, calendar block drag-to-move
- TaskForm: add start_time/end_time fields; on save emits optional
  block payload so PlannerView creates a PlannedBlock automatically
- PlannerView: handleSave accepts block param, calls createBlock after
  task creation when time is provided
- CalendarBlock: planned blocks with task_id get draggable="true" +
  @dragstart emitting blockDragStart event
- CalendarGrid: forward blockDragStart to useCalendarDnD
- useCalendarDnD: onBlockDragStart stores block_id + duration in
  dataTransfer; onDrop handles both move-existing-block and
  create-new-block paths

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 21:19:49 +01:00

1 line
12 KiB
JavaScript

import{d as M,u as j,c as s,b as V,a as e,F as $,l as A,t as m,i as h,m as b,o as n,n as H,w as _,j as C,p as d,q as B,g as z,s as S,k as D,K as T,f as L,e as x,T as R,r as O}from"./index-DBJT1cIA.js";const I={class:"flex flex-col h-full bg-[hsl(220_44%_8%)] border-r border-border"},P={class:"flex-1 px-2 py-3 space-y-0.5 overflow-y-auto"},N={key:0,class:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-4 bg-primary rounded-r-full"},F={class:"text-sm"},K={class:"p-3 border-t border-border shrink-0"},q={class:"flex items-center gap-3 px-2 py-2 rounded-lg"},E={class:"h-7 w-7 rounded-full bg-primary/15 ring-1 ring-primary/20 flex items-center justify-center text-[10px] font-bold text-primary shrink-0"},U={class:"flex-1 min-w-0"},W={class:"text-xs font-medium text-foreground truncate"},G=M({__name:"Sidebar",emits:["close"],setup(y,{emit:g}){const a=z(),l=j(),v=g,u=[{name:"Dashboard",path:"/",icon:"grid"},{name:"Calendar",path:"/calendar",icon:"calendar"},{name:"Planner",path:"/planner",icon:"check-square"},{name:"Projects",path:"/projects",icon:"folder"},{name:"Live Feed",path:"/live",icon:"activity"},{name:"Reports",path:"/reports",icon:"file-text"},{name:"Keys",path:"/keys",icon:"key"},{name:"DevOps",path:"/devops",icon:"devops"},{name:"Settings",path:"/settings",icon:"settings"},{name:"Admin",path:"/admin",icon:"shield",adminOnly:!0}],f=b(()=>u.filter(c=>!c.adminOnly||l.isAdmin));function r(c){return c==="/"?a.path==="/":a.path.startsWith(c)}const i=b(()=>{var t,p;return(((t=l.user)==null?void 0:t.username)??((p=l.user)==null?void 0:p.email)??"?").slice(0,2).toUpperCase()});return(c,t)=>{var k,w;const p=B("RouterLink");return n(),s("aside",I,[t[12]||(t[12]=V('<div class="h-14 flex items-center px-4 border-b border-border shrink-0"><div class="flex items-center gap-3"><div class="h-8 w-8 rounded-lg bg-primary/10 ring-1 ring-primary/25 flex items-center justify-center"><svg class="h-4 w-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path></svg></div><div><p class="font-bold text-sm text-foreground leading-none tracking-tight">CC Dashboard</p><p class="text-[10px] text-muted-foreground mt-0.5 tracking-wide">Oliver Agency</p></div></div></div>',1)),e("nav",P,[(n(!0),s($,null,A(f.value,o=>(n(),H(p,{key:o.path,to:o.path,class:d(["relative flex items-center gap-3 px-3 h-10 rounded-lg text-sm font-medium transition-all duration-150 group",r(o.path)?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"]),onClick:t[0]||(t[0]=se=>v("close"))},{default:_(()=>[r(o.path)?(n(),s("span",N)):C("",!0),o.icon==="grid"?(n(),s("svg",{key:1,class:d(["h-4 w-4 shrink-0 transition-colors",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[1]||(t[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])],2)):o.icon==="calendar"?(n(),s("svg",{key:2,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[2]||(t[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):o.icon==="check-square"?(n(),s("svg",{key:3,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[3]||(t[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},null,-1)])],2)):o.icon==="folder"?(n(),s("svg",{key:4,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[4]||(t[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):o.icon==="activity"?(n(),s("svg",{key:5,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[5]||(t[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)])],2)):o.icon==="file-text"?(n(),s("svg",{key:6,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[6]||(t[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},null,-1)])],2)):o.icon==="key"?(n(),s("svg",{key:7,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[7]||(t[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])],2)):o.icon==="devops"?(n(),s("svg",{key:8,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[8]||(t[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2)):o.icon==="settings"?(n(),s("svg",{key:9,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)):o.icon==="shield"?(n(),s("svg",{key:10,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-muted-foreground/60 group-hover:text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)])],2)):C("",!0),e("span",F,m(o.name),1)]),_:2},1032,["to","class"]))),128))]),e("div",K,[e("div",q,[e("div",E,m(i.value),1),e("div",U,[e("p",W,m(((k=h(l).user)==null?void 0:k.username)??((w=h(l).user)==null?void 0:w.email)),1),t[11]||(t[11]=e("div",{class:"flex items-center gap-1 mt-0.5"},[e("div",{class:"h-1.5 w-1.5 rounded-full bg-[hsl(var(--success))]"}),e("span",{class:"text-[10px] text-muted-foreground"},"Online")],-1))])])])])}}}),J={class:"h-14 border-b border-border bg-card/95 backdrop-blur-sm flex items-center px-4 gap-3 shrink-0 sticky top-0 z-10"},Q={class:"flex-1"},X={class:"text-sm font-semibold text-foreground"},Y={class:"flex items-center gap-2.5"},Z={class:"h-7 w-7 rounded-full bg-primary/15 ring-1 ring-primary/25 flex items-center justify-center text-[10px] font-bold text-primary shrink-0"},ee={class:"hidden sm:block text-xs font-medium text-foreground max-w-[120px] truncate"},te=M({__name:"TopBar",props:{title:{},sidebarOpen:{type:Boolean}},emits:["toggleSidebar","toggleDark"],setup(y,{emit:g}){const a=g,l=j(),v=L();async function u(){await l.logout(),T.success("Logged out"),v.push({name:"login"})}function f(){const r=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",r?"dark":"light"),a("toggleDark")}return(r,i)=>{var c,t,p,k;return n(),s("header",J,[e("button",{class:"lg:hidden flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle sidebar",onClick:i[0]||(i[0]=w=>a("toggleSidebar"))},[...i[1]||(i[1]=[e("svg",{class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("div",Q,[e("h1",X,m(y.title??"CC Dashboard"),1)]),S(r.$slots,"actions"),e("button",{class:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle dark mode",onClick:f},[...i[2]||(i[2]=[e("svg",{class:"h-4 w-4 hidden dark:block",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})],-1),e("svg",{class:"h-4 w-4 dark:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})],-1)])]),i[4]||(i[4]=e("div",{class:"h-6 w-px bg-border"},null,-1)),e("div",Y,[e("div",Z,m((((c=h(l).user)==null?void 0:c.username)??((t=h(l).user)==null?void 0:t.email)??"?").slice(0,2).toUpperCase()),1),e("span",ee,m(((p=h(l).user)==null?void 0:p.username)??((k=h(l).user)==null?void 0:k.email)),1),e("button",{class:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:u},[...i[3]||(i[3]=[e("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),D(" Sign out ",-1)])])])])}}}),oe={class:"h-screen flex overflow-hidden bg-background"},re={class:"flex-1 flex flex-col overflow-hidden min-w-0"},ne={class:"flex-1 overflow-y-auto"},le=M({__name:"AppLayout",setup(y){const g=z(),a=O(!1),l=b(()=>({dashboard:"Dashboard",calendar:"Calendar",planner:"Planner",projects:"Projects","project-detail":"Project Details",live:"Live Feed",reports:"AI Reports",keys:"API Keys",settings:"Settings",admin:"Admin"})[g.name]??"CC Dashboard");return(v,u)=>{const f=B("RouterView");return n(),s("div",oe,[x(R,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:_(()=>[a.value?(n(),s("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 lg:hidden",onClick:u[0]||(u[0]=r=>a.value=!1)})):C("",!0)]),_:1}),e("div",{class:d(["fixed inset-y-0 left-0 z-30 w-60 transform transition-transform duration-300 lg:relative lg:translate-x-0",a.value?"translate-x-0":"-translate-x-full"])},[x(G,{onClose:u[1]||(u[1]=r=>a.value=!1)})],2),e("div",re,[x(te,{title:l.value,"sidebar-open":a.value,onToggleSidebar:u[2]||(u[2]=r=>a.value=!a.value)},null,8,["title","sidebar-open"]),e("main",ne,[x(f)])])])}}});export{le as default};