skypilot-nightly 1.0.0.dev20250711__py3-none-any.whl → 1.0.0.dev20250713__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.
- sky/__init__.py +2 -2
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/{ldZFQWCiYX_vZnIfB_o8S → JnRZeU80MTbNRfWV2kd8w}/_buildManifest.js +1 -1
- sky/dashboard/out/_next/static/chunks/{1043-1b39779691bb4030.js → 1043-5e5ef6198735ff7e.js} +1 -1
- sky/dashboard/out/_next/static/chunks/1871-cf1a47986d716dd2.js +6 -0
- sky/dashboard/out/_next/static/chunks/6601-d38d10f957dff832.js +1 -0
- sky/dashboard/out/_next/static/chunks/{6989-6ff4e45dfb49d11d.js → 6989-eab0e9c16b64fd9f.js} +1 -1
- sky/dashboard/out/_next/static/chunks/938-8e25c8ea0baa271a.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-4608dc89f95eba89.js +6 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-980d6f6b64ca7833.js +16 -0
- sky/dashboard/out/_next/static/chunks/{webpack-60070a62f55486a6.js → webpack-4d50ce5087a63a95.js} +1 -1
- sky/dashboard/out/_next/static/css/a713705ccc8fe059.css +3 -0
- sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
- sky/dashboard/out/clusters/[cluster].html +1 -1
- sky/dashboard/out/clusters.html +1 -1
- sky/dashboard/out/config.html +1 -1
- sky/dashboard/out/index.html +1 -1
- sky/dashboard/out/infra/[context].html +1 -1
- sky/dashboard/out/infra.html +1 -1
- sky/dashboard/out/jobs/[job].html +1 -1
- sky/dashboard/out/jobs.html +1 -1
- sky/dashboard/out/users.html +1 -1
- sky/dashboard/out/volumes.html +1 -1
- sky/dashboard/out/workspace/new.html +1 -1
- sky/dashboard/out/workspaces/[name].html +1 -1
- sky/dashboard/out/workspaces.html +1 -1
- sky/optimizer.py +22 -14
- sky/resources.py +2 -0
- sky/setup_files/dependencies.py +1 -0
- sky/utils/kubernetes/generate_kubeconfig.sh +3 -0
- {skypilot_nightly-1.0.0.dev20250711.dist-info → skypilot_nightly-1.0.0.dev20250713.dist-info}/METADATA +3 -1
- {skypilot_nightly-1.0.0.dev20250711.dist-info → skypilot_nightly-1.0.0.dev20250713.dist-info}/RECORD +38 -38
- sky/dashboard/out/_next/static/chunks/1871-3a0f047988be65cd.js +0 -6
- sky/dashboard/out/_next/static/chunks/6601-fcfad0ddf92ec7ab.js +0 -1
- sky/dashboard/out/_next/static/chunks/938-044ad21de8b4626b.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8135aba0712bda37.js +0 -6
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-c4d5cfac7fbc0668.js +0 -16
- sky/dashboard/out/_next/static/css/6cbd41a88d2e9e1c.css +0 -3
- /sky/dashboard/out/_next/static/{ldZFQWCiYX_vZnIfB_o8S → JnRZeU80MTbNRfWV2kd8w}/_ssgManifest.js +0 -0
- /sky/dashboard/out/_next/static/chunks/pages/{_app-e6e82dc8abb50c4f.js → _app-49ff6c04332cc621.js} +0 -0
- {skypilot_nightly-1.0.0.dev20250711.dist-info → skypilot_nightly-1.0.0.dev20250713.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250711.dist-info → skypilot_nightly-1.0.0.dev20250713.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250711.dist-info → skypilot_nightly-1.0.0.dev20250713.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250711.dist-info → skypilot_nightly-1.0.0.dev20250713.dist-info}/top_level.txt +0 -0
sky/__init__.py
CHANGED
@@ -5,7 +5,7 @@ from typing import Optional
|
|
5
5
|
import urllib.request
|
6
6
|
|
7
7
|
# Replaced with the current commit when building the wheels.
|
8
|
-
_SKYPILOT_COMMIT_SHA = '
|
8
|
+
_SKYPILOT_COMMIT_SHA = '6369e0e45c8eec6beeec9b6543353f21157cb3a5'
|
9
9
|
|
10
10
|
|
11
11
|
def _get_git_commit():
|
@@ -35,7 +35,7 @@ def _get_git_commit():
|
|
35
35
|
|
36
36
|
|
37
37
|
__commit__ = _get_git_commit()
|
38
|
-
__version__ = '1.0.0.
|
38
|
+
__version__ = '1.0.0.dev20250713'
|
39
39
|
__root_dir__ = os.path.dirname(os.path.abspath(__file__))
|
40
40
|
|
41
41
|
|
sky/dashboard/out/404.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/a713705ccc8fe059.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/a713705ccc8fe059.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/dashboard/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/dashboard/_next/static/chunks/webpack-4d50ce5087a63a95.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-efc06c2733009cd3.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-c0a4f1ea606d48d2.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-49ff6c04332cc621.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c72a1f77a3c0be1b.js" defer=""></script><script src="/dashboard/_next/static/JnRZeU80MTbNRfWV2kd8w/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/JnRZeU80MTbNRfWV2kd8w/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"JnRZeU80MTbNRfWV2kd8w","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
sky/dashboard/out/_next/static/{ldZFQWCiYX_vZnIfB_o8S → JnRZeU80MTbNRfWV2kd8w}/_buildManifest.js
RENAMED
@@ -1 +1 @@
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,f,u,n,
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,f,u,n,r,i,b,j,d,k,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-927ddeebe57a8ac3.js"],"/_error":["static/chunks/pages/_error-c72a1f77a3c0be1b.js"],"/clusters":["static/chunks/pages/clusters-102d169e87913ba1.js"],"/clusters/[cluster]":[s,c,a,e,t,r,b,f,u,n,j,i,d,k,o,"static/chunks/1871-cf1a47986d716dd2.js","static/chunks/pages/clusters/[cluster]-0fbfb1dd0b08c90c.js"],"/clusters/[cluster]/[job]":[s,c,a,e,t,f,u,n,"static/chunks/pages/clusters/[cluster]/[job]-4608dc89f95eba89.js"],"/config":["static/chunks/pages/config-a2673b256b6d416f.js"],"/infra":["static/chunks/pages/infra-ae9d2f705ce582c9.js"],"/infra/[context]":["static/chunks/pages/infra/[context]-8b0809f59034d509.js"],"/jobs":["static/chunks/pages/jobs-5bbdc71878f0a068.js"],"/jobs/[job]":[s,c,a,e,t,r,f,u,n,i,"static/chunks/pages/jobs/[job]-980d6f6b64ca7833.js"],"/users":["static/chunks/pages/users-cd43fb3c122eedde.js"],"/volumes":["static/chunks/pages/volumes-4ebf6484f7216387.js"],"/workspace/new":["static/chunks/pages/workspace/new-5629d4e551dba1ee.js"],"/workspaces":["static/chunks/pages/workspaces-06bde99155fa6292.js"],"/workspaces/[name]":[s,c,a,e,t,r,b,f,u,n,j,i,d,k,o,"static/chunks/1141-726e5a3f00b67185.js","static/chunks/pages/workspaces/[name]-7c0187f43757a548.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/config","/infra","/infra/[context]","/jobs","/jobs/[job]","/users","/volumes","/workspace/new","/workspaces","/workspaces/[name]"]}}("static/chunks/616-162f3033ffcd3d31.js","static/chunks/5230-df791914b54d91d9.js","static/chunks/5739-5ea3ffa10fc884f2.js","static/chunks/1664-d65361e92b85e786.js","static/chunks/804-9f5e98ce84d46bdd.js","static/chunks/6989-eab0e9c16b64fd9f.js","static/chunks/3698-52ad1ca228faa776.js","static/chunks/9470-21d059a1dfa03f61.js","static/chunks/1272-1ef0bf0237faccdb.js","static/chunks/8969-13bb52ce3cffa4e3.js","static/chunks/3947-b059261d6fa88a1f.js","static/chunks/6990-d0dc765474fa0eca.js","static/chunks/1043-5e5ef6198735ff7e.js","static/chunks/6601-d38d10f957dff832.js","static/chunks/938-8e25c8ea0baa271a.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1043],{326:function(e,t,a){a.d(t,{$N:function(){return p},Be:function(){return _},Vq:function(){return c},cN:function(){return f},cZ:function(){return d},fK:function(){return g}});var r=a(5893),s=a(7294),o=a(6327),n=a(2350),l=a(3767);let c=o.fC;o.xz;let u=o.h_;o.x8;let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s})});i.displayName=o.aV.displayName;let d=s.forwardRef((e,t)=>{let{className:a,children:s,...c}=e;return(0,r.jsxs)(u,{children:[(0,r.jsx)(i,{}),(0,r.jsxs)(o.VY,{ref:t,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...c,children:[s,(0,r.jsxs)(o.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500",children:[(0,r.jsx)(l.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});d.displayName=o.VY.displayName;let g=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};g.displayName="DialogHeader";let f=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="DialogFooter";let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",a),...s})});p.displayName=o.Dx.displayName;let _=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.dk,{ref:t,className:(0,n.cn)("text-sm text-gray-500",a),...s})});_.displayName=o.dk.displayName},3266:function(e,t,a){a.d(t,{QL:function(){return g},Sl:function(){return i},getClusters:function(){return c},uR:function(){return u}});var r=a(7294),s=a(5821),o=a(7145),n=a(6378);let l={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function c(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await o.x.fetch("/status",{cluster_names:e,all_users:!0})).map(e=>{let t="",a=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 a=Math.floor((t-3)/2),r=a+(t-3)%2;return 0===a?e.substring(0,r)+"...":e.substring(0,r)+"..."+e.substring(e.length-a)}(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:a?"".concat(e.cloud," (").concat(a,")"):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 u(){try{let e=await o.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 a=e.user_name||"-";return{status:e.status?l[e.status]:"TERMINATED",cluster:e.name,user:a,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 i(e){let{clusterName:t,jobId:a,onNewLog:r,workspace:n}=e;try{await o.x.stream("/logs",{follow:!1,cluster_name:t,job_id:a,override_skypilot_config:{active_workspace:n||"default"}},r)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,s.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function d(e){let{clusterName:t,workspace:a}=e;try{return(await o.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:a}})).map(e=>{let r=e.end_at?e.end_at:Date.now()/1e3,s=0,o=0;return e.submitted_at&&(s=r-e.submitted_at),e.start_at&&(o=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:s,job_duration:o,infra:"",logs:"",workspace:a||"default"}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function g(e){let{cluster:t,job:a=null}=e,[s,o]=(0,r.useState)(null),[l,u]=(0,r.useState)(null),[i,g]=(0,r.useState)(!0),[f,p]=(0,r.useState)(!0),_=(0,r.useCallback)(async()=>{if(t)try{g(!0);let e=await n.default.get(c,[{clusterNames:[t]}]);return o(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{g(!1)}return null},[t]),h=(0,r.useCallback)(async e=>{if(t)try{p(!0);let a=await n.default.get(d,[{clusterName:t,workspace:e||"default"}]);u(a)}catch(e){console.error("Error fetching cluster job data:",e)}finally{p(!1)}},[t]),m=(0,r.useCallback)(async()=>{n.default.invalidate(c,[{clusterNames:[t]}]);let e=await _();e&&(n.default.invalidate(d,[{clusterName:t,workspace:e.workspace||"default"}]),await h(e.workspace))},[_,h,t]),b=(0,r.useCallback)(async()=>{s&&(n.default.invalidate(d,[{clusterName:t,workspace:s.workspace||"default"}]),await h(s.workspace))},[h,s,t]);return(0,r.useEffect)(()=>{(async()=>{let e=await _();e&&h(e.workspace)})()},[t,a,_,h]),{clusterData:s,clusterJobData:l,loading:i,clusterDetailsLoading:i,clusterJobsLoading:f,refreshData:m,refreshClusterJobsOnly:b}}},2045:function(e,t,a){a.d(t,{l4:function(){return n}});var r=a(3225),s=a(7145);async function o(e,t){try{let a=[];try{let e=await s.x.get("/enabled_clouds"),t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),r=await s.x.get("/api/get?request_id=".concat(t)),o=await r.json();a=o.return_value?JSON.parse(o.return_value):[],console.log("Enabled clouds:",a)}catch(e){console.error("Error fetching enabled clouds:",e),a=[]}let o={};r.$m.forEach(e=>{let t=a.includes(e.toLowerCase());o[e]={name:e,clusters:0,jobs:0,enabled:t}}),e.forEach(e=>{if(e.cloud){let t=e.cloud;o[t]&&(o[t].clusters+=1,o[t].enabled=!0)}}),t.forEach(e=>{if(e.cloud){let t=e.cloud;o[t]&&(o[t].jobs+=1,o[t].enabled=!0)}});let n=r.$m.length,l=Object.values(o).filter(e=>e.enabled).length;return{clouds:Object.values(o).filter(e=>e.enabled).sort((e,t)=>t.clusters-e.clusters||t.jobs-e.jobs),totalClouds:n,enabledClouds:l}}catch(e){return console.error("Error fetching cloud infrastructure:",e),{clouds:[],totalClouds:r.$m.length,enabledClouds:0}}}async function n(){let{getClusters:e}=await Promise.resolve().then(a.bind(a,3266)),{getManagedJobs:t}=await Promise.resolve().then(a.bind(a,8969)),r=(await Promise.resolve().then(a.bind(a,6378))).default,[s,n]=await Promise.all([r.get(e),r.get(t,[{allUsers:!0}])]),c=s||[],u=(null==n?void 0:n.jobs)||[],[i,d]=await Promise.all([l(c,u),o(c,u)]);return{gpuData:i,cloudData:d}}async function l(e,t){return await g({clusters:e||[],jobs:t||[]})}async function c(){try{let e=await s.x.post("/realtime_kubernetes_gpu_availability",{context:null,name_filter:null,quantity_filter:null});if(!e.ok)return console.error("Error fetching Kubernetes context GPUs (in getKubernetesContextGPUs): ".concat(e.status," ").concat(e.statusText)),[];let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)return console.error("No request ID returned for Kubernetes GPU availability (in getKubernetesContextGPUs)"),[];let a=await s.x.get("/api/get?request_id=".concat(t)),r=await a.text();if(500===a.status){try{let e=JSON.parse(r);if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);console.error("[infra.jsx] getKubernetesContextGPUs: Server error detail:",t.message)}catch(t){console.error("[infra.jsx] getKubernetesContextGPUs: Error parsing server error JSON:",t,"Original error text:",e.detail.error)}}catch(e){console.error("[infra.jsx] getKubernetesContextGPUs: Error parsing 500 error response JSON:",e,"Raw text was:",r)}return[]}let o=JSON.parse(r);return o.return_value?JSON.parse(o.return_value):[]}catch(e){return console.error("[infra.jsx] Outer error in getKubernetesContextGPUs:",e),[]}}async function u(){try{let e=await s.x.get("/all_contexts");if(!e.ok)return console.error("Error fetching all contexts: ".concat(e.status," ").concat(e.statusText)),[];let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)return console.error("No request ID returned for /all_contexts"),[];let a=await s.x.get("/api/get?request_id=".concat(t)),r=await a.json();return r.return_value?JSON.parse(r.return_value):[]}catch(e){return console.error("[infra.jsx] Error in getAllContexts:",e),[]}}async function i(e){try{let t=await s.x.post("/kubernetes_node_info",{context:e}),a=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("x-request-id"),r=await s.x.get("/api/get?request_id=".concat(a));if(500===r.status){try{let e=await r.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);console.error("Error fetching Kubernetes per node GPUs:",t.message)}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{}}let o=await r.json();return(o.return_value?JSON.parse(o.return_value):{}).node_info_dict||{}}catch(t){return console.error("[infra.jsx] Error in getKubernetesPerNodeGPUs for context",e,":",t),{}}}async function d(e){try{let t=e.clusters,a=e.jobs,r={};return t.forEach(e=>{let t=null;if("Kubernetes"===e.cloud)(t=e.region)&&(t="kubernetes/".concat(t));else if("SSH"===e.cloud&&(t=e.region)){let e=t.startsWith("ssh-")?t.substring(4):t;t="ssh/".concat(e)}t&&(r[t]||(r[t]={clusters:0,jobs:0}),r[t].clusters+=1)}),a.forEach(e=>{let t=null;if("Kubernetes"===e.cloud)(t=e.region)&&(t="kubernetes/".concat(t));else if("SSH"===e.cloud&&(t=e.region)){let e=t.startsWith("ssh-")?t.substring(4):t;t="ssh/".concat(e)}t&&(r[t]||(r[t]={clusters:0,jobs:0}),r[t].jobs+=1)}),r}catch(e){return console.error("=== Error in getContextClustersAndJobs ===",e),{}}}async function g(e){try{let o=await u();if(!o||0===o.length)return console.log("No contexts found from /all_contexts endpoint."),{allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{}};let n=await d(e),l=await c(),g=new Map;l&&l.forEach(e=>{g.set(e[0],e[1])});let f={},p={},_={};for(let e of o){p[e]||(p[e]=[]);let o=g.get(e);if(o&&o.length>0)for(let t of o){let a=t[0],r=t[1].join(", "),s=t[2],o=t[3];a in f?(f[a].gpu_total+=s,f[a].gpu_free+=o):f[a]={gpu_total:s,gpu_free:o,gpu_name:a},p[e].push({gpu_name:a,gpu_requestable_qty_per_node:r,gpu_total:s,gpu_free:o,context:e})}let n=await i(e);if(n&&Object.keys(n).length>0)for(let o in n){var t,a,r,s;let l=n[o],c=l.accelerator_type||"-",u=null!==(r=null===(t=l.total)||void 0===t?void 0:t.accelerator_count)&&void 0!==r?r:0,i=null!==(s=null===(a=l.free)||void 0===a?void 0:a.accelerators_available)&&void 0!==s?s:0;_["".concat(e,"/").concat(o)]={node_name:l.name,gpu_name:c,gpu_total:u,gpu_free:i,ip_address:l.ip_address||null,context:e},"-"===c||p[e].some(e=>e.gpu_name===c)||(c in f||(f[c]={gpu_total:0,gpu_free:0,gpu_name:c}),p[e].find(e=>e.gpu_name===c)||p[e].push({gpu_name:c,gpu_requestable_qty_per_node:"-",gpu_total:0,gpu_free:0,context:e}))}0===p[e].length&&n&&Object.keys(n).length}return{allContextNames:o.sort(),allGPUs:Object.values(f).sort((e,t)=>e.gpu_name.localeCompare(t.gpu_name)),perContextGPUs:Object.values(p).flat().sort((e,t)=>e.context.localeCompare(t.context)||e.gpu_name.localeCompare(t.gpu_name)),perNodeGPUs:Object.values(_).sort((e,t)=>e.context.localeCompare(t.context)||e.node_name.localeCompare(t.node_name)||e.gpu_name.localeCompare(t.gpu_name)),contextStats:n}}catch(e){return console.error("[infra.jsx] Outer error in getKubernetesGPUs:",e),{allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{}}}}},3081:function(e,t,a){a.d(t,{R:function(){return s}}),a(3266),a(8969);var r=a(7145);async function s(){try{let e=await r.x.get("/users");if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return(await e.json()).map(e=>({userId:e.id,username:e.name,role:e.role}))||[]}catch(e){return console.error("Failed to fetch users:",e),[]}}},9238:function(e,t,a){a.d(t,{C:function(){return s},w:function(){return o}});var r=a(7145);async function s(){try{return(await r.x.fetch("/volumes",{},"GET")).map(e=>{var t,a,r;let s=e.cloud||"";return e.region&&(s+="/".concat(e.region)),e.zone&&(s+="/".concat(e.zone)),{name:e.name,launched_at:e.launched_at,user_hash:e.user_hash,user_name:e.user_name||"-",workspace:e.workspace||"-",last_attached_at:e.last_attached_at,status:e.status,type:e.type,cloud:e.cloud,region:e.region,zone:e.zone,infra:s,size:"".concat(e.size,"Gi"),config:e.config,storage_class:(null===(t=e.config)||void 0===t?void 0:t.storage_class_name)||"-",access_mode:(null===(a=e.config)||void 0===a?void 0:a.access_mode)||"-",namespace:(null===(r=e.config)||void 0===r?void 0:r.namespace)||"-",name_on_cloud:e.name_on_cloud,usedby_pods:e.usedby_pods,usedby_clusters:e.usedby_clusters}})||[]}catch(e){return console.error("Failed to fetch volumes:",e),[]}}async function o(e){let t="";try{let a=(await r.x.post("/volumes/delete",{names:[e]})).headers.get("X-Request-ID"),s=await r.x.get("/api/get?request_id=".concat(a));if(500===s.status){try{let e=await s.json();if(e.detail&&e.detail.error)try{t=JSON.parse(e.detail.error).message}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{success:!1,msg:t}}return{success:!0}}catch(e){return console.error("Failed to delete volume:",e),{success:!1,msg:e.message}}}},6856:function(e,t,a){var r=a(6378),s=a(3266),o=a(8969),n=a(7324),l=a(3081),c=a(2045),u=a(9238);let i={base:{getClusters:{fn:s.getClusters,args:[]},getClusterHistory:{fn:s.uR,args:[]},getManagedJobs:{fn:o.getManagedJobs,args:[{allUsers:!0}]},getWorkspaces:{fn:n.fX,args:[]},getUsers:{fn:l.R,args:[]},getInfraData:{fn:c.l4,args:[]},getVolumes:{fn:u.C,args:[]}},dynamic:{getEnabledClouds:{fn:n.yz,requiresWorkspaces:!0}},pages:{clusters:["getClusters","getClusterHistory","getWorkspaces","getUsers"],jobs:["getManagedJobs","getClusters","getWorkspaces","getUsers"],infra:["getInfraData","getClusters","getManagedJobs"],workspaces:["getWorkspaces","getClusters","getManagedJobs","getEnabledClouds"],users:["getUsers","getClusters","getManagedJobs"],volumes:["getVolumes"]}};class d{async preloadForPage(e,t){let{backgroundPreload:a=!0,force:r=!1}=t||{};if(!i.pages[e]){console.warn("Unknown page: ".concat(e));return}console.log("[CachePreloader] Preloading cache for page: ".concat(e));try{await this._loadPageData(e,r),a&&this._backgroundPreloadOtherPages(e)}catch(t){console.error("[CachePreloader] Error preloading for page ".concat(e,":"),t)}}async _loadPageData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=i.pages[e],s=[];for(let e of a)if(i.base[e]){let{fn:a,args:o}=i.base[e];t&&r.default.invalidate(a,o),s.push(r.default.get(a,o))}else"getEnabledClouds"===e&&s.push(this._loadEnabledCloudsForAllWorkspaces(t));await Promise.allSettled(s),console.log("[CachePreloader] Loaded data for page: ".concat(e))}async _loadEnabledCloudsForAllWorkspaces(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e&&r.default.invalidate(n.fX);let t=await r.default.get(n.fX),a=Object.keys(t||{}).map(t=>(e&&r.default.invalidate(n.yz,[t]),r.default.get(n.yz,[t])));await Promise.allSettled(a)}catch(e){console.error("[CachePreloader] Error loading enabled clouds:",e)}}_backgroundPreloadOtherPages(e){if(this.isPreloading)return;this.isPreloading=!0;let t=Object.keys(i.pages).filter(t=>t!==e);console.log("[CachePreloader] Background preloading pages: ".concat(t.join(", "))),Promise.allSettled(t.map(async e=>{try{await this._loadPageData(e,!1),console.log("[CachePreloader] Background loaded: ".concat(e))}catch(t){console.error("[CachePreloader] Background load failed for ".concat(e,":"),t)}})).then(()=>{this.isPreloading=!1,console.log("[CachePreloader] Background preloading complete")})}async preloadBaseFunctions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];console.log("[CachePreloader] Preloading all base functions");let t=Object.entries(i.base).map(t=>{let[a,{fn:s,args:o}]=t;return e&&r.default.invalidate(s,o),r.default.get(s,o).catch(e=>{console.error("[CachePreloader] Failed to preload ".concat(a,":"),e)})});await Promise.allSettled(t),console.log("[CachePreloader] Base functions preloaded")}getCacheStats(){return{...r.default.getStats(),isPreloading:this.isPreloading}}clearCache(){r.default.clear(),this.isPreloading=!1,this.preloadPromises.clear(),console.log("[CachePreloader] Cache cleared")}constructor(){this.isPreloading=!1,this.preloadPromises=new Map}}let g=new d;t.ZP=g}}]);
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1043],{326:function(e,t,a){a.d(t,{$N:function(){return p},Be:function(){return _},Vq:function(){return c},cN:function(){return f},cZ:function(){return d},fK:function(){return g}});var r=a(5893),s=a(7294),o=a(6327),n=a(2350),l=a(3767);let c=o.fC;o.xz;let u=o.h_;o.x8;let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s})});i.displayName=o.aV.displayName;let d=s.forwardRef((e,t)=>{let{className:a,children:s,...c}=e;return(0,r.jsxs)(u,{children:[(0,r.jsx)(i,{}),(0,r.jsxs)(o.VY,{ref:t,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...c,children:[s,(0,r.jsxs)(o.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500",children:[(0,r.jsx)(l.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});d.displayName=o.VY.displayName;let g=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};g.displayName="DialogHeader";let f=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="DialogFooter";let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",a),...s})});p.displayName=o.Dx.displayName;let _=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.dk,{ref:t,className:(0,n.cn)("text-sm text-gray-500",a),...s})});_.displayName=o.dk.displayName},3266:function(e,t,a){a.d(t,{QL:function(){return g},Sl:function(){return i},getClusters:function(){return c},uR:function(){return u}});var r=a(7294),s=a(5821),o=a(7145),n=a(6378);let l={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function c(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await o.x.fetch("/status",{cluster_names:e,all_users:!0})).map(e=>{let t="",a=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 a=Math.floor((t-3)/2),r=a+(t-3)%2;return 0===a?e.substring(0,r)+"...":e.substring(0,r)+"..."+e.substring(e.length-a)}(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:a?"".concat(e.cloud," (").concat(a,")"):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 u(){try{let e=await o.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 a=e.user_name||"-";return{status:e.status?l[e.status]:"TERMINATED",cluster:e.name,user:a,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 i(e){let{clusterName:t,jobId:a,onNewLog:r,workspace:n}=e;try{await o.x.stream("/logs",{follow:!1,cluster_name:t,job_id:a,override_skypilot_config:{active_workspace:n||"default"}},r)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,s.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function d(e){let{clusterName:t,workspace:a}=e;try{return(await o.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:a}})).map(e=>{let r=e.end_at?e.end_at:Date.now()/1e3,s=0,o=0;return e.submitted_at&&(s=r-e.submitted_at),e.start_at&&(o=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:s,job_duration:o,infra:"",logs:"",workspace:a||"default"}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function g(e){let{cluster:t,job:a=null}=e,[s,o]=(0,r.useState)(null),[l,u]=(0,r.useState)(null),[i,g]=(0,r.useState)(!0),[f,p]=(0,r.useState)(!0),_=(0,r.useCallback)(async()=>{if(t)try{g(!0);let e=await n.default.get(c,[{clusterNames:[t]}]);return o(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{g(!1)}return null},[t]),h=(0,r.useCallback)(async e=>{if(t)try{p(!0);let a=await n.default.get(d,[{clusterName:t,workspace:e||"default"}]);u(a)}catch(e){console.error("Error fetching cluster job data:",e)}finally{p(!1)}},[t]),m=(0,r.useCallback)(async()=>{n.default.invalidate(c,[{clusterNames:[t]}]);let e=await _();e&&(n.default.invalidate(d,[{clusterName:t,workspace:e.workspace||"default"}]),await h(e.workspace))},[_,h,t]),b=(0,r.useCallback)(async()=>{s&&(n.default.invalidate(d,[{clusterName:t,workspace:s.workspace||"default"}]),await h(s.workspace))},[h,s,t]);return(0,r.useEffect)(()=>{(async()=>{let e=await _();e&&h(e.workspace)})()},[t,a,_,h]),{clusterData:s,clusterJobData:l,loading:i,clusterDetailsLoading:i,clusterJobsLoading:f,refreshData:m,refreshClusterJobsOnly:b}}},2045:function(e,t,a){a.d(t,{l4:function(){return n}});var r=a(3225),s=a(7145);async function o(e,t){try{let a=[];try{let e=await s.x.get("/enabled_clouds"),t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),r=await s.x.get("/api/get?request_id=".concat(t)),o=await r.json();a=o.return_value?JSON.parse(o.return_value):[],console.log("Enabled clouds:",a)}catch(e){console.error("Error fetching enabled clouds:",e),a=[]}let o={};r.$m.forEach(e=>{let t=a.includes(e.toLowerCase());o[e]={name:e,clusters:0,jobs:0,enabled:t}}),e.forEach(e=>{if(e.cloud){let t=e.cloud;o[t]&&(o[t].clusters+=1,o[t].enabled=!0)}}),t.forEach(e=>{if(e.cloud){let t=e.cloud;o[t]&&(o[t].jobs+=1,o[t].enabled=!0)}});let n=r.$m.length,l=Object.values(o).filter(e=>e.enabled).length;return{clouds:Object.values(o).filter(e=>e.enabled).sort((e,t)=>t.clusters-e.clusters||t.jobs-e.jobs),totalClouds:n,enabledClouds:l}}catch(e){return console.error("Error fetching cloud infrastructure:",e),{clouds:[],totalClouds:r.$m.length,enabledClouds:0}}}async function n(){let{getClusters:e}=await Promise.resolve().then(a.bind(a,3266)),{getManagedJobs:t}=await Promise.resolve().then(a.bind(a,8969)),r=(await Promise.resolve().then(a.bind(a,6378))).default,[s,n]=await Promise.all([r.get(e),r.get(t,[{allUsers:!0}])]),c=s||[],u=(null==n?void 0:n.jobs)||[],[i,d]=await Promise.all([l(c,u),o(c,u)]);return{gpuData:i,cloudData:d}}async function l(e,t){return await g({clusters:e||[],jobs:t||[]})}async function c(){try{let e=await s.x.post("/realtime_kubernetes_gpu_availability",{context:null,name_filter:null,quantity_filter:null});if(!e.ok)return console.error("Error fetching Kubernetes context GPUs (in getKubernetesContextGPUs): ".concat(e.status," ").concat(e.statusText)),[];let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)return console.error("No request ID returned for Kubernetes GPU availability (in getKubernetesContextGPUs)"),[];let a=await s.x.get("/api/get?request_id=".concat(t)),r=await a.text();if(500===a.status){try{let e=JSON.parse(r);if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);console.error("[infra.jsx] getKubernetesContextGPUs: Server error detail:",t.message)}catch(t){console.error("[infra.jsx] getKubernetesContextGPUs: Error parsing server error JSON:",t,"Original error text:",e.detail.error)}}catch(e){console.error("[infra.jsx] getKubernetesContextGPUs: Error parsing 500 error response JSON:",e,"Raw text was:",r)}return[]}let o=JSON.parse(r);return o.return_value?JSON.parse(o.return_value):[]}catch(e){return console.error("[infra.jsx] Outer error in getKubernetesContextGPUs:",e),[]}}async function u(){try{let e=await s.x.get("/all_contexts");if(!e.ok)return console.error("Error fetching all contexts: ".concat(e.status," ").concat(e.statusText)),[];let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)return console.error("No request ID returned for /all_contexts"),[];let a=await s.x.get("/api/get?request_id=".concat(t)),r=await a.json();return r.return_value?JSON.parse(r.return_value):[]}catch(e){return console.error("[infra.jsx] Error in getAllContexts:",e),[]}}async function i(e){try{let t=await s.x.post("/kubernetes_node_info",{context:e}),a=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("x-request-id"),r=await s.x.get("/api/get?request_id=".concat(a));if(500===r.status){try{let e=await r.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);console.error("Error fetching Kubernetes per node GPUs:",t.message)}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{}}let o=await r.json();return(o.return_value?JSON.parse(o.return_value):{}).node_info_dict||{}}catch(t){return console.error("[infra.jsx] Error in getKubernetesPerNodeGPUs for context",e,":",t),{}}}async function d(e){try{let t=e.clusters,a=e.jobs,r={};return t.forEach(e=>{let t=null;if("Kubernetes"===e.cloud)(t=e.region)&&(t="kubernetes/".concat(t));else if("SSH"===e.cloud&&(t=e.region)){let e=t.startsWith("ssh-")?t.substring(4):t;t="ssh/".concat(e)}t&&(r[t]||(r[t]={clusters:0,jobs:0}),r[t].clusters+=1)}),a.forEach(e=>{let t=null;if("Kubernetes"===e.cloud)(t=e.region)&&(t="kubernetes/".concat(t));else if("SSH"===e.cloud&&(t=e.region)){let e=t.startsWith("ssh-")?t.substring(4):t;t="ssh/".concat(e)}t&&(r[t]||(r[t]={clusters:0,jobs:0}),r[t].jobs+=1)}),r}catch(e){return console.error("=== Error in getContextClustersAndJobs ===",e),{}}}async function g(e){try{let o=await u();if(!o||0===o.length)return console.log("No contexts found from /all_contexts endpoint."),{allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{}};let n=await d(e),l=await c(),g=new Map;l&&l.forEach(e=>{g.set(e[0],e[1])});let f={},p={},_={};for(let e of o){p[e]||(p[e]=[]);let o=g.get(e);if(o&&o.length>0)for(let t of o){let a=t[0],r=t[1].join(", "),s=t[2],o=t[3];a in f?(f[a].gpu_total+=s,f[a].gpu_free+=o):f[a]={gpu_total:s,gpu_free:o,gpu_name:a},p[e].push({gpu_name:a,gpu_requestable_qty_per_node:r,gpu_total:s,gpu_free:o,context:e})}let n=await i(e);if(n&&Object.keys(n).length>0)for(let o in n){var t,a,r,s;let l=n[o],c=l.accelerator_type||"-",u=null!==(r=null===(t=l.total)||void 0===t?void 0:t.accelerator_count)&&void 0!==r?r:0,i=null!==(s=null===(a=l.free)||void 0===a?void 0:a.accelerators_available)&&void 0!==s?s:0;_["".concat(e,"/").concat(o)]={node_name:l.name,gpu_name:c,gpu_total:u,gpu_free:i,ip_address:l.ip_address||null,context:e},"-"===c||p[e].some(e=>e.gpu_name===c)||(c in f||(f[c]={gpu_total:0,gpu_free:0,gpu_name:c}),p[e].find(e=>e.gpu_name===c)||p[e].push({gpu_name:c,gpu_requestable_qty_per_node:"-",gpu_total:0,gpu_free:0,context:e}))}0===p[e].length&&n&&Object.keys(n).length}return{allContextNames:o.sort(),allGPUs:Object.values(f).sort((e,t)=>e.gpu_name.localeCompare(t.gpu_name)),perContextGPUs:Object.values(p).flat().sort((e,t)=>e.context.localeCompare(t.context)||e.gpu_name.localeCompare(t.gpu_name)),perNodeGPUs:Object.values(_).sort((e,t)=>e.context.localeCompare(t.context)||e.node_name.localeCompare(t.node_name)||e.gpu_name.localeCompare(t.gpu_name)),contextStats:n}}catch(e){return console.error("[infra.jsx] Outer error in getKubernetesGPUs:",e),{allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{}}}}},3081:function(e,t,a){a.d(t,{R:function(){return s}}),a(3266),a(8969);var r=a(7145);async function s(){try{let e=await r.x.get("/users");if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return(await e.json()).map(e=>({userId:e.id,username:e.name,role:e.role,created_at:e.created_at}))||[]}catch(e){return console.error("Failed to fetch users:",e),[]}}},9238:function(e,t,a){a.d(t,{C:function(){return s},w:function(){return o}});var r=a(7145);async function s(){try{return(await r.x.fetch("/volumes",{},"GET")).map(e=>{var t,a,r;let s=e.cloud||"";return e.region&&(s+="/".concat(e.region)),e.zone&&(s+="/".concat(e.zone)),{name:e.name,launched_at:e.launched_at,user_hash:e.user_hash,user_name:e.user_name||"-",workspace:e.workspace||"-",last_attached_at:e.last_attached_at,status:e.status,type:e.type,cloud:e.cloud,region:e.region,zone:e.zone,infra:s,size:"".concat(e.size,"Gi"),config:e.config,storage_class:(null===(t=e.config)||void 0===t?void 0:t.storage_class_name)||"-",access_mode:(null===(a=e.config)||void 0===a?void 0:a.access_mode)||"-",namespace:(null===(r=e.config)||void 0===r?void 0:r.namespace)||"-",name_on_cloud:e.name_on_cloud,usedby_pods:e.usedby_pods,usedby_clusters:e.usedby_clusters}})||[]}catch(e){return console.error("Failed to fetch volumes:",e),[]}}async function o(e){let t="";try{let a=(await r.x.post("/volumes/delete",{names:[e]})).headers.get("X-Request-ID"),s=await r.x.get("/api/get?request_id=".concat(a));if(500===s.status){try{let e=await s.json();if(e.detail&&e.detail.error)try{t=JSON.parse(e.detail.error).message}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{success:!1,msg:t}}return{success:!0}}catch(e){return console.error("Failed to delete volume:",e),{success:!1,msg:e.message}}}},6856:function(e,t,a){var r=a(6378),s=a(3266),o=a(8969),n=a(7324),l=a(3081),c=a(2045),u=a(9238);let i={base:{getClusters:{fn:s.getClusters,args:[]},getClusterHistory:{fn:s.uR,args:[]},getManagedJobs:{fn:o.getManagedJobs,args:[{allUsers:!0}]},getWorkspaces:{fn:n.fX,args:[]},getUsers:{fn:l.R,args:[]},getInfraData:{fn:c.l4,args:[]},getVolumes:{fn:u.C,args:[]}},dynamic:{getEnabledClouds:{fn:n.yz,requiresWorkspaces:!0}},pages:{clusters:["getClusters","getClusterHistory","getWorkspaces","getUsers"],jobs:["getManagedJobs","getClusters","getWorkspaces","getUsers"],infra:["getInfraData","getClusters","getManagedJobs"],workspaces:["getWorkspaces","getClusters","getManagedJobs","getEnabledClouds"],users:["getUsers","getClusters","getManagedJobs"],volumes:["getVolumes"]}};class d{async preloadForPage(e,t){let{backgroundPreload:a=!0,force:r=!1}=t||{};if(!i.pages[e]){console.warn("Unknown page: ".concat(e));return}console.log("[CachePreloader] Preloading cache for page: ".concat(e));try{await this._loadPageData(e,r),a&&this._backgroundPreloadOtherPages(e)}catch(t){console.error("[CachePreloader] Error preloading for page ".concat(e,":"),t)}}async _loadPageData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=i.pages[e],s=[];for(let e of a)if(i.base[e]){let{fn:a,args:o}=i.base[e];t&&r.default.invalidate(a,o),s.push(r.default.get(a,o))}else"getEnabledClouds"===e&&s.push(this._loadEnabledCloudsForAllWorkspaces(t));await Promise.allSettled(s),console.log("[CachePreloader] Loaded data for page: ".concat(e))}async _loadEnabledCloudsForAllWorkspaces(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e&&r.default.invalidate(n.fX);let t=await r.default.get(n.fX),a=Object.keys(t||{}).map(t=>(e&&r.default.invalidate(n.yz,[t]),r.default.get(n.yz,[t])));await Promise.allSettled(a)}catch(e){console.error("[CachePreloader] Error loading enabled clouds:",e)}}_backgroundPreloadOtherPages(e){if(this.isPreloading)return;this.isPreloading=!0;let t=Object.keys(i.pages).filter(t=>t!==e);console.log("[CachePreloader] Background preloading pages: ".concat(t.join(", "))),Promise.allSettled(t.map(async e=>{try{await this._loadPageData(e,!1),console.log("[CachePreloader] Background loaded: ".concat(e))}catch(t){console.error("[CachePreloader] Background load failed for ".concat(e,":"),t)}})).then(()=>{this.isPreloading=!1,console.log("[CachePreloader] Background preloading complete")})}async preloadBaseFunctions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];console.log("[CachePreloader] Preloading all base functions");let t=Object.entries(i.base).map(t=>{let[a,{fn:s,args:o}]=t;return e&&r.default.invalidate(s,o),r.default.get(s,o).catch(e=>{console.error("[CachePreloader] Failed to preload ".concat(a,":"),e)})});await Promise.allSettled(t),console.log("[CachePreloader] Base functions preloaded")}getCacheStats(){return{...r.default.getStats(),isPreloading:this.isPreloading}}clearCache(){r.default.clear(),this.isPreloading=!1,this.preloadPromises.clear(),console.log("[CachePreloader] Cache cleared")}constructor(){this.isPreloading=!1,this.preloadPromises=new Map}}let g=new d;t.ZP=g}}]);
|
@@ -0,0 +1,6 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1871,430],{9037:function(e,s,t){"use strict";t.r(s),t.d(s,{ClusterTable:function(){return _},Clusters:function(){return E},Status2Actions:function(){return A},enabledActions:function(){return V},handleVSCodeConnection:function(){return H}});var r=t(5893),l=t(7294),a=t(1163),n=t(5739),c=t(6989),i=t(1664),o=t.n(i),u=t(803),d=t(7673),h=t(8764),x=t(3266),p=t(7324),m=t(3081),f=t(4545),j=t(3626),v=t(998);/**
|
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 g=(0,v.Z)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),b=(0,v.Z)("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);t(9470);var w=t(9284),y=t(9307),k=t(3001),N=t(8950),C=t(6378),S=t(6856);t(1272);var L=t(546);let M=[{label:"Status",value:"status"},{label:"Cluster",value:"cluster"},{label:"User",value:"user"},{label:"Infra",value:"infra"},{label:"Workspace",value:"workspace"}],I=(e,s)=>{let t="",r="";return e>=0&&(t=e+"m",r=" "),s&&(t+="".concat(r,"(down)")),""===t&&(t="-"),t},R=(e,s)=>{if(e&&e.includes("@")){let t=e.split("@")[0];return s&&s!==t?"".concat(t," (").concat(s,")"):t}let t=e||s||"N/A";return s&&s!==t?"".concat(t," (").concat(s,")"):t},O=e=>{if(!e||0===e)return"-";let s=e=Math.floor(e),t="",r=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(s>=e.value&&r<2){let l=Math.floor(s/e.value);t+="".concat(l).concat(e.label," "),s%=e.value,r++}return t.trim()||"0s"};function E(){let e=(0,a.useRouter)(),[s,t]=(0,l.useState)(!1),i=l.useRef(null),[u,d]=(0,l.useState)(!1),[h,f]=(0,l.useState)(!1),[v,g]=(0,l.useState)(null),[b,y]=(0,l.useState)(!1),N=(0,k.X)(),[L,I]=(0,l.useState)([]),[O,E]=(0,l.useState)({status:[],cluster:[],user:[],workspace:[],infra:[]});(0,l.useEffect)(()=>{e.isReady&&F()},[e.isReady]),(0,l.useEffect)(()=>{(async()=>{try{await S.ZP.preloadForPage("clusters");let e=await C.default.get(p.fX),s=Object.keys(e),t=await C.default.get(x.getClusters),r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],l=new Set(s);r.includes("default")&&l.has("default"),r.forEach(e=>l.add(e));let a=await C.default.get(m.R),n=[...new Set(t.map(e=>({userId:e.user_hash||e.user,username:e.user})).filter(e=>e.userId)).values()],c=new Map;a.forEach(e=>{c.set(e.userId,{userId:e.userId,username:e.username,display:R(e.username,e.userId)})}),n.forEach(e=>{c.has(e.userId)||c.set(e.userId,{userId:e.userId,username:e.username,display:R(e.username,e.userId)})})}catch(e){console.error("Error fetching data for filters:",e)}})()},[]);let H=s=>{let t={...e.query},r=[],l=[],a=[];s.map((e,s)=>{var t;r.push(null!==(t=e.property.toLowerCase())&&void 0!==t?t:""),l.push(e.operator),a.push(e.value)}),t.property=r,t.operator=l,t.value=a,e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},F=()=>{let s={...e.query},t=s.property,r=s.operator,l=s.value;if(void 0===t)return;let a=[],n=Array.isArray(t)?t.length:1,c=new Map;if(c.set("",""),c.set("status","Status"),c.set("cluster","Cluster"),c.set("user","User"),c.set("workspace","Workspace"),c.set("infra","Infra"),1===n)a.push({property:c.get(t),operator:r,value:l});else for(let e=0;e<n;e++)a.push({property:c.get(t[e]),operator:r[e],value:l[e]});I(a)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(o(),{href:"/clusters",className:"text-sky-blue hover:underline leading-none",children:"Sky Clusters"}),(0,r.jsx)(z,{propertyList:M,valueList:O,setFilters:I,updateURLParams:H,placeholder:"Filter clusters"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsxs)("label",{className:"flex items-center cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:b,onChange:e=>y(e.target.checked),className:"sr-only"}),(0,r.jsx)("div",{className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors ".concat(b?"bg-sky-600":"bg-gray-300"),children:(0,r.jsx)("span",{className:"inline-block h-3 w-3 transform rounded-full bg-white transition-transform ".concat(b?"translate-x-5":"translate-x-1")})}),(0,r.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Show history (Last 30 days)"})]})}),(0,r.jsxs)("div",{className:"flex items-center",children:[s&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(n.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsxs)("button",{onClick:()=>{C.default.invalidate(x.getClusters),C.default.invalidate(x.uR),C.default.invalidate(p.fX),C.default.invalidate(m.R),i.current&&i.current()},disabled:s,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(j.Z,{className:"h-4 w-4 mr-1.5"}),!N&&(0,r.jsx)("span",{children:"Refresh"})]})]})]})]}),(0,r.jsx)(Z,{filters:L,setFilters:I,updateURLParams:H}),(0,r.jsx)(_,{refreshInterval:c.yc,setLoading:t,refreshDataRef:i,filters:L,showHistory:b,onOpenSSHModal:e=>{g(e),d(!0)},onOpenVSCodeModal:e=>{g(e),f(!0)},setOptionValues:E}),(0,r.jsx)(w.Oh,{isOpen:u,onClose:()=>d(!1),cluster:v}),(0,r.jsx)(w._R,{isOpen:h,onClose:()=>f(!1),cluster:v})]})}function _(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a,filters:i,showHistory:p,onOpenSSHModal:m,onOpenVSCodeModal:j,setOptionValues:v}=e,[g,b]=(0,l.useState)([]),[w,k]=(0,l.useState)({key:null,direction:"ascending"}),[N,S]=(0,l.useState)(!1),[M,R]=(0,l.useState)(!0),[E,_]=(0,l.useState)(1),[H,F]=(0,l.useState)(10),V=e=>{let s={status:[],cluster:[],user:[],workspace:[],infra:[]},t=(e,s)=>{e.includes(s)||e.push(s)};return e.map(e=>{t(s.status,e.status),t(s.cluster,e.cluster),t(s.user,e.user),t(s.workspace,e.workspace),t(s.infra,e.infra)}),s},W=l.useCallback(async()=>{t(!0),S(!0);try{let e=await C.default.get(x.getClusters);if(p){let s=await C.default.get(x.uR),t=e.map(e=>({...e,isHistorical:!1})),r=s.map(e=>({...e,isHistorical:!0})),l=[...t];r.forEach(s=>{e.some(e=>(e.cluster||e.name)===(s.cluster||s.name))||l.push(s)}),v(V(l)),b(l)}else{let s=e.map(e=>({...e,isHistorical:!1}));v(V(s)),b(s)}}catch(e){console.error("Error fetching cluster data:",e),v(V([])),b([])}t(!1),S(!1),R(!1)},[t,p]),z=(e,s)=>{var t;let{property:r,operator:l,value:a}=s;if(!a)return!0;if(!r){let s=a.toLowerCase();return Object.values(e).some(e=>null==e?void 0:e.toString().toLowerCase().includes(s))}let n=null===(t=e[r.toLowerCase()])||void 0===t?void 0:t.toString().toLowerCase(),c=a.toString().toLowerCase();switch(l){case"=":return n===c;case":":return null==n?void 0:n.includes(c);default:return!0}},Z=l.useMemo(()=>{let e=0===i.length?g:g.filter(e=>{let s=null;for(let t=0;t<i.length;t++){let r=z(e,i[t]);s=null===s?r:s&&r}return s});return(0,f.R0)(e,w.key,w.direction)},[g,w,i]);l.useEffect(()=>{a&&(a.current=W)},[a,W]),(0,l.useEffect)(()=>{b([]);let e=!0;W();let t=setInterval(()=>{e&&W()},s);return()=>{e=!1,clearInterval(t)}},[s,W]),(0,l.useEffect)(()=>{_(1)},[g.length]);let B=e=>{let s="ascending";w.key===e&&"ascending"===w.direction&&(s="descending"),k({key:e,direction:s})},q=e=>w.key===e?"ascending"===w.direction?" ↑":" ↓":"",D=Math.ceil(Z.length/H),P=(E-1)*H,U=P+H,X=Z.slice(P,U);return(0,r.jsxs)("div",{children:[(0,r.jsx)(d.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)(h.iA,{className:"min-w-full",children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>B("status"),children:["Status",q("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>B("cluster"),children:["Cluster",q("cluster")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden sm:table-cell",onClick:()=>B("user"),children:["User",q("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden md:table-cell",onClick:()=>B("workspace"),children:["Workspace",q("workspace")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden lg:table-cell",onClick:()=>B("infra"),children:["Infra",q("infra")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden xl:table-cell",onClick:()=>B("resources_str"),children:["Resources",q("resources_str")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>B("time"),children:["Started",q("time")]}),p&&(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden lg:table-cell",onClick:()=>B("duration"),children:["Duration",q("duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden md:table-cell",onClick:()=>B("autostop"),children:["Autostop",q("autostop")]}),(0,r.jsx)(h.ss,{className:"sticky right-0 bg-white",children:"Actions"})]})}),(0,r.jsx)(h.RM,{children:N&&M?(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(n.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):X.length>0?X.map((e,s)=>(0,r.jsxs)(h.SC,{children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(y.OE,{status:e.status})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(o(),{href:"/clusters/".concat(e.isHistorical?e.cluster_hash:e.cluster||e.name),className:"text-blue-600",children:e.cluster||e.name})}),(0,r.jsx)(h.pj,{className:"hidden sm:table-cell",children:(0,r.jsx)(L.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(h.pj,{className:"hidden md:table-cell",children:(0,r.jsx)(o(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(h.pj,{className:"hidden lg:table-cell",children:(0,r.jsx)(c.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(o(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})})}),(0,r.jsx)(h.pj,{className:"hidden xl:table-cell",children:(0,r.jsx)(c.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(c.Zg,{date:e.time})}),p&&(0,r.jsx)(h.pj,{className:"hidden lg:table-cell",children:O(e.duration)}),(0,r.jsx)(h.pj,{className:"hidden md:table-cell",children:e.isHistorical?"-":I(e.autostop,e.to_down)}),(0,r.jsx)(h.pj,{className:"text-left sticky right-0 bg-white",children:!e.isHistorical&&(0,r.jsx)(A,{cluster:e.cluster,status:e.status,onOpenSSHModal:m,onOpenVSCodeModal:j})})]},s)):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:p?"No clusters found":"No active clusters"})})})]})})}),g.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:H,onChange:e=>{F(parseInt(e.target.value,10)),_(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsx)("div",{children:"".concat(P+1," - ").concat(Math.min(U,Z.length)," of ").concat(Z.length)}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(u.z,{variant:"ghost",size:"icon",onClick:()=>{_(e=>Math.max(e-1,1))},disabled:1===E,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(u.z,{variant:"ghost",size:"icon",onClick:()=>{_(e=>Math.min(e+1,D))},disabled:E===D||0===D,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}let H=(e,s)=>{s&&s(e)},F=(e,s)=>{s?s(e):window.open("ssh://".concat(e))},V=e=>"RUNNING"===e?["connect","VSCode"]:[],W={connect:(0,r.jsx)(g,{className:"w-4 h-4 text-gray-500 inline-block"}),VSCode:(0,r.jsx)(b,{className:"w-4 h-4 text-gray-500 inline-block"})};function A(e){let{withLabel:s=!1,cluster:t,status:l,onOpenSSHModal:a,onOpenVSCodeModal:n}=e,i=V(l),o=(0,k.X)(),u=e=>{switch(e){case"connect":F(t,a);break;case"VSCode":H(t,n);break;default:return}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center space-x-4",children:Object.entries(W).map(e=>{let t,l,[a,n]=e;switch(a){case"connect":t="Connect",l="Connect with SSH";break;case"VSCode":t="VSCode",l="Open in VS Code"}return(s||(t=""),i.includes(a))?(0,r.jsx)(c.WH,{content:l,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:()=>u(a),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[n,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},a):(0,r.jsx)(c.WH,{content:l,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("span",{className:"opacity-30 flex items-center cursor-not-allowed text-sm",title:a,children:[n,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},a)})})})}let z=e=>{let{propertyList:s=[],valueList:t,setFilters:a,updateURLParams:n,placeholder:c="Filter clusters"}=e,i=(0,l.useRef)(null),[o,u]=(0,l.useState)(!1),[d,h]=(0,l.useState)(""),[x,p]=(0,l.useState)("status"),[m,f]=(0,l.useState)([]),j=[];(0,l.useEffect)(()=>{let e=[];switch(x){case"status":e=t.status;break;case"user":e=t.user;break;case"cluster":e=t.cluster;break;case"workspace":e=t.workspace;break;case"infra":e=t.infra}f(e=e.filter(e=>e.includes(d.toLowerCase())))},[x,t,d]);let v=e=>{let t=s.find(s=>s.value===e);return t?t.label:e},g=e=>{h(e.target.value)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"flex flex-row ml-4 mr-2 border border-gray-300 rounded-md overflow-hidden",children:[(0,r.jsx)("div",{className:"border-r border-gray-300",children:(0,r.jsxs)(N.Ph,{onValueChange:e=>p(e),value:x,children:[(0,r.jsx)(N.i4,{"aria-label":"Node",className:"focus:ring-0 focus:ring-offset-0 border-none rounded-none w-32 h-8",children:(0,r.jsx)(N.ki,{placeholder:"Select Property"})}),(0,r.jsx)(N.Bw,{children:s.map((e,s)=>(0,r.jsx)(N.Ql,{value:e.value,children:e.label},"property-item-".concat(s)))})]})}),(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",ref:i,placeholder:c,value:d,onChange:e=>g(e),onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:e=>{"Enter"===e.key&&""!==d&&(a(e=>{let s=[...e,{property:v(x),operator:":",value:d}];return n(s),s}),h(""),u(!1),i.current.blur())},className:"h-8 w-32 sm:w-96 px-3 pr-8 text-sm border-none rounded-none focus:ring-0 focus:outline-none",autoComplete:"off"}),d&&(0,r.jsx)("button",{onClick:()=>{h("")},className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",tabIndex:-1,children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),o&&m.length>0&&(0,r.jsx)("div",{className:"flex flex-col absolute z-10 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg",children:m.map((e,s)=>(0,r.jsx)("div",{className:"flex flex-col pl-7 py-2 cursor-pointer hover:bg-sky-50 text-sm ".concat(s!=j.length-1," && border-b"),onMouseDown:s=>{s.preventDefault(),a(s=>{let t=[...s,{property:v(x),operator:"=",value:e}];return n(t),t}),u(!1),h(""),i.current.blur()},children:(0,r.jsx)("span",{className:"text-sm text-gray-600",children:e})},e))})]})]})})},Z=e=>{let{filters:s=[],setFilters:t,updateURLParams:l}=e,a=e=>{t(s=>{let t=s.filter((s,t)=>t!==e);return l(t),t})};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center gap-4 py-1 px-2",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-content gap-2",children:[s.map((e,s)=>(0,r.jsx)(B,{filter:e,onRemove:()=>a(s)},"filteritem-".concat(s))),s.length>0&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("button",{onClick:()=>{l([]),t([])},className:"rounded-full px-4 py-1 text-sm text-gray-700 bg-gray-200 hover:bg-gray-300",children:"Clear filters"})})]})})})},B=e=>{let{filter:s,onRemove:t}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"flex items-center gap-1 text-blue-600 bg-blue-100 px-1 py-1 rounded-full text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 rounded-l-lg",children:[(0,r.jsx)("span",{children:"".concat(s.property," ")}),(0,r.jsx)("span",{children:"".concat(s.operator," ")}),(0,r.jsx)("span",{children:" ".concat(s.value)})]}),(0,r.jsx)("button",{onClick:()=>t(),className:"p-0.5 transform text-gray-400 hover:text-gray-600 bg-blue-500 hover:bg-blue-600 rounded-full flex flex-col items-center",title:"Clear filter",children:(0,r.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"white",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:5,d:"M6 18L18 6M6 6l12 12"})})})]})})}},1163:function(e,s,t){e.exports=t(6036)},2003:function(e,s,t){"use strict";t.d(s,{j:function(){return n}});var r=t(512);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=r.W,n=(e,s)=>t=>{var r;if((null==s?void 0:s.variants)==null)return a(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:n,defaultVariants:c}=s,i=Object.keys(n).map(e=>{let s=null==t?void 0:t[e],r=null==c?void 0:c[e];if(null===s)return null;let a=l(s)||l(r);return n[e][a]}),o=t&&Object.entries(t).reduce((e,s)=>{let[t,r]=s;return void 0===r||(e[t]=r),e},{});return a(e,i,null==s?void 0:null===(r=s.compoundVariants)||void 0===r?void 0:r.reduce((e,s)=>{let{class:t,className:r,...l}=s;return Object.entries(l).every(e=>{let[s,t]=e;return Array.isArray(t)?t.includes({...c,...o}[s]):({...c,...o})[s]===t})?[...e,t,r]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6601],{9307:function(e,s,t){t.d(s,{Cl:function(){return l},OE:function(){return d}});var r=t(5893);t(7294);var n=t(5739),a=t(6989),c=t(3850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":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":case"READY":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"}},i=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(n.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,r.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.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":case"READY":return(0,r.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},o=e=>{let s=l(e),t=i(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(s),children:[t,e]})},d=e=>{let{status:s}=e;return(0,r.jsx)(a.WH,{content:s,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:o(s)})})}},546:function(e,s,t){t.d(s,{H:function(){return d}});var r=t(5893);t(7294);var n=t(1664),a=t.n(n),c=t(5697),l=t.n(c);function i(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let o=()=>(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:s,userHash:t,className:n="flex items-center gap-1",linkClassName:c="text-gray-700 hover:text-blue-600 hover:underline",showBadge:l=!0}=e,d=i(t),u=i(t)?"/users?tab=service-accounts":"/users";return(0,r.jsxs)("div",{className:n,children:[(0,r.jsx)(a(),{href:u,className:c,children:s}),l&&d&&(0,r.jsx)(o,{})]})};d.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},9284:function(e,s,t){t.d(s,{Oh:function(){return m},_R:function(){return x},cV:function(){return h}});var r=t(5893),n=t(7294),a=t(326),c=t(803),l=t(7673),i=t(8671),o=t(6989),d=t(3225),u=t(3001);function m(e){let{isOpen:s,onClose:t,cluster:d}=e,[u,m]=n.useState(!1),x=e=>{navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)},h=["sky status ".concat(d),"ssh ".concat(d)],f=h.join("\n");return(0,r.jsx)(a.Vq,{open:s,onOpenChange:t,children:(0,r.jsxs)(a.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(a.fK,{children:[(0,r.jsxs)(a.$N,{children:["Connect to: ",(0,r.jsx)("span",{className:"font-light",children:d})]}),(0,r.jsx)(a.Be,{children:"Use these instructions to connect to your cluster via SSH."})]}),(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"SSH Command"}),(0,r.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm w-full whitespace-pre-wrap",children:h.map((e,s)=>(0,r.jsx)("code",{className:"block",children:e},s))}),(0,r.jsx)(o.WH,{content:u?"Copied!":"Copy command",children:(0,r.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>x(f),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Additional Information"}),(0,r.jsxs)("p",{className:"text-sm text-secondary-foreground",children:["Make sure to run"," ",(0,r.jsxs)("code",{className:"text-sm",children:["sky status ",d]})," first to have SkyPilot set up the SSH access."]})]})]})]})})}function x(e){let{isOpen:s,onClose:t,cluster:n}=e,m=(0,u.X)();return(0,r.jsx)(a.Vq,{open:s,onOpenChange:t,children:(0,r.jsx)(a.cZ,{className:"sm:max-w-3xl",children:(0,r.jsxs)(a.fK,{children:[(0,r.jsxs)(a.$N,{children:["Connect to: ",(0,r.jsx)("span",{className:"font-light",children:n})]}),(0,r.jsx)(a.Be,{children:(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Setup SSH access"}),(0,r.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm",children:(0,r.jsxs)("code",{children:["sky status ",n]})}),(0,r.jsx)(o.WH,{content:"Copy command",children:(0,r.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("sky status ".concat(n)),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Connect with VSCode/Cursor"}),(0,r.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm",children:(0,r.jsxs)("code",{children:["code --remote ssh-remote+",n]})}),(0,r.jsx)(o.WH,{content:"Copy command",children:(0,r.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("code --remote ssh-remote+".concat(n)),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium",children:"Or use the GUI to connect"}),(0,r.jsx)("div",{className:"relative ".concat(m?"-mt-5":"-mt-10"),style:{paddingBottom:"70%"},children:(0,r.jsxs)("video",{className:"absolute top-0 left-0 w-full h-full rounded-lg",controls:!0,autoPlay:!0,muted:!0,preload:"metadata",children:[(0,r.jsx)("source",{src:"".concat(d.GW,"/videos/cursor-small.mp4"),type:"video/mp4"}),"Your browser does not support the video tag."]})})]})]})})]})})})}function h(e){let{isOpen:s,onClose:t,onConfirm:n,title:l,message:i,confirmText:o="Confirm",confirmVariant:d="destructive",confirmClassName:u=null}=e;return(0,r.jsx)(a.Vq,{open:s,onOpenChange:t,children:(0,r.jsxs)(a.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(a.fK,{children:[(0,r.jsx)(a.$N,{children:l}),(0,r.jsx)(a.Be,{children:i})]}),(0,r.jsxs)(a.cN,{className:"flex justify-end gap-2 pt-4",children:[(0,r.jsx)(c.z,{variant:"outline",onClick:t,children:"Cancel"}),(0,r.jsx)(c.z,{variant:u?void 0:d,className:u,onClick:()=>{n(),t()},children:o})]})]})})}},8764:function(e,s,t){t.d(s,{RM:function(){return i},SC:function(){return o},iA:function(){return c},pj:function(){return u},ss:function(){return d},xD:function(){return l}});var r=t(5893),n=t(7294),a=t(2350);let c=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,a.cn)("w-full caption-bottom text-base",t),...n})})});c.displayName="Table";let l=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("thead",{ref:s,className:(0,a.cn)("[&_tr]:border-b",t),...n})});l.displayName="TableHeader";let i=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("tbody",{ref:s,className:(0,a.cn)("[&_tr:last-child]:border-0",t),...n})});i.displayName="TableBody",n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("tfoot",{ref:s,className:(0,a.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...n})}).displayName="TableFooter";let o=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("tr",{ref:s,className:(0,a.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...n})});o.displayName="TableRow";let d=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("th",{ref:s,className:(0,a.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",t),...n})});d.displayName="TableHead";let u=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("td",{ref:s,className:(0,a.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...n})});u.displayName="TableCell",n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("caption",{ref:s,className:(0,a.cn)("mt-4 text-base text-muted-foreground",t),...n})}).displayName="TableCaption"},4545:function(e,s,t){function r(e){return e.startsWith("sky-jobs-controller-")}function n(e,s,t){return null===s?e:[...e].sort((e,r)=>e[s]<r[s]?"ascending"===t?-1:1:e[s]>r[s]?"ascending"===t?1:-1:0)}t.d(s,{R0:function(){return n},Ym:function(){return r}})}}]);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6989],{8950:function(e,n,t){t.d(n,{Bw:function(){return h},Ph:function(){return d},Ql:function(){return g},i4:function(){return m},ki:function(){return u}});var a=t(5893),r=t(7294),o=t(2067),l=t(5895),s=t(7242),i=t(282),c=t(2350);let d=o.fC;o.ZA;let u=o.B4,m=r.forwardRef((e,n)=>{let{className:t,children:r,...s}=e;return(0,a.jsxs)(o.xz,{ref:n,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[r,(0,a.jsx)(o.JO,{asChild:!0,children:(0,a.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=o.xz.displayName;let f=r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.u_,{ref:n,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",t),...r,children:(0,a.jsx)(s.Z,{className:"h-4 w-4"})})});f.displayName=o.u_.displayName;let p=r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.$G,{ref:n,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",t),...r,children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})});p.displayName=o.$G.displayName;let h=r.forwardRef((e,n)=>{let{className:t,children:r,position:l="popper",...s}=e;return(0,a.jsx)(o.h_,{children:(0,a.jsxs)(o.VY,{ref:n,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:l,...s,children:[(0,a.jsx)(f,{}),(0,a.jsx)(o.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,a.jsx)(p,{})]})})});h.displayName=o.VY.displayName,r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.__,{ref:n,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...r})}).displayName=o.__.displayName;let g=r.forwardRef((e,n)=>{let{className:t,children:r,...l}=e;return(0,a.jsxs)(o.ck,{ref:n,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(o.wU,{children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(o.eT,{children:r})]})});g.displayName=o.ck.displayName,r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.Z0,{ref:n,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",t),...r})}).displayName=o.Z0.displayName},6989:function(e,n,t){t.d(n,{$B:function(){return p},LU:function(){return m},Md:function(){return u},WH:function(){return d},Zg:function(){return h},q8:function(){return f},xn:function(){return g},yc:function(){return i}});var a=t(5893),r=t(7294),o=t(3302),l=t(1886),s=t(8950);let i=t(1214).nb.REFRESH_INTERVAL,c={placement:"bottom",color:"default"},d=e=>{let{children:n,...t}=e,r=t.content;return t.content=void 0,(0,a.jsx)(o.e,{...c,...t,content:(0,a.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm capitalize rounded",children:r}),children:n})},u=e=>{let{children:n,...t}=e,r=t.content;return t.content=void 0,(0,a.jsx)(o.e,{...c,...t,content:(0,a.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm rounded",children:r}),children:n})};function m(e){if(!e&&0!==e)return"-";let n=e=Math.floor(e),t="",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(n>=e.value&&a<2){let r=Math.floor(n/e.value);t+="".concat(r).concat(e.label," "),n%=e.value,a++}return t.trim()||"0s"}function f(e){return e?(e=e.split("\n").filter(e=>!e.match(/<rich_.*?\[bold cyan\]/)&&!e.match(/<rich_.*>.*<\/rich_.*>/)&&!e.match(/├──/)&&!e.match(/└──/)).join("\n").replace(/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKH]/g,"")).split("\n").map(e=>{let n=e.match(/^([IWED])\s+(\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+([^:]+:\d+\])(.*)/);if(n){let[e,t,a,r,o]=n,l={I:"INFO",W:"WARNING",E:"ERROR",D:"DEBUG"}[t]||"";return'<span class="log-line '.concat(l,'"><span class="level">').concat(t,'</span><span class="timestamp">').concat(a,'</span><span class="location">').concat(r,'</span><span class="message">').concat(o,"</span></span>")}let t=e.match(/^(\([^)]+\))(.*)$/);if(t){let[e,n,a]=t;return'<span class="log-line"><span class="log-prefix">'.concat(n,'</span><span class="log-rest">').concat(a,"</span></span>")}return'<span class="log-line"><span class="message">'.concat(e,"</span></span>")}).join("\n"):""}function p(e){let{logs:n,controller:t=!1}=e,[o,l]=(0,r.useState)("all"),[i,c]=(0,r.useState)(n),[d,u]=(0,r.useState)([]);return(0,r.useEffect)(()=>{u(function(e){let n;let t=/\((head|worker\d+),/g,a=new Set;for(;null!==(n=t.exec(e));)a.add(n[1]);return Array.from(a).sort((e,n)=>"head"===e?-1:"head"===n?1:e.localeCompare(n,void 0,{numeric:!0,sensitivity:"base"}))}(n))},[n]),(0,r.useEffect)(()=>{"all"===o?c(n):c(n.split("\n").filter(e=>e.includes("(".concat(o,","))).join("\n"))},[o,n]),(0,a.jsxs)("div",{children:[(0,a.jsx)("style",{children:'\n .logs-container {\n background-color: #f7f7f7;\n padding: 16px;\n max-height: calc(100vh - 300px);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n line-height: 1.5;\n border-radius: 6px;\n min-height: fit-content;\n }\n\n .log-line {\n display: block;\n white-space: pre-wrap;\n margin: 2px 0;\n }\n\n .log-line .level {\n display: inline;\n width: 1ch;\n margin-right: 1ch;\n font-weight: bold;\n }\n\n .log-line.INFO .level {\n color: #2563eb;\n }\n\n .log-line.WARNING .level {\n color: #d97706;\n }\n\n .log-line.ERROR .level {\n color: #dc2626;\n }\n\n .log-line.DEBUG .level {\n color: #6b7280;\n }\n\n .log-line .timestamp {\n color: #059669;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .location {\n color: #6366f1;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .message {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n\n .log-line .log-prefix {\n color: #6366f1;\n font-weight: 500;\n }\n\n .log-line .log-rest {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n'}),!t&&(0,a.jsx)("div",{style:{marginBottom:"1rem"},children:(0,a.jsxs)(s.Ph,{onValueChange:e=>l(e),value:o,children:[(0,a.jsx)(s.i4,{"aria-label":"Node",className:"focus:ring-0 focus:ring-offset-0",children:(0,a.jsx)(s.ki,{placeholder:"Select Node"})}),(0,a.jsxs)(s.Bw,{children:[(0,a.jsx)(s.Ql,{value:"all",children:"All Nodes"}),d.map(e=>(0,a.jsx)(s.Ql,{value:e,children:e},e))]})]})}),(0,a.jsx)("div",{className:"logs-container",dangerouslySetInnerHTML:{__html:i}})]})}function h(e){let n,{date:t}=e;if(!t)return"N/A";let r=new Date,o=t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0"),s=t.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"});return n=function(e){if(!e||"string"!=typeof e)return e;if("just now"===e)return"now";if("less than a minute ago"===e.toLowerCase())return"Less than 1m ago";let n=e.match(/^about\s+(\d+)\s+(\w+)\s+ago$/i);if(n){let e=n[1],t=n[2],a={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(a[t])return"".concat(e).concat(a[t]," ago")}let t=e.match(/^a[n]?\s+(\w+)\s+ago$/i);if(t){let e=t[1],n={second:"s",minute:"m",hour:"h",day:"d",month:"mo",year:"yr"};if(n[e])return"1".concat(n[e]," ago")}let a=e.match(/^(\d+)\s+(\w+)\s+ago$/i);if(a){let e=a[1],n=a[2],t={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(t[n])return"".concat(e).concat(t[n]," ago")}return e}((0,l.B)(t,r,{addSuffix:!0})),(0,a.jsx)(d,{content:o+"
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6989],{8950:function(e,n,t){t.d(n,{Bw:function(){return h},Ph:function(){return d},Ql:function(){return g},i4:function(){return m},ki:function(){return u}});var a=t(5893),r=t(7294),o=t(2067),l=t(5895),s=t(7242),i=t(282),c=t(2350);let d=o.fC;o.ZA;let u=o.B4,m=r.forwardRef((e,n)=>{let{className:t,children:r,...s}=e;return(0,a.jsxs)(o.xz,{ref:n,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[r,(0,a.jsx)(o.JO,{asChild:!0,children:(0,a.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=o.xz.displayName;let f=r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.u_,{ref:n,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",t),...r,children:(0,a.jsx)(s.Z,{className:"h-4 w-4"})})});f.displayName=o.u_.displayName;let p=r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.$G,{ref:n,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",t),...r,children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})});p.displayName=o.$G.displayName;let h=r.forwardRef((e,n)=>{let{className:t,children:r,position:l="popper",...s}=e;return(0,a.jsx)(o.h_,{children:(0,a.jsxs)(o.VY,{ref:n,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:l,...s,children:[(0,a.jsx)(f,{}),(0,a.jsx)(o.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,a.jsx)(p,{})]})})});h.displayName=o.VY.displayName,r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.__,{ref:n,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...r})}).displayName=o.__.displayName;let g=r.forwardRef((e,n)=>{let{className:t,children:r,...l}=e;return(0,a.jsxs)(o.ck,{ref:n,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(o.wU,{children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(o.eT,{children:r})]})});g.displayName=o.ck.displayName,r.forwardRef((e,n)=>{let{className:t,...r}=e;return(0,a.jsx)(o.Z0,{ref:n,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",t),...r})}).displayName=o.Z0.displayName},6989:function(e,n,t){t.d(n,{$B:function(){return p},LU:function(){return m},Md:function(){return u},WH:function(){return d},Zg:function(){return h},q8:function(){return f},xn:function(){return g},yc:function(){return i}});var a=t(5893),r=t(7294),o=t(3302),l=t(1886),s=t(8950);let i=t(1214).nb.REFRESH_INTERVAL,c={placement:"bottom",color:"default"},d=e=>{let{children:n,...t}=e,r=t.content;return t.content=void 0,(0,a.jsx)(o.e,{...c,...t,content:(0,a.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm capitalize rounded",children:r}),children:n})},u=e=>{let{children:n,...t}=e,r=t.content;return t.content=void 0,(0,a.jsx)(o.e,{...c,...t,content:(0,a.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm rounded",children:r}),children:n})};function m(e){if(!e&&0!==e)return"-";let n=e=Math.floor(e),t="",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(n>=e.value&&a<2){let r=Math.floor(n/e.value);t+="".concat(r).concat(e.label," "),n%=e.value,a++}return t.trim()||"0s"}function f(e){return e?(e=e.split("\n").filter(e=>!e.match(/<rich_.*?\[bold cyan\]/)&&!e.match(/<rich_.*>.*<\/rich_.*>/)&&!e.match(/├──/)&&!e.match(/└──/)).join("\n").replace(/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKH]/g,"")).split("\n").map(e=>{let n=e.match(/^([IWED])\s+(\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+([^:]+:\d+\])(.*)/);if(n){let[e,t,a,r,o]=n,l={I:"INFO",W:"WARNING",E:"ERROR",D:"DEBUG"}[t]||"";return'<span class="log-line '.concat(l,'"><span class="level">').concat(t,'</span><span class="timestamp">').concat(a,'</span><span class="location">').concat(r,'</span><span class="message">').concat(o,"</span></span>")}let t=e.match(/^(\([^)]+\))(.*)$/);if(t){let[e,n,a]=t;return'<span class="log-line"><span class="log-prefix">'.concat(n,'</span><span class="log-rest">').concat(a,"</span></span>")}return'<span class="log-line"><span class="message">'.concat(e,"</span></span>")}).join("\n"):""}function p(e){let{logs:n,controller:t=!1}=e,[o,l]=(0,r.useState)("all"),[i,c]=(0,r.useState)(n),[d,u]=(0,r.useState)([]);return(0,r.useEffect)(()=>{u(function(e){let n;let t=/\((head|worker\d+),/g,a=new Set;for(;null!==(n=t.exec(e));)a.add(n[1]);return Array.from(a).sort((e,n)=>"head"===e?-1:"head"===n?1:e.localeCompare(n,void 0,{numeric:!0,sensitivity:"base"}))}(n))},[n]),(0,r.useEffect)(()=>{"all"===o?c(n):c(n.split("\n").filter(e=>e.includes("(".concat(o,","))).join("\n"))},[o,n]),(0,a.jsxs)("div",{children:[(0,a.jsx)("style",{children:'\n .logs-container {\n background-color: #f7f7f7;\n padding: 16px;\n max-height: calc(100vh - 300px);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n line-height: 1.5;\n border-radius: 6px;\n min-height: fit-content;\n }\n\n .log-line {\n display: block;\n white-space: pre-wrap;\n margin: 2px 0;\n }\n\n .log-line .level {\n display: inline;\n width: 1ch;\n margin-right: 1ch;\n font-weight: bold;\n }\n\n .log-line.INFO .level {\n color: #2563eb;\n }\n\n .log-line.WARNING .level {\n color: #d97706;\n }\n\n .log-line.ERROR .level {\n color: #dc2626;\n }\n\n .log-line.DEBUG .level {\n color: #6b7280;\n }\n\n .log-line .timestamp {\n color: #059669;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .location {\n color: #6366f1;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .message {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n\n .log-line .log-prefix {\n color: #6366f1;\n font-weight: 500;\n }\n\n .log-line .log-rest {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n'}),!t&&(0,a.jsx)("div",{style:{marginBottom:"1rem"},children:(0,a.jsxs)(s.Ph,{onValueChange:e=>l(e),value:o,children:[(0,a.jsx)(s.i4,{"aria-label":"Node",className:"focus:ring-0 focus:ring-offset-0",children:(0,a.jsx)(s.ki,{placeholder:"Select Node"})}),(0,a.jsxs)(s.Bw,{children:[(0,a.jsx)(s.Ql,{value:"all",children:"All Nodes"}),d.map(e=>(0,a.jsx)(s.Ql,{value:e,children:e},e))]})]})}),(0,a.jsx)("div",{className:"logs-container",dangerouslySetInnerHTML:{__html:i}})]})}function h(e){let n,{date:t}=e;if(!t)return"N/A";let r=new Date,o=t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0"),s=t.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"});return n=function(e){if(!e||"string"!=typeof e)return e;if("just now"===e)return"now";if("less than a minute ago"===e.toLowerCase())return"Less than 1m ago";let n=e.match(/^about\s+(\d+)\s+(\w+)\s+ago$/i);if(n){let e=n[1],t=n[2],a={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(a[t])return"".concat(e).concat(a[t]," ago")}let t=e.match(/^a[n]?\s+(\w+)\s+ago$/i);if(t){let e=t[1],n={second:"s",minute:"m",hour:"h",day:"d",month:"mo",year:"yr"};if(n[e])return"1".concat(n[e]," ago")}let a=e.match(/^(\d+)\s+(\w+)\s+ago$/i);if(a){let e=a[1],n=a[2],t={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(t[n])return"".concat(e).concat(t[n]," ago")}return e}((0,l.B)(t,r,{addSuffix:!0})),(0,a.jsx)(d,{content:o+" "+s,className:"text-sm text-muted-foreground",children:(0,a.jsx)("span",{className:"border-b border-dotted border-gray-400 cursor-help",children:n})})}function g(e){return e?e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")+" "+e.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"}):"N/A"}},1214:function(e,n,t){t.d(n,{MO:function(){return o},ej:function(){return a},nb:function(){return r}});let a={DEFAULT_TTL:12e4},r={REFRESH_INTERVAL:3e4,GPU_REFRESH_INTERVAL:3e4},o={NAME_TRUNCATE_LENGTH:20}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[938],{938:function(e,s,t){t.r(s),t.d(s,{ClusterJobs:function(){return W},ManagedJobs:function(){return U},ManagedJobsTable:function(){return q},Status2Actions:function(){return z},filterJobsByName:function(){return M},filterJobsByUser:function(){return D},filterJobsByWorkspace:function(){return A},statusGroups:function(){return _}});var r=t(5893),n=t(7294),a=t(1163),l=t(1664),i=t.n(l),c=t(5739),o=t(803),d=t(7673),u=t(8764),h=t(6989),x=t(8969),m=t(3266),j=t(7324),p=t(3081);t(9470);var f=t(3626),g=t(3293),b=t(6521),w=t(3610),N=t(9284),y=t(4545),v=t(9307),k=t(546),C=t(3001),S=t(8950),L=t(6378),E=t(6856);let _={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},I="__ALL_WORKSPACES__",R="__ALL_USERS__";function M(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.name||"").toLowerCase().includes(t))}function A(e,s){return s&&s!==I?e.filter(e=>(e.workspace||"default").toLowerCase()===s.toLowerCase()):e}function D(e,s){return s&&s!==R?e.filter(e=>(e.user_hash||e.user)===s):e}let O=(e,s)=>{if(e&&e.includes("@")){let t=e.split("@")[0];return s&&s!==t?"".concat(t," (").concat(s,")"):t}let t=e||s||"N/A";return s&&s!==t?"".concat(t," (").concat(s,")"):t},F=e=>{if(!e)return"-";let s=e instanceof Date?e:new Date(1e3*e);return(0,r.jsx)(h.Zg,{date:s})};function U(){var e;let s=(0,a.useRouter)(),[t,l]=(0,n.useState)(!1),o=n.useRef(null),[d,u]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),m=(0,C.X)(),[g,b]=(0,n.useState)(I),[w,y]=(0,n.useState)(R),[v,k]=(0,n.useState)(""),[_,M]=(0,n.useState)([]),[A,D]=(0,n.useState)([]);(0,n.useEffect)(()=>{s.isReady&&(s.query.workspace&&b(Array.isArray(s.query.workspace)?s.query.workspace[0]:s.query.workspace),s.query.user&&y(Array.isArray(s.query.user)?s.query.user[0]:s.query.user),s.query.name&&k(Array.isArray(s.query.name)?s.query.name[0]:s.query.name))},[s.isReady,s.query.workspace,s.query.user,s.query.name]);let F=(e,t,r)=>{let n={...s.query};e&&e!==I?n.workspace=e:delete n.workspace,t&&t!==R?n.user=t:delete n.user,r&&""!==r.trim()?n.name=r.trim():delete n.name,s.replace({pathname:s.pathname,query:n},void 0,{shallow:!0})},U=e=>{k(e),F(g,w,e)};return(0,n.useEffect)(()=>{(async()=>{try{await E.ZP.preloadForPage("jobs");let e=await L.default.get(j.fX),s=Object.keys(e),t=(await L.default.get(x.getManagedJobs,[{allUsers:!0}])).jobs||[],r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],n=new Set(s);r.forEach(e=>n.add(e)),M(Array.from(n).sort());let a=await L.default.get(p.R),l=[...new Set(t.map(e=>({userId:e.user_hash||e.user,username:e.user})).filter(e=>e.userId)).values()],i=new Map;a.forEach(e=>{i.set(e.userId,{userId:e.userId,username:e.username,display:O(e.username,e.userId)})}),l.forEach(e=>{i.has(e.userId)||i.set(e.userId,{userId:e.userId,username:e.username,display:O(e.username,e.userId)})}),D(Array.from(i.values()).sort((e,s)=>e.display.localeCompare(s.display)))}catch(e){console.error("Error fetching data for filters:",e),M(["default"]),D([])}})()},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(i(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"}),(0,r.jsxs)("div",{className:"relative ml-4 mr-2",children:[(0,r.jsx)("input",{type:"text",placeholder:"Filter by job name",value:v,onChange:e=>U(e.target.value),className:"h-8 w-48 px-3 pr-8 text-sm border border-gray-300 rounded-md focus:ring-1 focus:ring-sky-500 focus:border-sky-500 outline-none"}),v&&(0,r.jsx)("button",{onClick:()=>U(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsxs)(S.Ph,{value:g,onValueChange:e=>{b(e),F(e,w,v)},children:[(0,r.jsx)(S.i4,{className:"h-8 w-48 ml-2 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(S.ki,{placeholder:"Filter by workspace...",children:g===I?"All Workspaces":g})}),(0,r.jsxs)(S.Bw,{children:[(0,r.jsx)(S.Ql,{value:I,children:"All Workspaces"}),_.map(e=>(0,r.jsx)(S.Ql,{value:e,children:e},e))]})]}),(0,r.jsxs)(S.Ph,{value:w,onValueChange:e=>{y(e),F(g,e,v)},children:[(0,r.jsx)(S.i4,{className:"h-8 w-48 ml-2 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(S.ki,{placeholder:"Filter by user...",children:w===R?"All Users":(null===(e=A.find(e=>e.userId===w))||void 0===e?void 0:e.display)||w})}),(0,r.jsxs)(S.Bw,{children:[(0,r.jsx)(S.Ql,{value:R,children:"All Users"}),A.map(e=>(0,r.jsx)(S.Ql,{value:e.userId,children:e.display},e.userId))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(c.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,r.jsxs)("button",{onClick:()=>{L.default.invalidate(x.getManagedJobs,[{allUsers:!0}]),L.default.invalidate(j.fX),L.default.invalidate(p.R),o.current&&o.current()},disabled:t,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",title:"Refresh",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!m&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(q,{refreshInterval:h.yc,setLoading:l,refreshDataRef:o,workspaceFilter:g,userFilter:w,nameFilter:v}),(0,r.jsx)(N.cV,{isOpen:d.isOpen,onClose:()=>u({...d,isOpen:!1}),onConfirm:d.onConfirm,title:d.title,message:d.message})]})}function q(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a,workspaceFilter:l,userFilter:j,nameFilter:p}=e,[f,b]=(0,n.useState)([]),[w,C]=(0,n.useState)({key:null,direction:"ascending"}),[S,E]=(0,n.useState)(!1),[I,R]=(0,n.useState)(!0),[O,U]=(0,n.useState)(1),[q,W]=(0,n.useState)(10),[Z,B]=(0,n.useState)(null),T=(0,n.useRef)(null),[H,G]=(0,n.useState)([]),[V,Q]=(0,n.useState)({}),[X,K]=(0,n.useState)(!1),[Y,$]=(0,n.useState)(!1),[ee,es]=(0,n.useState)(!1),[et,er]=(0,n.useState)("all"),[en,ea]=(0,n.useState)(!0),[el,ei]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),ec=async()=>{ei({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller?",onConfirm:async()=>{try{es(!0),E(!0),await (0,x.Ce)("restartcontroller"),await eo()}catch(e){console.error("Error restarting controller:",e)}finally{es(!1),E(!1)}}})},eo=n.useCallback(async()=>{E(!0),t(!0);try{let[e,s]=await Promise.all([L.default.get(x.getManagedJobs,[{allUsers:!0}]),L.default.get(m.getClusters)]),{jobs:t=[],controllerStopped:r=!1}=e||{},n=null==s?void 0:s.find(e=>(0,y.Ym)(e.cluster)),a=n?n.status:"NOT_FOUND",l=!1;"STOPPED"==a&&r&&(l=!0),"LAUNCHING"==a?$(!0):$(!1),b(t),K(l),R(!1)}catch(e){console.error("Error fetching data:",e),b([]),K(!1),R(!1)}finally{E(!1),t(!1)}},[t]);n.useEffect(()=>{a&&(a.current=eo)},[a,eo]),(0,n.useEffect)(()=>{b([]);let e=!0;eo();let t=setInterval(()=>{e&&eo()},s);return()=>{e=!1,clearInterval(t)}},[s,eo]),(0,n.useEffect)(()=>{U(1)},[et,null==f?void 0:f.length]),(0,n.useEffect)(()=>{G([]),ea(!0)},[et]);let ed=e=>{let s="ascending";w.key===e&&"ascending"===w.direction&&(s="descending"),C({key:e,direction:s})},eu=e=>w.key===e?"ascending"===w.direction?" ↑":" ↓":"";n.useMemo(()=>{let e=f||[];return{active:e.filter(e=>_.active.includes(e.status)).length,finished:e.filter(e=>_.finished.includes(e.status)).length}},[f]);let eh=e=>H.length>0?H.includes(e):"all"===et||_[et].includes(e),ex=n.useMemo(()=>{let e=A(f,l);return(e=M(e=D(e,j),p),H.length>0)?e.filter(e=>H.includes(e.status)):en?"all"===et?e:e.filter(e=>_[et].includes(e.status)):[]},[f,et,H,en,l,j,p]),em=n.useMemo(()=>w.key?[...ex].sort((e,s)=>e[w.key]<s[w.key]?"ascending"===w.direction?-1:1:e[w.key]>s[w.key]?"ascending"===w.direction?1:-1:0):ex,[ex,w]),ej=Math.ceil(em.length/q),ep=(O-1)*q,ef=ep+q,eg=em.slice(ep,ef),eb=e=>{if(H.includes(e)){let s=H.filter(s=>s!==e);0===s.length?(ea(!0),G([])):(G(s),ea(!1))}else G([...H,e]),ea(!1)};return(0,n.useEffect)(()=>{Q((f||[]).reduce((e,s)=>(e[s.status]=(e[s.status]||0)+1,e),{}))},[f]),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"flex flex-col space-y-1 mb-1",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center text-sm mb-1",children:[(0,r.jsx)("span",{className:"mr-2 text-sm font-medium",children:"Statuses:"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[!S&&(!f||0===f.length)&&!I&&(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(V).map(e=>{let[s,t]=e;return(0,r.jsxs)("button",{onClick:()=>eb(s),className:"px-3 py-0.5 rounded-full flex items-center space-x-2 ".concat(eh(s)||H.includes(s)?(0,v.Cl)(s):"bg-gray-50 text-gray-600 hover:bg-gray-100"),children:[(0,r.jsx)("span",{children:s}),(0,r.jsx)("span",{className:"text-xs ".concat(eh(s)||H.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),f&&f.length>0&&(0,r.jsxs)("div",{className:"flex items-center ml-2 gap-2",children:[(0,r.jsx)("span",{className:"text-gray-500",children:"("}),(0,r.jsx)("button",{onClick:()=>{er("all"),G([]),ea(!0)},className:"text-sm font-medium ".concat("all"===et&&en?"text-purple-700 underline":"text-gray-600 hover:text-purple-700 hover:underline"),children:"show all jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{er("active"),G([]),ea(!0)},className:"text-sm font-medium ".concat("active"===et&&en?"text-green-700 underline":"text-gray-600 hover:text-green-700 hover:underline"),children:"show all active jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{er("finished"),G([]),ea(!0)},className:"text-sm font-medium ".concat("finished"===et&&en?"text-blue-700 underline":"text-gray-600 hover:text-blue-700 hover:underline"),children:"show all finished jobs"}),(0,r.jsx)("span",{className:"text-gray-500",children:")"})]})]})]})}),(0,r.jsx)(d.Zb,{children:(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("id"),children:["ID",eu("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("name"),children:["Name",eu("name")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("user"),children:["User",eu("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("workspace"),children:["Workspace",eu("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("submitted_at"),children:["Submitted",eu("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("job_duration"),children:["Duration",eu("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("status"),children:["Status",eu("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("resources_str"),children:["Requested",eu("resources_str")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("infra"),children:["Infra",eu("infra")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("cluster"),children:["Resources",eu("cluster")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("recoveries"),children:["Recoveries",eu("recoveries")]}),(0,r.jsx)(u.ss,{children:"Details"}),(0,r.jsx)(u.ss,{children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:S||I?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:12,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):eg.length>0?(0,r.jsx)(r.Fragment,{children:eg.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(k.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:F(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.requested_resources}),(0,r.jsx)(u.pj,{children:e.infra&&"-"!==e.infra?(0,r.jsx)(h.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(i(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud||e.infra.split("(")[0].trim()}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})}):(0,r.jsx)("span",{children:e.infra||"-"})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(h.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(u.pj,{children:e.recoveries}),(0,r.jsx)(u.pj,{children:e.details?(0,r.jsx)(P,{text:e.details,rowId:e.id,expandedRowId:Z,setExpandedRowId:B}):"-"}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(z,{jobParent:"/jobs",jobId:e.id,managed:!0})})]}),Z===e.id&&(0,r.jsx)(J,{text:e.details,colSpan:12,innerRef:T})]},e.id))}):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:12,className:"text-center py-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[Y&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. It will be ready shortly."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!X&&!Y&&(0,r.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),X&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller has been stopped. Restart to check the latest job status."}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:ec,className:"text-sky-blue hover:text-sky-blue-bright",disabled:S||ee,children:ee?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})}),em&&em.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:q,onChange:e=>{W(parseInt(e.target.value,10)),U(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[ep+1," – ",Math.min(ef,em.length)," of"," ",em.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{U(e=>Math.max(e-1,1))},disabled:1===O,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{U(e=>Math.min(e+1,ej))},disabled:O===ej||0===ej,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})}),(0,r.jsx)(N.cV,{isOpen:el.isOpen,onClose:()=>ei({...el,isOpen:!1}),onConfirm:el.onConfirm,title:el.title,message:el.message,confirmClassName:"bg-blue-600 hover:bg-blue-700 text-white"})]})}function z(e){let{withLabel:s=!1,jobParent:t,jobId:n,managed:l}=e,i=(0,a.useRouter)(),c=(e,s)=>{e.preventDefault(),e.stopPropagation(),i.push({pathname:"".concat(t,"/").concat(n),query:{tab:s}})};return(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(h.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>c(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(b.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),l&&(0,r.jsx)(h.WH,{content:"View Controller Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>c(e,"controllerlogs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(w.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-2",children:"Controller Logs"})]})},"controllerlogs")]})}function W(e){let{clusterName:s,clusterJobData:t,loading:a,refreshClusterJobsOnly:l,userFilter:x=null,nameFilter:m=null}=e,[j,p]=(0,n.useState)(null),[g,b]=(0,n.useState)({key:null,direction:"ascending"}),[w,N]=(0,n.useState)(1),[y,C]=(0,n.useState)(10),S=(0,n.useRef)(null),[L,E]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{j&&S.current&&!S.current.contains(e.target)&&p(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[j]);let _=n.useMemo(()=>{let e=t||[];return x&&x!==R&&(e=D(e,x)),m&&(e=M(e,m)),e},[t,x,m]);(0,n.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(L)&&E(t)},[t,L]);let I=n.useMemo(()=>g.key?[..._].sort((e,s)=>e[g.key]<s[g.key]?"ascending"===g.direction?-1:1:e[g.key]>s[g.key]?"ascending"===g.direction?1:-1:0):_,[_,g]),A=e=>{let s="ascending";g.key===e&&"ascending"===g.direction&&(s="descending"),b({key:e,direction:s})},O=e=>g.key===e?"ascending"===g.direction?" ↑":" ↓":"",U=Math.ceil(I.length/y),q=(w-1)*y,W=q+y,Z=I.slice(q,W);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)(d.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Cluster Jobs"}),(0,r.jsx)("div",{className:"flex items-center",children:l&&(0,r.jsxs)("button",{onClick:l,disabled:a,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center text-sm ml-2",children:[(0,r.jsx)(f.Z,{className:"w-4 h-4 mr-1"}),"Refresh Jobs"]})})]}),(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("id"),children:["ID",O("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("job"),children:["Name",O("job")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("user"),children:["User",O("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("workspace"),children:["Workspace",O("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("submitted_at"),children:["Submitted",O("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("job_duration"),children:["Duration",O("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("status"),children:["Status",O("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("resources"),children:["Resources",O("resources")]}),(0,r.jsx)(u.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:a?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:9,className:"text-center py-12 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading cluster jobs..."})]})})}):Z.length>0?Z.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(u.SC,{className:j===e.id?"selected-row":"",children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,r.jsx)(P,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:j,setExpandedRowId:p})})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(k.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:F(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.resources}),(0,r.jsx)(u.pj,{className:"flex content-center items-center",children:(0,r.jsx)(z,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1})})]}),j===e.id&&(0,r.jsx)(J,{text:e.job||"Unnamed job",colSpan:9,innerRef:S})]},e.id)):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),I&&I.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:y,onChange:e=>{C(parseInt(e.target.value,10)),N(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:5,children:"5"}),(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:20,children:"20"}),(0,r.jsx)("option",{value:50,children:"50"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[q+1," – ",Math.min(W,I.length)," of"," ",I.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{N(e=>Math.max(e-1,1))},disabled:1===w,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{N(e=>Math.min(e+1,U))},disabled:w===U||0===U,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function J(e){let{text:s,colSpan:t,innerRef:n}=e;return(0,r.jsx)(u.SC,{className:"expanded-details",children:(0,r.jsx)(u.pj,{colSpan:t,children:(0,r.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:n,children:(0,r.jsx)("div",{className:"flex justify-between items-start",children:(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Full Details"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-700",style:{whiteSpace:"pre-wrap"},children:s})]})})})})})}function P(e){let{text:s,rowId:t,expandedRowId:a,setExpandedRowId:l}=e,i=s||"",c=i.length>50,o=a===t,d=c?"".concat(i.substring(0,50)):i,u=(0,n.useRef)(null);return(0,r.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,r.jsx)("span",{className:"truncate",children:d}),c&&(0,r.jsx)("button",{ref:u,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(o?null:t)},className:"text-blue-600 hover:text-blue-800 font-medium ml-1 flex-shrink-0","data-button-type":"show-more-less",children:o?"... show less":"... show more"})]})}}}]);
|
@@ -0,0 +1,6 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9826,2544],{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 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)("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 u}});var r=s(5893);s(7294);var a=s(5739),n=s(6989),c=s(3850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":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":case"READY":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)(a.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,r.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.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":case"READY":return(0,r.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=l(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]})},u=e=>{let{status:t}=e;return(0,r.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:i(t)})})}},546:function(e,t,s){"use strict";s.d(t,{H:function(){return u}});var r=s(5893);s(7294);var a=s(1664),n=s.n(a),c=s(5697),l=s.n(c);function o(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),u=e=>{let{username:t,userHash:s,className:a="flex items-center gap-1",linkClassName:c="text-gray-700 hover:text-blue-600 hover:underline",showBadge:l=!0}=e,u=o(s),d=o(s)?"/users?tab=service-accounts":"/users";return(0,r.jsxs)("div",{className:a,children:[(0,r.jsx)(n(),{href:d,className:c,children:t}),l&&u&&(0,r.jsx)(i,{})]})};u.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},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 u}});var r=s(5893),a=s(7294),n=s(5697),c=s.n(n),l=s(2350);let o=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:a})});o.displayName="Card",o.propTypes={className:c().string,children:c().node};let i=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:a})});i.displayName="CardHeader",i.propTypes={className:c().string,children:c().node};let u=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:a})});u.displayName="CardTitle",u.propTypes={className:c().string,children:c().node};let d=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...n,children:a})});d.displayName="CardDescription",d.propTypes={className:c().string,children:c().node};let h=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",s),...n,children:a})});h.displayName="CardContent",h.propTypes={className:c().string,children:c().node};let m=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",s),...n,children:a})});m.displayName="CardFooter",m.propTypes={className:c().string,children:c().node}},7145:function(e,t,s){"use strict";s.d(t,{x:function(){return a}});var r=s(3225);let a={fetch:async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",a=window.location.origin,n="".concat(a).concat(r.f4).concat(e),c=await fetch(n,{method:s,headers:"POST"===s?{"Content-Type":"application/json"}:{},body:"POST"===s?JSON.stringify(t):void 0}),l=c.headers.get("X-Skypilot-Request-ID")||c.headers.get("X-Request-ID"),o=await fetch("".concat(a).concat(r.f4,"/api/get?request_id=").concat(l)),i=await o.json();return i.return_value?JSON.parse(i.return_value):[]},post:async(e,t)=>{let s=window.location.origin,a="".concat(s).concat(r.f4).concat(e);return await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let r=(await a.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await r.read();if(e)break;let a=new TextDecoder().decode(t);s(a)}}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)}}},3266:function(e,t,s){"use strict";s.d(t,{QL:function(){return h},Sl:function(){return u},getClusters:function(){return o},uR:function(){return i}});var r=s(7294),a=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),r=s+(t-3)%2;return 0===s?e.substring(0,r)+"...":e.substring(0,r)+"..."+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 u(e){let{clusterName:t,jobId:s,onNewLog:r,workspace:c}=e;try{await n.x.stream("/logs",{follow:!1,cluster_name:t,job_id:s,override_skypilot_config:{active_workspace:c||"default"}},r)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,a.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function d(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 r=e.end_at?e.end_at:Date.now()/1e3,a=0,n=0;return e.submitted_at&&(a=r-e.submitted_at),e.start_at&&(n=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:a,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,[a,n]=(0,r.useState)(null),[l,i]=(0,r.useState)(null),[u,h]=(0,r.useState)(!0),[m,f]=(0,r.useState)(!0),x=(0,r.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,r.useCallback)(async e=>{if(t)try{f(!0);let s=await c.default.get(d,[{clusterName:t,workspace:e||"default"}]);i(s)}catch(e){console.error("Error fetching cluster job data:",e)}finally{f(!1)}},[t]),b=(0,r.useCallback)(async()=>{c.default.invalidate(o,[{clusterNames:[t]}]);let e=await x();e&&(c.default.invalidate(d,[{clusterName:t,workspace:e.workspace||"default"}]),await g(e.workspace))},[x,g,t]),N=(0,r.useCallback)(async()=>{a&&(c.default.invalidate(d,[{clusterName:t,workspace:a.workspace||"default"}]),await g(a.workspace))},[g,a,t]);return(0,r.useEffect)(()=>{(async()=>{let e=await x();e&&g(e.workspace)})()},[t,s,x,g]),{clusterData:a,clusterJobData:l,loading:u,clusterDetailsLoading:u,clusterJobsLoading:m,refreshData:b,refreshClusterJobsOnly:N}}},5821:function(e,t,s){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=document.getElementById("toast-container");r||((r=document.createElement("div")).id="toast-container",r.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(r));let a=document.createElement("div");switch(a.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":a.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":a.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":a.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:a.className+=" bg-blue-100 border-blue-500 text-blue-800"}return a.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 '),r.appendChild(a),a.querySelector("button").addEventListener("click",()=>{r.removeChild(a)}),setTimeout(()=>{r.contains(a)&&r.removeChild(a)},s),a}s.d(t,{C:function(){return r}})},6378:function(e,t,s){"use strict";s.r(t),s.d(t,{DashboardCache:function(){return a},dashboardCache:function(){return n}});let r=s(1214).ej.DEFAULT_TTL;class a{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=s.ttl||r,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<a){let s=Math.round((i-o.lastUpdated)/1e3);return this._debug("Cache HIT for ".concat(l," (age: ").concat(s,"s, TTL: ").concat(Math.round(a/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,r]of this.cache.entries()){let a=e-r.lastUpdated;t.push({key:s,age:Math.round(a/1e3),lastUpdated:new Date(r.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),r=1;r<t;r++)s[r-1]=arguments[r];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=function(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s);return t>>>0}(e.toString()),r=t.length>0?JSON.stringify(t):"";return"".concat(s,"_").concat(r)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.debugMode=!1}}let n=new a;t.default=n},2350:function(e,t,s){"use strict";s.d(t,{cn:function(){return n}});var r=s(512),a=s(8388);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.m6)((0,r.W)(t))}},190:function(e,t,s){"use strict";s.r(t),s.d(t,{JobDetailPage:function(){return p}});var r=s(5893),a=s(7294);s(9470);var n=s(7673),c=s(1664),l=s.n(c),o=s(1163),i=s(3266),u=s(6989),d=s(3626),h=s(5739),m=s(9307),f=s(3001),x=s(9008),g=s.n(x),b=s(546);function N(e){let{cluster:t,job:s,jobData:a,onRefresh:n,isRefreshing:c,loading:o}=e,i=(0,f.X)();return(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(l(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsx)(l(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsxs)(l(),{href:"/clusters/".concat(t,"/").concat(s),className:"text-sky-blue hover:underline",children:[s,a.job&&"-"!=a.job?" (".concat(a.job,")"):""]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[(o||c)&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(h.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"text-sm ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsx)(u.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.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,r.jsx)(d.Z,{className:"w-4 h-4 mr-1.5"}),!i&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]})}function p(){let e=(0,o.useRouter)(),{cluster:t,job:s}=e.query,{clusterData:c,clusterJobData:f,loading:x,refreshData:p}=(0,i.QL)({cluster:t}),[y,j]=(0,a.useState)(!1),[_,w]=(0,a.useState)(!0),[v,E]=(0,a.useState)(!1),[k,C]=(0,a.useState)([]),[D,T]=(0,a.useState)(!1),S=(0,a.useMemo)(()=>["INIT","PENDING","SETTING_UP"],[]),I=(0,a.useMemo)(()=>{if(!f||!s)return!0;let e=f.find(e=>e.id==s);return e&&S.includes(e.status)},[f,s,S]);a.useEffect(()=>{!x&&_&&w(!1)},[x,_]),(0,a.useEffect)(()=>{let e=!0;return t&&s&&!I?(E(!0),(0,i.Sl)({clusterName:t,jobId:s,onNewLog:t=>{if(e){let e=(0,u.q8)(t);C(t=>[...t,e])}},workspace:null==c?void 0:c.workspace}).then(()=>{e&&E(!1)}).catch(t=>{e&&(console.error("Error streaming logs:",t),E(!1))})):E(!1),()=>{e=!1}},[t,s,D,I,c]);let R=async()=>{j(!0),T(e=>!e),C([]);try{p&&await p()}catch(e){console.error("Error refreshing data:",e)}finally{j(!1)}};if(!e.isReady)return(0,r.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,user_hash:c.user_hash})}let A=t&&s?"Job: ".concat(s," @ ").concat(t," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g(),{children:(0,r.jsx)("title",{children:A})}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{cluster:t,job:s,jobData:L,onRefresh:R,isRefreshing:y,loading:x}),x&&_?(0,r.jsxs)("div",{className:"flex items-center justify-center h-64",children:[(0,r.jsx)(h.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)("div",{id:"details",children:(0,r.jsxs)(n.Zb,{children:[(0,r.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Details"})}),(0,r.jsx)("div",{className:"p-4",children:(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"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.id})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job Name"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.job})]}),(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)(m.OE,{status:L.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:(0,r.jsx)(b.H,{username:L.user,userHash:L.user_hash})})]}),(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:L.submitted_at?(0,u.xn)(L.submitted_at):"N/A"})]}),L.resources&&(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:L.resources||"N/A"})]}),L.cluster&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(l(),{href:"/clusters/".concat(L.cluster),className:"text-sky-blue hover:underline",children:L.cluster})})]})]})})]})}),(0,r.jsx)("div",{id:"logs",className:"mt-6",children:(0,r.jsxs)(n.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)("h2",{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)(u.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{T(e=>!e),C([])},disabled:v,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(d.Z,{className:"w-4 h-4 ".concat(v?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:I?(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."})}):v?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(h.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",children:(0,r.jsx)(u.$B,{logs:k.join("")})})})]})})]})]})]})}t.default=p},9008:function(e,t,s){e.exports=s(7219)},1163:function(e,t,s){e.exports=s(6036)}},function(e){e.O(0,[616,5230,5739,1664,804,6989,3698,9470,2888,9774,179],function(){return e(e.s=4966)}),_N_E=e.O()}]);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9315,2544],{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(5739),a=s(6989),l=s(3850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":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":case"READY":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":case"IN_USE":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":case"READY":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)})})}},546:function(e,t,s){"use strict";s.d(t,{H:function(){return d}});var r=s(5893);s(7294);var n=s(1664),a=s.n(n),l=s(5697),c=s.n(l);function o(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:t,userHash:s,className:n="flex items-center gap-1",linkClassName:l="text-gray-700 hover:text-blue-600 hover:underline",showBadge:c=!0}=e,d=o(s),u=o(s)?"/users?tab=service-accounts":"/users";return(0,r.jsxs)("div",{className:n,children:[(0,r.jsx)(a(),{href:u,className:l,children:t}),c&&d&&(0,r.jsx)(i,{})]})};d.propTypes={username:c().string.isRequired,userHash:c().string,className:c().string,linkClassName:c().string,showBadge:c().bool}},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 function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",n=window.location.origin,a="".concat(n).concat(r.f4).concat(e),l=await fetch(a,{method:s,headers:"POST"===s?{"Content-Type":"application/json"}:{},body:"POST"===s?JSON.stringify(t):void 0}),c=l.headers.get("X-Skypilot-Request-ID")||l.headers.get("X-Request-ID"),o=await fetch("".concat(n).concat(r.f4,"/api/get?request_id=").concat(c)),i=await o.json();return i.return_value?JSON.parse(i.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(5739),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),v=s(546);function w(e){let{jobData:t,activeTab:s,setIsLoadingLogs:l,setIsLoadingControllerLogs:c,isLoadingLogs:i,isLoadingControllerLogs:u,refreshFlag:p}=e,[N,y]=(0,n.useState)(""),[w,E]=(0,n.useState)(""),[L,C]=(0,n.useState)(!1),[S,R]=(0,n.useState)({}),[T,I]=(0,n.useState)(!1),[k,A]=(0,n.useState)(!1),[D,_]=(0,n.useState)(0),[Z,P]=(0,n.useState)(0),[O,q]=(0,n.useState)(!1),[F,M]=(0,n.useState)(!1),[U,H]=(0,n.useState)(!1),[G,W]=(0,n.useState)(!1),Y=(0,n.useRef)(null),J=(0,n.useRef)(null),B=(0,n.useRef)(new WeakSet),z=(0,n.useRef)(null),$=(0,n.useRef)(null),V=(0,n.useRef)(""),X=(0,n.useRef)(""),K=(0,n.useRef)(null);(0,n.useRef)(0);let Q=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"request";if(e){if(B.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")),B.current.add(e);return}e.abort(),B.current.add(e),console.log("Successfully aborted ".concat(t))}catch(s){console.log("Caught error while aborting ".concat(t,":"),s.name,s.message),B.current.add(e),"AbortError"!==s.name&&"InvalidStateError"!==s.name&&console.warn("Unexpected error aborting ".concat(t,":"),s)}}},[]),ee=(0,n.useCallback)(e=>{let t="logs"===e?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}}},[]),et=["PENDING","SUBMITTED","STARTING"].includes(t.status),es=["PENDING","SUBMITTED"].includes(t.status),er=["RECOVERING"].includes(t.status),en=e=>{R(t=>({...t,[e]:!t[e]}))},ea=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),I(!0),setTimeout(()=>I(!1),2e3)}catch(e){console.error("Failed to copy YAML to clipboard:",e)}},el=async()=>{try{await navigator.clipboard.writeText(t.entrypoint),A(!0),setTimeout(()=>A(!1),2e3)}catch(e){console.error("Failed to copy command to clipboard:",e)}};(0,n.useEffect)(()=>{y(""),_(0),W(!1)},[s,t.id]),(0,n.useEffect)(()=>{E(""),P(0),W(!1)},[s,t.id]);let ec=(0,n.useCallback)((e,t)=>{("logs"===e?y:E)(e=>e+t),requestAnimationFrame(()=>{ee(e)})},[ee]),eo=(0,n.useCallback)(function(e,t,s,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a="logs"===e?Y:J;if(a.current)return console.log("Request already active for ".concat(e,", skipping...")),()=>{};let l=!0,c=new AbortController;return"logs"===e&&(et||er)?(r(!1),n&&q(!1),()=>{}):"controllerlogs"===e&&es?(r(!1),n&&M(!1),()=>{}):t?(a.current=c,r(!0),H(!0),n&&(s(""),"logs"===e?_(0):P(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?_(e=>e+s.length):P(e=>e+s.length)}}}).then(()=>{l&&(r(!1),n&&("logs"===e?q(!1):M(!1)),requestAnimationFrame(()=>{ee(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?q(!1):M(!1)))}).finally(()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(Q(c,e),a.current=null),"logs"===e?V.current="":X.current="",K.current&&(clearTimeout(K.current),K.current=null)}),()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(Q(c,"".concat(e," cleanup")),a.current=null),"logs"===e?V.current="":X.current="",K.current&&(clearTimeout(K.current),K.current=null)}):()=>{l=!1}},[et,es,er,G,Q,ee,ec]);return((0,n.useEffect)(()=>{if(Y.current&&(Q(Y.current,"logs"),Y.current=null),!et&&!er)return eo("logs",t.id,y,l)},[t.id,eo,l,et,er,Q]),(0,n.useEffect)(()=>{if(J.current&&(Q(J.current,"controller logs"),J.current=null),!es)return eo("controllerlogs",t.id,E,c)},[t.id,eo,c,es,Q]),(0,n.useEffect)(()=>{if(p>0&&"logs"===s)return Y.current&&(Q(Y.current,"logs refresh"),Y.current=null),q(!0),eo("logs",t.id,y,l,!0)},[p,s,t.id,eo,l,Q]),(0,n.useEffect)(()=>{if(p>0&&"controllerlogs"===s)return J.current&&(Q(J.current,"controller logs refresh"),J.current=null),M(!0),eo("controllerlogs",t.id,E,c,!0)},[p,s,t.id,eo,c,Q]),(0,n.useEffect)(()=>()=>{console.log("Cleaning up managed job log requests..."),Y.current&&(Q(Y.current,"logs cleanup"),Y.current=null),J.current&&(Q(J.current,"controller logs cleanup"),J.current=null),K.current&&(clearTimeout(K.current),K.current=null),V.current="",X.current="",l(!1),c(!1),q(!1),M(!1)},[Q,l,c]),(0,n.useEffect)(()=>{let e=()=>{document.hidden?(console.log("Page hidden - pausing log streaming for performance"),K.current&&(clearTimeout(K.current),K.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&&w)&&ee("logs"===s?"logs":"controllerlogs")};requestAnimationFrame(()=>{requestAnimationFrame(e)})},[s,N,w,ee]),"logs"===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 to start; refresh in a few moments."})}):er?(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:$,children: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 controller process to start; refresh in a few moments."})}):G||w?(0,r.jsx)(h.$B,{logs:w,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:w,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:(0,r.jsx)(v.H,{username:t.user,userHash:t.user_hash})})]}),(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:k?"Copied!":"Copy command",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:el,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:k?(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:()=>{C(!L)},className:"flex items-center text-left focus:outline-none text-gray-700 hover:text-gray-900 transition-colors duration-200",children:[L?(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:T?"Copied!":"Copy YAML",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:T?(0,r.jsx)(m.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(x.Z,{className:"w-4 h-4"})})})]}),L&&(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:()=>en(t),className:"flex items-center justify-between w-full text-left focus:outline-none",children:(0,r.jsxs)("div",{className:"flex items-center",children:[S[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]})]})}),S[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,v]=(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&&v(!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)),H=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:H})}),(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)(w,{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)(w,{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)(w,{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)},1163:function(e,t,s){e.exports=s(6036)}},function(e){e.O(0,[616,5230,5739,1664,804,1272,6989,3698,9470,8969,2888,9774,179],function(){return e(e.s=479)}),_N_E=e.O()}]);
|
sky/dashboard/out/_next/static/chunks/{webpack-60070a62f55486a6.js → webpack-4d50ce5087a63a95.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";var e,t,n,r,c,a,o,u,f,i={},s={};function d(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}},r=!0;try{i[e](n,n.exports,d),r=!1}finally{r&&delete s[e]}return n.exports}d.m=i,e=[],d.O=function(t,n,r,c){if(n){c=c||0;for(var a=e.length;a>0&&e[a-1][2]>c;a--)e[a]=e[a-1];e[a]=[n,r,c];return}for(var o=1/0,a=0;a<e.length;a++){for(var n=e[a][0],r=e[a][1],c=e[a][2],u=!0,f=0;f<n.length;f++)o>=c&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(u=!1,c<o&&(o=c));if(u){e.splice(a--,1);var i=r();void 0!==i&&(t=i)}}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 a={};t=t||[null,n({}),n([]),n(n)];for(var o=2&r&&e;"object"==typeof o&&!~t.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach(function(t){a[t]=function(){return e[t]}});return a.default=function(){return e},d.d(c,a),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 2544===e?"static/chunks/2544.27f70672535675ed.js":5491===e?"static/chunks/5491.918ffed0ba7a5294.js":3937===e?"static/chunks/3937.d7f1c55d1916c7f2.js":9025===e?"static/chunks/9025.a7c44babfe56ce09.js":2875===e?"static/chunks/2875.c24c6d57dc82e436.js":9984===e?"static/chunks/9984.b56614f3c4c5961d.js":430===e?"static/chunks/430.ed51037d1a4a438b.js":4697===e?"static/chunks/4697.f5421144224da9fc.js":
|
1
|
+
!function(){"use strict";var e,t,n,r,c,a,o,u,f,i={},s={};function d(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}},r=!0;try{i[e](n,n.exports,d),r=!1}finally{r&&delete s[e]}return n.exports}d.m=i,e=[],d.O=function(t,n,r,c){if(n){c=c||0;for(var a=e.length;a>0&&e[a-1][2]>c;a--)e[a]=e[a-1];e[a]=[n,r,c];return}for(var o=1/0,a=0;a<e.length;a++){for(var n=e[a][0],r=e[a][1],c=e[a][2],u=!0,f=0;f<n.length;f++)o>=c&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(u=!1,c<o&&(o=c));if(u){e.splice(a--,1);var i=r();void 0!==i&&(t=i)}}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 a={};t=t||[null,n({}),n([]),n(n)];for(var o=2&r&&e;"object"==typeof o&&!~t.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach(function(t){a[t]=function(){return e[t]}});return a.default=function(){return e},d.d(c,a),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 2544===e?"static/chunks/2544.27f70672535675ed.js":5491===e?"static/chunks/5491.918ffed0ba7a5294.js":3937===e?"static/chunks/3937.d7f1c55d1916c7f2.js":9025===e?"static/chunks/9025.a7c44babfe56ce09.js":2875===e?"static/chunks/2875.c24c6d57dc82e436.js":9984===e?"static/chunks/9984.b56614f3c4c5961d.js":430===e?"static/chunks/430.ed51037d1a4a438b.js":4697===e?"static/chunks/4697.f5421144224da9fc.js":1691===e?"static/chunks/1691.44e378727a41f3b5.js":3256===e?"static/chunks/3256.7257acd01b481bed.js":4725===e?"static/chunks/4725.4c849b1e05c8e9ad.js":3785===e?"static/chunks/3785.b3cc2bc1d49d2c3c.js":8982===e?"static/chunks/8982.a2e214068f30a857.js":"static/chunks/"+e+"-"+({616:"162f3033ffcd3d31",804:"9f5e98ce84d46bdd",938:"8e25c8ea0baa271a",1043:"5e5ef6198735ff7e",1141:"726e5a3f00b67185",1272:"1ef0bf0237faccdb",1664:"d65361e92b85e786",1871:"cf1a47986d716dd2",3698:"52ad1ca228faa776",3947:"b059261d6fa88a1f",5230:"df791914b54d91d9",5739:"5ea3ffa10fc884f2",6601:"d38d10f957dff832",6989:"eab0e9c16b64fd9f",6990:"d0dc765474fa0eca",8969:"13bb52ce3cffa4e3",9470:"21d059a1dfa03f61"})[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,a){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var o,u,f=document.getElementsByTagName("script"),i=0;i<f.length;i++){var s=f[i];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==c+n){o=s;break}}o||(u=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.setAttribute("data-webpack",c+n),o.src=d.tu(e)),r[e]=[t];var b=function(t,n){o.onerror=o.onload=null,clearTimeout(l);var c=r[e];if(delete r[e],o.parentNode&&o.parentNode.removeChild(o),c&&c.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=b.bind(null,o.onerror),o.onload=b.bind(null,o.onload),u&&document.head.appendChild(o)},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===a&&(a={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(a=trustedTypes.createPolicy("nextjs#bundler",a))),a},d.tu=function(e){return d.tt().createScriptURL(e)},d.p="/dashboard/_next/",o={2272:0},d.f.j=function(e,t){var n=d.o(o,e)?o[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(2272!=e){var r=new Promise(function(t,r){n=o[e]=[t,r]});t.push(n[2]=r);var c=d.p+d.u(e),a=Error();d.l(c,function(t){if(d.o(o,e)&&(0!==(n=o[e])&&(o[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",a.name="ChunkLoadError",a.type=r,a.request=c,n[1](a)}},"chunk-"+e,e)}else o[e]=0}},d.O.j=function(e){return 0===o[e]},u=function(e,t){var n,r,c=t[0],a=t[1],u=t[2],f=0;if(c.some(function(e){return 0!==o[e]})){for(n in a)d.o(a,n)&&(d.m[n]=a[n]);if(u)var i=u(d)}for(e&&e(t);f<c.length;f++)r=c[f],d.o(o,r)&&o[r]&&o[r][0](),o[r]=0;return d.O(i)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(u.bind(null,0)),f.push=u.bind(null,f.push.bind(f)),d.nc=void 0}();
|