@overlordai/server 1.0.149 → 1.0.151
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/database/migrations/015-automation-template-taxonomy.sql +99 -0
- package/dist/adapters/lark/lark.controller.js +1 -1
- package/dist/adapters/lark/lark.controller.js.map +1 -1
- package/dist/adapters/slack/slack.controller.d.ts.map +1 -1
- package/dist/adapters/slack/slack.controller.js +4 -1
- package/dist/adapters/slack/slack.controller.js.map +1 -1
- package/dist/automation/automation-template.service.d.ts +4 -1
- package/dist/automation/automation-template.service.d.ts.map +1 -1
- package/dist/automation/automation-template.service.js +9 -2
- package/dist/automation/automation-template.service.js.map +1 -1
- package/dist/automation/builtin-templates.d.ts +14 -0
- package/dist/automation/builtin-templates.d.ts.map +1 -0
- package/dist/automation/builtin-templates.js +327 -0
- package/dist/automation/builtin-templates.js.map +1 -0
- package/dist/database/repositories/automation.repository.d.ts +12 -0
- package/dist/database/repositories/automation.repository.d.ts.map +1 -1
- package/dist/database/repositories/automation.repository.js +63 -2
- package/dist/database/repositories/automation.repository.js.map +1 -1
- package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
- package/dist/dispatcher/dispatcher.service.js +6 -1
- package/dist/dispatcher/dispatcher.service.js.map +1 -1
- package/dist/dispatcher/dispatcher.types.d.ts +2 -0
- package/dist/dispatcher/dispatcher.types.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.d.ts +1 -8
- package/dist/notifier/notification-consumer.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.js +4 -58
- package/dist/notifier/notification-consumer.js.map +1 -1
- package/dist/notifier/template.service.d.ts.map +1 -1
- package/dist/notifier/template.service.js +14 -7
- package/dist/notifier/template.service.js.map +1 -1
- package/dist/web/automation.controller.js +1 -1
- package/dist/web/automation.controller.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-jZ0fW6lX.js → AccessTokensPage-DOQYcLSs.js} +1 -1
- package/public/assets/{AdminPage-BhEFd__u.js → AdminPage-vaAs4nmP.js} +1 -1
- package/public/assets/{AgentCliPage-BlwF0Ske.js → AgentCliPage-BXGIfvSo.js} +1 -1
- package/public/assets/{ApiReferencePage-DYw-AFRb.js → ApiReferencePage-ChGlKtFZ.js} +1 -1
- package/public/assets/{ArchitecturePage-Bj4s2Tjl.js → ArchitecturePage-BDo0Sz0V.js} +1 -1
- package/public/assets/{AuditLogPage-Dw56aHuy.js → AuditLogPage-CDonhWBh.js} +1 -1
- package/public/assets/AutomationCreatePage-C1_2qnf5.js +1 -0
- package/public/assets/{AutomationDetailPage-DNYkC31X.js → AutomationDetailPage-BruGQNkV.js} +1 -1
- package/public/assets/{AutomationEditPage-C8IUsSvR.js → AutomationEditPage-BVlx-7AI.js} +1 -1
- package/public/assets/AutomationListPage-BprhRKdu.js +26 -0
- package/public/assets/{AutomationRunDetailPage-C3PuPibC.js → AutomationRunDetailPage-BWRONm49.js} +2 -2
- package/public/assets/{BindPlatformPage-M_2I5Qrq.js → BindPlatformPage-B-jO83qZ.js} +1 -1
- package/public/assets/BotIntegrationPage-CfWOXPnJ.js +1 -0
- package/public/assets/{BotManage-DGBezqSD.js → BotManage-Dt4gvWW6.js} +1 -1
- package/public/assets/{BotSetupPage-C0Fs8ZnS.js → BotSetupPage-BAtr0Wem.js} +1 -1
- package/public/assets/ChangelogPage-CbYmEPo0.js +1 -0
- package/public/assets/{CliReferencePage-CZfrDLHw.js → CliReferencePage-DzBrPSnn.js} +1 -1
- package/public/assets/ConfirmStageDialog-CJ8pWink.js +6 -0
- package/public/assets/{DeploymentPage-7vnTwGfh.js → DeploymentPage-DngrSHQT.js} +1 -1
- package/public/assets/{DevWorkflowPage-DuwsvFYh.js → DevWorkflowPage-BQfJaZyg.js} +1 -1
- package/public/assets/{DeveloperManage-D4RJh1ZW.js → DeveloperManage-whlVH116.js} +1 -1
- package/public/assets/{DeveloperSetupPage-BrCi0Lwe.js → DeveloperSetupPage-LrbpgJ2C.js} +1 -1
- package/public/assets/DocsIndexPage-vE4yr9Si.js +26 -0
- package/public/assets/{DocsLayout-C6xN_yk0.js → DocsLayout-ByGEAOqk.js} +1 -1
- package/public/assets/{DocsPrimitives-IJB6nZ_z.js → DocsPrimitives-DCBNKtsW.js} +1 -1
- package/public/assets/{EditProjectPage-BPUvr801.js → EditProjectPage-CjJMof0e.js} +2 -2
- package/public/assets/{EmptyState-CW1xfNCv.js → EmptyState-BfgwLg0u.js} +1 -1
- package/public/assets/{EnvVariablesPage-CR4pvBH3.js → EnvVariablesPage-D5h_sa-J.js} +1 -1
- package/public/assets/{HomePage-A0kDqIF6.js → HomePage-BfETjlYe.js} +1 -1
- package/public/assets/{InfoRow-D-vceQHX.js → InfoRow-CIwHf1Un.js} +1 -1
- package/public/assets/{InstallationPage-DQOr1ZdF.js → InstallationPage-2uTV3WlY.js} +1 -1
- package/public/assets/{LandingPage-B1mQ0b1M.js → LandingPage-DMFC0PF_.js} +1 -1
- package/public/assets/{LocalDevelopmentPage-B3tPpv14.js → LocalDevelopmentPage-9g3s63GP.js} +1 -1
- package/public/assets/{LoginPage-2TJGugqP.js → LoginPage-CXwygPZl.js} +1 -1
- package/public/assets/{MetricBar-BWriVYES.js → MetricBar-BWuqiydF.js} +1 -1
- package/public/assets/{NotFoundPage-CL8L-hAH.js → NotFoundPage-Cs7ae_Mz.js} +1 -1
- package/public/assets/{OnboardingGuide-Cdz3B-Hy.js → OnboardingGuide-uCrXzgnL.js} +1 -1
- package/public/assets/{PermissionsPage-BdKxCcLI.js → PermissionsPage-CVrdX2r2.js} +1 -1
- package/public/assets/{PipelineConfigPage-CYPnPxIe.js → PipelineConfigPage-BxkXW1la.js} +1 -1
- package/public/assets/{PipelineEditorPage-Cx5jQ7sn.js → PipelineEditorPage-DiyMvTIg.js} +2 -2
- package/public/assets/{PlanPage-B8izWg2B.js → PlanPage-B-NSg434.js} +1 -1
- package/public/assets/{ProfilePage-S_chkZka.js → ProfilePage-CRMCbMyc.js} +1 -1
- package/public/assets/{ProjectDetailPage-DPjR4K6z.js → ProjectDetailPage-Bx1DUkpw.js} +3 -3
- package/public/assets/{ProjectListPage-B7KDEb5r.js → ProjectListPage-D1LzmIVf.js} +2 -2
- package/public/assets/PtyTerminal-CxBKQBbF.js +38 -0
- package/public/assets/{QuickAuth-kStSentC.js → QuickAuth-BMY6Nw6u.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-nrYU_g4X.js → RemoveMemberConfirmDialog-Da3XlOxO.js} +1 -1
- package/public/assets/{ReviewAggregatePage-BycSqu1a.js → ReviewAggregatePage-mnnW-Nli.js} +2 -2
- package/public/assets/{ReviewPage-CDyr8wXz.js → ReviewPage-_pd3mJC1.js} +1 -1
- package/public/assets/{Select-B0NXCdTE.js → Select-CaAVBHmI.js} +1 -1
- package/public/assets/{SettingsPage-BOXtwa2r.js → SettingsPage-CsDJ7FS9.js} +1 -1
- package/public/assets/{Skeleton-BiHQNXJ9.js → Skeleton-CNV0Dyd8.js} +1 -1
- package/public/assets/{SkillPage-DBiTVuCH.js → SkillPage-CQyxaNa5.js} +1 -1
- package/public/assets/TaskDetailPage-Dn7Vl2tI.js +21 -0
- package/public/assets/{TaskGuidePage-BsH7MBPf.js → TaskGuidePage-Ch465zVv.js} +1 -1
- package/public/assets/{TaskListPage-pui2im5r.js → TaskListPage-DbQbJMDj.js} +1 -1
- package/public/assets/{TaskStatusBadge-CeC-9VO9.js → TaskStatusBadge-Dzloj2eJ.js} +1 -1
- package/public/assets/TerminalHomePage-C2bwGFkH.js +6 -0
- package/public/assets/TokenManage-mToToJ_g.js +1 -0
- package/public/assets/{Tooltip-BtLbD3s1.js → Tooltip-DzkVglKi.js} +1 -1
- package/public/assets/{TotpSetupPage-QOB1KoQV.js → TotpSetupPage-Dk00_OYo.js} +1 -1
- package/public/assets/{WorkerDetailPage-BbUUJ-4x.js → WorkerDetailPage-C8_zfmSR.js} +1 -1
- package/public/assets/{WorkerListPage-Cz97ZJ44.js → WorkerListPage-kKUioe-i.js} +2 -2
- package/public/assets/{WorkerOperationsPage-BVb41hZJ.js → WorkerOperationsPage-CBzwbV8I.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-Cidrk_C8.js → WorkerSetupGuidePage-DvaP5u6N.js} +1 -1
- package/public/assets/{WorkerSetupPage-BEBJC4eO.js → WorkerSetupPage-BD-EAPKM.js} +1 -1
- package/public/assets/{agent-type-options-js05RaN7.js → agent-type-options-BiwwFXJv.js} +1 -1
- package/public/assets/{arrow-left-B7mlJm2S.js → arrow-left-BnN4eZhK.js} +1 -1
- package/public/assets/{arrow-right-pahP-ey1.js → arrow-right-BDaYPEVr.js} +1 -1
- package/public/assets/{bot-Utar32Rx.js → bot-jsWsZ197.js} +1 -1
- package/public/assets/{chevron-down-rRjDei6n.js → chevron-down-DyqUpmgf.js} +1 -1
- package/public/assets/{chevron-left-Bh3DdiT8.js → chevron-left-D5fJVFiB.js} +1 -1
- package/public/assets/{chevron-right-BUIsW0nB.js → chevron-right-Bz-j2WmS.js} +1 -1
- package/public/assets/{chevron-up-CC4d-5nr.js → chevron-up-DEXIEMJO.js} +1 -1
- package/public/assets/{circle-alert-DfjZjHfx.js → circle-alert-DE06tNOV.js} +1 -1
- package/public/assets/{clock-CcoV8c6t.js → clock-DyV22whY.js} +1 -1
- package/public/assets/{copy-CVElRaVS.js → copy-Dtpgo9EK.js} +1 -1
- package/public/assets/{download-Cuv6Ei5j.js → download-DVCPTZuD.js} +1 -1
- package/public/assets/{external-link-Beb0-hR9.js → external-link-Bbo-dc9z.js} +1 -1
- package/public/assets/{git-fork-IyYS1SDo.js → git-fork-A1WGp9ha.js} +1 -1
- package/public/assets/index-Du11Fv9c.css +1 -0
- package/public/assets/{index-CFc6KjWS.js → index-PZwTchr_.js} +32 -27
- package/public/assets/{key-C5pNR-B1.js → key-BDx4jfUG.js} +1 -1
- package/public/assets/{loader-circle-BlnkIjik.js → loader-circle-nKG9e8iK.js} +1 -1
- package/public/assets/{pencil-C2RlSzkd.js → pencil-Dgj4md4-.js} +1 -1
- package/public/assets/{play-CShsFo4_.js → play-DFj8BMl8.js} +1 -1
- package/public/assets/{plus-Awea36q5.js → plus-CCF-PMRF.js} +1 -1
- package/public/assets/{rotate-ccw-Lsbc1OqV.js → rotate-ccw-CyltG4Qx.js} +1 -1
- package/public/assets/{scroll-text-Dljs30sR.js → scroll-text-IFQgBRlh.js} +1 -1
- package/public/assets/{settings-Dagn2Hyc.js → settings-CYtYYzCu.js} +1 -1
- package/public/assets/{skip-forward-DGvJRd3l.js → skip-forward-Ck7tY58a.js} +1 -1
- package/public/assets/{status-colors-BDICDBur.js → status-colors-DDycfcf7.js} +1 -1
- package/public/assets/{task-constants-Cla1S92u.js → task-constants-CSVY_jfk.js} +1 -1
- package/public/assets/{task.store-C7wSxS0U.js → task.store-BTXbcXgO.js} +1 -1
- package/public/assets/{timer-DJB-k-YQ.js → timer-CXsWiTNP.js} +1 -1
- package/public/assets/{trash-2-Dbr1-vpY.js → trash-2-DXJqRCdo.js} +1 -1
- package/public/assets/{useFetch-BXXQ6s_s.js → useFetch-6R6P2rOm.js} +1 -1
- package/public/assets/{users-CAOqfuvd.js → users-BZPY-p6E.js} +1 -1
- package/public/assets/{wifi-CxjX29U2.js → wifi-Bgq95lS8.js} +1 -1
- package/public/assets/{workflow-BAPA9kNh.js → workflow-RqNfx4vc.js} +1 -1
- package/public/assets/{zap-yBKAVFp4.js → zap-BIwamY7L.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AutomationCreatePage-Dt2pGfgf.js +0 -1
- package/public/assets/AutomationListPage-Bqog--Ae.js +0 -16
- package/public/assets/BotIntegrationPage-CAwevaIk.js +0 -1
- package/public/assets/ChangelogPage-DlB2ibrO.js +0 -1
- package/public/assets/ConfirmStageDialog-Z0pbQqim.js +0 -7
- package/public/assets/DocsIndexPage-rnTjEz8b.js +0 -26
- package/public/assets/PtyTerminal-SPgs4fDa.js +0 -38
- package/public/assets/TaskDetailPage-CTVJwy-t.js +0 -21
- package/public/assets/TerminalHomePage-Bu10hJuQ.js +0 -6
- package/public/assets/TokenManage-Bo15S_D_.js +0 -1
- package/public/assets/file-text-DQb29yBJ.js +0 -6
- package/public/assets/index-CdJk2QGi.css +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as R,a as $,j as e,s as q,A as K,f as B,u as H,i as J,r as x,
|
|
1
|
+
import{c as R,a as $,j as e,s as q,A as K,f as B,u as H,i as J,r as x,Y as k,w as V,l as D,Z as Y,h as v}from"./index-PZwTchr_.js";import{U as P,A as Z,R as z}from"./RemoveMemberConfirmDialog-Da3XlOxO.js";import{T as G}from"./Tooltip-DzkVglKi.js";import{c as _}from"./date-RFA7-ZGs.js";import{t as T}from"./status-colors-DDycfcf7.js";import{I as o}from"./InfoRow-CIwHf1Un.js";import{u as Q}from"./useFetch-6R6P2rOm.js";import{P as X}from"./pencil-Dgj4md4-.js";import{T as ee}from"./trash-2-DXJqRCdo.js";import{A as te}from"./arrow-left-BnN4eZhK.js";import{P as re}from"./plus-CCF-PMRF.js";import"./Select-CaAVBHmI.js";import"./chevron-down-DyqUpmgf.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const se=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ae({isOpen:n,onClose:a,onConfirm:r,projectName:m,loading:p}){const{t:j}=$();return e.jsx(q,{isOpen:n,onClose:a,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function ue(){const{key:n}=K(),a=B(),{t:r}=$(),m=H(t=>t.user),p=J(),[j,N]=x.useState(!1),[L,C]=x.useState(!1),[S,A]=x.useState(!1),[d,u]=x.useState(null),[W,I]=x.useState(!1),{data:l,loading:F,error:M,refetch:y}=X(async()=>{if(!n)throw new Error("Missing project key");const[t,w,f]=await Promise.all([v.get(`web/projects/${n}`).json(),v.get(`web/projects/${n}/members`).json().catch(()=>[]),v.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(U=>U.data).catch(()=>[])]);let h=null;if(t.pipeline)try{h=JSON.parse(t.pipeline)}catch{}return{project:t,members:w,tasks:f,pipelineConfig:h}},[n]),s=(l==null?void 0:l.project)??null,b=(l==null?void 0:l.members)??[],g=(l==null?void 0:l.tasks)??[],i=(l==null?void 0:l.pipelineConfig)??null,c=p||b.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===k.MAINTAINER);V(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[c&&e.jsxs("button",{onClick:()=>a(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(Y,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,c,p,a,r]));async function O(){if(s){C(!0);try{await v.delete(`admin/projects/${s.key}`),a("/projects")}catch{}finally{C(!1),N(!1)}}}async function E(){if(!(!s||!d)){I(!0);try{await v.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(d.developerId)}}),await y()}catch{}finally{I(!1),u(null)}}}return F?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):M?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(--destructive)]",children:M}),e.jsx("button",{onClick:()=>y(),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("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>a("/projects"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(te,{className:"h-4 w-4"})}),e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:[s.key," — ",s.name]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 hidden md:block text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md: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")}),c&&e.jsxs("button",{onClick:()=>A(!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(re,{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.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] p-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"block text-[11px] mt-0.5",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-muted)"},children:t.role})]}),c&&e.jsx("button",{onClick:()=>u(t),className:"shrink-0 text-[var(--destructive)] hover:underline ml-2","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})]},t.developerId))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),c&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)}),c&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>u(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),g.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_tasks_for_project")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:g.map(t=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] p-3 transition-colors active:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),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 line-clamp-2",title:t.description,children:["#",t.id," ",D(t)]}),e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:T[t.status]},children:t.status})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(t.createdAt)})]},t.id))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:e.jsx(Q,{content:t.description,children:D(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:T[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)})]},t.id))})]})})]})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((t,w)=>{var f,h;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
|
|
7
|
-
`)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((f=t.onFailure)==null?void 0:f.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(
|
|
6
|
+
*/const se=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ae({isOpen:n,onClose:a,onConfirm:r,projectName:m,loading:p}){const{t:j}=$();return e.jsx(q,{isOpen:n,onClose:a,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function ue(){const{key:n}=K(),a=B(),{t:r}=$(),m=H(t=>t.user),p=J(),[j,N]=x.useState(!1),[L,C]=x.useState(!1),[S,A]=x.useState(!1),[d,u]=x.useState(null),[W,I]=x.useState(!1),{data:l,loading:F,error:M,refetch:y}=Q(async()=>{if(!n)throw new Error("Missing project key");const[t,w,f]=await Promise.all([v.get(`web/projects/${n}`).json(),v.get(`web/projects/${n}/members`).json().catch(()=>[]),v.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(U=>U.data).catch(()=>[])]);let h=null;if(t.pipeline)try{h=JSON.parse(t.pipeline)}catch{}return{project:t,members:w,tasks:f,pipelineConfig:h}},[n]),s=(l==null?void 0:l.project)??null,b=(l==null?void 0:l.members)??[],g=(l==null?void 0:l.tasks)??[],i=(l==null?void 0:l.pipelineConfig)??null,c=p||b.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===k.MAINTAINER);V(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[c&&e.jsxs("button",{onClick:()=>a(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(X,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,c,p,a,r]));async function O(){if(s){C(!0);try{await v.delete(`admin/projects/${s.key}`),a("/projects")}catch{}finally{C(!1),N(!1)}}}async function E(){if(!(!s||!d)){I(!0);try{await v.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(d.developerId)}}),await y()}catch{}finally{I(!1),u(null)}}}return F?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):M?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(--destructive)]",children:M}),e.jsx("button",{onClick:()=>y(),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("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>a("/projects"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(te,{className:"h-4 w-4"})}),e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:[s.key," — ",s.name]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 hidden md:block text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md: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")}),c&&e.jsxs("button",{onClick:()=>A(!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(re,{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.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] p-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"block text-[11px] mt-0.5",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-muted)"},children:t.role})]}),c&&e.jsx("button",{onClick:()=>u(t),className:"shrink-0 text-[var(--destructive)] hover:underline ml-2","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})]},t.developerId))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),c&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)}),c&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>u(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),g.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_tasks_for_project")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:g.map(t=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] p-3 transition-colors active:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),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 line-clamp-2",title:t.description,children:["#",t.id," ",D(t)]}),e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:T[t.status]},children:t.status})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(t.createdAt)})]},t.id))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:e.jsx(G,{content:t.description,children:D(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:T[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)})]},t.id))})]})})]})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((t,w)=>{var f,h;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
|
|
7
|
+
`)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((f=t.onFailure)==null?void 0:f.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(Y,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["onFailure.goto: ",t.onFailure.goto,", maxLoops: ",t.onFailure.maxLoops]})]}),w<i.stages.length-1&&!((h=t.onFailure)!=null&&h.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(se,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},t.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:r("projects.no_pipeline_configured")}),c&&e.jsx("button",{onClick:()=>a(`/projects/${s.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:r("projects.add_stage")})]})})]}),e.jsx(ae,{isOpen:j,onClose:()=>N(!1),onConfirm:O,projectName:s.name,loading:L}),e.jsx(Z,{isOpen:S,onClose:()=>A(!1),projectKey:s.key,existingMemberIds:b.map(t=>t.developerId),onAdded:y}),e.jsx(z,{isOpen:!!d,onClose:()=>u(null),onConfirm:E,memberName:d?d.developerName??`#${d.developerId}`:"",loading:W})]})]}):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:()=>a("/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")})]})}export{ue as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as I,a as P,v as R,r as o,G as x,
|
|
1
|
+
import{c as I,a as P,v as R,r as o,G as x,O as z,j as e,h as E,f as H,w as M}from"./index-PZwTchr_.js";import{S as U}from"./Select-CaAVBHmI.js";import{a as D}from"./agent-type-options-BiwwFXJv.js";import{E as J}from"./EmptyState-BfgwLg0u.js";import{T as O}from"./Skeleton-CNV0Dyd8.js";import{t as q}from"./date-RFA7-ZGs.js";import{u as W}from"./useFetch-6R6P2rOm.js";import{P as $}from"./plus-CCF-PMRF.js";import{A as K}from"./arrow-left-BnN4eZhK.js";import"./chevron-down-DyqUpmgf.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const V=I("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),m={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},i={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function Q({isOpen:l,onClose:a,onCreated:j}){const{t}=P();R(l);const d=D(r=>r),[c,u]=o.useState(""),[s,b]=o.useState(""),[n,g]=o.useState(""),[y,f]=o.useState(""),[C,_]=o.useState("main"),[k,N]=o.useState(x.GITHUB),[S,B]=o.useState(z.CLAUDE),[p,T]=o.useState(!1),[w,v]=o.useState("");o.useEffect(()=>{l&&F()},[l]);function F(){u(""),b(""),g(""),f(""),_("main"),N(x.GITHUB),B(z.CLAUDE),v("")}function A(){F(),a()}async function L(r){r.preventDefault(),v(""),T(!0);try{const h=await E.post("admin/projects",{json:{name:c,key:s,repoUrl:n,sshUrl:y||void 0,defaultBranch:C,gitPlatform:k,agentType:S}}).json();j(h),A()}catch(h){const G=h instanceof Error?h.message:t("projects.failed_to_create_project");v(G)}finally{T(!1)}}return l?e.jsx("div",{style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))",padding:"1rem"},children:e.jsxs("div",{onClick:r=>r.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},children:["> ",t("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:t("projects.add_project_desc")})]}),w&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:w}),e.jsxs("form",{onSubmit:L,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_name")}),e.jsx("input",{type:"text",value:c,onChange:r=>u(r.target.value),placeholder:t("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_key")}),e.jsx("input",{type:"text",value:s,onChange:r=>b(r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:t("projects.project_key_placeholder"),required:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.repo_url")}),e.jsx("input",{type:"text",value:n,onChange:r=>g(r.target.value),placeholder:t("projects.repo_url_placeholder"),required:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.ssh_url")}),e.jsx("input",{type:"text",value:y,onChange:r=>f(r.target.value),placeholder:t("projects.ssh_url_placeholder"),style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.ssh_url_hint")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.default_branch")}),e.jsx("input",{type:"text",value:C,onChange:r=>_(r.target.value),placeholder:t("projects.main"),style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.git_platform")}),e.jsx(U,{value:k,onChange:r=>N(r),options:[{value:x.GITHUB,label:t("projects.github")},{value:x.GITLAB,label:t("projects.gitlab")},{value:x.GITEA,label:t("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.agent_type")}),e.jsx(U,{value:S,onChange:r=>B(r),options:d})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:A,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:t("common.cancel")}),e.jsx("button",{type:"submit",disabled:p||!c||!s||!n,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p||!c||!s||!n?"not-allowed":"pointer",opacity:p||!c||!s||!n?.7:1},children:t(p?"common.creating":"common.create")})]})]})]})}):null}function le(){const l=H(),{t:a}=P(),[j,t]=o.useState(!1),{data:d,loading:c,refetch:u}=W(()=>E.get("web/projects").json(),[]);return M(o.useMemo(()=>e.jsxs("button",{onClick:()=>t(!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($,{className:"h-3.5 w-3.5"}),a("projects.create_project")]}),[a])),e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>l("/dashboard"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(K,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:a("projects.title")})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[c?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(O,{rows:4})}):!d||d.length===0?e.jsx(J,{icon:V,title:a("projects.no_projects_yet"),description:a("projects.create_first_project"),actionLabel:a("projects.create_project"),onAction:()=>t(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:d.map(s=>e.jsxs("div",{onClick:()=>l(`/projects/${s.key}`),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-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--accent)]",children:s.key}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.taskCount??0," tasks"]})]}),e.jsx("span",{className:"mt-1 block text-[11px] text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"mt-0.5 block text-[11px] text-[var(--text-muted)]",children:s.agentType})]},s.key))}),e.jsxs("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:a("projects.key")}),e.jsx("span",{children:a("projects.name")}),e.jsx("span",{children:a("projects.members")}),e.jsx("span",{children:a("projects.tasks_count")}),e.jsx("span",{children:a("projects.last_activity")})]}),d.map((s,b)=>e.jsxs("div",{onClick:()=>l(`/projects/${s.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:b+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:s.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsxs("span",{className:"block truncate text-[11px] text-[var(--text-muted)]",children:[s.agentType," · ",s.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(s.members??[]).map(n=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[11px] font-bold text-[var(--accent)]",title:n.name,children:n.name.charAt(0).toUpperCase()},n.id)),(s.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[11px] text-[var(--text-muted)]",children:["+",s.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.taskCount??0}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:q(s.lastActivity??null)})]},s.key))]})]}),e.jsx(Q,{isOpen:j,onClose:()=>t(!1),onCreated:u})]})]})}export{le as default};
|