@overlordai/server 1.0.36 → 1.0.37
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/package.json +2 -2
- package/public/assets/{AccessTokensPage-DTrIditb.js → AccessTokensPage-ojllPkL9.js} +1 -1
- package/public/assets/{AdminPage-spE4NopL.js → AdminPage-DT5Gz95n.js} +1 -1
- package/public/assets/{ApiReferencePage-BQTlr1a3.js → ApiReferencePage-ClkFkTlQ.js} +1 -1
- package/public/assets/{AuditLogPage-DpWVEOeD.js → AuditLogPage-ItQ-a-Ug.js} +1 -1
- package/public/assets/{BotManage-BHIfrSQ9.js → BotManage-B6ghS4AS.js} +1 -1
- package/public/assets/{CliReferencePage-BpD75e6J.js → CliReferencePage-Dp2FlU4w.js} +1 -1
- package/public/assets/{DeveloperManage-w3ZCt_NM.js → DeveloperManage-Dd69OOTz.js} +1 -1
- package/public/assets/EditProjectPage-CHOX_K9y.js +2 -0
- package/public/assets/{EmptyState-C9vei1H4.js → EmptyState-CqOs-r87.js} +1 -1
- package/public/assets/{HomePage-CPg4Qc6p.js → HomePage-BFeB9nZ3.js} +1 -1
- package/public/assets/{LandingPage-B6mDnkMI.js → LandingPage-J4rOJEzd.js} +1 -1
- package/public/assets/{LoginPage-lTCE4PWV.js → LoginPage-DZSKqR5I.js} +1 -1
- package/public/assets/{MachineDetailPage-CVj-dTHS.js → MachineDetailPage-CLbJ-Pzk.js} +1 -1
- package/public/assets/{MachineListPage-DQq5DZFL.js → MachineListPage-D5AjVzuP.js} +1 -1
- package/public/assets/{NotFoundPage-COyyGIMN.js → NotFoundPage-DBAUSGVI.js} +1 -1
- package/public/assets/{PipelineEditorPage-DEw5xksl.js → PipelineEditorPage-C2Oc_jPg.js} +1 -1
- package/public/assets/{ProfilePage-DjFeJa-r.js → ProfilePage-C95OfWvM.js} +1 -1
- package/public/assets/{ProjectDetailPage-Bi4r2iHL.js → ProjectDetailPage-Cv_Vkdmn.js} +3 -3
- package/public/assets/{ProjectListPage-BKuhnPBI.js → ProjectListPage-Cb3X53kU.js} +1 -1
- package/public/assets/{QuickAuth-L60GzSOW.js → QuickAuth-BZuEWnXM.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-2jr0B-lt.js → RemoveMemberConfirmDialog-DJc5TI2H.js} +1 -1
- package/public/assets/{Select-DOPqCoVh.js → Select-vE59gnrR.js} +1 -1
- package/public/assets/{SettingsPage-BPNWmxTz.js → SettingsPage-bUzbAlJ5.js} +1 -1
- package/public/assets/{Skeleton-DRiV4Mc_.js → Skeleton-DkWfJwGk.js} +1 -1
- package/public/assets/{SkillPage-CtW_Yh-Z.js → SkillPage-KxhNwqaU.js} +1 -1
- package/public/assets/{TaskDetailPage-BONY8TYd.js → TaskDetailPage-DcbvNDx0.js} +1 -1
- package/public/assets/{TaskListPage-D86Z1p5a.js → TaskListPage-BCXlj6fs.js} +1 -1
- package/public/assets/{TaskStatusBadge-BOkVIY-S.js → TaskStatusBadge-C6STyltI.js} +1 -1
- package/public/assets/{TokenManage-DJ5FKh1g.js → TokenManage-DfPGpCx-.js} +1 -1
- package/public/assets/{TotpSetupPage-D4zL65kY.js → TotpSetupPage-Xa8ezAxQ.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-DkERqTk-.js → WorkerSetupGuidePage-QJry2UPm.js} +1 -1
- package/public/assets/{arrow-left-rWVL-A4T.js → arrow-left-_sT90Vgd.js} +1 -1
- package/public/assets/{arrow-right-DES2lofC.js → arrow-right-BrkUEdML.js} +1 -1
- package/public/assets/{bot-Bjj1z-2h.js → bot-D0OdHc2O.js} +1 -1
- package/public/assets/{chevron-right-CNgok700.js → chevron-right-DE9L0bkk.js} +1 -1
- package/public/assets/{copy-CpdsOI_O.js → copy-DeIFkKL0.js} +1 -1
- package/public/assets/{external-link-Cp9i7osW.js → external-link-8WYxL39M.js} +1 -1
- package/public/assets/{index-BdEJ0aTM.js → index-IC0w3nms.js} +2 -2
- package/public/assets/{key-D6HzwwXl.js → key-BWK1AZ5R.js} +1 -1
- package/public/assets/{loader-circle-CwvOmGaz.js → loader-circle-CjjIeO9t.js} +1 -1
- package/public/assets/{pencil-D6ZHfLK_.js → pencil-BIUaEBhE.js} +1 -1
- package/public/assets/{plus-8YfTJ47b.js → plus-DAoE-jeh.js} +1 -1
- package/public/assets/{rotate-ccw-CrJHxzN4.js → rotate-ccw-CY2m880Q.js} +1 -1
- package/public/assets/{scroll-text-dlAJEgcC.js → scroll-text-C4o9sGsu.js} +1 -1
- package/public/assets/{settings-B5JVwtOy.js → settings-CRoMlkO8.js} +1 -1
- package/public/assets/{task.store-CR5aAb6q.js → task.store-DDFQ0jcG.js} +1 -1
- package/public/assets/{trash-2-Dkm6k-XU.js → trash-2-CopJbaLA.js} +1 -1
- package/public/assets/{users-Bb4kMVG2.js → users-C5PA9aph.js} +1 -1
- package/public/index.html +1 -1
- package/public/assets/EditProjectPage-BWYk0T8l.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L,r as a,f as m,t as i,j as e,L as S,K as R}from"./index-
|
|
1
|
+
import{a as L,r as a,f as m,t as i,j as e,L as S,K as R}from"./index-IC0w3nms.js";function D(){const{t:r}=L(),[t,k]=a.useState(null),[P,u]=a.useState(!0),[x,f]=a.useState(""),[o,b]=a.useState(""),[v,g]=a.useState(""),[h,j]=a.useState(!1),[_,n]=a.useState(""),[c,w]=a.useState(""),[y,N]=a.useState(!1),p=a.useCallback(async()=>{try{u(!0);const s=await m.get("web/profile").json();k(s)}catch{i.error(r("profile.failed_to_load_profile"))}finally{u(!1)}},[r]);a.useEffect(()=>{p()},[p]);const C=async()=>{if(n(""),!x){n(r("profile.current_password_required"));return}if(!o){n(r("profile.new_password_required"));return}if(o.length<10||o.length>20){n(r("profile.password_length_10_20"));return}if(o!==v){n(r("profile.passwords_do_not_match"));return}try{j(!0),await m.put("web/profile/password",{json:{currentPassword:x,newPassword:o}}),i.success(r("profile.password_changed")),f(""),b(""),g("")}catch(s){const d=s instanceof Error?s.message:r("profile.failed_to_change_password");n(d)}finally{j(!1)}},E=async()=>{if(!c||c.length!==6){i.error(r("profile.totp_code_required"));return}try{N(!0),await m.post("web/profile/totp/regenerate",{json:{code:c}}),i.success(r("profile.two_fa_regenerated")),w(""),p()}catch(s){const d=s instanceof Error?s.message:r("profile.totp_code_invalid");i.error(d)}finally{N(!1)}};return P?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):e.jsxs("div",{className:"mx-auto max-w-xl space-y-8 px-6 py-8 font-mono lowercase",children:[e.jsxs("h1",{className:"text-lg text-[var(--text-primary)]",children:[r("profile.title")," ",e.jsx("span",{className:"text-[var(--text-muted)]",children:r("profile.personal_settings")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.profile_info")}),t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{label:r("profile.username"),value:t.name}),e.jsx(l,{label:r("common.role"),value:t.role}),e.jsx(l,{label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(l,{label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(l,{label:r("profile.status"),value:t.status}),e.jsx(l,{label:r("profile.created_at"),value:new Date(t.createdAt).toLocaleDateString()})]}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("profile.unable_to_load_profile")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.change_password")}),e.jsxs("div",{className:"space-y-4",children:[_&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:_}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_password")}),e.jsx("input",{type:"password",value:x,onChange:s=>f(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.new_password")}),e.jsx("input",{type:"password",value:o,onChange:s=>b(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r("profile.password_hint_10_20")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.confirm_password")}),e.jsx("input",{type:"password",value:v,onChange:s=>g(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:C,disabled:h,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(h?"common.updating":"profile.update_password")})})]})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.two_factor_auth")}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm",children:t!=null&&t.totpEnabled?e.jsxs("span",{className:"text-[var(--accent)]",children:["● ",r("profile.two_fa_enabled")]}):e.jsxs("span",{className:"text-[var(--text-muted)]",children:["● ",r("profile.two_fa_not_setup")]})}),(t==null?void 0:t.totpEnabled)&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.regenerate_2fa_warning")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_totp_code")}),e.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,placeholder:r("profile.totp_code_placeholder"),value:c,onChange:s=>{const d=s.target.value.replace(/\D/g,"").slice(0,6);w(d)},className:"w-full max-w-xs rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)] font-mono tracking-widest"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:E,disabled:y||c.length!==6,className:"rounded-[4px] border border-[var(--warning)] bg-transparent px-4 py-2 text-xs font-medium text-[var(--warning)] hover:bg-[var(--warning)] hover:text-black disabled:opacity-50 transition-colors",children:r(y?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(S,{to:"/access-tokens",className:"flex items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]",children:[e.jsx(R,{size:16,className:"text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[var(--text-primary)]",children:r("profile.access_tokens")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.access_tokens_desc")})]})]})]})}function l({label:r,value:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-28 shrink-0 text-xs text-[var(--text-muted)]",children:r}),e.jsx("span",{className:"text-sm text-[var(--text-primary)]",children:t})]})}export{D as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as F,a as S,j as e,l as G,m as K,d as q,u as B,r as l,h as H,f as j,v as J}from"./index-
|
|
1
|
+
import{c as F,a as S,j as e,l as G,m as K,d as q,u as B,r as l,h as H,f as j,v as J}from"./index-IC0w3nms.js";import{T as d}from"./protocol-C5uQmiiB.js";import{U as Q,A as V,R as z}from"./RemoveMemberConfirmDialog-DJc5TI2H.js";import{P as W}from"./pencil-BIUaEBhE.js";import{T as X}from"./trash-2-CopJbaLA.js";import{P as Y}from"./plus-DAoE-jeh.js";import"./Select-vE59gnrR.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 Z=F("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ee({isOpen:n,onClose:a,onConfirm:t,projectName:o,loading:p}){const{t:r}=S();return e.jsx(G,{isOpen:n,onClose:a,onConfirm:t,title:`> ${r("projects.delete_project")}`,message:r("projects.delete_project_confirm",{name:o}),confirmLabel:r("projects.delete_project"),confirmVariant:"danger",isLoading:p})}const te={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"var(--info)",[d.RUNNING]:"var(--info)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function D(n){return new Date(n).toLocaleString()}function de(){const{key:n}=K(),a=q(),{t}=S(),o=B(s=>s.user),p=(o==null?void 0:o.role)==="admin",[r,M]=l.useState(null),[u,P]=l.useState([]),i=p||u.some(s=>s.developerId===(o==null?void 0:o.id)&&s.role==="maintainer"),[w,L]=l.useState([]),[A,E]=l.useState(!0),[x,f]=l.useState(null),[I,N]=l.useState(!1),[T,k]=l.useState(!1),[$,_]=l.useState(!1),[m,y]=l.useState(null),[
|
|
7
|
-
`)[0].slice(0,40)]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.confirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:t("projects.confirm_label")}),s.irreversible&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:t("pipeline.irreversible")})]})]}),((
|
|
6
|
+
*/const Z=F("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ee({isOpen:n,onClose:a,onConfirm:t,projectName:o,loading:p}){const{t:r}=S();return e.jsx(G,{isOpen:n,onClose:a,onConfirm:t,title:`> ${r("projects.delete_project")}`,message:r("projects.delete_project_confirm",{name:o}),confirmLabel:r("projects.delete_project"),confirmVariant:"danger",isLoading:p})}const te={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"var(--info)",[d.RUNNING]:"var(--info)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function D(n){return new Date(n).toLocaleString()}function de(){const{key:n}=K(),a=q(),{t}=S(),o=B(s=>s.user),p=(o==null?void 0:o.role)==="admin",[r,M]=l.useState(null),[u,P]=l.useState([]),i=p||u.some(s=>s.developerId===(o==null?void 0:o.id)&&s.role==="maintainer"),[w,L]=l.useState([]),[A,E]=l.useState(!0),[x,f]=l.useState(null),[I,N]=l.useState(!1),[T,k]=l.useState(!1),[$,_]=l.useState(!1),[m,y]=l.useState(null),[U,C]=l.useState(!1);H(l.useMemo(()=>r?e.jsxs(e.Fragment,{children:[i&&e.jsxs("button",{onClick:()=>a(`/projects/${r.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(W,{className:"h-3 w-3"}),t("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(X,{className:"h-3 w-3"}),t("common.delete")]})]}):null,[r,i,p,a,t]));const v=l.useCallback(async()=>{if(n)try{const[s,g,h]=await Promise.all([j.get(`web/projects/${n}`).json(),j.get(`web/projects/${n}/members`).json().catch(()=>[]),j.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(b=>b.data).catch(()=>[])]);if(M(s),P(g),L(h),s.pipeline)try{f(JSON.parse(s.pipeline))}catch{f(null)}else f(null)}catch{}finally{E(!1)}},[n]);l.useEffect(()=>{v()},[v]);async function O(){if(r){k(!0);try{await j.delete(`admin/projects/${r.key}`),a("/projects")}catch{}finally{k(!1),N(!1)}}}async function R(){if(!(!r||!m)){C(!0);try{await j.delete(`web/projects/${r.key}/members`,{searchParams:{developerId:String(m.developerId)}}),await v()}catch{}finally{C(!1),y(null)}}}return A?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)]"})}):r?e.jsxs("div",{className:"mx-auto max-w-6xl 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:()=>a("/projects"),children:t("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r.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 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:t("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{label:t("projects.key"),value:r.key}),e.jsx(c,{label:t("projects.name"),value:r.name}),e.jsx(c,{label:t("projects.repo_url"),value:r.repoUrl,href:r.repoUrl}),r.sshUrl&&e.jsx(c,{label:t("projects.ssh_url"),value:r.sshUrl}),e.jsx(c,{label:t("projects.git_platform"),value:r.gitPlatform}),e.jsx(c,{label:t("projects.default_branch"),value:r.defaultBranch}),e.jsx(c,{label:t("projects.agent_type"),value:r.agentType}),e.jsx(c,{label:t("projects.max_turns"),value:String(r.maxTurns)}),e.jsx(c,{label:t("projects.allowed_tools"),value:r.allowedTools??"all"}),e.jsx(c,{label:t("projects.auto_merge"),value:r.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded 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:t("projects.members")}),i&&e.jsxs("button",{onClick:()=>_(!0),className:"flex items-center gap-1.5 rounded bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),t("projects.add_member")]})]}),u.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:t("projects.no_members_yet")})]}):e.jsx("div",{className:"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:t("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.added_at")}),i&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:t("common.actions")})]})}),e.jsx("tbody",{children:u.map(s=>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:s.developerName??`#${s.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:s.role==="maintainer"?"var(--warning)":"var(--text-secondary)"},children:s.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)}),i&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>y(s),className:"text-[var(--destructive)] hover:underline","aria-label":t("projects.remove_member"),children:e.jsx(Q,{className:"h-3.5 w-3.5"})})})]},s.developerId))})]})})]}),e.jsxs("section",{className:"rounded 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:t("projects.recent_tasks")}),w.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:t("projects.no_tasks_for_project")})]}):e.jsx("div",{className:"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:t("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.created")})]})}),e.jsx("tbody",{children:w.map(s=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${s.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:s.description}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:te[s.status]},children:s.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)})]},s.id))})]})})]})]}),e.jsx("div",{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-[13px] font-medium text-[var(--accent)]",children:t("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),x!=null&&x.stages&&x.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:x.stages.map((s,g)=>{var h,b;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/${r.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:s.name}),s.command&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",s.command.split(`
|
|
7
|
+
`)[0].slice(0,40)]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.confirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:t("projects.confirm_label")}),s.irreversible&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:t("pipeline.irreversible")})]})]}),((h=s.onFailure)==null?void 0:h.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(J,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[10px] text-[var(--warning)]",children:["onFailure.goto: ",s.onFailure.goto,", maxLoops: ",s.onFailure.maxLoops]})]}),g<x.stages.length-1&&!((b=s.onFailure)!=null&&b.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(Z,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},s.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:t("projects.no_pipeline_configured")}),i&&e.jsx("button",{onClick:()=>a(`/projects/${r.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:t("projects.add_stage")})]})})]}),e.jsx(ee,{isOpen:I,onClose:()=>N(!1),onConfirm:O,projectName:r.name,loading:T}),e.jsx(V,{isOpen:$,onClose:()=>_(!1),projectKey:r.key,existingMemberIds:u.map(s=>s.developerId),onAdded:v}),e.jsx(z,{isOpen:!!m,onClose:()=>y(null),onConfirm:R,memberName:m?m.developerName??`#${m.developerId}`:"",loading:U})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:t("projects.back_to_projects")})]})}function c({label:n,value:a,href:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-32 shrink-0 text-xs text-[var(--text-muted)]",children:n}),t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",children:a}):e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:a})]})}export{de as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as L,a as E,r as a,j as e,f as z,d as D,h as R}from"./index-
|
|
1
|
+
import{c as L,a as E,r as a,j as e,f as z,d as D,h as R}from"./index-IC0w3nms.js";import{G as h,A as m}from"./protocol-C5uQmiiB.js";import{S as F}from"./Select-vE59gnrR.js";import{E as G}from"./EmptyState-CqOs-r87.js";import{T as I}from"./Skeleton-DkWfJwGk.js";import{P as H}from"./plus-DAoE-jeh.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{a as b,r as s,f as h,j as e,C as v}from"./index-
|
|
1
|
+
import{a as b,r as s,f as h,j as e,C as v}from"./index-IC0w3nms.js";import{C as f}from"./copy-DeIFkKL0.js";function k({mode:l}){const{t:o}=b(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{h.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status==="active");d(r),r.length>0&&c(r[0].id)}).catch(()=>{})},[]);const a=l==="cli"?"ov login --token <your-token>":'curl -H "authorization: bearer <your-token>" http://localhost:9000/api/web/tasks',p=s.useCallback(()=>{navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},[a]);return n.length===0?null:e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--accent)]/20 bg-[var(--bg-card)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:o("docs.quick_start_with_token")}),e.jsx("select",{value:x??"",onChange:t=>c(Number(t.target.value)),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2 py-1 text-xs text-[var(--text-primary)]",children:n.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] break-all",children:a}),e.jsx("button",{onClick:p,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:u?e.jsx(v,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{k as Q};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as w,a as _,r as s,j as e,X as R,f as g,l as C}from"./index-
|
|
1
|
+
import{c as w,a as _,r as s,j as e,X as R,f as g,l as C}from"./index-IC0w3nms.js";import{P as l}from"./protocol-C5uQmiiB.js";import{S as N}from"./Select-vE59gnrR.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{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-IC0w3nms.js";const n="rounded-[4px] bg-[var(--border)] animate-pulse";function c({rows:r=5}){const a=[[60,200,80,120],[60,160,100,80],[60,220,70,140],[60,180,90,100],[60,190,110,90]];return e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:r}).map((s,l)=>{const t=a[l%a.length];return e.jsx("div",{className:"flex gap-4",children:t.map((i,o)=>e.jsx("div",{className:n,style:{width:i,height:12}},o))},l)})})}function m({cards:r=4}){return e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Array.from({length:r}).map((a,s)=>e.jsx("div",{className:`${n} h-20`},s))})}export{m as C,c as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,j as e,r as n,C as o}from"./index-
|
|
1
|
+
import{a as c,j as e,r as n,C as o}from"./index-IC0w3nms.js";import{E as i}from"./external-link-8WYxL39M.js";import{C as d}from"./copy-DeIFkKL0.js";function a({text:t}){const[s,r]=n.useState(!1);return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:s?e.jsx(o,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(d,{className:"h-3 w-3"})})}function x({text:t}){return e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:t}),e.jsx(a,{text:t})]})}const l=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see machine status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and machines by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],m=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many machines are online?","cancel task 15"],p=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function b(){c();const t=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(x,{text:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:t})]}),e.jsx(a,{text:`export OVERLORD_SERVER=${t}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(a,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[10px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:l.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),m.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:p.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(i,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{b as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var He=Object.defineProperty;var Fe=(G,$,F)=>$ in G?He(G,$,{enumerable:!0,configurable:!0,writable:!0,value:F}):G[$]=F;var ve=(G,$,F)=>Fe(G,typeof $!="symbol"?$+"":$,F);import{c as pe,r as z,u as We,f as ce,j as C,a as be,l as Ie,m as Ue,d as $e,n as ze,X as we,o as Ke,t as ke,i as qe}from"./index-
|
|
1
|
+
var He=Object.defineProperty;var Fe=(G,$,F)=>$ in G?He(G,$,{enumerable:!0,configurable:!0,writable:!0,value:F}):G[$]=F;var ve=(G,$,F)=>Fe(G,typeof $!="symbol"?$+"":$,F);import{c as pe,r as z,u as We,f as ce,j as C,a as be,l as Ie,m as Ue,d as $e,n as ze,X as we,o as Ke,t as ke,i as qe}from"./index-IC0w3nms.js";import{u as Ve}from"./task.store-DDFQ0jcG.js";import{S as Ge}from"./Select-vE59gnrR.js";import{A as Xe}from"./arrow-left-_sT90Vgd.js";import{R as Je}from"./rotate-ccw-CY2m880Q.js";import{E as Ye}from"./external-link-8WYxL39M.js";import{L as Ee}from"./loader-circle-CjjIeO9t.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{d as I,j as e,g as T,a as P,r as n,X as U,h as O,f as K,H as Q,i as W,k as R}from"./index-BdEJ0aTM.js";import{u as G}from"./task.store-CR5aAb6q.js";import{T as B}from"./TaskStatusBadge-BOkVIY-S.js";import{S as F}from"./Select-DOPqCoVh.js";import{C as V}from"./copy-CpdsOI_O.js";import{E as $}from"./EmptyState-C9vei1H4.js";import{T as z}from"./Skeleton-DRiV4Mc_.js";import{P as X}from"./plus-8YfTJ47b.js";function Z(s,t){return s.length<=t?s:s.slice(0,t)+"..."}function Y(s){const t=Date.now(),m=new Date(s).getTime(),d=t-m,c=Math.floor(d/6e4);if(c<1)return T("common.just_now");if(c<60)return T("common.m_ago",{n:c});const o=Math.floor(c/60);if(o<24)return T("common.h_ago",{n:o});const a=Math.floor(o/24);return T("common.d_ago",{n:a})}function ee({task:s}){const t=I();return e.jsxs("tr",{onClick:()=>t(`/tasks/${s.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:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:Z(s.description,80)}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(B,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.machineName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:Y(s.createdAt)})]})}function te({isOpen:s,onClose:t,projects:m,projectsLoading:d,onSubmit:c,isSubmitting:o}){const{t:a}=P(),[l,g]=n.useState(""),[x,u]=n.useState(""),[b,p]=n.useState(""),[M,k]=n.useState(""),[N,f]=n.useState("");n.useEffect(()=>{s&&(g(""),u(""),p(""),k(""),f(""))},[s]),n.useEffect(()=>{if(!s)return;function i(v){v.key==="Escape"&&t()}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[s,t]);async function _(i){if(i.preventDefault(),f(""),!l||!x.trim()){f(a("tasks.project_and_description_required"));return}try{await c({projectKey:l,description:x.trim(),machineId:b||void 0,agentType:void 0})}catch(v){const y=v instanceof Error?v.message:a("tasks.failed_to_create_task");f(y)}}return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:i=>{i.target===i.currentTarget&&t()},children:e.jsxs("div",{className:"w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:i=>i.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:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:_,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:a("tasks.task_description")}),e.jsx("textarea",{value:x,onChange:i=>u(i.target.value),placeholder:a("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:a("tasks.project")}),e.jsx(F,{value:l,onChange:g,options:m.map(i=>({value:i.key,label:i.name})),placeholder:a(d?"common.loading":"tasks.select_project"),disabled:d})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_machine")}),e.jsx("input",{type:"text",value:b,onChange:i=>p(i.target.value),placeholder:a("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)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(F,{value:M,onChange:k,options:[],placeholder:a("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:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:o||!l||!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:a(o?"common.creating":"tasks.create_task")})]})]})]})}):null}function se({isOpen:s,onClose:t,onForceCreate:m,onViewExisting:d,similarTask:c,isLoading:o}){const{t:a}=P();return!c||!s?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:l=>l.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(V,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("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:["#",c.id," · ",c.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:c.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:o,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:o?"not-allowed":"pointer",opacity:o?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>d(c.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:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:m,disabled:o,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:o?"not-allowed":"pointer",opacity:o?.7:1},children:a(o?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function re(s){const t=Date.now(),m=new Date(s).getTime(),d=t-m,c=Math.floor(d/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const o=Math.floor(c/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function ae({task:s}){const t=I();return e.jsxs("div",{onClick:()=>t(`/tasks/${s.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-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",s.id," ",s.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(B,{status:s.status})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[9px] text-[var(--text-muted)]",children:[e.jsx("span",{children:re(s.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.projectKey}),s.machineName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.machineName})]})]})]})}const oe=[{key:"all",labelKey:"tasks.tab_all"},{key:"RUNNING",labelKey:"tasks.tab_running"},{key:"QUEUED",labelKey:"tasks.tab_queued"},{key:"COMPLETED",labelKey:"tasks.tab_completed"},{key:"FAILED",labelKey:"tasks.tab_failed"},{key:"CANCELLED",labelKey:"tasks.tab_cancelled"}],E=20;function ue(){const s=I(),{t}=P(),{tasks:m,loading:d,fetchTasks:c}=G(),[o,a]=n.useState("all"),[l,g]=n.useState(""),[x,u]=n.useState(1),[b,p]=n.useState(!1);O(n.useMemo(()=>e.jsxs("button",{onClick:()=>p(!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(X,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[M,k]=n.useState([]),[N,f]=n.useState(!1),[_,i]=n.useState(!1),[v,y]=n.useState(!1),[A,q]=n.useState(null),[j,H]=n.useState(null);n.useEffect(()=>{const r={limit:String(E)};o!=="all"&&(r.status=o),c(r),u(1)},[o,c]),n.useEffect(()=>{u(1)},[l]),n.useEffect(()=>{b&&(f(!0),K.get("web/projects").json().then(r=>k(r)).catch(()=>{}).finally(()=>f(!1)))},[b]);const J=n.useCallback(async r=>{i(!0);try{const h=await K.post("web/tasks",{json:{projectKey:r.projectKey,description:r.description,machineId:r.machineId}}).json();p(!1),s(`/tasks/${h.task.id}`)}catch(h){if(h instanceof Q&&h.response.status===409){try{const D=await h.response.json();if(D.confirmRequired){q({id:D.confirmRequired.taskId,description:D.confirmRequired.message,status:"active"}),H(r),p(!1),y(!0);return}}catch{}alert(t("tasks.similar_task_exists"))}else throw h}finally{i(!1)}},[s]),L=n.useCallback(async()=>{if(j){i(!0);try{const r=await K.post("web/tasks",{json:{projectKey:j.projectKey,description:j.description,machineId:j.machineId,force:!0}}).json();y(!1),s(`/tasks/${r.task.id}`)}finally{i(!1)}}},[j,s]),w=l.trim()?m.filter(r=>r.description.toLowerCase().includes(l.toLowerCase())||String(r.id).includes(l)):m,C=Math.max(1,Math.ceil(w.length/E)),S=w.slice((x-1)*E,x*E);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:oe.map(r=>e.jsx("button",{onClick:()=>a(r.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${o===r.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(r.labelKey)},r.key))}),e.jsxs("div",{className:"relative md:ml-auto md:w-64",children:[e.jsx(W,{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:l,onChange:r=>g(r.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)]"}),l&&e.jsx("button",{onClick:()=>g(""),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.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[d&&S.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-4",children:e.jsx(z,{rows:5})})}),!d&&w.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-4",children:e.jsx($,{icon:R,title:t("tasks.no_tasks_found"),description:t(l?"tasks.try_adjusting_search":"tasks.create_first_task"),action:l?void 0:e.jsx("button",{onClick:()=>p(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")})})})}),S.map(r=>e.jsx(ee,{task:r},r.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[d&&S.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(z,{rows:5})}),!d&&w.length===0&&e.jsx($,{icon:R,title:t("tasks.no_tasks_found"),description:t(l?"tasks.try_adjusting_search":"tasks.create_first_task"),action:l?void 0:e.jsx("button",{onClick:()=>p(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")})}),S.map(r=>e.jsx(ae,{task:r},r.id))]}),C>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:()=>u(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",children:t("tasks.prev")}),Array.from({length:C},(r,h)=>h+1).map(r=>e.jsx("button",{onClick:()=>u(r),className:`rounded-[4px] px-2.5 py-1 text-xs transition-colors ${x===r?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r},r)),e.jsx("button",{onClick:()=>u(Math.min(C,x+1)),disabled:x===C,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30",children:t("common.next")})]}),e.jsx(te,{isOpen:b,onClose:()=>p(!1),projects:M,projectsLoading:N,onSubmit:J,isSubmitting:_}),e.jsx(se,{isOpen:v,onClose:()=>y(!1),onForceCreate:L,onViewExisting:r=>{y(!1),s(`/tasks/${r}`)},similarTask:A,isLoading:_})]})}export{ue as default};
|
|
1
|
+
import{d as I,j as e,g as T,a as P,r as n,X as U,h as O,f as K,H as Q,i as W,k as R}from"./index-IC0w3nms.js";import{u as G}from"./task.store-DDFQ0jcG.js";import{T as B}from"./TaskStatusBadge-C6STyltI.js";import{S as F}from"./Select-vE59gnrR.js";import{C as V}from"./copy-DeIFkKL0.js";import{E as $}from"./EmptyState-CqOs-r87.js";import{T as z}from"./Skeleton-DkWfJwGk.js";import{P as X}from"./plus-DAoE-jeh.js";function Z(s,t){return s.length<=t?s:s.slice(0,t)+"..."}function Y(s){const t=Date.now(),m=new Date(s).getTime(),d=t-m,c=Math.floor(d/6e4);if(c<1)return T("common.just_now");if(c<60)return T("common.m_ago",{n:c});const o=Math.floor(c/60);if(o<24)return T("common.h_ago",{n:o});const a=Math.floor(o/24);return T("common.d_ago",{n:a})}function ee({task:s}){const t=I();return e.jsxs("tr",{onClick:()=>t(`/tasks/${s.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:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:Z(s.description,80)}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(B,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.machineName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:Y(s.createdAt)})]})}function te({isOpen:s,onClose:t,projects:m,projectsLoading:d,onSubmit:c,isSubmitting:o}){const{t:a}=P(),[l,g]=n.useState(""),[x,u]=n.useState(""),[b,p]=n.useState(""),[M,k]=n.useState(""),[N,f]=n.useState("");n.useEffect(()=>{s&&(g(""),u(""),p(""),k(""),f(""))},[s]),n.useEffect(()=>{if(!s)return;function i(v){v.key==="Escape"&&t()}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[s,t]);async function _(i){if(i.preventDefault(),f(""),!l||!x.trim()){f(a("tasks.project_and_description_required"));return}try{await c({projectKey:l,description:x.trim(),machineId:b||void 0,agentType:void 0})}catch(v){const y=v instanceof Error?v.message:a("tasks.failed_to_create_task");f(y)}}return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:i=>{i.target===i.currentTarget&&t()},children:e.jsxs("div",{className:"w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:i=>i.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:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:_,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:a("tasks.task_description")}),e.jsx("textarea",{value:x,onChange:i=>u(i.target.value),placeholder:a("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:a("tasks.project")}),e.jsx(F,{value:l,onChange:g,options:m.map(i=>({value:i.key,label:i.name})),placeholder:a(d?"common.loading":"tasks.select_project"),disabled:d})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_machine")}),e.jsx("input",{type:"text",value:b,onChange:i=>p(i.target.value),placeholder:a("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)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(F,{value:M,onChange:k,options:[],placeholder:a("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:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:o||!l||!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:a(o?"common.creating":"tasks.create_task")})]})]})]})}):null}function se({isOpen:s,onClose:t,onForceCreate:m,onViewExisting:d,similarTask:c,isLoading:o}){const{t:a}=P();return!c||!s?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:l=>l.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(V,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("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:["#",c.id," · ",c.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:c.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:o,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:o?"not-allowed":"pointer",opacity:o?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>d(c.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:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:m,disabled:o,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:o?"not-allowed":"pointer",opacity:o?.7:1},children:a(o?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function re(s){const t=Date.now(),m=new Date(s).getTime(),d=t-m,c=Math.floor(d/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const o=Math.floor(c/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function ae({task:s}){const t=I();return e.jsxs("div",{onClick:()=>t(`/tasks/${s.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-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",s.id," ",s.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(B,{status:s.status})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[9px] text-[var(--text-muted)]",children:[e.jsx("span",{children:re(s.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.projectKey}),s.machineName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.machineName})]})]})]})}const oe=[{key:"all",labelKey:"tasks.tab_all"},{key:"RUNNING",labelKey:"tasks.tab_running"},{key:"QUEUED",labelKey:"tasks.tab_queued"},{key:"COMPLETED",labelKey:"tasks.tab_completed"},{key:"FAILED",labelKey:"tasks.tab_failed"},{key:"CANCELLED",labelKey:"tasks.tab_cancelled"}],E=20;function ue(){const s=I(),{t}=P(),{tasks:m,loading:d,fetchTasks:c}=G(),[o,a]=n.useState("all"),[l,g]=n.useState(""),[x,u]=n.useState(1),[b,p]=n.useState(!1);O(n.useMemo(()=>e.jsxs("button",{onClick:()=>p(!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(X,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[M,k]=n.useState([]),[N,f]=n.useState(!1),[_,i]=n.useState(!1),[v,y]=n.useState(!1),[A,q]=n.useState(null),[j,H]=n.useState(null);n.useEffect(()=>{const r={limit:String(E)};o!=="all"&&(r.status=o),c(r),u(1)},[o,c]),n.useEffect(()=>{u(1)},[l]),n.useEffect(()=>{b&&(f(!0),K.get("web/projects").json().then(r=>k(r)).catch(()=>{}).finally(()=>f(!1)))},[b]);const J=n.useCallback(async r=>{i(!0);try{const h=await K.post("web/tasks",{json:{projectKey:r.projectKey,description:r.description,machineId:r.machineId}}).json();p(!1),s(`/tasks/${h.task.id}`)}catch(h){if(h instanceof Q&&h.response.status===409){try{const D=await h.response.json();if(D.confirmRequired){q({id:D.confirmRequired.taskId,description:D.confirmRequired.message,status:"active"}),H(r),p(!1),y(!0);return}}catch{}alert(t("tasks.similar_task_exists"))}else throw h}finally{i(!1)}},[s]),L=n.useCallback(async()=>{if(j){i(!0);try{const r=await K.post("web/tasks",{json:{projectKey:j.projectKey,description:j.description,machineId:j.machineId,force:!0}}).json();y(!1),s(`/tasks/${r.task.id}`)}finally{i(!1)}}},[j,s]),w=l.trim()?m.filter(r=>r.description.toLowerCase().includes(l.toLowerCase())||String(r.id).includes(l)):m,C=Math.max(1,Math.ceil(w.length/E)),S=w.slice((x-1)*E,x*E);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:oe.map(r=>e.jsx("button",{onClick:()=>a(r.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${o===r.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(r.labelKey)},r.key))}),e.jsxs("div",{className:"relative md:ml-auto md:w-64",children:[e.jsx(W,{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:l,onChange:r=>g(r.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)]"}),l&&e.jsx("button",{onClick:()=>g(""),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.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[d&&S.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-4",children:e.jsx(z,{rows:5})})}),!d&&w.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-4",children:e.jsx($,{icon:R,title:t("tasks.no_tasks_found"),description:t(l?"tasks.try_adjusting_search":"tasks.create_first_task"),action:l?void 0:e.jsx("button",{onClick:()=>p(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")})})})}),S.map(r=>e.jsx(ee,{task:r},r.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[d&&S.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(z,{rows:5})}),!d&&w.length===0&&e.jsx($,{icon:R,title:t("tasks.no_tasks_found"),description:t(l?"tasks.try_adjusting_search":"tasks.create_first_task"),action:l?void 0:e.jsx("button",{onClick:()=>p(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")})}),S.map(r=>e.jsx(ae,{task:r},r.id))]}),C>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:()=>u(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",children:t("tasks.prev")}),Array.from({length:C},(r,h)=>h+1).map(r=>e.jsx("button",{onClick:()=>u(r),className:`rounded-[4px] px-2.5 py-1 text-xs transition-colors ${x===r?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r},r)),e.jsx("button",{onClick:()=>u(Math.min(C,x+1)),disabled:x===C,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30",children:t("common.next")})]}),e.jsx(te,{isOpen:b,onClose:()=>p(!1),projects:M,projectsLoading:N,onSubmit:J,isSubmitting:_}),e.jsx(se,{isOpen:v,onClose:()=>y(!1),onForceCreate:L,onViewExisting:r=>{y(!1),s(`/tasks/${r}`)},similarTask:A,isLoading:_})]})}export{ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,j as e}from"./index-
|
|
1
|
+
import{a as n,j as e}from"./index-IC0w3nms.js";const r={QUEUED:{labelKey:"tasks.status_queued",color:"var(--text-muted)"},ASSIGNED:{labelKey:"tasks.status_assigned",color:"#60a5fa"},RUNNING:{labelKey:"tasks.status_running",color:"var(--accent)"},SUSPENDED:{labelKey:"tasks.status_suspended",color:"var(--warning)"},COMPLETED:{labelKey:"tasks.status_completed",color:"var(--accent)"},FAILED:{labelKey:"tasks.status_failed",color:"var(--destructive)"},CANCELLED:{labelKey:"tasks.status_cancelled",color:"var(--text-muted)"}};function u({status:t}){const{t:a}=n(),s=r[t]??null,l=s?a(s.labelKey):t.toLowerCase(),o=(s==null?void 0:s.color)??"var(--text-muted)";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs",style:{color:o},children:[e.jsx("span",{style:{fontSize:"0.6rem"},children:"●"}),l]})}export{u as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S,r as s,j as e,f as w,d as D,o as F,K as A,x as I,l as O}from"./index-BdEJ0aTM.js";import{K as T}from"./key-D6HzwwXl.js";import{C as R}from"./copy-CpdsOI_O.js";import{E as $}from"./external-link-Cp9i7osW.js";import{E as P}from"./EmptyState-C9vei1H4.js";import{T as B}from"./Skeleton-DRiV4Mc_.js";import{P as J}from"./plus-8YfTJ47b.js";function K({isOpen:a,onClose:x,onCreated:y}){const{t:n}=S(),[t,c]=s.useState(""),[d,m]=s.useState(!1),[b,v]=s.useState(""),p=()=>{c(""),v(""),x()},l=async()=>{if(v(""),!t.trim()){v(n("admin.pat_label_required"));return}try{m(!0);const o=await w.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:o.token,id:o.id})}catch(o){const f=o instanceof Error?o.message:n("admin.pat_failed_to_generate");v(f)}finally{m(!1)}};return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&p()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:n("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[b&&e.jsx("div",{className:"border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",style:{borderRadius:"4px"},children:b}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.label")}),e.jsx("input",{type:"text",placeholder:n("admin.pat_label_placeholder"),value:t,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&l()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n("admin.label_identifies_machine")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:p,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n("common.cancel")}),e.jsx("button",{onClick:l,disabled:d,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n(d?"admin.generating":"admin.generate")})]})]})}):null}const V=3e3,W=600*1e3;function z({isOpen:a,token:x,tokenId:y,onClose:n}){const{t}=S(),[c,d]=s.useState("command"),[m,b]=s.useState(!1),[v,p]=s.useState(!1),[l,o]=s.useState(""),[f,g]=s.useState(null),i=s.useRef(void 0),N=s.useRef(Date.now()),j=D(),_=typeof window<"u"?window.location.origin:"https://overlord.example.com",k=`overlord setup worker --token ${x} --server ${_}`,C=async()=>{try{await navigator.clipboard.writeText(x),b(!0),setTimeout(()=>b(!1),2e3)}catch{}},r=async()=>{try{await navigator.clipboard.writeText(k),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},L=s.useCallback(async()=>{try{const h=await w.get(`admin/worker-tokens/${y}/status`).json();h.status==="used"&&h.machine_name&&(d("success"),o(h.machine_name),g(h.machine_id??null),i.current&&clearInterval(i.current))}catch{}Date.now()-N.current>W&&(d("timeout"),i.current&&clearInterval(i.current))},[y]),E=()=>{d("waiting"),N.current=Date.now(),i.current=setInterval(L,V)};s.useEffect(()=>()=>{i.current&&clearInterval(i.current)},[]);const M=()=>{n(),f&&j(`/machines/${f}`)};if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:h=>{h.target===h.currentTarget&&n()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:x}),e.jsx("button",{onClick:C,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:m?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:t("admin.setup_command")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",k]}),e.jsx("button",{onClick:r,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:t("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:t("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:t("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[t("admin.machine"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:l})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsx("button",{onClick:E,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsxs("button",{onClick:M,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:[e.jsx($,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function Z(){const{t:a}=S(),[x,y]=s.useState([]),[n,t]=s.useState(!0),[c,d]=s.useState(!1),[m,b]=s.useState(null),[v,p]=s.useState(!1),[l,o]=s.useState(null),[f,g]=s.useState(!1),[i,N]=s.useState(!1),j=s.useCallback(async()=>{try{t(!0);const r=await w.get("admin/worker-tokens").json();y(r)}catch{}finally{t(!1)}},[]);s.useEffect(()=>{j()},[j]);const _=async()=>{if(l){g(!0);try{await w.post(`admin/worker-tokens/${l.id}/revoke`),p(!1),o(null),j()}catch{}finally{g(!1)}}},k=r=>{d(!1),b(r),j()},C=r=>{switch(r){case"active":return"text-green-400";case"used":return"text-blue-400";case"revoked":return"text-red-400";case"expired":return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>d(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!n&&x.some(r=>r.status==="revoked")&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>N(!i),className:`text-xs transition-colors ${i?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(i?"admin.hide_revoked":"admin.show_revoked")})}),n?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(B,{rows:3})}):x.filter(r=>i||r.status!=="revoked").length===0?e.jsx(P,{icon:A,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>d(!0)}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:x.filter(r=>i||r.status!=="revoked").map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:r.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:C(r.status),children:r.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:r.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(r.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:r.status==="active"&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{o(r),p(!0)},children:[e.jsx(I,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},r.id))})]})}),e.jsx(K,{isOpen:c,onClose:()=>d(!1),onCreated:k}),m&&e.jsx(z,{isOpen:!!m,token:m.token,tokenId:m.id,onClose:()=>b(null)}),e.jsx(O,{isOpen:v,onClose:()=>{p(!1),o(null)},onConfirm:_,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(l==null?void 0:l.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:f})]})}export{Z as default};
|
|
1
|
+
import{a as S,r as s,j as e,f as w,d as D,o as F,K as A,x as I,l as O}from"./index-IC0w3nms.js";import{K as T}from"./key-BWK1AZ5R.js";import{C as R}from"./copy-DeIFkKL0.js";import{E as $}from"./external-link-8WYxL39M.js";import{E as P}from"./EmptyState-CqOs-r87.js";import{T as B}from"./Skeleton-DkWfJwGk.js";import{P as J}from"./plus-DAoE-jeh.js";function K({isOpen:a,onClose:x,onCreated:y}){const{t:n}=S(),[t,c]=s.useState(""),[d,m]=s.useState(!1),[b,v]=s.useState(""),p=()=>{c(""),v(""),x()},l=async()=>{if(v(""),!t.trim()){v(n("admin.pat_label_required"));return}try{m(!0);const o=await w.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:o.token,id:o.id})}catch(o){const f=o instanceof Error?o.message:n("admin.pat_failed_to_generate");v(f)}finally{m(!1)}};return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&p()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:n("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[b&&e.jsx("div",{className:"border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",style:{borderRadius:"4px"},children:b}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.label")}),e.jsx("input",{type:"text",placeholder:n("admin.pat_label_placeholder"),value:t,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&l()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n("admin.label_identifies_machine")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:p,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n("common.cancel")}),e.jsx("button",{onClick:l,disabled:d,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n(d?"admin.generating":"admin.generate")})]})]})}):null}const V=3e3,W=600*1e3;function z({isOpen:a,token:x,tokenId:y,onClose:n}){const{t}=S(),[c,d]=s.useState("command"),[m,b]=s.useState(!1),[v,p]=s.useState(!1),[l,o]=s.useState(""),[f,g]=s.useState(null),i=s.useRef(void 0),N=s.useRef(Date.now()),j=D(),_=typeof window<"u"?window.location.origin:"https://overlord.example.com",k=`overlord setup worker --token ${x} --server ${_}`,C=async()=>{try{await navigator.clipboard.writeText(x),b(!0),setTimeout(()=>b(!1),2e3)}catch{}},r=async()=>{try{await navigator.clipboard.writeText(k),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},L=s.useCallback(async()=>{try{const h=await w.get(`admin/worker-tokens/${y}/status`).json();h.status==="used"&&h.machine_name&&(d("success"),o(h.machine_name),g(h.machine_id??null),i.current&&clearInterval(i.current))}catch{}Date.now()-N.current>W&&(d("timeout"),i.current&&clearInterval(i.current))},[y]),E=()=>{d("waiting"),N.current=Date.now(),i.current=setInterval(L,V)};s.useEffect(()=>()=>{i.current&&clearInterval(i.current)},[]);const M=()=>{n(),f&&j(`/machines/${f}`)};if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:h=>{h.target===h.currentTarget&&n()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:x}),e.jsx("button",{onClick:C,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:m?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:t("admin.setup_command")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",k]}),e.jsx("button",{onClick:r,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:t("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:t("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:t("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[t("admin.machine"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:l})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsx("button",{onClick:E,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsxs("button",{onClick:M,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:[e.jsx($,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function Z(){const{t:a}=S(),[x,y]=s.useState([]),[n,t]=s.useState(!0),[c,d]=s.useState(!1),[m,b]=s.useState(null),[v,p]=s.useState(!1),[l,o]=s.useState(null),[f,g]=s.useState(!1),[i,N]=s.useState(!1),j=s.useCallback(async()=>{try{t(!0);const r=await w.get("admin/worker-tokens").json();y(r)}catch{}finally{t(!1)}},[]);s.useEffect(()=>{j()},[j]);const _=async()=>{if(l){g(!0);try{await w.post(`admin/worker-tokens/${l.id}/revoke`),p(!1),o(null),j()}catch{}finally{g(!1)}}},k=r=>{d(!1),b(r),j()},C=r=>{switch(r){case"active":return"text-green-400";case"used":return"text-blue-400";case"revoked":return"text-red-400";case"expired":return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>d(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!n&&x.some(r=>r.status==="revoked")&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>N(!i),className:`text-xs transition-colors ${i?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(i?"admin.hide_revoked":"admin.show_revoked")})}),n?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(B,{rows:3})}):x.filter(r=>i||r.status!=="revoked").length===0?e.jsx(P,{icon:A,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>d(!0)}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:x.filter(r=>i||r.status!=="revoked").map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:r.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:C(r.status),children:r.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:r.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(r.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:r.status==="active"&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{o(r),p(!0)},children:[e.jsx(I,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},r.id))})]})}),e.jsx(K,{isOpen:c,onClose:()=>d(!1),onCreated:k}),m&&e.jsx(z,{isOpen:!!m,token:m.token,tokenId:m.id,onClose:()=>b(null)}),e.jsx(O,{isOpen:v,onClose:()=>{p(!1),o(null)},onConfirm:_,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(l==null?void 0:l.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:f})]})}export{Z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as A,d as he,u as Y,a as fe,r as F,j as v,f as J,t as me}from"./index-
|
|
1
|
+
import{R as A,d as he,u as Y,a as fe,r as F,j as v,f as J,t as me}from"./index-IC0w3nms.js";var ge=Object.defineProperty,T=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,W=(u,a,i)=>a in u?ge(u,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[a]=i,j=(u,a)=>{for(var i in a||(a={}))V.call(a,i)&&W(u,i,a[i]);if(T)for(var i of T(a))X.call(a,i)&&W(u,i,a[i]);return u},k=(u,a)=>{var i={};for(var c in u)V.call(u,c)&&a.indexOf(c)<0&&(i[c]=u[c]);if(u!=null&&T)for(var c of T(u))a.indexOf(c)<0&&X.call(u,c)&&(i[c]=u[c]);return i};/**
|
|
2
2
|
* @license QR Code generator library (TypeScript)
|
|
3
3
|
* Copyright (c) Project Nayuki.
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c,d as x,a as d,j as e,o as a}from"./index-
|
|
1
|
+
import{c,d as x,a as d,j as e,o as a}from"./index-IC0w3nms.js";import{K as l}from"./key-BWK1AZ5R.js";import{S as m}from"./settings-CRoMlkO8.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|