@overlordai/server 1.0.58 → 1.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/repositories/workspace.repository.d.ts +1 -0
- package/dist/database/repositories/workspace.repository.d.ts.map +1 -1
- package/dist/database/repositories/workspace.repository.js +7 -0
- package/dist/database/repositories/workspace.repository.js.map +1 -1
- package/dist/dispatcher/scheduler.service.d.ts +3 -1
- package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
- package/dist/dispatcher/scheduler.service.js +20 -2
- package/dist/dispatcher/scheduler.service.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-DPQB2fbi.js → AccessTokensPage-CV8VN5V1.js} +1 -1
- package/public/assets/{AdminPage-BqVelYNu.js → AdminPage-Bo3P5iZr.js} +1 -1
- package/public/assets/{ApiReferencePage-CiGvbLxL.js → ApiReferencePage-CmYuc51e.js} +1 -1
- package/public/assets/{AuditLogPage-DSo4jVYm.js → AuditLogPage-AZg7lGzK.js} +1 -1
- package/public/assets/{BindPlatformPage-CTqzpOmt.js → BindPlatformPage-B6UZICVu.js} +1 -1
- package/public/assets/{BotManage-CIR0rrK7.js → BotManage-BmO8KcyJ.js} +1 -1
- package/public/assets/{CliReferencePage-C8GmlwUz.js → CliReferencePage-C94W05JK.js} +1 -1
- package/public/assets/{DeveloperManage-r6y2AoB4.js → DeveloperManage-DCDaMC7Q.js} +1 -1
- package/public/assets/EditProjectPage-BppWlins.js +2 -0
- package/public/assets/{EmptyState-D3foEiul.js → EmptyState-Wu8ZN3Cr.js} +1 -1
- package/public/assets/{HomePage-D4yv4orb.js → HomePage-l0ArgLuo.js} +1 -1
- package/public/assets/{InfoRow-DhdTYoY9.js → InfoRow-g3rebB-5.js} +1 -1
- package/public/assets/{LandingPage-CqS0E2eC.js → LandingPage-boW1qkFr.js} +1 -1
- package/public/assets/{LoginPage-DDXkdcz_.js → LoginPage-BnrBN7Pm.js} +1 -1
- package/public/assets/{MetricBar-DMMHfS0A.js → MetricBar-DJTYljvt.js} +1 -1
- package/public/assets/{NotFoundPage-D5x5BrlX.js → NotFoundPage-DJfS5CJ3.js} +1 -1
- package/public/assets/{OnboardingGuide-D8RyPcEd.js → OnboardingGuide-DnA7icKO.js} +1 -1
- package/public/assets/{PipelineEditorPage-y2-Q8ofQ.js → PipelineEditorPage-CeJlcFvd.js} +1 -1
- package/public/assets/{ProfilePage-DN7usHOi.js → ProfilePage-CA89g3ZV.js} +1 -1
- package/public/assets/{ProjectDetailPage-DJexg49z.js → ProjectDetailPage-BWbDAdFB.js} +1 -1
- package/public/assets/{ProjectListPage-Bz7I2D0H.js → ProjectListPage-DS1H39MT.js} +1 -1
- package/public/assets/{QuickAuth-Dr0Q50ld.js → QuickAuth-Zna-TvoV.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-BCrue0AP.js → RemoveMemberConfirmDialog-l1wwa1W6.js} +1 -1
- package/public/assets/{Select-BnV8yZlD.js → Select-DZq-bKgi.js} +1 -1
- package/public/assets/{SettingsPage-HaUCcsgl.js → SettingsPage-TEGcISlB.js} +1 -1
- package/public/assets/{Skeleton-DUgWc2LJ.js → Skeleton-Dj8lxPoL.js} +1 -1
- package/public/assets/{SkillPage-BInwZTQh.js → SkillPage-C8Ajp8QF.js} +1 -1
- package/public/assets/{TaskDetailPage-CfwEj1hy.js → TaskDetailPage-BtKpmra7.js} +1 -1
- package/public/assets/TaskListPage-CvipzH6U.js +1 -0
- package/public/assets/{TaskStatusBadge-DuOoGIwE.js → TaskStatusBadge-acWzsl5J.js} +1 -1
- package/public/assets/{TerminalHomePage-BwXJjr-a.js → TerminalHomePage-CcAC6dSC.js} +1 -1
- package/public/assets/{TokenManage-B0Cpv6SO.js → TokenManage-BIb_820M.js} +1 -1
- package/public/assets/{TotpSetupPage-MSCCURj9.js → TotpSetupPage-BqZ_9PoT.js} +1 -1
- package/public/assets/{WorkerDetailPage-R2veIzKo.js → WorkerDetailPage-DjJH105s.js} +1 -1
- package/public/assets/{WorkerListPage-CserMjGO.js → WorkerListPage-BtbmZFmW.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-SqO2lzVa.js → WorkerSetupGuidePage-Dj4Uw6lE.js} +1 -1
- package/public/assets/{arrow-left-DklRsENx.js → arrow-left-BIZegN7f.js} +1 -1
- package/public/assets/{arrow-right-MDrzFe3K.js → arrow-right-Cz2VYV06.js} +1 -1
- package/public/assets/{bot-DPaziJPf.js → bot-DEczKx10.js} +1 -1
- package/public/assets/{chevron-right-CqyufMDW.js → chevron-right-BP3RjJKD.js} +1 -1
- package/public/assets/{copy-BUH7P2Hf.js → copy--Yno9vb0.js} +1 -1
- package/public/assets/{external-link-ChPgQ7N_.js → external-link-CcU-f6-c.js} +1 -1
- package/public/assets/{index-vL7aQJNr.js → index-BkCeTWBV.js} +3 -3
- package/public/assets/{key-CxvwwHnW.js → key-CMkJGiSp.js} +1 -1
- package/public/assets/{loader-circle-DS5g1-Od.js → loader-circle-bii_pnUR.js} +1 -1
- package/public/assets/{pencil-B6spIBcw.js → pencil-D5GJfzl9.js} +1 -1
- package/public/assets/{plus-Bnd1Vz2Y.js → plus-D1YuxwcM.js} +1 -1
- package/public/assets/{rotate-ccw-CgcLAXNR.js → rotate-ccw-DowaAMVF.js} +1 -1
- package/public/assets/{scroll-text-CecZ0Fk5.js → scroll-text-BUhyeA5Y.js} +1 -1
- package/public/assets/{settings-C1uOD3PZ.js → settings-CZ-y53-I.js} +1 -1
- package/public/assets/{status-colors-BPEUp90-.js → status-colors-iyCXeYpO.js} +1 -1
- package/public/assets/{task-constants-BbFyCyKk.js → task-constants-5g7L_hzP.js} +1 -1
- package/public/assets/{task.store-BE6fEPu4.js → task.store-CtHlNDEq.js} +1 -1
- package/public/assets/{trash-2-A2FsT1yG.js → trash-2-BOrTcn3-.js} +1 -1
- package/public/assets/{useFetch-vGZMAvGi.js → useFetch-HnnJMiuj.js} +1 -1
- package/public/assets/{users-CEdRS_A3.js → users-3lnyKPXK.js} +1 -1
- package/public/assets/{wifi-D60NkK6F.js → wifi-7vpmfpr3.js} +1 -1
- package/public/assets/{zap-DXw1NrWz.js → zap-BWW7mt1l.js} +1 -1
- package/public/index.html +1 -1
- package/public/sw.js +1 -1
- package/public/assets/EditProjectPage-7WCsNltj.js +0 -2
- package/public/assets/TaskListPage-Dh59ldSZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as r,l as e,F as s,J as u,B as a}from"./index-
|
|
1
|
+
import{W as r,l as e,F as s,J as u,B as a}from"./index-BkCeTWBV.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--accent)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const c={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return c[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,c as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ee=Object.defineProperty;var ke=(te,j,K)=>j in te?Ee(te,j,{enumerable:!0,configurable:!0,writable:!0,value:K}):te[j]=K;var se=(te,j,K)=>ke(te,typeof j!="symbol"?j+"":j,K);import{c as Le,r as X,u as De,g as Re,j as xe,l as ge}from"./index-
|
|
1
|
+
var Ee=Object.defineProperty;var ke=(te,j,K)=>j in te?Ee(te,j,{enumerable:!0,configurable:!0,writable:!0,value:K}):te[j]=K;var se=(te,j,K)=>ke(te,typeof j!="symbol"?j+"":j,K);import{c as Le,r as X,u as De,g as Re,j as xe,l as ge}from"./index-BkCeTWBV.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as i,g as l}from"./index-
|
|
1
|
+
import{k as i,g as l}from"./index-BkCeTWBV.js";const f=i((t,c)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,fetchTasks:async a=>{const s=c()._fetchTasksAbort;s&&s.abort();const o=new AbortController;t({loading:!0,error:null,_fetchTasksAbort:o});try{const r={};a!=null&&a.status&&(r.status=a.status),a!=null&&a.projectKey&&(r.projectKey=a.projectKey),a!=null&&a.cursor&&(r.cursor=a.cursor),a!=null&&a.limit&&(r.limit=String(a.limit));const n=await l.get("web/tasks",{searchParams:r,signal:o.signal}).json();a!=null&&a.cursor?t(e=>({tasks:[...e.tasks,...n.data],nextCursor:n.nextCursor??null,_fetchTasksAbort:null})):t({tasks:n.data,nextCursor:n.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;t({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{t({loading:!1})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await l.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await l.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await l.post(`web/tasks/${a}/cancel`);const{currentTask:s}=c();(s==null?void 0:s.id)===a&&await c().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null})}}));export{f as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-BkCeTWBV.js";function p(c,f){const[l,i]=e.useState(null),[d,u]=e.useState(!0),[R,a]=e.useState(null),o=e.useRef(c);o.current=c;const r=e.useRef(0),n=e.useCallback(async()=>{const s=++r.current;u(!0),a(null);try{const t=await o.current();s===r.current&&i(t)}catch(t){if(s===r.current){const g=t instanceof Error?t.message:"An unexpected error occurred";a(g)}}finally{s===r.current&&u(!1)}},f);return e.useEffect(()=>{n()},[n]),{data:l,loading:d,error:R,refetch:n}}export{p as u};
|
package/public/index.html
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
|
|
29
29
|
rel="stylesheet"
|
|
30
30
|
/>
|
|
31
|
-
<script type="module" crossorigin src="/assets/index-
|
|
31
|
+
<script type="module" crossorigin src="/assets/index-BkCeTWBV.js"></script>
|
|
32
32
|
<link rel="stylesheet" crossorigin href="/assets/index-BS0Fbx5V.css">
|
|
33
33
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
34
34
|
<body>
|
package/public/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let o={};const
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let o={};const a=s=>l(s,r),u={module:{uri:r},exports:o,require:a};e[r]=Promise.all(i.map(s=>u[s]||a(s))).then(s=>(n(...s),o))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"757e9a0ccac23120e80fd31c1bc3f2cb"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-BWW7mt1l.js",revision:null},{url:"assets/wifi-7vpmfpr3.js",revision:null},{url:"assets/users-3lnyKPXK.js",revision:null},{url:"assets/useFetch-HnnJMiuj.js",revision:null},{url:"assets/trash-2-BOrTcn3-.js",revision:null},{url:"assets/task.store-CtHlNDEq.js",revision:null},{url:"assets/task-constants-Beg8tuEN.css",revision:null},{url:"assets/task-constants-5g7L_hzP.js",revision:null},{url:"assets/string-B39tzdVK.js",revision:null},{url:"assets/status-colors-iyCXeYpO.js",revision:null},{url:"assets/settings-CZ-y53-I.js",revision:null},{url:"assets/scroll-text-BUhyeA5Y.js",revision:null},{url:"assets/rotate-ccw-DowaAMVF.js",revision:null},{url:"assets/plus-D1YuxwcM.js",revision:null},{url:"assets/pencil-D5GJfzl9.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-bii_pnUR.js",revision:null},{url:"assets/key-CMkJGiSp.js",revision:null},{url:"assets/index-BkCeTWBV.js",revision:null},{url:"assets/index-BS0Fbx5V.css",revision:null},{url:"assets/external-link-CcU-f6-c.js",revision:null},{url:"assets/date-BdNtiQTP.js",revision:null},{url:"assets/copy--Yno9vb0.js",revision:null},{url:"assets/chevron-right-BP3RjJKD.js",revision:null},{url:"assets/bot-DEczKx10.js",revision:null},{url:"assets/arrow-right-Cz2VYV06.js",revision:null},{url:"assets/arrow-left-BIZegN7f.js",revision:null},{url:"assets/WorkerSetupGuidePage-Dj4Uw6lE.js",revision:null},{url:"assets/WorkerListPage-BtbmZFmW.js",revision:null},{url:"assets/WorkerDetailPage-DjJH105s.js",revision:null},{url:"assets/TotpSetupPage-BqZ_9PoT.js",revision:null},{url:"assets/TokenManage-BIb_820M.js",revision:null},{url:"assets/TerminalHomePage-CcAC6dSC.js",revision:null},{url:"assets/TaskStatusBadge-acWzsl5J.js",revision:null},{url:"assets/TaskListPage-CvipzH6U.js",revision:null},{url:"assets/TaskDetailPage-BtKpmra7.js",revision:null},{url:"assets/SkillPage-C8Ajp8QF.js",revision:null},{url:"assets/Skeleton-Dj8lxPoL.js",revision:null},{url:"assets/SettingsPage-TEGcISlB.js",revision:null},{url:"assets/Select-DZq-bKgi.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-l1wwa1W6.js",revision:null},{url:"assets/QuickAuth-Zna-TvoV.js",revision:null},{url:"assets/ProjectListPage-DS1H39MT.js",revision:null},{url:"assets/ProjectDetailPage-BWbDAdFB.js",revision:null},{url:"assets/ProfilePage-CA89g3ZV.js",revision:null},{url:"assets/PipelineEditorPage-CeJlcFvd.js",revision:null},{url:"assets/OnboardingGuide-DnA7icKO.js",revision:null},{url:"assets/NotFoundPage-DJfS5CJ3.js",revision:null},{url:"assets/MetricBar-DJTYljvt.js",revision:null},{url:"assets/LoginPage-BnrBN7Pm.js",revision:null},{url:"assets/LandingPage-boW1qkFr.js",revision:null},{url:"assets/InfoRow-g3rebB-5.js",revision:null},{url:"assets/HomePage-l0ArgLuo.js",revision:null},{url:"assets/EmptyState-Wu8ZN3Cr.js",revision:null},{url:"assets/EditProjectPage-BppWlins.js",revision:null},{url:"assets/DeveloperManage-DCDaMC7Q.js",revision:null},{url:"assets/CliReferencePage-C94W05JK.js",revision:null},{url:"assets/BotManage-BmO8KcyJ.js",revision:null},{url:"assets/BindPlatformPage-B6UZICVu.js",revision:null},{url:"assets/AuditLogPage-AZg7lGzK.js",revision:null},{url:"assets/ApiReferencePage-CmYuc51e.js",revision:null},{url:"assets/AdminPage-Bo3P5iZr.js",revision:null},{url:"assets/AccessTokensPage-CV8VN5V1.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"c35fecd3fb20dd6d473c713737b26dd4"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as ne,e as le,a as ce,r as a,G as u,A as d,g as m,j as e,L as de,P as W,t as f}from"./index-vL7aQJNr.js";import{S as X}from"./Select-BnV8yZlD.js";import{U as pe,A as ie,R as xe}from"./RemoveMemberConfirmDialog-BCrue0AP.js";import{P as ue}from"./plus-Bnd1Vz2Y.js";function he(){const{key:n}=ne(),l=le(),{t:r}=ce(),[o,Q]=a.useState(null),[b,V]=a.useState([]),[Y,Z]=a.useState(!0),[N,v]=a.useState(!1),[j,C]=a.useState(""),[h,w]=a.useState(""),[_,S]=a.useState(""),[k,I]=a.useState(u.GITHUB),[M,T]=a.useState(""),[A,P]=a.useState(d.CLAUDE),[R,U]=a.useState(""),[O,E]=a.useState("50"),[D,$]=a.useState(""),[L,B]=a.useState(""),[G,F]=a.useState(""),[J,q]=a.useState("0"),[p,g]=a.useState(""),[ee,z]=a.useState(!1),[c,y]=a.useState(null),[te,H]=a.useState(!1),i=a.useCallback(async()=>{if(n)try{const[t,x]=await Promise.all([m.get(`web/projects/${n}`).json(),m.get(`web/projects/${n}/members`).json().catch(()=>[])]);if(Q(t),V(x),C(t.name),w(t.repoUrl),S(t.sshUrl??""),I(t.gitPlatform),T(t.defaultBranch),P(t.agentType),U(t.agentCommand??""),E(String(t.maxTurns)),$(t.workspaceRoot??""),B(t.setupCommands??""),F(t.testCommand??""),q(String(t.ptyOutputFilter??0)),t.pipeline)try{g(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{g(t.pipeline)}}catch{}finally{Z(!1)}},[n]);a.useEffect(()=>{i()},[i]);async function re(t){if(t.preventDefault(),!o)return;v(!0);let x=null;if(p.trim())try{JSON.parse(p),x=p.trim()}catch{f.error(r("projects.invalid_pipeline_json")),v(!1);return}try{await m.put(`web/projects/${o.key}`,{json:{name:j,repoUrl:h,sshUrl:_||null,defaultBranch:M,gitPlatform:k,agentType:A,agentCommand:R||null,maxTurns:parseInt(O,10)||50,workspaceRoot:D||null,setupCommands:L||null,testCommand:G||null,ptyOutputFilter:parseInt(J,10)||0,pipeline:x}}),f.success(r("projects.project_saved")),l(`/projects/${o.key}`)}catch(K){const oe=K instanceof Error?K.message:r("projects.failed_to_save_project");f.error(oe)}finally{v(!1)}}function ae(){l(`/projects/${n}`)}async function se(){if(!(!o||!c)){H(!0);try{await m.delete(`web/projects/${o.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await i()}catch{}finally{H(!1),y(null)}}}return Y?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):o?e.jsxs("form",{onSubmit:re,className:"mx-auto max-w-6xl px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l(`/projects/${o.key}`),children:o.key})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r("common.edit")})]}),e.jsx("h1",{className:"text-lg font-bold text-[var(--text-primary)] mb-4",children:r("projects.edit_project_title")}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.basic_info")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.key"),children:e.jsx("input",{type:"text",value:o.key,readOnly:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] outline-none opacity-60 cursor-not-allowed"})}),e.jsx(s,{label:r("projects.name"),children:e.jsx("input",{type:"text",value:j,onChange:t=>C(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:h,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsxs(s,{label:r("projects.ssh_url"),children:[e.jsx("input",{type:"text",value:_,onChange:t=>S(t.target.value),placeholder:r("projects.ssh_url_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:r("projects.ssh_url_hint")})]}),e.jsx(s,{label:r("projects.git_platform"),children:e.jsx(X,{value:k,onChange:t=>I(t),options:[{value:u.GITHUB,label:r("projects.github")},{value:u.GITLAB,label:r("projects.gitlab")},{value:u.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:M,onChange:t=>T(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.agent_config")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.agent_type"),children:e.jsx(X,{value:A,onChange:t=>P(t),options:[{value:d.CLAUDE,label:r("projects.claude")},{value:d.CURSOR,label:r("projects.cursor")},{value:d.CODEX,label:r("projects.codex")},{value:d.CUSTOM,label:r("projects.custom")}]})}),e.jsx(s,{label:r("projects.agent_command"),children:e.jsx("input",{type:"text",value:R,onChange:t=>U(t.target.value),placeholder:"custom agent command",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.max_turns"),children:e.jsx("input",{type:"number",value:O,onChange:t=>E(t.target.value),min:1,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.workspace_root"),children:e.jsx("input",{type:"text",value:D,onChange:t=>$(t.target.value),placeholder:"/path/to/workspace",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.environment")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.setup_commands"),children:e.jsx("textarea",{value:L,onChange:t=>B(t.target.value),rows:3,placeholder:`npm install
|
|
2
|
-
npm run build`,className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.post_command"),children:e.jsx("input",{type:"text",value:G,onChange:t=>F(t.target.value),placeholder:"npm test",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.security")}),e.jsx("div",{className:"space-y-3",children:e.jsx(s,{label:r("projects.pty_output_filter"),children:e.jsx("input",{type:"text",value:J,onChange:t=>q(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.pipeline_section")}),e.jsx(de,{to:"/projects/"+n+"/pipeline",className:"text-xs text-[var(--accent)] hover:underline",children:r("projects.edit_pipeline")})]}),e.jsx("textarea",{value:p,onChange:t=>g(t.target.value),rows:20,spellCheck:!1,placeholder:'{"stages": []}',className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]",style:{fontFamily:'"JetBrains Mono", monospace',textTransform:"none"}})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),e.jsxs("button",{type:"button",onClick:()=>z(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsx("div",{className:"space-y-2",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-[var(--accent)]/20 text-xs font-bold text-[var(--accent)]",children:(t.developerName??String(t.developerId)).charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"ml-2 rounded-[4px] px-1.5 py-0.5 text-[11px] font-medium",style:{color:t.role===W.MAINTAINER?"var(--warning)":"var(--text-secondary)",background:t.role===W.MAINTAINER?"rgba(245,158,11,0.1)":"rgba(163,163,163,0.1)"},children:t.role})]})]}),e.jsx("button",{type:"button",onClick:()=>y(t),className:"text-[var(--destructive)] hover:opacity-70 transition-opacity","aria-label":r("projects.remove_member"),children:e.jsx(pe,{className:"h-3.5 w-3.5"})})]},t.developerId))})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3 border-t border-[var(--border)] pt-6",children:[e.jsx("button",{type:"button",onClick:ae,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.discard")}),e.jsx("button",{type:"submit",disabled:N||!j||!h,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:r(N?"common.saving":"projects.save_changes")})]}),e.jsx(ie,{isOpen:ee,onClose:()=>z(!1),projectKey:o.key,existingMemberIds:b.map(t=>t.developerId),onAdded:i}),e.jsx(xe,{isOpen:!!c,onClose:()=>y(null),onConfirm:se,memberName:c?c.developerName??`#${c.developerId}`:"",loading:te})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>l("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}function s({label:n,children:l}){return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[e.jsx("label",{className:"sm:w-36 shrink-0 sm:pt-2 text-xs text-[var(--text-muted)]",children:n}),e.jsx("div",{className:"flex-1",children:l})]})}export{he as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as V,e as F,a as P,j as e,u as X,h as Z,r as o,g as M,X as Y,i as ee,n as te,H as se,t as q,l as C,o as re,p as $}from"./index-vL7aQJNr.js";import{u as ae}from"./task.store-BE6fEPu4.js";import{T as U}from"./TaskStatusBadge-DuOoGIwE.js";import{f as W}from"./date-BdNtiQTP.js";import{t as oe}from"./string-B39tzdVK.js";import{S as L}from"./Select-BnV8yZlD.js";import{C as ne}from"./copy-BUH7P2Hf.js";import{E as J}from"./EmptyState-D3foEiul.js";import{T as H}from"./Skeleton-DUgWc2LJ.js";import{P as ie}from"./plus-Bnd1Vz2Y.js";import"./status-colors-BPEUp90-.js";const ce=V.memo(function({task:t}){const m=F(),{t:p}=P(),d=(i,r)=>p(`common.${i}`,{n:r});return e.jsxs("tr",{onClick:()=>m(`/tasks/${t.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",t.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:oe(t.description,80)}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(U,{status:t.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.developerName??t.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:W(t.createdAt,d)})]})});function le({isOpen:n,onClose:t,projects:m,projectsLoading:p,onSubmit:d,isSubmitting:i}){const{t:r}=P();X(a=>a.user);const h=Z(),[c,j]=o.useState(""),[x,v]=o.useState(""),[f,b]=o.useState(""),[g,_]=o.useState(""),[A,k]=o.useState([]),[N,u]=o.useState("");o.useEffect(()=>{n&&(j(""),v(""),b(""),_(""),u(""),h&&M.get("admin/developers").json().then(k).catch(()=>k([])))},[n,h]),o.useEffect(()=>{if(!n)return;function a(y){y.key==="Escape"&&t()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[n,t]);async function D(a){if(a.preventDefault(),u(""),!c||!x.trim()){u(r("tasks.project_and_description_required"));return}try{await d({projectKey:c,description:x.trim(),workerId:f||void 0,developerId:g?Number(g):void 0})}catch(y){const R=y instanceof Error?y.message:r("tasks.failed_to_create_task");u(R)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:a=>{a.target===a.currentTarget&&t()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",r("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(Y,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:D,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.task_description")}),e.jsx("textarea",{value:x,onChange:a=>v(a.target.value),placeholder:r("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.project")}),e.jsx(L,{value:c,onChange:j,options:m.map(a=>({value:a.key,label:a.name})),placeholder:r(p?"common.loading":"tasks.select_project"),disabled:p})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.target_worker")}),e.jsx("input",{type:"text",value:f,onChange:a=>b(a.target.value),placeholder:r("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),h&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.assign_developer")}),e.jsx(L,{value:g,onChange:_,options:A.map(a=>({value:String(a.id),label:a.username})),placeholder:r("tasks.select_developer")})]}),N&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:N})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:r("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!c||!x.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:r(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function de({isOpen:n,onClose:t,onForceCreate:m,onViewExisting:p,similarTask:d,isLoading:i}){const{t:r}=P();return!d||!n?null:e.jsx("div",{onClick:t,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:h=>h.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(ne,{style:{width:"1rem",height:"1rem"}}),r("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",d.id," · ",d.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:d.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:r("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>p(d.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:r("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:m,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:r(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function xe({task:n}){const t=F();return e.jsxs("div",{onClick:()=>t(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",n.id," ",n.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(U,{status:n.status})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:W(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const pe=[{key:"all",labelKey:"tasks.tab_all"},{key:C.RUNNING,labelKey:"tasks.tab_running"},{key:C.QUEUED,labelKey:"tasks.tab_queued"},{key:C.COMPLETED,labelKey:"tasks.tab_completed"},{key:C.FAILED,labelKey:"tasks.tab_failed"},{key:C.CANCELLED,labelKey:"tasks.tab_cancelled"}],K=20;function we(){const n=F(),{t}=P(),{tasks:m,loading:p,fetchTasks:d}=ae(),i=ee(s=>s.taskSeq),[r,h]=o.useState("all"),[c,j]=o.useState(""),[x,v]=o.useState(1),[f,b]=o.useState(!1);te(o.useMemo(()=>e.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[g,_]=o.useState([]),[A,k]=o.useState(!1),[N,u]=o.useState(!1),[D,a]=o.useState(!1),[y,R]=o.useState(null),[w,O]=o.useState(null);o.useEffect(()=>{const s={limit:String(K)};r!=="all"&&(s.status=r),d(s)},[r,d,i]),o.useEffect(()=>{v(1)},[c]),o.useEffect(()=>{f&&(k(!0),M.get("web/projects").json().then(s=>_(s)).catch(()=>{}).finally(()=>k(!1)))},[f]);const Q=o.useCallback(async s=>{u(!0);try{const l=await M.post("web/tasks",{json:{projectKey:s.projectKey,description:s.description,workerId:s.workerId,developerId:s.developerId}}).json();b(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof se&&l.response.status===409){try{const S=await l.response.json();if(S.confirmRequired){R({id:S.confirmRequired.taskId,description:S.confirmRequired.message,status:"active"}),O(s),b(!1),a(!0);return}}catch{}q.error(t("tasks.similar_task_exists"))}else{const S=l instanceof Error?l.message:String(l);q.error(S)}}finally{u(!1)}},[n]),G=o.useCallback(async()=>{if(w){u(!0);try{const s=await M.post("web/tasks",{json:{projectKey:w.projectKey,description:w.description,workerId:w.workerId,force:!0}}).json();a(!1),n(`/tasks/${s.task.id}`)}finally{u(!1)}}},[w,n]),E=o.useMemo(()=>{if(!c.trim())return m;const s=c.toLowerCase();return m.filter(l=>l.description.toLowerCase().includes(s)||String(l.id).includes(c))},[m,c]),T=Math.max(1,Math.ceil(E.length/K)),I=E.slice((x-1)*K,x*K),z=t(c?"tasks.try_adjusting_search":"tasks.create_first_task"),B=c?void 0:e.jsx("button",{onClick:()=>b(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:pe.map(s=>e.jsx("button",{onClick:()=>h(s.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${r===s.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(s.labelKey)},s.key))}),e.jsxs("div",{className:"relative md:ml-auto md:w-64",children:[e.jsx(re,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:t("tasks.search_tasks"),value:c,onChange:s=>j(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),c&&e.jsx("button",{onClick:()=>j(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:t("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[p&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(H,{rows:5})})}),!p&&E.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(J,{icon:$,title:t("tasks.no_tasks_found"),description:z,action:B})})}),I.map(s=>e.jsx(ce,{task:s},s.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[p&&I.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(H,{rows:5})}),!p&&E.length===0&&e.jsx(J,{icon:$,title:t("tasks.no_tasks_found"),description:z,action:B}),I.map(s=>e.jsx(xe,{task:s},s.id))]}),T>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:()=>v(Math.max(1,x-1)),disabled:x===1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30 min-w-[44px] min-h-[44px] flex items-center justify-center",children:t("tasks.prev")}),Array.from({length:T},(s,l)=>l+1).map(s=>e.jsx("button",{onClick:()=>v(s),className:`rounded-[4px] px-2.5 py-1 text-xs transition-colors min-w-[44px] min-h-[44px] flex items-center justify-center ${x===s?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:s},s)),e.jsx("button",{onClick:()=>v(Math.min(T,x+1)),disabled:x===T,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30 min-w-[44px] min-h-[44px] flex items-center justify-center",children:t("common.next")})]}),e.jsx(le,{isOpen:f,onClose:()=>b(!1),projects:g,projectsLoading:A,onSubmit:Q,isSubmitting:N}),e.jsx(de,{isOpen:D,onClose:()=>a(!1),onForceCreate:G,onViewExisting:s=>{a(!1),n(`/tasks/${s}`)},similarTask:y,isLoading:N})]})}export{we as default};
|