skypilot-nightly 1.0.0.dev20250624__py3-none-any.whl → 1.0.0.dev20250625__py3-none-any.whl

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 (145) hide show
  1. sky/__init__.py +2 -2
  2. sky/backends/backend_utils.py +26 -11
  3. sky/backends/cloud_vm_ray_backend.py +16 -5
  4. sky/client/cli/command.py +222 -4
  5. sky/client/sdk.py +110 -82
  6. sky/clouds/aws.py +10 -7
  7. sky/clouds/azure.py +10 -7
  8. sky/clouds/cloud.py +2 -0
  9. sky/clouds/cudo.py +2 -0
  10. sky/clouds/do.py +10 -7
  11. sky/clouds/fluidstack.py +2 -0
  12. sky/clouds/gcp.py +10 -7
  13. sky/clouds/hyperbolic.py +10 -7
  14. sky/clouds/ibm.py +2 -0
  15. sky/clouds/kubernetes.py +26 -9
  16. sky/clouds/lambda_cloud.py +10 -7
  17. sky/clouds/nebius.py +10 -7
  18. sky/clouds/oci.py +10 -7
  19. sky/clouds/paperspace.py +10 -7
  20. sky/clouds/runpod.py +10 -7
  21. sky/clouds/scp.py +10 -7
  22. sky/clouds/vast.py +10 -7
  23. sky/clouds/vsphere.py +2 -0
  24. sky/core.py +1 -0
  25. sky/dag.py +14 -0
  26. sky/dashboard/out/404.html +1 -1
  27. sky/dashboard/out/_next/static/ZWdSYkqVe3WjnFR8ocqoG/_buildManifest.js +1 -0
  28. sky/dashboard/out/_next/static/chunks/230-d6e363362017ff3a.js +1 -0
  29. sky/dashboard/out/_next/static/chunks/310.2671028c20e892c7.js +16 -0
  30. sky/dashboard/out/_next/static/chunks/{37-4650f214e2119168.js → 37-1f1e94f5a561202a.js} +2 -2
  31. sky/dashboard/out/_next/static/chunks/42.bc85e5b1a4debf22.js +6 -0
  32. sky/dashboard/out/_next/static/chunks/470-92dd1614396389be.js +1 -0
  33. sky/dashboard/out/_next/static/chunks/544.110e53813fb98e2e.js +1 -0
  34. sky/dashboard/out/_next/static/chunks/645.961f08e39b8ce447.js +1 -0
  35. sky/dashboard/out/_next/static/chunks/66-66ae330df2d3c1c7.js +1 -0
  36. sky/dashboard/out/_next/static/chunks/682.00e56a220dd26fe1.js +6 -0
  37. sky/dashboard/out/_next/static/chunks/697.6460bf72e760addd.js +20 -0
  38. sky/dashboard/out/_next/static/chunks/{856-bfddc18e16f3873c.js → 856-cdf66268ec878d0c.js} +1 -1
  39. sky/dashboard/out/_next/static/chunks/pages/{_app-ce31493da9747ef4.js → _app-0ef7418d1a3822f3.js} +1 -1
  40. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-aff040d7bc5d0086.js +6 -0
  41. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-32ce4f49f2261f55.js +6 -0
  42. sky/dashboard/out/_next/static/chunks/pages/clusters-4aa031d1f42723d8.js +1 -0
  43. sky/dashboard/out/_next/static/chunks/pages/config-3102d02a188f04b3.js +1 -0
  44. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-6f1e02e31eecb5ce.js +1 -0
  45. sky/dashboard/out/_next/static/chunks/pages/infra-fd5dc8a91bd9169a.js +1 -0
  46. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-e4b23128db0774cd.js +16 -0
  47. sky/dashboard/out/_next/static/chunks/pages/jobs-26da173e20af16e4.js +1 -0
  48. sky/dashboard/out/_next/static/chunks/pages/users-ce29e7420385563d.js +1 -0
  49. sky/dashboard/out/_next/static/chunks/pages/volumes-476b670ef33d1ecd.js +1 -0
  50. sky/dashboard/out/_next/static/chunks/pages/workspace/new-09ae0f6f972aa871.js +1 -0
  51. sky/dashboard/out/_next/static/chunks/pages/workspaces/{[name]-ecc5a7003776cfa7.js → [name]-0b4c662a25e4747a.js} +1 -1
  52. sky/dashboard/out/_next/static/chunks/pages/workspaces-862b120406461b10.js +1 -0
  53. sky/dashboard/out/_next/static/chunks/webpack-6133dc1e928bd0b5.js +1 -0
  54. sky/dashboard/out/_next/static/css/b23cb0257bf96c51.css +3 -0
  55. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  56. sky/dashboard/out/clusters/[cluster].html +1 -1
  57. sky/dashboard/out/clusters.html +1 -1
  58. sky/dashboard/out/config.html +1 -1
  59. sky/dashboard/out/index.html +1 -1
  60. sky/dashboard/out/infra/[context].html +1 -1
  61. sky/dashboard/out/infra.html +1 -1
  62. sky/dashboard/out/jobs/[job].html +1 -1
  63. sky/dashboard/out/jobs.html +1 -1
  64. sky/dashboard/out/users.html +1 -1
  65. sky/dashboard/out/volumes.html +1 -0
  66. sky/dashboard/out/workspace/new.html +1 -1
  67. sky/dashboard/out/workspaces/[name].html +1 -1
  68. sky/dashboard/out/workspaces.html +1 -1
  69. sky/data/storage_utils.py +2 -4
  70. sky/exceptions.py +15 -0
  71. sky/execution.py +5 -0
  72. sky/global_user_state.py +129 -0
  73. sky/jobs/client/sdk.py +13 -11
  74. sky/jobs/server/core.py +4 -0
  75. sky/models.py +16 -0
  76. sky/provision/__init__.py +26 -0
  77. sky/provision/kubernetes/__init__.py +3 -0
  78. sky/provision/kubernetes/instance.py +38 -77
  79. sky/provision/kubernetes/utils.py +52 -2
  80. sky/provision/kubernetes/volume.py +147 -0
  81. sky/resources.py +20 -76
  82. sky/serve/client/sdk.py +13 -13
  83. sky/serve/server/core.py +5 -1
  84. sky/server/common.py +40 -5
  85. sky/server/constants.py +5 -1
  86. sky/server/metrics.py +105 -0
  87. sky/server/requests/executor.py +30 -14
  88. sky/server/requests/payloads.py +16 -0
  89. sky/server/requests/requests.py +35 -1
  90. sky/server/rest.py +152 -0
  91. sky/server/server.py +66 -16
  92. sky/server/state.py +20 -0
  93. sky/server/stream_utils.py +8 -3
  94. sky/server/uvicorn.py +153 -13
  95. sky/setup_files/dependencies.py +2 -0
  96. sky/skylet/constants.py +14 -3
  97. sky/task.py +141 -18
  98. sky/templates/kubernetes-ray.yml.j2 +30 -1
  99. sky/users/permission.py +2 -0
  100. sky/utils/context.py +3 -1
  101. sky/utils/resources_utils.py +66 -0
  102. sky/utils/rich_utils.py +6 -0
  103. sky/utils/schemas.py +146 -3
  104. sky/utils/status_lib.py +10 -0
  105. sky/utils/validator.py +11 -1
  106. sky/volumes/__init__.py +0 -0
  107. sky/volumes/client/__init__.py +0 -0
  108. sky/volumes/client/sdk.py +64 -0
  109. sky/volumes/server/__init__.py +0 -0
  110. sky/volumes/server/core.py +199 -0
  111. sky/volumes/server/server.py +85 -0
  112. sky/volumes/utils.py +158 -0
  113. sky/volumes/volume.py +198 -0
  114. {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/METADATA +2 -1
  115. {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/RECORD +123 -108
  116. sky/dashboard/out/_next/static/chunks/350.9e123a4551f68b0d.js +0 -1
  117. sky/dashboard/out/_next/static/chunks/42.2273cc2415291ceb.js +0 -6
  118. sky/dashboard/out/_next/static/chunks/470-1494c899266cf5c9.js +0 -1
  119. sky/dashboard/out/_next/static/chunks/641.c8e452bc5070a630.js +0 -1
  120. sky/dashboard/out/_next/static/chunks/682.4dd5dc116f740b5f.js +0 -6
  121. sky/dashboard/out/_next/static/chunks/760-a89d354797ce7af5.js +0 -1
  122. sky/dashboard/out/_next/static/chunks/901-b424d293275e1fd7.js +0 -1
  123. sky/dashboard/out/_next/static/chunks/984.ae8c08791d274ca0.js +0 -50
  124. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-4e065c812a52460b.js +0 -6
  125. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-520ec1ab65e2f2a4.js +0 -6
  126. sky/dashboard/out/_next/static/chunks/pages/clusters-7e9736af1c6345a6.js +0 -1
  127. sky/dashboard/out/_next/static/chunks/pages/config-e4f473661889e7cd.js +0 -1
  128. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-00fd23b9577492ca.js +0 -1
  129. sky/dashboard/out/_next/static/chunks/pages/infra-8a4bf7370d4d9bb7.js +0 -1
  130. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-171c27f4ca94861c.js +0 -16
  131. sky/dashboard/out/_next/static/chunks/pages/jobs-55e5bcb16d563231.js +0 -1
  132. sky/dashboard/out/_next/static/chunks/pages/users-c9f4d785cdaa52d8.js +0 -1
  133. sky/dashboard/out/_next/static/chunks/pages/workspace/new-31aa8bdcb7592635.js +0 -1
  134. sky/dashboard/out/_next/static/chunks/pages/workspaces-f00cba35691483b1.js +0 -1
  135. sky/dashboard/out/_next/static/chunks/webpack-c85998e6a5722f21.js +0 -1
  136. sky/dashboard/out/_next/static/css/6ab927686b492a4a.css +0 -3
  137. sky/dashboard/out/_next/static/zsALxITkbP8J8NVwSDwMo/_buildManifest.js +0 -1
  138. /sky/dashboard/out/_next/static/{zsALxITkbP8J8NVwSDwMo → ZWdSYkqVe3WjnFR8ocqoG}/_ssgManifest.js +0 -0
  139. /sky/dashboard/out/_next/static/chunks/{843-bde186946d353355.js → 843-07d25a7e64462fd8.js} +0 -0
  140. /sky/dashboard/out/_next/static/chunks/{938-ce7991c156584b06.js → 938-068520cc11738deb.js} +0 -0
  141. /sky/dashboard/out/_next/static/chunks/{973-56412c7976b4655b.js → 973-5b5019ba333e8d62.js} +0 -0
  142. {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/WHEEL +0 -0
  143. {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/entry_points.txt +0 -0
  144. {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/licenses/LICENSE +0 -0
  145. {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/top_level.txt +0 -0
@@ -1,6 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[682],{3626:function(e,s,t){t.d(s,{Z:function(){return a}});/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let a=(0,t(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},8682:function(e,s,t){t.r(s),t.d(s,{ContextDetails:function(){return y},GPUs:function(){return w},InfrastructureSection:function(){return b}});var a=t(5893),l=t(7294),r=t(8799);t(9470);var n=t(3626),d=t(3001),c=t(2045),i=t(3266),o=t(8969),x=t(6378),m=t(6856),u=t(1214),h=t(1163),g=t(1664),f=t.n(g),p=t(6989);let j=u.nb.REFRESH_INTERVAL,N=u.MO.NAME_TRUNCATE_LENGTH;function b(e){let{title:s,isLoading:t,isDataLoaded:l,contexts:n,gpus:d,groupedPerContextGPUs:c,groupedPerNodeGPUs:i,handleContextClick:o,contextStats:x={},isSSH:m=!1}=e,u=n||[];return t||!l?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:s}),(0,a.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,a.jsx)(r.Z,{size:24,className:"mr-3"}),(0,a.jsxs)("span",{className:"text-gray-500",children:["Loading ",s,"..."]})]})]})}):l&&0===u.length?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:s}),(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:["No ",s," found or ",s," is not configured."]})]})}):l&&u.length>0?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:s}),(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-800 rounded-full text-xs font-medium",children:[u.length," ",1===u.length?m?"pool":"context":m?"pools":"contexts"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:m?"Node Pool":"Context"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Clusters"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Jobs"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Nodes"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:"GPU Types"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"#GPUs"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200 ".concat(u.length>5?"max-h-[250px] overflow-y-auto block":""),children:u.map(e=>{let s=c[e]||[],t=i[e]||[],l=s.reduce((e,s)=>e+(s.gpu_total||0),0),r=x[m?"ssh/".concat(e.replace(/^ssh-/,"")):"kubernetes/".concat(e)]||{clusters:0,jobs:0},n=Object.keys(s.reduce((e,s)=>(e[s.gpu_name]=(e[s.gpu_name]||0)+(s.gpu_total||0),e),{})).join(", "),d=m?e.replace(/^ssh-/,""):e;return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3",children:(0,a.jsx)(p.Md,{content:d,className:"text-sm text-muted-foreground",children:(0,a.jsx)("span",{className:"text-blue-600 hover:underline cursor-pointer",onClick:()=>o(e),children:d.length>N?"".concat(d.substring(0,Math.floor((N-3)/2)),"...").concat(d.substring(d.length-Math.ceil((N-3)/2))):d})})}),(0,a.jsx)("td",{className:"p-3",children:r.clusters>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded text-xs font-medium",children:r.clusters}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:r.jobs>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs font-medium",children:r.jobs}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:(t||[]).length}),(0,a.jsx)("td",{className:"p-3",children:n||"-"}),(0,a.jsx)("td",{className:"p-3",children:l})]},e)})})]})})}),d&&d.length>0&&(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsxs)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4 whitespace-nowrap",children:["GPU",(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded-full text-xs font-medium whitespace-nowrap",children:[d.reduce((e,s)=>e+s.gpu_free,0)," ","of"," ",d.reduce((e,s)=>e+s.gpu_total,0)," ","free"]})]}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:"Requestable"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/2",children:(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsx)("span",{children:"Utilization"})})})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200 ".concat(d.length>5?"max-h-[250px] overflow-y-auto block":""),children:d.map(e=>{let s=e.gpu_total-e.gpu_free,t=e.gpu_total>0?e.gpu_free/e.gpu_total*100:0,l=e.gpu_total>0?s/e.gpu_total*100:0,r=c?Object.values(c).flat().filter(s=>s.gpu_name===e.gpu_name&&(m?s.context.startsWith("ssh-"):!s.context.startsWith("ssh-"))).map(e=>e.gpu_requestable_qty_per_node).filter((e,s,t)=>t.indexOf(e)===s).join(", "):"-";return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"p-3 font-medium w-24 whitespace-nowrap",children:e.gpu_name}),(0,a.jsxs)("td",{className:"p-3 text-xs text-gray-600",children:[r||"-"," / node"]}),(0,a.jsx)("td",{className:"p-3 w-2/3",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"flex-1 bg-gray-100 rounded-md h-5 flex overflow-hidden shadow-sm min-w-[100px] w-full",children:[l>0&&(0,a.jsx)("div",{style:{width:"".concat(l,"%")},className:"bg-yellow-500 h-full flex items-center justify-center text-white text-xs font-medium",children:l>15&&"".concat(s," used")}),t>0&&(0,a.jsx)("div",{style:{width:"".concat(t,"%")},className:"bg-green-700 h-full flex items-center justify-center text-white text-xs font-medium",children:t>15&&"".concat(e.gpu_free," free")})]})})})]},e.gpu_name)})})]})})})]})]})}):null}function y(e){let{contextName:s,gpusInContext:t,nodesInContext:l}=e;return s.startsWith("ssh-"),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm h-full",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Available GPUs"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6",children:t.map(e=>{let s=e.gpu_total-e.gpu_free,t=e.gpu_total>0?e.gpu_free/e.gpu_total*100:0,l=e.gpu_total>0?s/e.gpu_total*100:0;return(0,a.jsxs)("div",{className:"p-3 bg-gray-50 rounded-md border border-gray-200 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1.5 flex-wrap",children:[(0,a.jsxs)("div",{className:"font-medium text-gray-800 text-sm",children:[e.gpu_name,(0,a.jsxs)("span",{className:"text-xs text-gray-500 ml-2",children:["(Requestable: ",e.gpu_requestable_qty_per_node," / node)"]})]}),(0,a.jsxs)("span",{className:"text-xs font-medium",children:[e.gpu_free," free / ",e.gpu_total," total"]})]}),(0,a.jsxs)("div",{className:"w-full bg-gray-100 rounded-md h-4 flex overflow-hidden shadow-sm",children:[l>0&&(0,a.jsx)("div",{style:{width:"".concat(l,"%")},className:"bg-yellow-500 h-full flex items-center justify-center text-white text-xs",children:l>15&&"".concat(s," used")}),t>0&&(0,a.jsx)("div",{style:{width:"".concat(t,"%")},className:"bg-green-700 h-full flex items-center justify-center text-white text-xs",children:t>15&&"".concat(e.gpu_free," free")})]})]},e.gpu_name)})}),l&&l.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Nodes"}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-100",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"Node"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"GPU"}),(0,a.jsx)("th",{className:"p-3 text-right font-medium text-gray-600",children:"Availability"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:l.map((e,s)=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.node_name}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.gpu_name}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-right text-gray-700",children:"".concat(e.gpu_free," of ").concat(e.gpu_total," free")})]},"".concat(e.node_name,"-").concat(s)))})]})})]})]})})})}function w(){let[e,s]=(0,l.useState)(!0),[t,u]=(0,l.useState)(!0),[g,p]=(0,l.useState)(!0),N=l.useRef(null),w=(0,d.X)(),[v,_]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),P=(0,h.useRouter)(),[k,L]=(0,l.useState)([]),[U,E]=(0,l.useState)([]),[I,G]=(0,l.useState)([]),[M,R]=(0,l.useState)([]),[q,A]=(0,l.useState)([]),[Z,W]=(0,l.useState)(0),[z,D]=(0,l.useState)(0),[F,H]=(0,l.useState)({}),[T,O]=(0,l.useState)(null),J=l.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{showLoadingIndicators:!0};e.showLoadingIndicators&&(s(!0),u(!0));try{let e=await x.default.get(c.l4),{gpuData:s,cloudData:t}=e||{};if(s){let{allContextNames:e,allGPUs:t,perContextGPUs:a,perNodeGPUs:l,contextStats:r}=s;L(e||[]),E(t||[]),G(a||[]),R(l||[]),H(r||{}),_(!0)}else e&&null===e.gpuData?(L([]),E([]),G([]),R([]),H({}),_(!0)):e||console.log("No infra data received from cache");t?(A(t.clouds||[]),W(t.totalClouds||0),D(t.enabledClouds||0),S(!0)):e&&null===e.cloudData?(A([]),W(0),D(0),S(!0)):e||console.log("No cloud data received from cache")}catch(e){console.error("Error in fetchData:",e),L([]),E([]),G([]),R([]),H({}),A([]),W(0),D(0),_(!0),S(!0)}finally{e.showLoadingIndicators&&(s(!1),u(!1)),g&&e.showLoadingIndicators&&p(!1)}},[g]);(0,l.useEffect)(()=>{N.current=J},[J]),(0,l.useEffect)(()=>{(async()=>{await m.ZP.preloadForPage("infra"),J({showLoadingIndicators:!0})})()},[J]),(0,l.useEffect)(()=>{let e=!0,s=setInterval(()=>{e&&N.current&&N.current({showLoadingIndicators:!1})},j);return()=>{e=!1,clearInterval(s)}},[]),(0,l.useEffect)(()=>()=>{_(!1),S(!1),p(!0)},[]),(U||[]).length,(U||[]).reduce((e,s)=>e+s.gpu_total,0),(U||[]).reduce((e,s)=>e+s.gpu_free,0);let K=l.useMemo(()=>I?I.reduce((e,s)=>{let{context:t}=s;return e[t]||(e[t]=[]),e[t].push(s),e},{}):{},[I]),V=l.useMemo(()=>k&&Array.isArray(k)?k.filter(e=>e.startsWith("ssh-")):[],[k]),X=l.useMemo(()=>k&&Array.isArray(k)?k.filter(e=>!e.startsWith("ssh-")):[],[k]),B=l.useMemo(()=>{if(!I||!U)return[];let e=new Set;return I.forEach(s=>{s.context.startsWith("ssh-")&&e.add(s.gpu_name)}),U.filter(s=>e.has(s.gpu_name))},[U,I]),Q=l.useMemo(()=>{if(!I||!U)return[];let e=new Set;return I.forEach(s=>{s.context.startsWith("ssh-")||e.add(s.gpu_name)}),U.filter(s=>e.has(s.gpu_name))},[U,I]),Y=l.useMemo(()=>M?M.reduce((e,s)=>{let{context:t}=s;return e[t]||(e[t]=[]),e[t].push(s),e},{}):{},[M]);(0,l.useEffect)(()=>{P.isReady&&P.query.context&&O(decodeURIComponent(Array.isArray(P.query.context)?P.query.context[0]:P.query.context))},[P.isReady,P.query.context]);let $=e=>{O(e),P.push("/infra/".concat(encodeURIComponent(e)))},ee=e||t,es=v&&C&&!g;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(f(),{href:"/infra",className:"text-sky-blue hover:underline ".concat(T?"":"cursor-default"),children:"Infrastructure"}),T&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),T.startsWith("ssh-")?(0,a.jsx)(f(),{href:"/infra",className:"text-sky-blue hover:underline cursor-pointer",children:"SSH Node Pool"}):(0,a.jsx)(f(),{href:"/infra",className:"text-sky-blue hover:underline cursor-pointer",children:"Kubernetes"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)("span",{className:"text-sky-blue",children:T.startsWith("ssh-")?T.replace(/^ssh-/,""):T})]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[ee&&(0,a.jsxs)("div",{className:"flex items-center mr-2",children:[(0,a.jsx)(r.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,a.jsxs)("button",{onClick:()=>{x.default.invalidate(i.getClusters),x.default.invalidate(o.getManagedJobs,[{allUsers:!0}]),x.default.invalidate(c.l4),N.current&&N.current({showLoadingIndicators:!0})},disabled:ee,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 mr-1.5"}),!w&&"Refresh"]})]})]}),es?T?e&&!v?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading Context..."})]}):(s=>{let t=K[s]||[],l=Y[s]||[];return e&&!v?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading Context..."})]}):(0,a.jsx)(y,{contextName:s,gpusInContext:t,nodesInContext:l})})(T):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{title:"SSH Node Pool",isLoading:e,isDataLoaded:v,contexts:V,gpus:B,groupedPerContextGPUs:K,groupedPerNodeGPUs:Y,handleContextClick:$,contextStats:F,isSSH:!0}),(0,a.jsx)(b,{title:"Kubernetes",isLoading:e,isDataLoaded:v,contexts:X,gpus:Q,groupedPerContextGPUs:K,groupedPerNodeGPUs:Y,handleContextClick:$,contextStats:F,isSSH:!1}),t||!C?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Cloud"}),(0,a.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,a.jsx)(r.Z,{size:24,className:"mr-3"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading Cloud..."})]})]})}):(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Cloud"}),(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-800 rounded-full text-xs font-medium",children:[z," of ",Z," enabled"]})]}),q&&0!==q.length?(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-32",children:"Cloud"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-24",children:"Clusters"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-24",children:"Jobs"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:q.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3 font-medium text-gray-700",children:e.name}),(0,a.jsx)("td",{className:"p-3",children:e.clusters>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded text-xs font-medium",children:e.clusters}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:e.jobs>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs font-medium",children:e.jobs}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})})]},e.name))})]})}):(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"No enabled clouds available."})]})})]}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-32",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading infrastructure data..."})]})]})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[760],{1163:function(e,r,t){e.exports=t(6036)},8771:function(e,r,t){"use strict";t.d(r,{F:function(){return l},e:function(){return i}});var o=t(7294);function n(e,r){if("function"==typeof e)return e(r);null!=e&&(e.current=r)}function l(...e){return r=>{let t=!1,o=e.map(e=>{let o=n(e,r);return t||"function"!=typeof o||(t=!0),o});if(t)return()=>{for(let r=0;r<o.length;r++){let t=o[r];"function"==typeof t?t():n(e[r],null)}}}}function i(...e){return o.useCallback(l(...e),e)}},5320:function(e,r,t){"use strict";t.d(r,{WV:function(){return s},jH:function(){return a}});var o=t(7294),n=t(3935),l=t(8426),i=t(5893),s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let t=(0,l.Z8)(`Primitive.${r}`),n=o.forwardRef((e,o)=>{let{asChild:n,...l}=e,s=n?t:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(s,{...l,ref:o})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{});function a(e,r){e&&n.flushSync(()=>e.dispatchEvent(r))}},8426:function(e,r,t){"use strict";t.d(r,{Z8:function(){return i},g7:function(){return s}});var o=t(7294),n=t(8771),l=t(5893);function i(e){let r=function(e){let r=o.forwardRef((e,r)=>{let{children:t,...l}=e;if(o.isValidElement(t)){let e,i;let s=(e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?t.props.ref:t.props.ref||t.ref,a=function(e,r){let t={...r};for(let o in r){let n=e[o],l=r[o];/^on[A-Z]/.test(o)?n&&l?t[o]=(...e)=>{let r=l(...e);return n(...e),r}:n&&(t[o]=n):"style"===o?t[o]={...n,...l}:"className"===o&&(t[o]=[n,l].filter(Boolean).join(" "))}return{...e,...t}}(l,t.props);return t.type!==o.Fragment&&(a.ref=r?(0,n.F)(r,s):s),o.cloneElement(t,a)}return o.Children.count(t)>1?o.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}(e),t=o.forwardRef((e,t)=>{let{children:n,...i}=e,s=o.Children.toArray(n),a=s.find(d);if(a){let e=a.props.children,n=s.map(r=>r!==a?r:o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null);return(0,l.jsx)(r,{...i,ref:t,children:o.isValidElement(e)?o.cloneElement(e,void 0,n):null})}return(0,l.jsx)(r,{...i,ref:t,children:n})});return t.displayName=`${e}.Slot`,t}var s=i("Slot"),a=Symbol("radix.slottable");function d(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a}},512:function(e,r,t){"use strict";function o(){for(var e,r,t=0,o="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=function e(r){var t,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r){if(Array.isArray(r)){var l=r.length;for(t=0;t<l;t++)r[t]&&(o=e(r[t]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o)}return n}(e))&&(o&&(o+=" "),o+=r);return o}t.d(r,{W:function(){return o}}),r.Z=o},8388:function(e,r,t){"use strict";t.d(r,{m6:function(){return L}});let o=e=>{let r=s(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{let t=e.split("-");return""===t[0]&&1!==t.length&&t.shift(),n(t,r)||i(e)},getConflictingClassGroupIds:(e,r)=>{let n=t[e]||[];return r&&o[e]?[...n,...o[e]]:n}}},n=(e,r)=>{if(0===e.length)return r.classGroupId;let t=e[0],o=r.nextPart.get(t),l=o?n(e.slice(1),o):void 0;if(l)return l;if(0===r.validators.length)return;let i=e.join("-");return r.validators.find(({validator:e})=>e(i))?.classGroupId},l=/^\[(.+)\]$/,i=e=>{if(l.test(e)){let r=l.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},s=e=>{let{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),t).forEach(([e,t])=>{a(t,o,e,r)}),o},a=(e,r,t,o)=>{e.forEach(e=>{if("string"==typeof e){(""===e?r:d(r,e)).classGroupId=t;return}if("function"==typeof e){if(c(e)){a(e(o),r,t,o);return}r.validators.push({validator:e,classGroupId:t});return}Object.entries(e).forEach(([e,n])=>{a(n,d(r,e),t,o)})})},d=(e,r)=>{let t=e;return r.split("-").forEach(e=>{t.nextPart.has(e)||t.nextPart.set(e,{nextPart:new Map,validators:[]}),t=t.nextPart.get(e)}),t},c=e=>e.isThemeGetter,u=(e,r)=>r?e.map(([e,t])=>[e,t.map(e=>"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[r+e,t])):e)]):e,p=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,t=new Map,o=new Map,n=(n,l)=>{t.set(n,l),++r>e&&(r=0,o=t,t=new Map)};return{get(e){let r=t.get(e);return void 0!==r?r:void 0!==(r=o.get(e))?(n(e,r),r):void 0},set(e,r){t.has(e)?t.set(e,r):n(e,r)}}},b=e=>{let{separator:r,experimentalParseClassName:t}=e,o=1===r.length,n=r[0],l=r.length,i=e=>{let t;let i=[],s=0,a=0;for(let d=0;d<e.length;d++){let c=e[d];if(0===s){if(c===n&&(o||e.slice(d,d+l)===r)){i.push(e.slice(a,d)),a=d+l;continue}if("/"===c){t=d;continue}}"["===c?s++:"]"===c&&s--}let d=0===i.length?e:e.substring(a),c=d.startsWith("!"),u=c?d.substring(1):d;return{modifiers:i,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:t&&t>a?t-a:void 0}};return t?e=>t({className:e,parseClassName:i}):i},f=e=>{if(e.length<=1)return e;let r=[],t=[];return e.forEach(e=>{"["===e[0]?(r.push(...t.sort(),e),t=[]):t.push(e)}),r.push(...t.sort()),r},m=e=>({cache:p(e.cacheSize),parseClassName:b(e),...o(e)}),g=/\s+/,h=(e,r)=>{let{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:n}=r,l=[],i=e.trim().split(g),s="";for(let e=i.length-1;e>=0;e-=1){let r=i[e],{modifiers:a,hasImportantModifier:d,baseClassName:c,maybePostfixModifierPosition:u}=t(r),p=!!u,b=o(p?c.substring(0,u):c);if(!b){if(!p||!(b=o(c))){s=r+(s.length>0?" "+s:s);continue}p=!1}let m=f(a).join(":"),g=d?m+"!":m,h=g+b;if(l.includes(h))continue;l.push(h);let y=n(b,p);for(let e=0;e<y.length;++e){let r=y[e];l.push(g+r)}s=r+(s.length>0?" "+s:s)}return s};function y(){let e,r,t=0,o="";for(;t<arguments.length;)(e=arguments[t++])&&(r=x(e))&&(o&&(o+=" "),o+=r);return o}let x=e=>{let r;if("string"==typeof e)return e;let t="";for(let o=0;o<e.length;o++)e[o]&&(r=x(e[o]))&&(t&&(t+=" "),t+=r);return t},v=e=>{let r=r=>r[e]||[];return r.isThemeGetter=!0,r},w=/^\[(?:([a-z-]+):)?(.+)\]$/i,k=/^\d+\/\d+$/,z=new Set(["px","full","screen"]),j=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,S=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,E=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>R(e)||z.has(e)||k.test(e),G=e=>T(e,"length",B),R=e=>!!e&&!Number.isNaN(Number(e)),$=e=>T(e,"number",R),W=e=>!!e&&Number.isInteger(Number(e)),_=e=>e.endsWith("%")&&R(e.slice(0,-1)),O=e=>w.test(e),I=e=>j.test(e),M=new Set(["length","size","percentage"]),V=e=>T(e,M,H),A=e=>T(e,"position",H),Z=new Set(["image","url"]),F=e=>T(e,Z,K),q=e=>T(e,"",J),D=()=>!0,T=(e,r,t)=>{let o=w.exec(e);return!!o&&(o[1]?"string"==typeof r?o[1]===r:r.has(o[1]):t(o[2]))},B=e=>C.test(e)&&!S.test(e),H=()=>!1,J=e=>E.test(e),K=e=>P.test(e),L=function(e,...r){let t,o,n;let l=function(s){return o=(t=m(r.reduce((e,r)=>r(e),e()))).cache.get,n=t.cache.set,l=i,i(s)};function i(e){let r=o(e);if(r)return r;let l=h(e,t);return n(e,l),l}return function(){return l(y.apply(null,arguments))}}(()=>{let e=v("colors"),r=v("spacing"),t=v("blur"),o=v("brightness"),n=v("borderColor"),l=v("borderRadius"),i=v("borderSpacing"),s=v("borderWidth"),a=v("contrast"),d=v("grayscale"),c=v("hueRotate"),u=v("invert"),p=v("gap"),b=v("gradientColorStops"),f=v("gradientColorStopPositions"),m=v("inset"),g=v("margin"),h=v("opacity"),y=v("padding"),x=v("saturate"),w=v("scale"),k=v("sepia"),z=v("skew"),j=v("space"),C=v("translate"),S=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",O,r],M=()=>[O,r],Z=()=>["",N,G],T=()=>["auto",R,O],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",O],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[R,O];return{cacheSize:500,separator:":",theme:{colors:[D],spacing:[N,G],blur:["none","",I,O],brightness:U(),borderColor:[e],borderRadius:["none","","full",I,O],borderSpacing:M(),borderWidth:Z(),contrast:U(),grayscale:L(),hueRotate:U(),invert:L(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[_,G],inset:P(),margin:P(),opacity:U(),padding:M(),saturate:U(),scale:U(),sepia:L(),skew:U(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[I]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),O]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",W,O]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",W,O]}],"grid-cols":[{"grid-cols":[D]}],"col-start-end":[{col:["auto",{span:["full",W,O]},O]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[D]}],"row-start-end":[{row:["auto",{span:[W,O]},O]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,r]}],"min-w":[{"min-w":[O,r,"min","max","fit"]}],"max-w":[{"max-w":[O,r,"none","full","min","max","fit","prose",{screen:[I]},I]}],h:[{h:[O,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,r,"auto","min","max","fit"]}],"font-size":[{text:["base",I,G]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$]}],"font-family":[{font:[D]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",O]}],"line-clamp":[{"line-clamp":["none",R,$]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",N,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",N,G]}],"underline-offset":[{"underline-offset":["auto",N,O]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),A]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},F]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:H()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[N,O]}],"outline-w":[{outline:[N,G]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[N,G]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",I,q]}],"shadow-color":[{shadow:[D]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",I,O]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",O]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[W,O]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",O]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[N,G,$]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[901,350],{7145:function(e,r,t){t.d(r,{x:function(){return a}});var o=t(3225);let a={fetch:async(e,r)=>{let t=window.location.origin,a="".concat(t).concat(o.f4).concat(e),s=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),n=s.headers.get("X-Skypilot-Request-ID")||s.headers.get("X-Request-ID"),c=await fetch("".concat(t).concat(o.f4,"/api/get?request_id=").concat(n)),l=await c.json();return l.return_value?JSON.parse(l.return_value):[]},post:async(e,r)=>{let t=window.location.origin,a="".concat(t).concat(o.f4).concat(e);return await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},stream:async(e,r,t)=>{let o=(await a.post(e,r)).body.getReader();try{for(;;){let{done:e,value:r}=await o.read();if(e)break;let a=new TextDecoder().decode(r);t(a)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let r=window.location.origin,t="".concat(r).concat(o.f4).concat(e);return await fetch(t)}}},7324:function(e,r,t){t.d(r,{MB:function(){return l},eA:function(){return c},fX:function(){return a},iE:function(){return u},rF:function(){return d},yz:function(){return s},zl:function(){return i}});var o=t(7145);async function a(){try{let e=await o.x.get("/workspaces");if(!e.ok)throw Error("Error scheduling getWorkspaces: ".concat(e.statusText," (status ").concat(e.status,")"));let r=e.headers.get("X-Skypilot-Request-ID");if(!r){console.warn("X-Skypilot-Request-ID header not found in /workspaces response. Attempting to find request_id in response body as a fallback.");try{let t=await e.json();if(t&&t.request_id)r=t.request_id,console.log("Found request_id in /workspaces response body (fallback):",r);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /workspaces.")}catch(r){let e=r.message||"Error processing fallback for request_id from /workspaces response body.";throw console.error("Error in /workspaces request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!r)throw Error("Failed to obtain X-Skypilot-Request-ID from /workspaces response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching workspace data with request_id: ".concat(r));let t=await o.x.get("/api/get?request_id=".concat(r));if(!t.ok){let e="Error fetching workspace data for request ID ".concat(r,": ").concat(t.statusText," (status ").concat(t.status,")");try{let o=await t.json();if(o&&o.detail){let t=o.detail;try{let e=JSON.parse(t);e&&e.error?t=e.error:e&&e.result&&e.result.error&&(t=e.result.error)}catch(e){}e="Error fetching workspace data for request ID ".concat(r,": ").concat(t)}}catch(e){}throw Error(e)}let a=await t.json();if(console.log("[Connector Debug] Full resultData from /api/get:",a),"FAILED"===a.status){let e="Unknown error during task execution";if(a.error)"string"==typeof a.error?e=a.error:"object"==typeof a.error&&(e=a.error.message||a.error.detail||JSON.stringify(a.error));else if(a.result&&a.result.error)"string"==typeof a.result.error?e=a.result.error:"object"==typeof a.result.error&&(e=a.result.error.message||a.result.error.detail||JSON.stringify(a.result.error));else if(a.return_value)try{let r=JSON.parse(a.return_value);r.error&&(e="string"==typeof r.error?r.error:r.error.message||r.error.detail||JSON.stringify(r.error))}catch(r){(a.return_value.includes("Error")||a.return_value.includes("Cannot"))&&(e=a.return_value)}throw Error(e)}let s={};if("SUCCEEDED"===a.status&&a.return_value)try{s=JSON.parse(a.return_value),console.log("Successfully parsed workspace data from return_value:",s)}catch(e){throw console.error("Failed to parse workspace data from return_value:",e,"Raw return_value:",a.return_value),Error("Failed to parse workspace data for request ID ".concat(r,": ").concat(e.message))}else a.result&&(console.warn("Using resultData.result as fallback for status ".concat(a.status)),s=a.result);return console.log("Effectively fetched workspace data (to be returned):",s),s||{}}catch(e){throw console.error("Failed to fetch workspaces (in getWorkspaces function):",e.message,e.stack),e}}async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let t="/enabled_clouds",a=new URLSearchParams;e&&a.append("workspace",e),r&&a.append("expand","true"),a.toString()&&(t+="?".concat(a.toString()));let s=await o.x.get(t);if(!s.ok)throw Error("Error scheduling getEnabledClouds: ".concat(s.statusText," (status ").concat(s.status,")"));let n=s.headers.get("X-Skypilot-Request-ID");if(!n){console.warn("X-Skypilot-Request-ID header not found in /enabled_clouds response. Attempting to find request_id in response body as a fallback.");try{let e=await s.json();if(e&&e.request_id)n=e.request_id,console.log("Found request_id in /enabled_clouds response body (fallback):",n);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /enabled_clouds.")}catch(r){let e=r.message||"Error processing fallback for request_id from /enabled_clouds response body.";throw console.error("Error in /enabled_clouds request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!n)throw Error("Failed to obtain X-Skypilot-Request-ID from /enabled_clouds response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching enabled_clouds data with request_id: ".concat(n));let c=await o.x.get("/api/get?request_id=".concat(n));if(!c.ok){let e="Error fetching enabled_clouds data for request ID ".concat(n,": ").concat(c.statusText," (status ").concat(c.status,")");try{let r=await c.json();if(r&&r.detail){let t=r.detail;try{let e=JSON.parse(t);e&&e.error?t=e.error:e&&e.result&&e.result.error&&(t=e.result.error)}catch(e){}e="Error fetching enabled_clouds data for request ID ".concat(n,": ").concat(t)}}catch(e){}throw Error(e)}let l=await c.json();if(console.log("[Connector Debug] Full resultData from /api/get for enabled_clouds:",l),"FAILED"===l.status){let e=l.error||l.result&&l.result.error||"Unknown error during task execution for enabled_clouds";throw Error("Fetching enabled_clouds data failed for request ID ".concat(n,": ").concat(e))}let i=[];if("SUCCEEDED"===l.status&&l.return_value)try{i=JSON.parse(l.return_value),console.log("Successfully parsed enabled_clouds data from return_value:",i)}catch(e){throw console.error("Failed to parse enabled_clouds data from return_value:",e,"Raw return_value:",l.return_value),Error("Failed to parse enabled_clouds data for request ID ".concat(n,": ").concat(e.message))}else l.result&&(console.warn("Using resultData.result as fallback for enabled_clouds status ".concat(l.status)),i=l.result);return Array.isArray(i)?i:[]}catch(e){throw console.error("Failed to fetch enabled_clouds (in getEnabledClouds function):",e.message,e.stack),e}}async function n(e,r){console.log("Polling for ".concat(r," task completion with request_id: ").concat(e));let t=await o.x.get("/api/get?request_id=".concat(e));if(!t.ok){let o="Error fetching ".concat(r," data for request ID ").concat(e,": ").concat(t.statusText," (status ").concat(t.status,")");try{let e=await t.json();if(console.error("[Error Debug] ".concat(r," HTTP error response:"),JSON.stringify(e,null,2)),e&&e.detail){if("object"==typeof e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t&&t.message)o="".concat(r," failed: ").concat(t.message);else if(t&&"object"==typeof t){let e=t.type||JSON.stringify(t);o="".concat(r," failed: ").concat(e)}}catch(t){o="".concat(r," failed: ").concat(e.detail.error)}else if("string"==typeof e.detail)o="".concat(r," failed: ").concat(e.detail);else{let t=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[o,a]of Object.entries(e)){let e=t(a,r?"".concat(r,".").concat(o):o);if(e)return e}return null},a=t(e.detail);a&&(o="".concat(r," failed: ").concat(a))}}}catch(e){console.error("[Error Debug] Failed to parse error response:",e)}throw Error(o)}let a=await t.json();if(console.log("[Connector Debug] ".concat(r," resultData:"),a),"FAILED"===a.status){console.error("[Error Debug] ".concat(r," failed. Full resultData:"),JSON.stringify(a,null,2)),console.error("[Error Debug] resultData.error:",a.error),console.error("[Error Debug] resultData.result:",a.result),console.error("[Error Debug] resultData.return_value:",a.return_value);let e="Unknown error during ".concat(r," task execution");if(a.error)"string"==typeof a.error?e=a.error:"object"==typeof a.error&&(e=a.error.message||a.error.detail||JSON.stringify(a.error));else if(a.result&&a.result.error)"string"==typeof a.result.error?e=a.result.error:"object"==typeof a.result.error&&(e=a.result.error.message||a.result.error.detail||JSON.stringify(a.result.error));else if(a.return_value)try{let r=JSON.parse(a.return_value);r.error&&(e="string"==typeof r.error?r.error:r.error.message||r.error.detail||JSON.stringify(r.error))}catch(r){a.return_value&&(a.return_value.includes("Error")||a.return_value.includes("Cannot"))&&(e=a.return_value)}if(e==="Unknown error during ".concat(r," task execution")){let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[o,a]of Object.entries(e)){let e=r(a,t?"".concat(t,".").concat(o):o);if(e)return e}return null},t=r(a);t&&(e=t)}throw Error(e)}let s={};if("SUCCEEDED"===a.status&&a.return_value)try{s=JSON.parse(a.return_value),console.log("Successfully parsed ".concat(r," data:"),s)}catch(t){throw console.error("Failed to parse ".concat(r," data from return_value:"),t,"Raw return_value:",a.return_value),Error("Failed to parse ".concat(r," data for request ID ").concat(e,": ").concat(t.message))}else a.result&&(console.warn("Using resultData.result as fallback for ".concat(r," status ").concat(a.status)),s=a.result);return s}async function c(e,r){try{console.log("Updating workspace ".concat(e," with config:"),r);let t=await o.x.post("/workspaces/update",{workspace_name:e,config:r});if(!t.ok)throw Error("Error scheduling updateWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let a=t.headers.get("X-Skypilot-Request-ID");if(!a)throw Error("Failed to obtain request ID for updateWorkspace");return await n(a,"updateWorkspace")}catch(e){throw console.error("Failed to update workspace:",e),e}}let l=async(e,r)=>{try{let t=await o.x.post("/workspaces/create",{workspace_name:e,config:r});if(!t.ok)throw await t.text(),Error("Error scheduling createWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let a=t.headers.get("X-Skypilot-Request-ID");if(!a)throw Error("Failed to obtain request ID for createWorkspace");return await n(a,"createWorkspace")}catch(e){throw console.error("Failed to create workspace:",e),e}};async function i(e){try{console.log("Deleting workspace ".concat(e));let r=await o.x.post("/workspaces/delete",{workspace_name:e});if(!r.ok)throw Error("Error scheduling deleteWorkspace: ".concat(r.statusText," (status ").concat(r.status,")"));let t=r.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("Failed to obtain request ID for deleteWorkspace");console.log("[Delete Debug] Got request ID for deleteWorkspace: ".concat(t));try{let e=await n(t,"deleteWorkspace");return console.log("[Delete Debug] deleteWorkspace completed successfully:",e),e}catch(e){throw console.error("[Delete Debug] deleteWorkspace failed with error:",e),console.error("[Delete Debug] Error message:",e.message),e}}catch(e){throw console.error("Failed to delete workspace:",e),e}}async function u(){try{console.log("Getting entire SkyPilot configuration");let e=await o.x.get("/workspaces/config");if(!e.ok)throw Error("Error scheduling getConfig: ".concat(e.statusText," (status ").concat(e.status,")"));let r=e.headers.get("X-Skypilot-Request-ID");if(!r)throw Error("Failed to obtain request ID for getConfig");return await n(r,"getConfig")}catch(e){throw console.error("Failed to get config:",e),e}}async function d(e){try{console.log("Updating entire SkyPilot configuration with config:",e);let r=await o.x.post("/workspaces/config",{config:e});if(!r.ok)throw Error("Error scheduling updateConfig: ".concat(r.statusText," (status ").concat(r.status,")"));let t=r.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("Failed to obtain request ID for updateConfig");return await n(t,"updateConfig")}catch(e){throw console.error("Failed to update config:",e),e}}},2350:function(e,r,t){t.d(r,{cn:function(){return s}});var o=t(512),a=t(8388);function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,a.m6)((0,o.W)(r))}}}]);
@@ -1,50 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[984],{6826:function(e,n,t){t.d(n,{Z:function(){return r}});/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let r=(0,t(998).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},3685:function(e,n,t){t.d(n,{Z:function(){return r}});/**
7
- * @license lucide-react v0.407.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */let r=(0,t(998).Z)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]])},6741:function(e,n,t){t.d(n,{Z:function(){return r}});/**
12
- * @license lucide-react v0.407.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */let r=(0,t(998).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},3936:function(e,n,t){t.d(n,{Z:function(){return r}});/**
17
- * @license lucide-react v0.407.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */let r=(0,t(998).Z)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},5274:function(e,n,t){t.d(n,{Z:function(){return r}});/**
22
- * @license lucide-react v0.407.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */let r=(0,t(998).Z)("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])},3626:function(e,n,t){t.d(n,{Z:function(){return r}});/**
27
- * @license lucide-react v0.407.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */let r=(0,t(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},7603:function(e,n,t){t.d(n,{Z:function(){return r}});/**
32
- * @license lucide-react v0.407.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */let r=(0,t(998).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},1109:function(e,n,t){t.d(n,{Z:function(){return r}});/**
37
- * @license lucide-react v0.407.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */let r=(0,t(998).Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},3767:function(e,n,t){t.d(n,{Z:function(){return r}});/**
42
- * @license lucide-react v0.407.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */let r=(0,t(998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6327:function(e,n,t){t.d(n,{x8:function(){return el},VY:function(){return eo},dk:function(){return ea},aV:function(){return er},h_:function(){return et},fC:function(){return ee},Dx:function(){return ei},xz:function(){return en}});var r=t(7294),o=t(6206),i=t(8771),a=t(5360),l=t(1276),u=t(7342),s=t(6063),d=t(5420),c=t(2651),f=t(9981),p=e=>{let n,t;let{present:o,children:a}=e,l=function(e){var n,t;let[o,i]=r.useState(),a=r.useRef(null),l=r.useRef(e),u=r.useRef("none"),[s,d]=(n=e?"mounted":"unmounted",t={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,n)=>t[e][n]??e,n));return r.useEffect(()=>{let e=y(a.current);u.current="mounted"===s?e:"none"},[s]),(0,f.b)(()=>{let n=a.current,t=l.current;if(t!==e){let r=u.current,o=y(n);e?d("MOUNT"):"none"===o||n?.display==="none"?d("UNMOUNT"):t&&r!==o?d("ANIMATION_OUT"):d("UNMOUNT"),l.current=e}},[e,d]),(0,f.b)(()=>{if(o){let e;let n=o.ownerDocument.defaultView??window,t=t=>{let r=y(a.current).includes(t.animationName);if(t.target===o&&r&&(d("ANIMATION_END"),!l.current)){let t=o.style.animationFillMode;o.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=t)})}},r=e=>{e.target===o&&(u.current=y(a.current))};return o.addEventListener("animationstart",r),o.addEventListener("animationcancel",t),o.addEventListener("animationend",t),()=>{n.clearTimeout(e),o.removeEventListener("animationstart",r),o.removeEventListener("animationcancel",t),o.removeEventListener("animationend",t)}}d("ANIMATION_END")},[o,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(o),u="function"==typeof a?a({present:l.isPresent}):r.Children.only(a),s=(0,i.e)(l.ref,(n=Object.getOwnPropertyDescriptor(u.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning?u.ref:(n=Object.getOwnPropertyDescriptor(u,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning?u.props.ref:u.props.ref||u.ref);return"function"==typeof a||l.isPresent?r.cloneElement(u,{ref:s}):null};function y(e){return e?.animationName||"none"}p.displayName="Presence";var m=t(5320),v=t(7552),g=t(6223),h=t(3541),N=t(8426),x=t(5893),M="Dialog",[k,D]=(0,a.b)(M),[O,b]=k(M),j=e=>{let{__scopeDialog:n,children:t,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,d=r.useRef(null),c=r.useRef(null),[f,p]=(0,u.T)({prop:o,defaultProp:i??!1,onChange:a,caller:M});return(0,x.jsx)(O,{scope:n,triggerRef:d,contentRef:c,contentId:(0,l.M)(),titleId:(0,l.M)(),descriptionId:(0,l.M)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:s,children:t})};j.displayName=M;var w="DialogTrigger",R=r.forwardRef((e,n)=>{let{__scopeDialog:t,...r}=e,a=b(w,t),l=(0,i.e)(n,a.triggerRef);return(0,x.jsx)(m.WV.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":K(a.open),...r,ref:l,onClick:(0,o.M)(e.onClick,a.onOpenToggle)})});R.displayName=w;var I="DialogPortal",[E,C]=k(I,{forceMount:void 0}),A=e=>{let{__scopeDialog:n,forceMount:t,children:o,container:i}=e,a=b(I,n);return(0,x.jsx)(E,{scope:n,forceMount:t,children:r.Children.map(o,e=>(0,x.jsx)(p,{present:t||a.open,children:(0,x.jsx)(c.h,{asChild:!0,container:i,children:e})}))})};A.displayName=I;var T="DialogOverlay",Z=r.forwardRef((e,n)=>{let t=C(T,e.__scopeDialog),{forceMount:r=t.forceMount,...o}=e,i=b(T,e.__scopeDialog);return i.modal?(0,x.jsx)(p,{present:r||i.open,children:(0,x.jsx)(F,{...o,ref:n})}):null});Z.displayName=T;var _=(0,N.Z8)("DialogOverlay.RemoveScroll"),F=r.forwardRef((e,n)=>{let{__scopeDialog:t,...r}=e,o=b(T,t);return(0,x.jsx)(g.Z,{as:_,allowPinchZoom:!0,shards:[o.contentRef],children:(0,x.jsx)(m.WV.div,{"data-state":K(o.open),...r,ref:n,style:{pointerEvents:"auto",...r.style}})})}),P="DialogContent",W=r.forwardRef((e,n)=>{let t=C(P,e.__scopeDialog),{forceMount:r=t.forceMount,...o}=e,i=b(P,e.__scopeDialog);return(0,x.jsx)(p,{present:r||i.open,children:i.modal?(0,x.jsx)(U,{...o,ref:n}):(0,x.jsx)(V,{...o,ref:n})})});W.displayName=P;var U=r.forwardRef((e,n)=>{let t=b(P,e.__scopeDialog),a=r.useRef(null),l=(0,i.e)(n,t.contentRef,a);return r.useEffect(()=>{let e=a.current;if(e)return(0,h.Ry)(e)},[]),(0,x.jsx)(L,{...e,ref:l,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.M)(e.onCloseAutoFocus,e=>{e.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.M)(e.onPointerDownOutside,e=>{let n=e.detail.originalEvent,t=0===n.button&&!0===n.ctrlKey;(2===n.button||t)&&e.preventDefault()}),onFocusOutside:(0,o.M)(e.onFocusOutside,e=>e.preventDefault())})}),V=r.forwardRef((e,n)=>{let t=b(P,e.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return(0,x.jsx)(L,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(o.current||t.triggerRef.current?.focus(),n.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(o.current=!0,"pointerdown"!==n.detail.originalEvent.type||(i.current=!0));let r=n.target;t.triggerRef.current?.contains(r)&&n.preventDefault(),"focusin"===n.detail.originalEvent.type&&i.current&&n.preventDefault()}})}),L=r.forwardRef((e,n)=>{let{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:l,...u}=e,c=b(P,t),f=r.useRef(null),p=(0,i.e)(n,f);return(0,v.EW)(),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(d.M,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:l,children:(0,x.jsx)(s.XB,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":K(c.open),...u,ref:p,onDismiss:()=>c.onOpenChange(!1)})}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{titleId:c.titleId}),(0,x.jsx)(Q,{contentRef:f,descriptionId:c.descriptionId})]})]})}),S="DialogTitle",$=r.forwardRef((e,n)=>{let{__scopeDialog:t,...r}=e,o=b(S,t);return(0,x.jsx)(m.WV.h2,{id:o.titleId,...r,ref:n})});$.displayName=S;var z="DialogDescription",q=r.forwardRef((e,n)=>{let{__scopeDialog:t,...r}=e,o=b(z,t);return(0,x.jsx)(m.WV.p,{id:o.descriptionId,...r,ref:n})});q.displayName=z;var H="DialogClose",B=r.forwardRef((e,n)=>{let{__scopeDialog:t,...r}=e,i=b(H,t);return(0,x.jsx)(m.WV.button,{type:"button",...r,ref:n,onClick:(0,o.M)(e.onClick,()=>i.onOpenChange(!1))})});function K(e){return e?"open":"closed"}B.displayName=H;var X="DialogTitleWarning",[Y,G]=(0,a.k)(X,{contentName:P,titleName:S,docsSlug:"dialog"}),J=({titleId:e})=>{let n=G(X),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
47
-
48
- If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
49
-
50
- For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return r.useEffect(()=>{e&&!document.getElementById(e)&&console.error(t)},[t,e]),null},Q=({contentRef:e,descriptionId:n})=>{let t=G("DialogDescriptionWarning"),o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t.contentName}}.`;return r.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");n&&t&&!document.getElementById(n)&&console.warn(o)},[o,e,n]),null},ee=j,en=R,et=A,er=Z,eo=W,ei=$,ea=q,el=B},2003:function(e,n,t){t.d(n,{j:function(){return a}});var r=t(512);let o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=r.W,a=(e,n)=>t=>{var r;if((null==n?void 0:n.variants)==null)return i(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:a,defaultVariants:l}=n,u=Object.keys(a).map(e=>{let n=null==t?void 0:t[e],r=null==l?void 0:l[e];if(null===n)return null;let i=o(n)||o(r);return a[e][i]}),s=t&&Object.entries(t).reduce((e,n)=>{let[t,r]=n;return void 0===r||(e[t]=r),e},{});return i(e,u,null==n?void 0:null===(r=n.compoundVariants)||void 0===r?void 0:r.reduce((e,n)=>{let{class:t,className:r,...o}=n;return Object.entries(o).every(e=>{let[n,t]=e;return Array.isArray(t)?t.includes({...l,...s}[n]):({...l,...s})[n]===t})?[...e,t,r]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}}}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[826,350],{4966:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters/[cluster]/[job]",function(){return s(190)}])},3626:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let a=(0,s(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},9307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return l},OE:function(){return d}});var a=s(5893);s(7294);var r=s(8799),n=s(6989),c=s(3850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,a.jsx)(r.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":default:return(0,a.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,a.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,a.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,a.jsx)(c.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return(0,a.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=l(e),s=o(e);return(0,a.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,a.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,a.jsx)("span",{children:i(t)})})}},7673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return h},eW:function(){return m},ll:function(){return d}});var a=s(5893),r=s(7294),n=s(5697),c=s.n(n),l=s(2350);let o=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:r})});o.displayName="Card",o.propTypes={className:c().string,children:c().node};let i=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:r})});i.displayName="CardHeader",i.propTypes={className:c().string,children:c().node};let d=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:r})});d.displayName="CardTitle",d.propTypes={className:c().string,children:c().node};let u=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...n,children:r})});u.displayName="CardDescription",u.propTypes={className:c().string,children:c().node};let h=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",s),...n,children:r})});h.displayName="CardContent",h.propTypes={className:c().string,children:c().node};let m=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",s),...n,children:r})});m.displayName="CardFooter",m.propTypes={className:c().string,children:c().node}},7145:function(e,t,s){"use strict";s.d(t,{x:function(){return r}});var a=s(3225);let r={fetch:async(e,t)=>{let s=window.location.origin,r="".concat(s).concat(a.f4).concat(e),n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),c=n.headers.get("X-Skypilot-Request-ID")||n.headers.get("X-Request-ID"),l=await fetch("".concat(s).concat(a.f4,"/api/get?request_id=").concat(c)),o=await l.json();return o.return_value?JSON.parse(o.return_value):[]},post:async(e,t)=>{let s=window.location.origin,r="".concat(s).concat(a.f4).concat(e);return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let a=(await r.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;let r=new TextDecoder().decode(t);s(r)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let t=window.location.origin,s="".concat(t).concat(a.f4).concat(e);return await fetch(s)}}},3266:function(e,t,s){"use strict";s.d(t,{QL:function(){return h},Sl:function(){return d},getClusters:function(){return o},uR:function(){return i}});var a=s(7294),r=s(5821),n=s(7145),c=s(6378);let l={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function o(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await n.x.fetch("/status",{cluster_names:e,all_users:!0})).map(e=>{let t="",s=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let s=Math.floor((t-3)/2),a=s+(t-3)%2;return 0===s?e.substring(0,a)+"...":e.substring(0,a)+"..."+e.substring(e.length-s)}(t,25)),{status:l[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cloud:e.cloud,region:e.region,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:s?"".concat(e.cloud," (").concat(s,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,autostop:e.autostop,to_down:e.to_down,jobs:[],command:e.last_creation_command||e.last_use,task_yaml:e.last_creation_yaml||"{}",events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function i(){try{let e=await n.x.fetch("/cost_report",{days:30});console.log("Raw cluster history data:",e);let t=e.map(e=>{let t="Unknown";e.cloud?t=e.cloud:e.resources&&e.resources.cloud&&(t=e.resources.cloud);let s=e.user_name||"-";return{status:e.status?l[e.status]:"TERMINATED",cluster:e.name,user:s,user_hash:e.user_hash,cloud:t,region:"",infra:t,full_infra:t,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:e.launched_at?new Date(1e3*e.launched_at):null,num_nodes:e.num_nodes||1,duration:e.duration,total_cost:e.total_cost,workspace:e.workspace||"default",autostop:-1,to_down:!1,cluster_hash:e.cluster_hash,usage_intervals:e.usage_intervals,command:e.last_creation_command||"",task_yaml:e.last_creation_yaml||"{}",events:[{time:e.launched_at?new Date(1e3*e.launched_at):new Date,event:"Cluster created."}]}});return console.log("Processed cluster history data:",t),t}catch(e){return console.error("Error fetching cluster history:",e),[]}}async function d(e){let{clusterName:t,jobId:s,onNewLog:a,workspace:c}=e;try{await n.x.stream("/logs",{follow:!1,cluster_name:t,job_id:s,override_skypilot_config:{active_workspace:c||"default"}},a)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,r.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function u(e){let{clusterName:t,workspace:s}=e;try{return(await n.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:s}})).map(e=>{let a=e.end_at?e.end_at:Date.now()/1e3,r=0,n=0;return e.submitted_at&&(r=a-e.submitted_at),e.start_at&&(n=a-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:r,job_duration:n,infra:"",logs:"",workspace:s||"default"}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function h(e){let{cluster:t,job:s=null}=e,[r,n]=(0,a.useState)(null),[l,i]=(0,a.useState)(null),[d,h]=(0,a.useState)(!0),[m,f]=(0,a.useState)(!0),x=(0,a.useCallback)(async()=>{if(t)try{h(!0);let e=await c.default.get(o,[{clusterNames:[t]}]);return n(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{h(!1)}return null},[t]),g=(0,a.useCallback)(async e=>{if(t)try{f(!0);let s=await c.default.get(u,[{clusterName:t,workspace:e||"default"}]);i(s)}catch(e){console.error("Error fetching cluster job data:",e)}finally{f(!1)}},[t]),b=(0,a.useCallback)(async()=>{c.default.invalidate(o,[{clusterNames:[t]}]);let e=await x();e&&(c.default.invalidate(u,[{clusterName:t,workspace:e.workspace||"default"}]),await g(e.workspace))},[x,g,t]),N=(0,a.useCallback)(async()=>{r&&(c.default.invalidate(u,[{clusterName:t,workspace:r.workspace||"default"}]),await g(r.workspace))},[g,r,t]);return(0,a.useEffect)(()=>{(async()=>{let e=await x();e&&g(e.workspace)})()},[t,s,x,g]),{clusterData:r,clusterJobData:l,loading:d,clusterDetailsLoading:d,clusterJobsLoading:m,refreshData:b,refreshClusterJobsOnly:N}}},5821:function(e,t,s){"use strict";function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,a=document.getElementById("toast-container");a||((a=document.createElement("div")).id="toast-container",a.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(a));let r=document.createElement("div");switch(r.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":r.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":r.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":r.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:r.className+=" bg-blue-100 border-blue-500 text-blue-800"}return r.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),a.appendChild(r),r.querySelector("button").addEventListener("click",()=>{a.removeChild(r)}),setTimeout(()=>{a.contains(r)&&a.removeChild(r)},s),r}s.d(t,{C:function(){return a}})},6378:function(e,t,s){"use strict";s.r(t),s.d(t,{DashboardCache:function(){return r},dashboardCache:function(){return n}});let a=s(1214).ej.DEFAULT_TTL;class r{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s.ttl||a,n=!1!==s.refreshOnAccess,c=this._generateKey(e,t),l=e.name||"anonymous",o=this.cache.get(c),i=Date.now();if(o&&i-o.lastUpdated<r){let s=Math.round((i-o.lastUpdated)/1e3);return this._debug("Cache HIT for ".concat(l," (age: ").concat(s,"s, TTL: ").concat(Math.round(r/1e3),"s)")),n&&(this.cache.set(c,{data:o.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(l))),this.backgroundJobs.has(c)||this._refreshInBackground(e,t,c),o.data}try{let s=await e(...t);return this.cache.set(c,{data:s,lastUpdated:i}),s}catch(e){if(o)return console.warn("Failed to fetch fresh data for ".concat(c,", returning stale data:"),e),o.data;throw e}}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=this._generateKey(e,t);this.cache.delete(s),this.backgroundJobs.delete(s)}invalidateFunction(e){let t=e.name||"anonymous",s=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&s.push(e);s.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[s,a]of this.cache.entries()){let r=e-a.lastUpdated;t.push({key:s,age:Math.round(r/1e3),lastUpdated:new Date(a.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(s)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,s=Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];this.debugMode&&console.log("[DashboardCache] ".concat(e),...s)}_refreshInBackground(e,t,s){this.backgroundJobs.set(s,!0),e(...t).then(e=>{this.cache.set(s,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(s,":"),e)}).finally(()=>{this.backgroundJobs.delete(s)})}_generateKey(e,t){let s=e.name||"anonymous",a=t.length>0?JSON.stringify(t):"";return"".concat(s,"_").concat(a)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.debugMode=!1}}let n=new r;t.default=n},2350:function(e,t,s){"use strict";s.d(t,{cn:function(){return n}});var a=s(512),r=s(8388);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.m6)((0,a.W)(t))}},190:function(e,t,s){"use strict";s.r(t),s.d(t,{JobDetailPage:function(){return N}});var a=s(5893),r=s(7294);s(9470);var n=s(7673),c=s(1664),l=s.n(c),o=s(1163),i=s(3266),d=s(6989),u=s(3626),h=s(8799),m=s(9307),f=s(3001),x=s(9008),g=s.n(x);function b(e){let{cluster:t,job:s,jobData:r,onRefresh:n,isRefreshing:c,loading:o}=e,i=(0,f.X)();return(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(l(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(l(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsxs)(l(),{href:"/clusters/".concat(t,"/").concat(s),className:"text-sky-blue hover:underline",children:[s,r.job&&"-"!=r.job?" (".concat(r.job,")"):""]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(o||c)&&(0,a.jsxs)("div",{className:"flex items-center mr-2",children:[(0,a.jsx)(h.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"text-sm ml-2 text-gray-500",children:"Loading..."})]}),(0,a.jsx)(d.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,a.jsxs)("button",{onClick:n,disabled:o||c,className:"text-sm text-sky-blue hover:text-sky-blue-bright font-medium mx-2 flex items-center",children:[(0,a.jsx)(u.Z,{className:"w-4 h-4 mr-1.5"}),!i&&(0,a.jsx)("span",{children:"Refresh"})]})})]})]})}function N(){let e=(0,o.useRouter)(),{cluster:t,job:s}=e.query,{clusterData:c,clusterJobData:f,loading:x,refreshData:N}=(0,i.QL)({cluster:t}),[y,p]=(0,r.useState)(!1),[w,j]=(0,r.useState)(!0),[_,v]=(0,r.useState)(!1),[E,k]=(0,r.useState)([]),[C,D]=(0,r.useState)(!1),T=(0,r.useMemo)(()=>["INIT","PENDING","SETTING_UP"],[]),S=(0,r.useMemo)(()=>{if(!f||!s)return!0;let e=f.find(e=>e.id==s);return e&&T.includes(e.status)},[f,s,T]);r.useEffect(()=>{!x&&w&&j(!1)},[x,w]),(0,r.useEffect)(()=>{let e=!0;return t&&s&&!S?(v(!0),(0,i.Sl)({clusterName:t,jobId:s,onNewLog:t=>{if(e){let e=(0,d.q8)(t);k(t=>[...t,e])}},workspace:null==c?void 0:c.workspace}).then(()=>{e&&v(!1)}).catch(t=>{e&&(console.error("Error streaming logs:",t),v(!1))})):v(!1),()=>{e=!1}},[t,s,C,S,c]);let I=async()=>{p(!0),D(e=>!e),k([]);try{N&&await N()}catch(e){console.error("Error refreshing data:",e)}finally{p(!1)}};if(!e.isReady)return(0,a.jsx)("div",{children:"Loading..."});let L={id:s};if(c&&f){let e=f.find(e=>e.id==s);e&&(L={...e,infra:c.infra,cluster:c.cluster,user:c.user})}let R=t&&s?"Job: ".concat(s," @ ").concat(t," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g(),{children:(0,a.jsx)("title",{children:R})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{cluster:t,job:s,jobData:L,onRefresh:I,isRefreshing:y,loading:x}),x&&w?(0,a.jsxs)("div",{className:"flex items-center justify-center h-64",children:[(0,a.jsx)(h.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]}):(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsx)("div",{id:"details",children:(0,a.jsxs)(n.Zb,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Details"})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID"}),(0,a.jsx)("div",{className:"text-base mt-1",children:L.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job Name"}),(0,a.jsx)("div",{className:"text-base mt-1",children:L.job})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(m.OE,{status:L.status})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,a.jsx)("div",{className:"text-base mt-1",children:L.user})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Submitted"}),(0,a.jsx)("div",{className:"text-base mt-1",children:L.submitted_at?(0,d.xn)(L.submitted_at):"N/A"})]}),L.resources&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,a.jsx)("div",{className:"text-base mt-1",children:L.resources||"N/A"})]}),L.cluster&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(l(),{href:"/clusters/".concat(L.cluster),className:"text-sky-blue hover:underline",children:L.cluster})})]})]})})]})}),(0,a.jsx)("div",{id:"logs",className:"mt-6",children:(0,a.jsxs)(n.Zb,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Logs"}),(0,a.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,a.jsx)(d.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:()=>{D(e=>!e),k([])},disabled:_,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,a.jsx)(u.Z,{className:"w-4 h-4 ".concat(_?"animate-spin":"")})})})]}),(0,a.jsx)("div",{className:"p-4",children:S?(0,a.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,a.jsx)("span",{children:"Waiting for the job to start; refresh in a few moments."})}):_?(0,a.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,a.jsx)(h.Z,{size:20,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]}):(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto",children:(0,a.jsx)(d.$B,{logs:E.join("")})})})]})})]})]})]})}t.default=N},9008:function(e,t,s){e.exports=s(7219)}},function(e){e.O(0,[616,760,799,804,664,989,470,888,774,179],function(){return e(e.s=4966)}),_N_E=e.O()}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[722],{8706:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters/[cluster]",function(){return s(6996)}])},6639:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let a=(0,s(998).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},4303:function(e,t,s){"use strict";s.d(t,{_q:function(){return r},pJ:function(){return i}});var a=s(1272);let r=e=>{if(!e)return"No YAML available";try{let t=a.ZP.load(e),s=a.ZP.dump(t,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),r=[],l=-1;for(let e=0;e<s.length;e++){let t=s[e],a=t.search(/\S/);0===a&&l>=0&&e>0&&r.push(""),r.push(t),l=a}return r.join("\n").trim()}catch(t){return console.error("YAML formatting error:",t),e}},l=e=>"string"==typeof e?e.substring(0,50)+"...":e&&e.name?"name: ".concat(e.name):e&&e.resources?"Task configuration":"YAML document",n=(e,t)=>{try{let s=a.ZP.load(e),r=a.ZP.dump(s,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),n=[],i=-1;for(let e=0;e<r.length;e++){let t=r[e],s=t.search(/\S/);0===s&&i>=0&&e>0&&n.push(""),n.push(t),i=s}return{index:t,content:n.join("\n").trim(),preview:l(s)}}catch(s){return console.error("YAML formatting error for document ".concat(t,":"),s),{index:t,content:e,preview:"Invalid YAML"}}},i=e=>{if(!e)return[];try{let t=[],s=e.split(/^---$/m);for(let e=0;e<s.length;e++){let a=s[e].trim();a&&""!==a&&t.push(a)}return(t.length>1?t.slice(1):t).map((e,t)=>n(e,t))}catch(t){return console.error("YAML formatting error:",t),[{index:0,content:e,preview:"Invalid YAML"}]}}},6996:function(e,t,s){"use strict";s.r(t);var a=s(5893),r=s(7294),l=s(8799),n=s(938),i=s(1163);s(9470);var c=s(1664),o=s.n(c),d=s(9037),m=s(9307),u=s(7673),x=s(3266),h=s(6378),f=s(3626),j=s(282),v=s(8671),y=s(5895),N=s(6639);s(1272);var b=s(6989),p=s(9284),g=s(3001),_=s(9008),w=s.n(_),C=s(4303);let k=(e,t)=>{let s="",a="";return e>=0&&(s=e+"m",a=" "),t&&(s+="".concat(a,"(down)")),""===s&&(s="-"),s};function S(e){var t,s;let{clusterData:l,clusterJobData:i,clusterJobsLoading:c,refreshClusterJobsOnly:d,isHistoricalCluster:x=!1}=e,[h,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),[_,w]=(0,r.useState)(!1),S=async()=>{try{let e=l.task_yaml||l.last_creation_yaml,t=(0,C._q)(e);await navigator.clipboard.writeText(t),g(!0),setTimeout(()=>g(!1),2e3)}catch(e){console.error("Failed to copy YAML to clipboard:",e)}},L=async()=>{try{let e=l.command||l.last_creation_command;await navigator.clipboard.writeText(e),w(!0),setTimeout(()=>w(!1),2e3)}catch(e){console.error("Failed to copy command to clipboard:",e)}},A=(null==l?void 0:l.last_creation_command)||(null==l?void 0:l.last_creation_yaml)||(null==l?void 0:l.command)||(null==l?void 0:l.task_yaml);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)(u.Zb,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x?"Historical Cluster Details":"Details"})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(m.OE,{status:l.status})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,a.jsx)("div",{className:"text-base mt-1",children:l.cluster||l.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,a.jsx)("div",{className:"text-base mt-1",children:l.user})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:x?"Cloud":"Infra"}),(0,a.jsx)("div",{className:"text-base mt-1",children:x?l.cloud||"N/A":l.infra?(0,a.jsx)(b.Md,{content:l.full_infra||l.infra,className:"text-sm text-muted-foreground",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(o(),{href:"/infra",className:"text-blue-600 hover:underline",children:l.cloud||l.infra.split("(")[0].trim()}),l.infra.includes("(")&&(0,a.jsx)("span",{children:" "+l.infra.substring(l.infra.indexOf("("))})]})}):"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Resources"}),(0,a.jsx)("div",{className:"text-base mt-1",children:l.resources_str_full||l.resources_str||"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Started"}),(0,a.jsx)("div",{className:"text-base mt-1",children:l.time?(0,b.xn)(new Date(l.time)):"N/A"})]}),x?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Duration"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(e=>{if(!e||0===e)return"-";let t=e=Math.floor(e),s="",a=0;for(let e of[{value:31536e3,label:"y"},{value:2592e3,label:"mo"},{value:86400,label:"d"},{value:3600,label:"h"},{value:60,label:"m"},{value:1,label:"s"}])if(t>=e.value&&a<2){let r=Math.floor(t/e.value);s+="".concat(r).concat(e.label," "),t%=e.value,a++}return s.trim()||"0s"})(l.duration)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cost"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(e=>{if(null==e||0===e)return"-";let t=Number(e);return isNaN(t)?"-":"$".concat(t.toFixed(2))})(l.total_cost)})]})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Autostop"}),(0,a.jsx)("div",{className:"text-base mt-1",children:k(l.autostop,l.to_down)})]}),A&&(0,a.jsxs)("div",{className:"col-span-2",children:[(l.command||l.last_creation_command)&&(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Entrypoint"}),l.command&&(0,a.jsx)(b.WH,{content:_?"Copied!":"Copy command",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:L,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:_?(0,a.jsx)(j.Z,{className:"w-4 h-4 text-green-600"}):(0,a.jsx)(v.Z,{className:"w-4 h-4"})})})]}),(0,a.jsxs)("div",{className:"space-y-4 mt-3",children:[(l.command||l.last_creation_command)&&(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3",children:(0,a.jsx)("code",{className:"text-sm text-gray-800 font-mono break-all",children:l.command||l.last_creation_command})})}),(l.task_yaml||l.last_creation_yaml)&&"{}"!==l.task_yaml&&"{}"!==l.last_creation_yaml&&!(null===(t=l.cluster||l.name)||void 0===t?void 0:t.startsWith("sky-jobs-controller-"))&&!(null===(s=l.cluster||l.name)||void 0===s?void 0:s.startsWith("sky-serve-controller-"))&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center mb-2",children:[(0,a.jsxs)("button",{onClick:()=>{f(!h)},className:"flex items-center text-left focus:outline-none text-gray-700 hover:text-gray-900 transition-colors duration-200",children:[h?(0,a.jsx)(y.Z,{className:"w-4 h-4 mr-1"}):(0,a.jsx)(N.Z,{className:"w-4 h-4 mr-1"}),(0,a.jsx)("span",{className:"text-base",children:"Show SkyPilot YAML"})]}),(0,a.jsx)(b.WH,{content:p?"Copied!":"Copy YAML",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:S,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:p?(0,a.jsx)(j.Z,{className:"w-4 h-4 text-green-600"}):(0,a.jsx)(v.Z,{className:"w-4 h-4"})})})]}),h&&(0,a.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 max-h-96 overflow-y-auto",children:(0,a.jsx)("pre",{className:"text-sm text-gray-800 font-mono whitespace-pre-wrap",children:(0,C._q)(l.task_yaml||l.last_creation_yaml)})})]})]})]})]})})]})}),!x&&(0,a.jsx)("div",{className:"mb-8",children:(0,a.jsx)(n.ClusterJobs,{clusterName:l.cluster,clusterJobData:i,loading:c,refreshClusterJobsOnly:d})})]})}t.default=function(){let e=(0,i.useRouter)(),{cluster:t}=e.query,[s,n]=(0,r.useState)(!1),[c,m]=(0,r.useState)(!0),[u,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),[N,_]=(0,r.useState)(null),[C,k]=(0,r.useState)(!1),[L,A]=(0,r.useState)(!1),Z=(0,g.X)(),{clusterData:M,clusterJobData:D,loading:O,clusterDetailsLoading:E,clusterJobsLoading:J,refreshData:R,refreshClusterJobsOnly:Y}=(0,x.QL)({cluster:t});r.useEffect(()=>{!E&&c&&m(!1)},[E,c]),r.useEffect(()=>{let e=async()=>{if(t&&!E&&!M){A(!0);try{let e=(await h.default.get(x.uR)).find(e=>e.cluster_hash===t||e.cluster===t);e&&(_(e),k(!0))}catch(e){console.error("Error fetching cluster history:",e)}finally{A(!1)}}};E||M||e()},[t,E,M]);let P=async()=>{n(!0),await R(),n(!1)};if(!e.isReady)return(0,a.jsx)("div",{children:"Loading..."});let T=t?"Cluster: ".concat(t," | SkyPilot Dashboard"):"Cluster Details | SkyPilot Dashboard";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w(),{children:(0,a.jsx)("title",{children:T})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(o(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(o(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t})]}),(0,a.jsx)("div",{className:"text-sm flex items-center",children:(0,a.jsxs)("div",{className:"text-sm flex items-center",children:[(E||s)&&(0,a.jsxs)("div",{className:"flex items-center mr-4",children:[(0,a.jsx)(l.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),M&&(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(b.WH,{content:"Refresh",className:"text-sm text-muted-foreground",children:(0,a.jsxs)("button",{onClick:P,disabled:E||s,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,a.jsx)(f.Z,{className:"w-4 h-4 mr-1.5"}),!Z&&(0,a.jsx)("span",{children:"Refresh"})]})}),(0,a.jsx)(d.Status2Actions,{withLabel:!0,cluster:M.cluster,status:M.status,onOpenSSHModal:()=>{j(!0)},onOpenVSCodeModal:()=>{y(!0)}})]})]})})]}),E&&c||L?(0,a.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,a.jsx)(l.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading cluster details..."})]}):M?(0,a.jsx)(S,{clusterData:M,clusterJobData:D,clusterJobsLoading:J,refreshClusterJobsOnly:Y,isHistoricalCluster:!1}):C&&N?(0,a.jsx)(S,{clusterData:N,clusterJobData:[],clusterJobsLoading:!1,refreshClusterJobsOnly:()=>{},isHistoricalCluster:!0}):(0,a.jsx)("div",{className:"flex justify-center items-center py-12",children:(0,a.jsx)("span",{className:"text-gray-500",children:"Cluster not found in active clusters or history."})}),(0,a.jsx)(p.Oh,{isOpen:u,onClose:()=>j(!1),cluster:t}),(0,a.jsx)(p._R,{isOpen:v,onClose:()=>y(!1),cluster:t})]})]})}},9008:function(e,t,s){e.exports=s(7219)}},function(e){e.O(0,[616,760,799,804,664,798,947,989,470,901,969,856,973,938,37,888,774,179],function(){return e(e.s=8706)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[810],{5833:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters",function(){return t(3450)}])},3450:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return l}});var r=t(5893);t(7294);var s=t(9008),u=t.n(s),i=t(5152);let c=t.n(i)()(()=>Promise.all([t.e(616),t.e(760),t.e(799),t.e(804),t.e(664),t.e(798),t.e(989),t.e(470),t.e(901),t.e(969),t.e(856),t.e(973),t.e(37),t.e(491)]).then(t.bind(t,9037)).then(e=>e.Clusters),{loadableGenerated:{webpack:()=>[9037]},ssr:!1});function l(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u(),{children:(0,r.jsx)("title",{children:"Clusters | SkyPilot Dashboard"})}),(0,r.jsx)(c,{})]})}},9008:function(e,n,t){e.exports=t(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=5833)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[490],{4483:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/config",function(){return t(9649)}])},9649:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return c}});var i=t(5893);t(7294);var r=t(9008),o=t.n(r),u=t(5152);let s=t.n(u)()(()=>Promise.all([t.e(616),t.e(760),t.e(799),t.e(798),t.e(989),t.e(901),t.e(42)]).then(t.bind(t,4042)).then(n=>n.Config),{loadableGenerated:{webpack:()=>[4042]},ssr:!1});function c(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:(0,i.jsx)("title",{children:"Edit SkyPilot Configuration | SkyPilot Dashboard"})}),(0,i.jsx)(s,{})]})}},9008:function(n,e,t){n.exports=t(7219)}},function(n){n.O(0,[888,774,179],function(){return n(n.s=4483)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[233],{1803:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/infra/[context]",function(){return t(1200)}])},1200:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return o}});var r=t(5893);t(7294);var i=t(9008),s=t.n(i),u=t(5152);let c=t.n(u)()(()=>Promise.all([t.e(616),t.e(760),t.e(799),t.e(804),t.e(664),t.e(989),t.e(470),t.e(901),t.e(969),t.e(856),t.e(682)]).then(t.bind(t,8682)).then(e=>e.GPUs),{loadableGenerated:{webpack:()=>[8682]},ssr:!1});function o(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s(),{children:(0,r.jsx)("title",{children:"Infra | SkyPilot Dashboard"})}),(0,r.jsx)(c,{})]})}},9008:function(e,n,t){e.exports=t(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=1803)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[588],{3177:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/infra",function(){return t(9054)}])},9054:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return c}});var r=t(5893);t(7294);var i=t(9008),s=t.n(i),u=t(5152);let a=t.n(u)()(()=>Promise.all([t.e(616),t.e(760),t.e(799),t.e(804),t.e(664),t.e(989),t.e(470),t.e(901),t.e(969),t.e(856),t.e(682)]).then(t.bind(t,8682)).then(e=>e.GPUs),{loadableGenerated:{webpack:()=>[8682]},ssr:!1});function c(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s(),{children:(0,r.jsx)("title",{children:"Infra | SkyPilot Dashboard"})}),(0,r.jsx)(a,{})]})}},9008:function(e,n,t){e.exports=t(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=3177)}),_N_E=e.O()}]);
@@ -1,16 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[315,350],{479:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/jobs/[job]",function(){return s(8099)}])},6639:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let r=(0,s(998).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},8671:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
7
- * @license lucide-react v0.407.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */let r=(0,s(998).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3626:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
12
- * @license lucide-react v0.407.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */let r=(0,s(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},9307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return c},OE:function(){return d}});var r=s(5893);s(7294);var n=s(8799),a=s(6989),l=s(3850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(n.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":default:return(0,r.jsx)(l.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(l.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.jsx)(l.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return(0,r.jsx)(l.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=c(e),s=o(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,r.jsx)(a.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:i(t)})})}},7673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return m},eW:function(){return x},ll:function(){return d}});var r=s(5893),n=s(7294),a=s(5697),l=s.n(a),c=s(2350);let o=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a,children:n})});o.displayName="Card",o.propTypes={className:l().string,children:l().node};let i=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",s),...a,children:n})});i.displayName="CardHeader",i.propTypes={className:l().string,children:l().node};let d=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",s),...a,children:n})});d.displayName="CardTitle",d.propTypes={className:l().string,children:l().node};let u=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",s),...a,children:n})});u.displayName="CardDescription",u.propTypes={className:l().string,children:l().node};let m=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",s),...a,children:n})});m.displayName="CardContent",m.propTypes={className:l().string,children:l().node};let x=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",s),...a,children:n})});x.displayName="CardFooter",x.propTypes={className:l().string,children:l().node}},7145:function(e,t,s){"use strict";s.d(t,{x:function(){return n}});var r=s(3225);let n={fetch:async(e,t)=>{let s=window.location.origin,n="".concat(s).concat(r.f4).concat(e),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),l=a.headers.get("X-Skypilot-Request-ID")||a.headers.get("X-Request-ID"),c=await fetch("".concat(s).concat(r.f4,"/api/get?request_id=").concat(l)),o=await c.json();return o.return_value?JSON.parse(o.return_value):[]},post:async(e,t)=>{let s=window.location.origin,n="".concat(s).concat(r.f4).concat(e);return await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let r=(await n.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await r.read();if(e)break;let n=new TextDecoder().decode(t);s(n)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let t=window.location.origin,s="".concat(t).concat(r.f4).concat(e);return await fetch(s)}}},2350:function(e,t,s){"use strict";s.d(t,{cn:function(){return a}});var r=s(512),n=s(8388);function a(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.m6)((0,r.W)(t))}},4303:function(e,t,s){"use strict";s.d(t,{_q:function(){return n},pJ:function(){return c}});var r=s(1272);let n=e=>{if(!e)return"No YAML available";try{let t=r.ZP.load(e),s=r.ZP.dump(t,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),n=[],a=-1;for(let e=0;e<s.length;e++){let t=s[e],r=t.search(/\S/);0===r&&a>=0&&e>0&&n.push(""),n.push(t),a=r}return n.join("\n").trim()}catch(t){return console.error("YAML formatting error:",t),e}},a=e=>"string"==typeof e?e.substring(0,50)+"...":e&&e.name?"name: ".concat(e.name):e&&e.resources?"Task configuration":"YAML document",l=(e,t)=>{try{let s=r.ZP.load(e),n=r.ZP.dump(s,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),l=[],c=-1;for(let e=0;e<n.length;e++){let t=n[e],s=t.search(/\S/);0===s&&c>=0&&e>0&&l.push(""),l.push(t),c=s}return{index:t,content:l.join("\n").trim(),preview:a(s)}}catch(s){return console.error("YAML formatting error for document ".concat(t,":"),s),{index:t,content:e,preview:"Invalid YAML"}}},c=e=>{if(!e)return[];try{let t=[],s=e.split(/^---$/m);for(let e=0;e<s.length;e++){let r=s[e].trim();r&&""!==r&&t.push(r)}return(t.length>1?t.slice(1):t).map((e,t)=>l(e,t))}catch(t){return console.error("YAML formatting error:",t),[{index:0,content:e,preview:"Invalid YAML"}]}}},8099:function(e,t,s){"use strict";s.r(t);var r=s(5893),n=s(7294),a=s(8799),l=s(1163);s(9470);var c=s(7673),o=s(8969),i=s(1664),d=s.n(i),u=s(3626),m=s(282),x=s(8671),f=s(5895),g=s(6639),h=s(6989),j=s(9307),p=s(3001),N=s(9008),y=s.n(N),b=s(4303);function v(e){let{jobData:t,activeTab:s,setIsLoadingLogs:l,setIsLoadingControllerLogs:c,isLoadingLogs:i,isLoadingControllerLogs:u,refreshFlag:p}=e,[N,y]=(0,n.useState)(""),[v,w]=(0,n.useState)(""),[E,L]=(0,n.useState)(!1),[C,S]=(0,n.useState)({}),[R,T]=(0,n.useState)(!1),[I,k]=(0,n.useState)(!1),[A,D]=(0,n.useState)(0),[_,Z]=(0,n.useState)(0),[P,O]=(0,n.useState)(!1),[q,F]=(0,n.useState)(!1),[M,U]=(0,n.useState)(!1),[G,W]=(0,n.useState)(!1),H=(0,n.useRef)(null),J=(0,n.useRef)(null),Y=(0,n.useRef)(new WeakSet),B=(0,n.useRef)(null),z=(0,n.useRef)(null),$=(0,n.useRef)(""),V=(0,n.useRef)(""),X=(0,n.useRef)(null);(0,n.useRef)(0);let K=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"request";if(e){if(Y.current.has(e)){console.log("".concat(t," controller already aborted previously, skipping"));return}try{if("function"!=typeof e.abort){console.warn("Controller for ".concat(t," does not have abort method"));return}if(e.signal&&e.signal.aborted){console.log("".concat(t," already aborted via signal, skipping")),Y.current.add(e);return}e.abort(),Y.current.add(e),console.log("Successfully aborted ".concat(t))}catch(s){console.log("Caught error while aborting ".concat(t,":"),s.name,s.message),Y.current.add(e),"AbortError"!==s.name&&"InvalidStateError"!==s.name&&console.warn("Unexpected error aborting ".concat(t,":"),s)}}},[]),Q=(0,n.useCallback)(e=>{let t="logs"===e?B:z;if(t.current)for(let s of[()=>t.current.querySelector(".logs-container"),()=>t.current.querySelector('[class*="logs-container"]'),()=>t.current.querySelector('div[style*="overflow"]'),()=>t.current]){let t=s();if(t&&t.scrollHeight>t.clientHeight){t.scrollTop=t.scrollHeight,console.log("Auto-scrolled ".concat(e," to bottom"));break}}},[]),ee=["PENDING","SUBMITTED","STARTING"].includes(t.status),et=["PENDING","SUBMITTED"].includes(t.status),es=["RECOVERING"].includes(t.status),er=e=>{S(t=>({...t,[e]:!t[e]}))},en=async()=>{try{let e=(0,b.pJ)(t.dag_yaml),s="";s=1===e.length?e[0].content:e.length>1?e.map(e=>e.content).join("\n---\n"):t.dag_yaml,await navigator.clipboard.writeText(s),T(!0),setTimeout(()=>T(!1),2e3)}catch(e){console.error("Failed to copy YAML to clipboard:",e)}},ea=async()=>{try{await navigator.clipboard.writeText(t.entrypoint),k(!0),setTimeout(()=>k(!1),2e3)}catch(e){console.error("Failed to copy command to clipboard:",e)}};(0,n.useEffect)(()=>{y(""),D(0),W(!1)},[s,t.id]),(0,n.useEffect)(()=>{w(""),Z(0),W(!1)},[s,t.id]);let el=(0,n.useCallback)(function(e,t,s,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a="logs"===e?H:J;if(a.current)return console.log("Request already active for ".concat(e,", skipping...")),()=>{};let l=!0,c=new AbortController;return"logs"===e&&(ee||es)?(r(!1),n&&O(!1),()=>{}):"controllerlogs"===e&&et?(r(!1),n&&F(!1),()=>{}):t?(a.current=c,r(!0),U(!0),n&&(s(""),"logs"===e?D(0):Z(0)),(0,o.NJ)({jobId:t,controller:"controllerlogs"===e,signal:c.signal,onNewLog:t=>{if(l){let s=(0,h.q8)(t);G||W(!0),ec(e,s),"logs"===e?D(e=>e+s.length):Z(e=>e+s.length)}}}).then(()=>{l&&(r(!1),n&&("logs"===e?O(!1):F(!1)),requestAnimationFrame(()=>{Q(e)}))}).catch(t=>{l&&("AbortError"!==t.name&&(console.error("Error streaming ".concat(e,":"),t),t.message&&s(e=>e+"Error fetching logs: ".concat(t.message,"\n"))),r(!1),n&&("logs"===e?O(!1):F(!1)))}).finally(()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(K(c,e),a.current=null),"logs"===e?$.current="":V.current="",X.current&&(clearTimeout(X.current),X.current=null)}),()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(K(c,"".concat(e," cleanup")),a.current=null),"logs"===e?$.current="":V.current="",X.current&&(clearTimeout(X.current),X.current=null)}):()=>{l=!1}},[ee,et,es,G,K]);(0,n.useEffect)(()=>{if(H.current&&(K(H.current,"logs"),H.current=null),!ee&&!es)return el("logs",t.id,y,l)},[t.id,el,l,ee,es,K]),(0,n.useEffect)(()=>{if(J.current&&(K(J.current,"controller logs"),J.current=null),!et)return el("controllerlogs",t.id,w,c)},[t.id,el,c,et,K]),(0,n.useEffect)(()=>{if(p>0&&"logs"===s)return H.current&&(K(H.current,"logs refresh"),H.current=null),O(!0),el("logs",t.id,y,l,!0)},[p,s,t.id,el,l,K]),(0,n.useEffect)(()=>{if(p>0&&"controllerlogs"===s)return J.current&&(K(J.current,"controller logs refresh"),J.current=null),F(!0),el("controllerlogs",t.id,w,c,!0)},[p,s,t.id,el,c,K]),(0,n.useEffect)(()=>()=>{console.log("Cleaning up managed job log requests..."),H.current&&(K(H.current,"logs cleanup"),H.current=null),J.current&&(K(J.current,"controller logs cleanup"),J.current=null),X.current&&(clearTimeout(X.current),X.current=null),$.current="",V.current="",l(!1),c(!1),O(!1),F(!1)},[K]),(0,n.useEffect)(()=>{let e=()=>{document.hidden?(console.log("Page hidden - pausing log streaming for performance"),X.current&&(clearTimeout(X.current),X.current=null)):console.log("Page visible - resuming normal operation")};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),(0,n.useEffect)(()=>{let e=()=>{("logs"===s&&N||"controllerlogs"===s&&v)&&Q("logs"===s?"logs":"controllerlogs")};requestAnimationFrame(()=>{requestAnimationFrame(e)})},[s,N,v,Q]);let ec=(0,n.useCallback)((e,t)=>{("logs"===e?y:w)(e=>e+t),requestAnimationFrame(()=>{Q(e)})},[Q]);return"logs"===s?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:B,children:ee?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job to start; refresh in a few moments."})}):es?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job to recover; refresh in a few moments."})}):G||N?(0,r.jsx)(h.$B,{logs:N}):i?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading logs..."})]}):(0,r.jsx)(h.$B,{logs:N})}):"controllerlogs"===s?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:z,children:et?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job controller process to start; refresh in a few moments."})}):G||v?(0,r.jsx)(h.$B,{logs:v,controller:!0}):u?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading logs..."})]}):(0,r.jsx)(h.$B,{logs:v,controller:!0})}):(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID (Name)"}),(0,r.jsxs)("div",{className:"text-base mt-1",children:[t.id," ",t.name?"(".concat(t.name,")"):""]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(j.OE,{status:t.status})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.user})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Submitted"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.submitted_at?(0,h.xn)(t.submitted_at):"N/A"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.requested_resources||"N/A"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Infra"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.infra?(0,r.jsx)(h.Md,{content:t.full_infra||t.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(d(),{href:"/infra",className:"text-blue-600 hover:underline",children:t.cloud||t.infra.split("(")[0].trim()}),t.infra.includes("(")&&(0,r.jsx)("span",{children:" "+t.infra.substring(t.infra.indexOf("("))})]})}):"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Resources"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.resources_str_full||t.resources_str||"-"})]}),(t.entrypoint||t.dag_yaml)&&(0,r.jsxs)("div",{className:"col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Entrypoint"}),t.entrypoint&&(0,r.jsx)(h.WH,{content:I?"Copied!":"Copy command",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:ea,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:I?(0,r.jsx)(m.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(x.Z,{className:"w-4 h-4"})})})]}),(0,r.jsxs)("div",{className:"space-y-4 mt-3",children:[t.entrypoint&&(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3",children:(0,r.jsx)("code",{className:"text-sm text-gray-800 font-mono break-all",children:t.entrypoint})})}),t.dag_yaml&&"{}"!==t.dag_yaml&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center mb-2",children:[(0,r.jsxs)("button",{onClick:()=>{L(!E)},className:"flex items-center text-left focus:outline-none text-gray-700 hover:text-gray-900 transition-colors duration-200",children:[E?(0,r.jsx)(f.Z,{className:"w-4 h-4 mr-1"}):(0,r.jsx)(g.Z,{className:"w-4 h-4 mr-1"}),(0,r.jsx)("span",{className:"text-base",children:"Show SkyPilot YAML"})]}),(0,r.jsx)(h.WH,{content:R?"Copied!":"Copy YAML",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:en,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:R?(0,r.jsx)(m.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(x.Z,{className:"w-4 h-4"})})})]}),E&&(0,r.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 max-h-96 overflow-y-auto",children:(()=>{let e=(0,b.pJ)(t.dag_yaml);return 0===e.length?(0,r.jsx)("div",{className:"text-gray-500",children:"No YAML available"}):1===e.length?(0,r.jsx)("pre",{className:"text-sm text-gray-800 font-mono whitespace-pre-wrap",children:e[0].content}):(0,r.jsx)("div",{className:"space-y-4",children:e.map((e,t)=>(0,r.jsxs)("div",{className:"border-b border-gray-200 pb-4 last:border-b-0",children:[(0,r.jsx)("button",{onClick:()=>er(t),className:"flex items-center justify-between w-full text-left focus:outline-none",children:(0,r.jsxs)("div",{className:"flex items-center",children:[C[t]?(0,r.jsx)(f.Z,{className:"w-4 h-4 mr-2"}):(0,r.jsx)(g.Z,{className:"w-4 h-4 mr-2"}),(0,r.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Task ",t+1,": ",e.preview]})]})}),C[t]&&(0,r.jsx)("div",{className:"mt-3 ml-6",children:(0,r.jsx)("pre",{className:"text-sm text-gray-800 font-mono whitespace-pre-wrap",children:e.content})})]},t))})})()})]})]})]})]})}t.default=function(){var e;let t=(0,l.useRouter)(),{job:s,tab:i}=t.query,[m,x]=(0,n.useState)(0),{jobData:f,loading:g}=(0,o.UA)(s,m),[j,N]=(0,n.useState)(!1),[b,w]=(0,n.useState)(!0),[E,L]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!1),[R,T]=(0,n.useState)(!1),[I,k]=(0,n.useState)(!1),[A,D]=(0,n.useState)(!1),[_,Z]=(0,n.useState)(0),[P,O]=(0,n.useState)(0),q=(0,p.X)();n.useEffect(()=>{!g&&b&&w(!1)},[g,b]);let F=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};(0,n.useEffect)(()=>{k(!0)},[]),(0,n.useEffect)(()=>{if(!A){let e=new MutationObserver(()=>{let t=document.getElementById("logs-section"),s=document.getElementById("controller-logs-section");("logs"===i&&t||"controllerlogs"===i&&s)&&(D(!0),e.disconnect())});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()}},[A,i]),(0,n.useEffect)(()=>{if(t.isReady&&I&&A&&!R){let e=setTimeout(()=>{"logs"===i?(F("logs-section"),T(!0)):"controllerlogs"===i&&(F("controller-logs-section"),T(!0))},800);return()=>clearTimeout(e)}},[t.isReady,i,R,I,A]),(0,n.useEffect)(()=>{T(!1),D(!1)},[i]);let M=async()=>{N(!0);try{x(e=>e+1),Z(e=>e+1),O(e=>e+1)}catch(e){console.error("Error refreshing data:",e)}finally{N(!1)}};if(!t.isReady)return(0,r.jsx)("div",{children:"Loading..."});let U=null==f?void 0:null===(e=f.jobs)||void 0===e?void 0:e.find(e=>String(e.id)===String(s)),G=s?"Job: ".concat(s," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y(),{children:(0,r.jsx)("title",{children:G})}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(d(),{href:"/jobs",className:"text-sky-blue hover:underline",children:"Managed Jobs"}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsxs)(d(),{href:"/jobs/".concat(s),className:"text-sky-blue hover:underline",children:[s," ",(null==U?void 0:U.name)?"(".concat(U.name,")"):""]})]}),(0,r.jsxs)("div",{className:"text-sm flex items-center",children:[(g||j||E||C)&&(0,r.jsxs)("div",{className:"flex items-center mr-4",children:[(0,r.jsx)(a.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsx)(h.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.jsxs)("button",{onClick:M,disabled:g||j,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(u.Z,{className:"w-4 h-4 mr-1.5"}),!q&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]}),g&&b?(0,r.jsxs)("div",{className:"flex items-center justify-center py-32",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):U?(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)("div",{id:"details-section",children:(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Details"})}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(v,{jobData:U,activeTab:"info",setIsLoadingLogs:L,setIsLoadingControllerLogs:S,isLoadingLogs:E,isLoadingControllerLogs:C,refreshFlag:0})})]})}),(0,r.jsx)("div",{id:"logs-section",className:"mt-6",children:(0,r.jsxs)(c.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Logs"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,r.jsx)(h.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{Z(e=>e+1)},disabled:E,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(E?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(v,{jobData:U,activeTab:"logs",setIsLoadingLogs:L,setIsLoadingControllerLogs:S,isLoadingLogs:E,isLoadingControllerLogs:C,refreshFlag:_})})]})}),(0,r.jsx)("div",{id:"controller-logs-section",className:"mt-6",children:(0,r.jsxs)(c.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Controller Logs"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,r.jsx)(h.WH,{content:"Refresh controller logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{O(e=>e+1)},disabled:C,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(C?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(v,{jobData:U,activeTab:"controllerlogs",setIsLoadingLogs:L,setIsLoadingControllerLogs:S,isLoadingLogs:E,isLoadingControllerLogs:C,refreshFlag:P})})]})})]}):(0,r.jsx)("div",{className:"flex items-center justify-center py-32",children:(0,r.jsx)("span",{children:"Job not found"})})]})]})}},9008:function(e,t,s){e.exports=s(7219)}},function(e){e.O(0,[616,760,799,804,664,798,989,470,969,888,774,179],function(){return e(e.s=479)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[142],{1446:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/jobs",function(){return t(8929)}])},8929:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return a}});var r=t(5893);t(7294);var s=t(9008),i=t.n(s),o=t(5152);let u=t.n(o)()(()=>Promise.all([t.e(616),t.e(760),t.e(799),t.e(804),t.e(664),t.e(947),t.e(989),t.e(470),t.e(901),t.e(969),t.e(856),t.e(973),t.e(938),t.e(211)]).then(t.bind(t,938)).then(e=>e.ManagedJobs),{loadableGenerated:{webpack:()=>[938]},ssr:!1});function a(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i(),{children:(0,r.jsx)("title",{children:"Managed Jobs | SkyPilot Dashboard"})}),(0,r.jsx)(u,{})]})}},9008:function(e,n,t){e.exports=t(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=1446)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[892],{7476:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/users",function(){return r(5126)}])},5126:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return o}});var t=r(5893);r(7294);var s=r(9008),u=r.n(s),i=r(5152);let c=r.n(i)()(()=>Promise.all([r.e(616),r.e(760),r.e(799),r.e(804),r.e(664),r.e(984),r.e(989),r.e(470),r.e(901),r.e(969),r.e(856),r.e(641)]).then(r.bind(r,2641)).then(e=>e.Users),{loadableGenerated:{webpack:()=>[2641]},ssr:!1});function o(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u(),{children:(0,t.jsx)("title",{children:"Users | SkyPilot Dashboard"})}),(0,t.jsx)(c,{})]})}},9008:function(e,n,r){e.exports=r(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=7476)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[963],{5113:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/workspace/new",function(){return r(4250)}])},4250:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return u}});var t=r(5893);r(7294);var s=r(9008),c=r.n(s),i=r(5152);let o=r.n(i)()(()=>Promise.all([r.e(760),r.e(664),r.e(901),r.e(513)]).then(r.bind(r,4513)).then(e=>e.NewWorkspace),{loadableGenerated:{webpack:()=>[4513]},ssr:!1});function u(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c(),{children:(0,t.jsx)("title",{children:"New Workspace | SkyPilot Dashboard"})}),(0,t.jsx)(o,{})]})}},9008:function(e,n,r){e.exports=r(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=5113)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[590],{2592:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/workspaces",function(){return r(4980)}])},4980:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return u}});var t=r(5893);r(7294);var s=r(9008),c=r.n(s),i=r(5152);let o=r.n(i)()(()=>Promise.all([r.e(616),r.e(760),r.e(799),r.e(804),r.e(664),r.e(798),r.e(947),r.e(989),r.e(470),r.e(901),r.e(969),r.e(856),r.e(973),r.e(938),r.e(443)]).then(r.bind(r,5443)).then(e=>e.Workspaces),{loadableGenerated:{webpack:()=>[5443]},ssr:!1});function u(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c(),{children:(0,t.jsx)("title",{children:"Workspaces | SkyPilot Dashboard"})}),(0,t.jsx)(o,{})]})}},9008:function(e,n,r){e.exports=r(7219)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=2592)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- !function(){"use strict";var e,t,n,r,c,o,u,a,i,f={},s={};function d(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}},r=!0;try{f[e](n,n.exports,d),r=!1}finally{r&&delete s[e]}return n.exports}d.m=f,e=[],d.O=function(t,n,r,c){if(n){c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[n,r,c];return}for(var u=1/0,o=0;o<e.length;o++){for(var n=e[o][0],r=e[o][1],c=e[o][2],a=!0,i=0;i<n.length;i++)u>=c&&Object.keys(d.O).every(function(e){return d.O[e](n[i])})?n.splice(i--,1):(a=!1,c<u&&(u=c));if(a){e.splice(o--,1);var f=r();void 0!==f&&(t=f)}}return t},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},d.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var c=Object.create(null);d.r(c);var o={};t=t||[null,n({}),n([]),n(n)];for(var u=2&r&&e;"object"==typeof u&&!~t.indexOf(u);u=n(u))Object.getOwnPropertyNames(u).forEach(function(t){o[t]=function(){return e[t]}});return o.default=function(){return e},d.d(c,o),c},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return 350===e?"static/chunks/350.9e123a4551f68b0d.js":491===e?"static/chunks/491.b3d264269613fe09.js":937===e?"static/chunks/937.3759f538f11a0953.js":42===e?"static/chunks/42.2273cc2415291ceb.js":682===e?"static/chunks/682.4dd5dc116f740b5f.js":211===e?"static/chunks/211.692afc57e812ae1a.js":984===e?"static/chunks/984.ae8c08791d274ca0.js":641===e?"static/chunks/641.c8e452bc5070a630.js":513===e?"static/chunks/513.309df9e18a9ff005.js":443===e?"static/chunks/443.b2242d0efcdf5f47.js":"static/chunks/"+e+"-"+({37:"4650f214e2119168",470:"1494c899266cf5c9",616:"d6128fa9e7cae6e6",664:"047bc03493fda379",760:"a89d354797ce7af5",798:"c0525dc3f21e488d",799:"3625946b2ec2eb30",804:"4c9fc53aa74bc191",843:"bde186946d353355",856:"bfddc18e16f3873c",901:"b424d293275e1fd7",938:"ce7991c156584b06",947:"6620842ef80ae879",969:"d3a0b53f728d280a",973:"56412c7976b4655b",989:"db34c16ad7ea6155"})[e]+".js"},d.miniCssF=function(e){},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},c="_N_E:",d.l=function(e,t,n,o){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var u,a,i=document.getElementsByTagName("script"),f=0;f<i.length;f++){var s=i[f];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==c+n){u=s;break}}u||(a=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,d.nc&&u.setAttribute("nonce",d.nc),u.setAttribute("data-webpack",c+n),u.src=d.tu(e)),r[e]=[t];var l=function(t,n){u.onerror=u.onload=null,clearTimeout(b);var c=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),c&&c.forEach(function(e){return e(n)}),t)return t(n)},b=setTimeout(l.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=l.bind(null,u.onerror),u.onload=l.bind(null,u.onload),a&&document.head.appendChild(u)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.tt=function(){return void 0===o&&(o={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o},d.tu=function(e){return d.tt().createScriptURL(e)},d.p="/dashboard/_next/",u={272:0},d.f.j=function(e,t){var n=d.o(u,e)?u[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(272!=e){var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var c=d.p+d.u(e),o=Error();d.l(c,function(t){if(d.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",o.name="ChunkLoadError",o.type=r,o.request=c,n[1](o)}},"chunk-"+e,e)}else u[e]=0}},d.O.j=function(e){return 0===u[e]},a=function(e,t){var n,r,c=t[0],o=t[1],a=t[2],i=0;if(c.some(function(e){return 0!==u[e]})){for(n in o)d.o(o,n)&&(d.m[n]=o[n]);if(a)var f=a(d)}for(e&&e(t);i<c.length;i++)r=c[i],d.o(u,r)&&u[r]&&u[r][0](),u[r]=0;return d.O(f)},(i=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(a.bind(null,0)),i.push=a.bind(null,i.push.bind(i)),d.nc=void 0}();