@overlordai/server 1.0.26 → 1.0.28

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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/public/assets/{AccessTokensPage-DjXg_GcZ.js → AccessTokensPage-DQEUkklL.js} +1 -1
  3. package/public/assets/{AdminPage-LU3VU8sd.js → AdminPage-Dy3fDESU.js} +1 -1
  4. package/public/assets/{ApiReferencePage-BMDuk9em.js → ApiReferencePage-BdVahGqK.js} +1 -1
  5. package/public/assets/{AuditLogPage-BQnvLBUm.js → AuditLogPage-DrxGWVeq.js} +1 -1
  6. package/public/assets/{BotManage-Is69ZQBf.js → BotManage-B3-rqR1c.js} +1 -1
  7. package/public/assets/{CliReferencePage-DpDJXb2B.js → CliReferencePage-Ca6ENkKU.js} +1 -1
  8. package/public/assets/{DeveloperManage-Ma4FgQXQ.js → DeveloperManage-CSd18cTX.js} +1 -1
  9. package/public/assets/{EditProjectPage-C78aJ078.js → EditProjectPage-jeKBXKpU.js} +1 -1
  10. package/public/assets/{EmptyState-BQ2BNVJS.js → EmptyState-CN7755V2.js} +1 -1
  11. package/public/assets/{HomePage-Bl0KZPgn.js → HomePage-BsiwA4gW.js} +1 -1
  12. package/public/assets/{LandingPage-Bxv40luT.js → LandingPage-BWfR2oXt.js} +1 -1
  13. package/public/assets/{LoginPage-CMyyf5ts.js → LoginPage-Ca4FsK2j.js} +1 -1
  14. package/public/assets/{MachineDetailPage-BARcjlVJ.js → MachineDetailPage-BdJIcUfz.js} +1 -1
  15. package/public/assets/{MachineListPage-C044mEFY.js → MachineListPage-B59mZoVm.js} +1 -1
  16. package/public/assets/{NotFoundPage-Ck2hYu_B.js → NotFoundPage-rIa2IHZG.js} +1 -1
  17. package/public/assets/{PipelineEditorPage-hoXGXxtB.js → PipelineEditorPage-DqNJhpu_.js} +1 -1
  18. package/public/assets/{ProfilePage-DQQh-J_f.js → ProfilePage-_uegx1AA.js} +1 -1
  19. package/public/assets/{ProjectDetailPage-7wHRY-_7.js → ProjectDetailPage-ByDXJRZx.js} +1 -1
  20. package/public/assets/{ProjectListPage-Cpzf-qNq.js → ProjectListPage-cWKxZMbI.js} +1 -1
  21. package/public/assets/{QuickAuth-CoRuLOkE.js → QuickAuth-DeEGbSkE.js} +1 -1
  22. package/public/assets/{RemoveMemberConfirmDialog-C-UcPD2-.js → RemoveMemberConfirmDialog-BHYJebBS.js} +1 -1
  23. package/public/assets/{Select-cAwdx-J1.js → Select-0Q0gGMd5.js} +1 -1
  24. package/public/assets/{SettingsPage-vlEdzALt.js → SettingsPage-BVRak3kN.js} +1 -1
  25. package/public/assets/{Skeleton-DkwMPaZ1.js → Skeleton-Brvkv-R9.js} +1 -1
  26. package/public/assets/{TaskDetailPage-CSM2ew4E.js → TaskDetailPage-NP2PS_Ck.js} +1 -1
  27. package/public/assets/{TaskListPage-Dr_IZ2vJ.js → TaskListPage-BpkKh4Yk.js} +1 -1
  28. package/public/assets/{TaskStatusBadge-B6pZ1mXD.js → TaskStatusBadge-C5Shy8Nl.js} +1 -1
  29. package/public/assets/TokenManage-k5e6DyJG.js +1 -0
  30. package/public/assets/{TotpSetupPage-CedCLn9b.js → TotpSetupPage-skouZwAo.js} +1 -1
  31. package/public/assets/{WorkerSetupGuidePage-C-faBGTF.js → WorkerSetupGuidePage-BelFB95H.js} +1 -1
  32. package/public/assets/{arrow-left-B701wpRZ.js → arrow-left-DcjEsA7R.js} +1 -1
  33. package/public/assets/{arrow-right-B4SWX5QX.js → arrow-right-B4YEa3u9.js} +1 -1
  34. package/public/assets/{bot-BMG_Lak4.js → bot-BXlxShij.js} +1 -1
  35. package/public/assets/{chevron-right-Dv5NEUXH.js → chevron-right-DfZYT44U.js} +1 -1
  36. package/public/assets/{copy-C0vNNRrm.js → copy-I9UBz5kC.js} +1 -1
  37. package/public/assets/{external-link-CVx7jdXb.js → external-link-6OjArMHy.js} +1 -1
  38. package/public/assets/{index-BTxGPsOB.js → index-DYT_rof3.js} +2 -2
  39. package/public/assets/{key-OwB_ZR3T.js → key-EI2JM6VQ.js} +1 -1
  40. package/public/assets/{loader-circle-BN3eQzTt.js → loader-circle-BlLUEdfY.js} +1 -1
  41. package/public/assets/{pencil-BtnOFy3d.js → pencil-CQghwYru.js} +1 -1
  42. package/public/assets/{plus-Cm_mqbAL.js → plus-Bi9CBO0p.js} +1 -1
  43. package/public/assets/{rotate-ccw-Di9lk9Jq.js → rotate-ccw-B5xHESUx.js} +1 -1
  44. package/public/assets/{scroll-text-C8HTue-V.js → scroll-text-0Fjom98e.js} +1 -1
  45. package/public/assets/{settings-BxP_lYKz.js → settings-Dz53j3EB.js} +1 -1
  46. package/public/assets/{task.store-CRByTXd0.js → task.store-DwkjgoRM.js} +1 -1
  47. package/public/assets/{trash-2-Bzd6fyHf.js → trash-2-Cv7vzkVw.js} +1 -1
  48. package/public/assets/{users-DmYD60pt.js → users-7UXJB8XB.js} +1 -1
  49. package/public/index.html +1 -1
  50. package/public/assets/TokenManage-TLgRE0QO.js +0 -1
@@ -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-BTxGPsOB.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
+ import{a as L,r as a,f as m,t as i,j as e,L as S,K as R}from"./index-DYT_rof3.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,4 +1,4 @@
1
- import{c as U,a as S,j as e,l as G,m as K,d as q,u as B,r as a,h as H,f as j,v as J}from"./index-BTxGPsOB.js";import{T as d}from"./protocol-C4f2G7mk.js";import{U as Q,A as V,R as z}from"./RemoveMemberConfirmDialog-C-UcPD2-.js";import{P as W}from"./pencil-BtnOFy3d.js";import{T as X}from"./trash-2-Bzd6fyHf.js";import{P as Y}from"./plus-Cm_mqbAL.js";import"./Select-cAwdx-J1.js";/**
1
+ import{c as U,a as S,j as e,l as G,m as K,d as q,u as B,r as a,h as H,f as j,v as J}from"./index-DYT_rof3.js";import{T as d}from"./protocol-C4f2G7mk.js";import{U as Q,A as V,R as z}from"./RemoveMemberConfirmDialog-BHYJebBS.js";import{P as W}from"./pencil-CQghwYru.js";import{T as X}from"./trash-2-Cv7vzkVw.js";import{P as Y}from"./plus-Bi9CBO0p.js";import"./Select-0Q0gGMd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as A,a as w,r as a,j as e,f as P,d as L,h as R}from"./index-BTxGPsOB.js";import{G as b,A as p}from"./protocol-C4f2G7mk.js";import{S as F}from"./Select-cAwdx-J1.js";import{E as G}from"./EmptyState-BQ2BNVJS.js";import{T as I}from"./Skeleton-DkwMPaZ1.js";import{P as M}from"./plus-Cm_mqbAL.js";/**
1
+ import{c as A,a as w,r as a,j as e,f as P,d as L,h as R}from"./index-DYT_rof3.js";import{G as b,A as p}from"./protocol-C4f2G7mk.js";import{S as F}from"./Select-0Q0gGMd5.js";import{E as G}from"./EmptyState-CN7755V2.js";import{T as I}from"./Skeleton-Brvkv-R9.js";import{P as M}from"./plus-Bi9CBO0p.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-BTxGPsOB.js";import{C as f}from"./copy-C0vNNRrm.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
+ import{a as b,r as s,f as h,j as e,C as v}from"./index-DYT_rof3.js";import{C as f}from"./copy-I9UBz5kC.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 _,a as N,r as s,j as e,X as S,f as h,l as R}from"./index-BTxGPsOB.js";import{P as i}from"./protocol-C4f2G7mk.js";import{S as g}from"./Select-cAwdx-J1.js";/**
1
+ import{c as _,a as N,r as s,j as e,X as S,f as h,l as R}from"./index-DYT_rof3.js";import{P as i}from"./protocol-C4f2G7mk.js";import{S as g}from"./Select-0Q0gGMd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as f,r as c,j as t}from"./index-BTxGPsOB.js";/**
1
+ import{c as f,r as c,j as t}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as h,a as v,r,j as e,f as m,t as x}from"./index-BTxGPsOB.js";/**
1
+ import{c as h,a as v,r,j as e,f as m,t as x}from"./index-DYT_rof3.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-BTxGPsOB.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
+ import{j as e}from"./index-DYT_rof3.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,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-BTxGPsOB.js";import{u as Ve}from"./task.store-CRByTXd0.js";import{S as Ge}from"./Select-cAwdx-J1.js";import{A as Xe}from"./arrow-left-B701wpRZ.js";import{R as Je}from"./rotate-ccw-Di9lk9Jq.js";import{E as Ye}from"./external-link-CVx7jdXb.js";import{L as Ee}from"./loader-circle-BN3eQzTt.js";/**
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-DYT_rof3.js";import{u as Ve}from"./task.store-DwkjgoRM.js";import{S as Ge}from"./Select-0Q0gGMd5.js";import{A as Xe}from"./arrow-left-DcjEsA7R.js";import{R as Je}from"./rotate-ccw-B5xHESUx.js";import{E as Ye}from"./external-link-6OjArMHy.js";import{L as Ee}from"./loader-circle-BlLUEdfY.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-BTxGPsOB.js";import{u as G}from"./task.store-CRByTXd0.js";import{T as B}from"./TaskStatusBadge-B6pZ1mXD.js";import{S as F}from"./Select-cAwdx-J1.js";import{C as V}from"./copy-C0vNNRrm.js";import{E as $}from"./EmptyState-BQ2BNVJS.js";import{T as z}from"./Skeleton-DkwMPaZ1.js";import{P as X}from"./plus-Cm_mqbAL.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-DYT_rof3.js";import{u as G}from"./task.store-DwkjgoRM.js";import{T as B}from"./TaskStatusBadge-C5Shy8Nl.js";import{S as F}from"./Select-0Q0gGMd5.js";import{C as V}from"./copy-I9UBz5kC.js";import{E as $}from"./EmptyState-CN7755V2.js";import{T as z}from"./Skeleton-Brvkv-R9.js";import{P as X}from"./plus-Bi9CBO0p.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-BTxGPsOB.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
+ import{a as n,j as e}from"./index-DYT_rof3.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};
@@ -0,0 +1 @@
1
+ import{a as _,r as a,j as e,f as N,d as T,o as L,K as E,x as M,l as D}from"./index-DYT_rof3.js";import{K as C}from"./key-EI2JM6VQ.js";import{C as F}from"./copy-I9UBz5kC.js";import{E as A}from"./external-link-6OjArMHy.js";import{E as I}from"./EmptyState-CN7755V2.js";import{T as O}from"./Skeleton-Brvkv-R9.js";import{P}from"./plus-Bi9CBO0p.js";function $({isOpen:r,onClose:h,onCreated:y}){const{t:s}=_(),[t,c]=a.useState(""),[i,x]=a.useState(!1),[m,p]=a.useState(""),u=()=>{c(""),p(""),h()},d=async()=>{if(p(""),!t.trim()){p(s("admin.pat_label_required"));return}try{x(!0);const n=await N.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:n.token,id:n.id})}catch(n){const l=n instanceof Error?n.message:s("admin.pat_failed_to_generate");p(l)}finally{x(!1)}};return r?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:n=>{n.target===n.currentTarget&&u()},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(C,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[m&&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:m}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:t,onChange:n=>c(n.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:n=>{n.key==="Enter"&&d()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("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:u,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:s("common.cancel")}),e.jsx("button",{onClick:d,disabled:i,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:s(i?"admin.generating":"admin.generate")})]})]})}):null}const B=3e3,J=600*1e3;function K({isOpen:r,token:h,tokenId:y,onClose:s}){const{t}=_(),[c,i]=a.useState("command"),[x,m]=a.useState(!1),[p,u]=a.useState(""),[d,n]=a.useState(null),l=a.useRef(void 0),j=a.useRef(Date.now()),f=T(),k=typeof window<"u"?window.location.origin:"https://overlord.example.com",g=`overlord setup worker --token ${h} --server ${k}`,w=async()=>{try{await navigator.clipboard.writeText(g),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},o=a.useCallback(async()=>{try{const v=await N.get(`admin/worker-tokens/${y}/status`).json();v.status==="used"&&v.machine_name&&(i("success"),u(v.machine_name),n(v.machine_id??null),l.current&&clearInterval(l.current))}catch{}Date.now()-j.current>J&&(i("timeout"),l.current&&clearInterval(l.current))},[y]),S=()=>{i("waiting"),j.current=Date.now(),l.current=setInterval(o,B)};a.useEffect(()=>()=>{l.current&&clearInterval(l.current)},[]);const R=()=>{s(),d&&f(`/machines/${d}`)};if(!r)return null;const b={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:v=>{v.target===v.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...b,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(L,{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(C,{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",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-4",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",g]}),e.jsx("button",{onClick:w,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:b,children:x?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{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:p})]})]})]}),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:s,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:b,children:t("common.close")}),e.jsx("button",{onClick:S,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:b,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,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:b,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,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:b,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,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:b,children:t("common.close")}),e.jsxs("button",{onClick:R,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:b,children:[e.jsx(A,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function H(){const{t:r}=_(),[h,y]=a.useState([]),[s,t]=a.useState(!0),[c,i]=a.useState(!1),[x,m]=a.useState(null),[p,u]=a.useState(!1),[d,n]=a.useState(null),[l,j]=a.useState(!1),f=a.useCallback(async()=>{try{t(!0);const o=await N.get("admin/worker-tokens").json();y(o)}catch{}finally{t(!1)}},[]);a.useEffect(()=>{f()},[f]);const k=async()=>{if(d){j(!0);try{await N.post(`admin/worker-tokens/${d.id}/revoke`),u(!1),n(null),f()}catch{}finally{j(!1)}}},g=o=>{i(!1),m(o),f()},w=o=>{switch(o){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:r("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("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:()=>i(!0),children:[e.jsx(P,{className:"h-3.5 w-3.5"}),r("admin.generate_token")]})]}),s?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(O,{rows:3})}):h.length===0?e.jsx(I,{icon:E,title:r("admin.no_worker_tokens"),description:r("admin.generate_token_desc"),actionLabel:r("admin.generate_token"),onAction:()=>i(!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:r("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:r("common.actions")})]})}),e.jsx("tbody",{children:h.map(o=>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:o.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:o.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:w(o.status),children:o.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(o.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:o.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(o.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:o.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:()=>{n(o),u(!0)},children:[e.jsx(M,{className:"h-3.5 w-3.5"}),r("admin.revoke")]})})]},o.id))})]})}),e.jsx($,{isOpen:c,onClose:()=>i(!1),onCreated:g}),x&&e.jsx(K,{isOpen:!!x,token:x.token,tokenId:x.id,onClose:()=>m(null)}),e.jsx(D,{isOpen:p,onClose:()=>{u(!1),n(null)},onConfirm:k,title:r("admin.revoke_token"),message:r("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:r("admin.revoke"),confirmVariant:"danger",isLoading:l})]})}export{H 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-BTxGPsOB.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};/**
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-DYT_rof3.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-BTxGPsOB.js";import{K as l}from"./key-OwB_ZR3T.js";import{S as m}from"./settings-BxP_lYKz.js";/**
1
+ import{c,d as x,a as d,j as e,o as a}from"./index-DYT_rof3.js";import{K as l}from"./key-EI2JM6VQ.js";import{S as m}from"./settings-Dz53j3EB.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-BTxGPsOB.js";/**
1
+ import{c as e}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as r}from"./index-BTxGPsOB.js";/**
1
+ import{c as r}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-BTxGPsOB.js";/**
1
+ import{c as t}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-BTxGPsOB.js";/**
1
+ import{c as t}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-BTxGPsOB.js";/**
1
+ import{c}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-BTxGPsOB.js";/**
1
+ import{c as a}from"./index-DYT_rof3.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.