skypilot-nightly 1.0.0.dev20251009__py3-none-any.whl → 1.0.0.dev20251012__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.
Potentially problematic release.
This version of skypilot-nightly might be problematic. Click here for more details.
- sky/__init__.py +2 -2
- sky/backends/cloud_vm_ray_backend.py +3 -2
- sky/client/cli/command.py +53 -4
- sky/client/sdk.py +11 -3
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/chunks/3015-7e0e8f06bb2f881c.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/{[job]-4f7079dcab6ed653.js → [job]-e5c9ce6a24fc0de4.js} +1 -1
- sky/dashboard/out/_next/static/chunks/{webpack-6a5ddd0184bfa22c.js → webpack-66f23594d38c7f16.js} +1 -1
- sky/dashboard/out/_next/static/{hIViZcQBkn0HE8SpaSsUU → yOfMelBaFp8uL5F9atyAK}/_buildManifest.js +1 -1
- 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/pools/[pool].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/data/mounting_utils.py +54 -15
- sky/jobs/server/server.py +2 -2
- sky/provision/kubernetes/instance.py +2 -27
- sky/provision/kubernetes/utils.py +47 -6
- sky/serve/server/server.py +1 -1
- sky/server/constants.py +4 -0
- sky/server/requests/executor.py +36 -36
- sky/server/requests/payloads.py +2 -0
- sky/server/requests/requests.py +119 -2
- sky/server/server.py +19 -5
- sky/server/stream_utils.py +61 -26
- sky/utils/common_utils.py +6 -3
- {skypilot_nightly-1.0.0.dev20251009.dist-info → skypilot_nightly-1.0.0.dev20251012.dist-info}/METADATA +36 -35
- {skypilot_nightly-1.0.0.dev20251009.dist-info → skypilot_nightly-1.0.0.dev20251012.dist-info}/RECORD +43 -43
- sky/dashboard/out/_next/static/chunks/3015-8d748834fcc60b46.js +0 -1
- /sky/dashboard/out/_next/static/{hIViZcQBkn0HE8SpaSsUU → yOfMelBaFp8uL5F9atyAK}/_ssgManifest.js +0 -0
- {skypilot_nightly-1.0.0.dev20251009.dist-info → skypilot_nightly-1.0.0.dev20251012.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20251009.dist-info → skypilot_nightly-1.0.0.dev20251012.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20251009.dist-info → skypilot_nightly-1.0.0.dev20251012.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20251009.dist-info → skypilot_nightly-1.0.0.dev20251012.dist-info}/top_level.txt +0 -0
sky/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ import urllib.request
|
|
|
7
7
|
from sky.utils import directory_utils
|
|
8
8
|
|
|
9
9
|
# Replaced with the current commit when building the wheels.
|
|
10
|
-
_SKYPILOT_COMMIT_SHA = '
|
|
10
|
+
_SKYPILOT_COMMIT_SHA = '7d5d1a2925fc7192af10061ca395d329364e7405'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def _get_git_commit():
|
|
@@ -37,7 +37,7 @@ def _get_git_commit():
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
__commit__ = _get_git_commit()
|
|
40
|
-
__version__ = '1.0.0.
|
|
40
|
+
__version__ = '1.0.0.dev20251012'
|
|
41
41
|
__root_dir__ = directory_utils.get_sky_dir()
|
|
42
42
|
|
|
43
43
|
|
|
@@ -211,6 +211,7 @@ _EXCEPTION_MSG_AND_RETURNCODE_FOR_DUMP_INLINE_SCRIPT = [
|
|
|
211
211
|
('too long', 255),
|
|
212
212
|
('request-uri too large', 1),
|
|
213
213
|
('request header fields too large', 1),
|
|
214
|
+
('400 bad request', 1), # CloudFlare 400 error
|
|
214
215
|
]
|
|
215
216
|
|
|
216
217
|
_RESOURCES_UNAVAILABLE_LOG = (
|
|
@@ -2825,7 +2826,7 @@ class CloudVmRayResourceHandle(backends.backend.ResourceHandle):
|
|
|
2825
2826
|
return grpc.insecure_channel(f'localhost:{tunnel.port}',
|
|
2826
2827
|
options=grpc_options)
|
|
2827
2828
|
except socket.error as e:
|
|
2828
|
-
logger.
|
|
2829
|
+
logger.debug(
|
|
2829
2830
|
'Failed to connect to SSH tunnel for cluster '
|
|
2830
2831
|
f'{self.cluster_name!r} on port {tunnel.port} ({e}), '
|
|
2831
2832
|
'acquiring lock')
|
|
@@ -2851,7 +2852,7 @@ class CloudVmRayResourceHandle(backends.backend.ResourceHandle):
|
|
|
2851
2852
|
return grpc.insecure_channel(f'localhost:{tunnel.port}',
|
|
2852
2853
|
options=grpc_options)
|
|
2853
2854
|
except socket.error as e:
|
|
2854
|
-
logger.
|
|
2855
|
+
logger.debug(
|
|
2855
2856
|
'Failed to connect to SSH tunnel for cluster '
|
|
2856
2857
|
f'{self.cluster_name!r} on port {tunnel.port} ({e}), '
|
|
2857
2858
|
'opening new tunnel')
|
sky/client/cli/command.py
CHANGED
|
@@ -111,6 +111,13 @@ an autogenerated name."""
|
|
|
111
111
|
# command.
|
|
112
112
|
_NUM_MANAGED_JOBS_TO_SHOW_IN_STATUS = 5
|
|
113
113
|
_NUM_MANAGED_JOBS_TO_SHOW = 50
|
|
114
|
+
_NUM_REQUESTS_TO_SHOW = 50
|
|
115
|
+
_DEFAULT_REQUEST_FIELDS_TO_SHOW = [
|
|
116
|
+
'request_id', 'name', 'user_id', 'status', 'created_at'
|
|
117
|
+
]
|
|
118
|
+
_VERBOSE_REQUEST_FIELDS_TO_SHOW = _DEFAULT_REQUEST_FIELDS_TO_SHOW + [
|
|
119
|
+
'cluster_name'
|
|
120
|
+
]
|
|
114
121
|
|
|
115
122
|
_STATUS_PROPERTY_CLUSTER_NUM_ERROR_MESSAGE = (
|
|
116
123
|
'{cluster_num} cluster{plural} {verb}. Please specify {cause} '
|
|
@@ -5212,7 +5219,15 @@ def jobs_pool_logs(
|
|
|
5212
5219
|
@flags.config_option(expose_value=False)
|
|
5213
5220
|
@usage_lib.entrypoint
|
|
5214
5221
|
def dashboard() -> None:
|
|
5215
|
-
"""
|
|
5222
|
+
"""Opens the SkyPilot dashboard."""
|
|
5223
|
+
sdk.dashboard()
|
|
5224
|
+
|
|
5225
|
+
|
|
5226
|
+
@cli.command(cls=_DocumentedCodeCommand, hidden=True)
|
|
5227
|
+
@flags.config_option(expose_value=False)
|
|
5228
|
+
@usage_lib.entrypoint
|
|
5229
|
+
def ui() -> None:
|
|
5230
|
+
"""Opens the SkyPilot dashboard."""
|
|
5216
5231
|
sdk.dashboard()
|
|
5217
5232
|
|
|
5218
5233
|
|
|
@@ -6147,6 +6162,25 @@ def api_cancel(request_ids: Optional[List[str]], all: bool, all_users: bool):
|
|
|
6147
6162
|
fg='green')
|
|
6148
6163
|
|
|
6149
6164
|
|
|
6165
|
+
class IntOrNone(click.ParamType):
|
|
6166
|
+
"""Int or None"""
|
|
6167
|
+
name = 'int-or-none'
|
|
6168
|
+
|
|
6169
|
+
def convert(self, value, param, ctx):
|
|
6170
|
+
if isinstance(value, int):
|
|
6171
|
+
return value
|
|
6172
|
+
if isinstance(value, str) and value.lower() in ('none', 'all'):
|
|
6173
|
+
return None
|
|
6174
|
+
try:
|
|
6175
|
+
return int(value)
|
|
6176
|
+
except ValueError:
|
|
6177
|
+
self.fail(f'{value!r} is not a valid integer or "none" or "all"',
|
|
6178
|
+
param, ctx)
|
|
6179
|
+
|
|
6180
|
+
|
|
6181
|
+
INT_OR_NONE = IntOrNone()
|
|
6182
|
+
|
|
6183
|
+
|
|
6150
6184
|
@api.command('status', cls=_DocumentedCodeCommand)
|
|
6151
6185
|
@flags.config_option(expose_value=False)
|
|
6152
6186
|
@click.argument('request_ids',
|
|
@@ -6160,15 +6194,26 @@ def api_cancel(request_ids: Optional[List[str]], all: bool, all_users: bool):
|
|
|
6160
6194
|
default=False,
|
|
6161
6195
|
required=False,
|
|
6162
6196
|
help='Show requests of all statuses.')
|
|
6197
|
+
@click.option(
|
|
6198
|
+
'--limit',
|
|
6199
|
+
'-l',
|
|
6200
|
+
default=_NUM_REQUESTS_TO_SHOW,
|
|
6201
|
+
type=INT_OR_NONE,
|
|
6202
|
+
required=False,
|
|
6203
|
+
help=(f'Number of requests to show, default is {_NUM_REQUESTS_TO_SHOW},'
|
|
6204
|
+
f' set to "none" or "all" to show all requests.'))
|
|
6163
6205
|
@flags.verbose_option('Show more details.')
|
|
6164
6206
|
@usage_lib.entrypoint
|
|
6165
6207
|
# pylint: disable=redefined-builtin
|
|
6166
6208
|
def api_status(request_ids: Optional[List[str]], all_status: bool,
|
|
6167
|
-
verbose: bool):
|
|
6209
|
+
verbose: bool, limit: Optional[int]):
|
|
6168
6210
|
"""List requests on SkyPilot API server."""
|
|
6169
6211
|
if not request_ids:
|
|
6170
6212
|
request_ids = None
|
|
6171
|
-
|
|
6213
|
+
fields = _DEFAULT_REQUEST_FIELDS_TO_SHOW
|
|
6214
|
+
if verbose:
|
|
6215
|
+
fields = _VERBOSE_REQUEST_FIELDS_TO_SHOW
|
|
6216
|
+
request_list = sdk.api_status(request_ids, all_status, limit, fields)
|
|
6172
6217
|
columns = ['ID', 'User', 'Name']
|
|
6173
6218
|
if verbose:
|
|
6174
6219
|
columns.append('Cluster')
|
|
@@ -6194,8 +6239,12 @@ def api_status(request_ids: Optional[List[str]], all_status: bool,
|
|
|
6194
6239
|
if verbose:
|
|
6195
6240
|
dummy_row.append('-')
|
|
6196
6241
|
table.add_row(dummy_row)
|
|
6197
|
-
click.echo()
|
|
6198
6242
|
click.echo(table)
|
|
6243
|
+
if limit and len(request_list) >= limit:
|
|
6244
|
+
click.echo()
|
|
6245
|
+
click.echo(
|
|
6246
|
+
f'Showing {limit} requests. Use "-l none" or "-l all" to show'
|
|
6247
|
+
f' all requests.')
|
|
6199
6248
|
|
|
6200
6249
|
|
|
6201
6250
|
@api.command('login', cls=_DocumentedCodeCommand)
|
sky/client/sdk.py
CHANGED
|
@@ -2158,7 +2158,9 @@ def _local_api_server_running(kill: bool = False) -> bool:
|
|
|
2158
2158
|
def api_status(
|
|
2159
2159
|
request_ids: Optional[List[Union[server_common.RequestId[T], str]]] = None,
|
|
2160
2160
|
# pylint: disable=redefined-builtin
|
|
2161
|
-
all_status: bool = False
|
|
2161
|
+
all_status: bool = False,
|
|
2162
|
+
limit: Optional[int] = None,
|
|
2163
|
+
fields: Optional[List[str]] = None,
|
|
2162
2164
|
) -> List[payloads.RequestPayload]:
|
|
2163
2165
|
"""Lists all requests.
|
|
2164
2166
|
|
|
@@ -2167,6 +2169,8 @@ def api_status(
|
|
|
2167
2169
|
If None, all requests are queried.
|
|
2168
2170
|
all_status: Whether to list all finished requests as well. This argument
|
|
2169
2171
|
is ignored if request_ids is not None.
|
|
2172
|
+
limit: The number of requests to show. If None, show all requests.
|
|
2173
|
+
fields: The fields to get. If None, get all fields.
|
|
2170
2174
|
|
|
2171
2175
|
Returns:
|
|
2172
2176
|
A list of request payloads.
|
|
@@ -2175,8 +2179,12 @@ def api_status(
|
|
|
2175
2179
|
logger.info('SkyPilot API server is not running.')
|
|
2176
2180
|
return []
|
|
2177
2181
|
|
|
2178
|
-
body = payloads.RequestStatusBody(
|
|
2179
|
-
|
|
2182
|
+
body = payloads.RequestStatusBody(
|
|
2183
|
+
request_ids=request_ids,
|
|
2184
|
+
all_status=all_status,
|
|
2185
|
+
limit=limit,
|
|
2186
|
+
fields=fields,
|
|
2187
|
+
)
|
|
2180
2188
|
response = server_common.make_authenticated_request(
|
|
2181
2189
|
'GET',
|
|
2182
2190
|
'/api/status',
|
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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-
|
|
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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-66f23594d38c7f16.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-ce361c6959bc2001.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_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":"yOfMelBaFp8uL5F9atyAK","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3015],{23015:function(e,s,t){t.r(s),t.d(s,{ClusterJobs:function(){return K},ManagedJobs:function(){return Z},ManagedJobsTable:function(){return B},Status2Actions:function(){return H},filterJobsByName:function(){return J},filterJobsByPool:function(){return O},filterJobsByUser:function(){return W},filterJobsByWorkspace:function(){return U},statusGroups:function(){return z}});var a=t(85893),r=t(67294),l=t(11163),n=t(41664),i=t.n(n),c=t(55739),o=t(30803),d=t(37673),u=t(68764),h=t(36989),x=t(51214),m=t(68969),p=t(6378);class j{_generateFilterKey(e){let{allUsers:s=!0,nameMatch:t,userMatch:a,workspaceMatch:r,poolMatch:l,statuses:n}=e;return["allUsers:".concat(s),t?"name:".concat(t):"",a?"user:".concat(a):"",r?"workspace:".concat(r):"",l?"pool:".concat(l):"",n&&n.length>0?"statuses:".concat(n.sort().join(",")):""].filter(Boolean).join("|")||"default"}_getCacheStatus(e){let s=this.fullDataCache.get(e),t=Date.now();if(!s)return{isCached:!1,isFresh:!1,age:0,maxAge:12e4,hasData:!1};let a=t-s.timestamp;return{isCached:!0,isFresh:a<12e4,age:a,maxAge:12e4,hasData:s.jobs&&Array.isArray(s.jobs),data:s}}async getPaginatedJobs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{page:s=1,limit:t=10,...a}=e,r=this._generateFilterKey(a);try{let e=this._getCacheStatus(r);if(e.isCached&&e.hasData){let l=e.data;if(!l.jobs||Array.isArray(l.jobs)&&0===l.jobs.length){if(!this.prefetching.has(r)){let e=this._loadFullDataset(a,r).catch(()=>{}).finally(()=>this.prefetching.delete(r));this.prefetching.set(r,e)}}else{let n=(s-1)*t,i=l.jobs.slice(n,n+t);if(!this.prefetching.has(r)&&(!e.isFresh||e.age>e.maxAge/2)){let e=this._loadFullDataset(a,r).catch(()=>{}).finally(()=>this.prefetching.delete(r));this.prefetching.set(r,e)}return{jobs:i,total:l.total,totalNoFilter:l.totalNoFilter||l.total,controllerStopped:l.controllerStopped,statusCounts:l.statusCounts||{},fromCache:!0,cacheStatus:e.isFresh?"local_cache_hit":"local_cache_stale_hit"}}}let l=await p.default.get(m.getManagedJobs,[{...a,page:s,limit:t}]),n=(null==l?void 0:l.jobs)||[],i="number"==typeof(null==l?void 0:l.total)?l.total:n.length,c=!!(null==l?void 0:l.controllerStopped);if(!this.prefetching.has(r)){let e=this._loadFullDataset(a,r).catch(e=>{console.warn("Background prefetch of full jobs failed:",e)}).finally(()=>{this.prefetching.delete(r)});this.prefetching.set(r,e)}return{jobs:n,total:i,totalNoFilter:(null==l?void 0:l.totalNoFilter)||i,controllerStopped:c,statusCounts:(null==l?void 0:l.statusCounts)||{},fromCache:!1,cacheStatus:"server_page_fetch"}}catch(e){return console.error("Error in getPaginatedJobs:",e),{jobs:[],total:0,totalNoFilter:0,controllerStopped:!1,statusCounts:{},fromCache:!1,cacheStatus:"error"}}}async _loadFullDataset(e,s){let t=await p.default.get(m.getManagedJobs,[e]);if(t.controllerStopped||!t.jobs)return t;let a={jobs:t.jobs,total:t.jobs.length,totalNoFilter:t.totalNoFilter||t.jobs.length,controllerStopped:!1,statusCounts:t.statusCounts||{},timestamp:Date.now()};return this.fullDataCache.set(s,a),a}isDataLoading(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e);return this.isLoading.has(s)||this.prefetching.has(s)}isDataCached(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e),t=this._getCacheStatus(s);return t.isCached&&t.isFresh&&t.hasData}getCacheStatus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e);return this._getCacheStatus(s)}invalidateCache(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){let s=this._generateFilterKey(e);this.fullDataCache.delete(s),this.isLoading.delete(s),this.prefetching.delete(s)}else this.fullDataCache.clear(),this.isLoading.clear(),this.prefetching.clear();p.default.invalidateFunction(m.getManagedJobs)}getCacheStats(){let e={cachedFilters:Array.from(this.fullDataCache.keys()),loadingFilters:Array.from(this.isLoading.keys()),prefetchingFilters:Array.from(this.prefetching.keys()),cacheSize:this.fullDataCache.size,loadingCount:this.isLoading.size,prefetchingCount:this.prefetching.size};for(let[s,t]of(e.detailedStatus={},this.fullDataCache.entries())){let a=this._getCacheStatus(s);e.detailedStatus[s]={age:a.age,isFresh:a.isFresh,hasData:a.hasData,jobCount:t.jobs?t.jobs.length:0}}return e}constructor(){this.fullDataCache=new Map,this.isLoading=new Map,this.prefetching=new Map}}let f=new j;var g=t(23266),b=t(17324),v=t(53081),y=t(13626),w=t(23293),N=t(6521),k=t(16826),C=t(92128),S=t(94545),L=t(99307),_=t(20546),E=t(23001),R=t(88950);let D=(e,s)=>{let t={...e.query},a=[],r=[],l=[];s.map((e,s)=>{var t;a.push(null!==(t=e.property.toLowerCase())&&void 0!==t?t:""),r.push(e.operator),l.push(e.value)}),t.property=a,t.operator=r,t.value=l,e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},M=(e,s)=>{let t={...e.query},a=t.property,r=t.operator,l=t.value;if(void 0===a)return[];let n=[],i=Array.isArray(a)?a.length:1;if(1===i)n.push({property:s.get(a),operator:r,value:l});else for(let e=0;e<i;e++)n.push({property:s.get(a[e]),operator:r[e],value:l[e]});return n},F=e=>{var s,t;let{propertyList:l=[],valueList:n,setFilters:i,updateURLParams:c,placeholder:o="Filter items"}=e,d=(0,r.useRef)(null),u=(0,r.useRef)(null),[h,x]=(0,r.useState)(!1),[m,p]=(0,r.useState)(""),[j,f]=(0,r.useState)((null===(s=l[0])||void 0===s?void 0:s.value)||"status"),[g,b]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=e=>{u.current&&!u.current.contains(e.target)&&d.current&&!d.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,r.useEffect)(()=>{let e=[];n&&"object"==typeof n&&(e=n[j]||[]),""!==m.trim()&&(e=e.filter(e=>e&&e.toString().toLowerCase().includes(m.toLowerCase()))),b(e)},[j,n,m]);let v=e=>{let s=l.find(s=>s.value===e);return s?s.label:e},y=e=>{i(s=>{let t=[...s,{property:v(j),operator:":",value:e}];return c(t),t}),x(!1),p(""),d.current.focus()};return(0,a.jsxs)("div",{className:"flex flex-row border border-gray-300 rounded-md overflow-visible",children:[(0,a.jsx)("div",{className:"border-r border-gray-300 flex-shrink-0",children:(0,a.jsxs)(R.Ph,{onValueChange:f,value:j,children:[(0,a.jsx)(R.i4,{"aria-label":"Filter Property",className:"focus:ring-0 focus:ring-offset-0 border-none rounded-l-md rounded-r-none w-20 sm:w-24 md:w-32 h-8 text-xs sm:text-sm",children:(0,a.jsx)(R.ki,{placeholder:(null===(t=l[0])||void 0===t?void 0:t.label)||"Status"})}),(0,a.jsx)(R.Bw,{children:l.map((e,s)=>(0,a.jsx)(R.Ql,{value:e.value,children:e.label},"property-item-".concat(s)))})]})}),(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("input",{type:"text",ref:d,placeholder:o,value:m,onChange:e=>{p(e.target.value),h||x(!0)},onFocus:()=>{x(!0)},onKeyDown:e=>{"Enter"===e.key&&""!==m.trim()?(i(e=>{let s=[...e,{property:v(j),operator:":",value:m}];return c(s),s}),p(""),x(!1)):"Escape"===e.key&&(x(!1),d.current.blur())},className:"h-8 w-full sm:w-96 px-3 pr-8 text-sm border-none rounded-l-none rounded-r-md focus:ring-0 focus:outline-none",autoComplete:"off"}),m&&(0,a.jsx)("button",{onClick:()=>{p(""),x(!1)},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,a.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),h&&g.length>0&&(0,a.jsx)("div",{ref:u,className:"absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-y-auto",style:{zIndex:9999},children:g.map((e,s)=>(0,a.jsx)("div",{className:"px-3 py-2 cursor-pointer hover:bg-gray-50 text-sm ".concat(s!==g.length-1?"border-b border-gray-100":""),onClick:()=>y(e),children:(0,a.jsx)("span",{className:"text-sm text-gray-700",children:e})},"".concat(e,"-").concat(s)))})]})]})},I=e=>{let{filters:s=[],setFilters:t,updateURLParams:r}=e,l=e=>{t(s=>{let t=s.filter((s,t)=>t!==e);return r(t),t})};return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"flex items-center gap-4 py-2 px-2",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-content gap-2",children:[s.map((e,s)=>(0,a.jsx)(A,{filter:e,onRemove:()=>l(s)},"filteritem-".concat(s))),s.length>0&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("button",{onClick:()=>{r([]),t([])},className:"rounded-full px-4 py-1 text-sm text-gray-700 bg-gray-200 hover:bg-gray-300",children:"Clear filters"})})]})})})},A=e=>{let{filter:s,onRemove:t}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-center text-blue-600 bg-blue-100 px-1 py-1 rounded-full text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 px-2",children:[(0,a.jsx)("span",{children:"".concat(s.property," ")}),(0,a.jsx)("span",{children:"".concat(s.operator," ")}),(0,a.jsx)("span",{children:" ".concat(s.value)})]}),(0,a.jsx)("button",{onClick:()=>t(),className:"p-0.5 ml-1 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,a.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"white",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:5,d:"M6 18L18 6M6 6l12 12"})})})]})})},z={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},P=[{label:"Name",value:"name"},{label:"User",value:"user"},{label:"Workspace",value:"workspace"},{label:"Pool",value:"pool"}];function J(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.name||"").toLowerCase().includes(t))}function U(e,s){return s&&"ALL_WORKSPACES"!==s?e.filter(e=>(e.workspace||"default").toLowerCase()===s.toLowerCase()):e}function W(e,s){return s&&"ALL_USERS"!==s?e.filter(e=>(e.user_hash||e.user)===s):e}function O(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.pool||"").toLowerCase().includes(t))}let T=e=>{if(!e)return"-";let s=e instanceof Date?e:new Date(1e3*e);return(0,a.jsx)(h.Zg,{date:s})};function Z(){let e=(0,l.useRouter)(),[s,t]=(0,r.useState)(!1),[n,c]=(0,r.useState)(!0),[o,d]=(0,r.useState)(!0),u=r.useRef(null),x=r.useRef(null),[j,g]=(0,r.useState)([]),[y,w]=(0,r.useState)([]),N=r.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t(!0),!e&&o&&c(!0);try{let[e]=await Promise.all([p.default.get(m.vs,[{}])]);g(e.pools||[])}catch(e){console.error("Error fetching data:",e)}finally{t(!1),!e&&o&&(c(!1),d(!1))}},[o]);(0,r.useEffect)(()=>{N()},[N]);let k=s=>{D(e,s)},C=r.useCallback(()=>{let s=new Map;s.set("",""),s.set("status","Status"),s.set("name","Name"),s.set("user","User"),s.set("workspace","Workspace"),s.set("pool","Pool"),w(M(e,s))},[e,w]);return(0,r.useEffect)(()=>{e.isReady&&C()},[e.isReady,e.query.tab,C]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,a.jsx)("div",{className:"text-base",children:(0,a.jsx)(i(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"})}),(0,a.jsx)("div",{className:"w-full sm:w-auto",children:(0,a.jsx)(F,{propertyList:P,valueList:{},setFilters:w,updateURLParams:k,placeholder:"Filter jobs"})})]}),(0,a.jsx)(I,{filters:y,setFilters:w,updateURLParams:k}),(0,a.jsx)(B,{refreshInterval:h.yc,setLoading:t,refreshDataRef:u,filters:y,onRefresh:()=>{f.invalidateCache(),p.default.invalidate(m.vs,[{}]),p.default.invalidate(b.getWorkspaces),p.default.invalidate(v.R),u.current&&u.current(),x.current&&x.current()},poolsData:j,poolsLoading:n}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(V,{refreshInterval:h.yc,setLoading:t,refreshDataRef:x})})]})}function B(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l,filters:n,onRefresh:j,poolsData:b,poolsLoading:v}=e,[N,k]=(0,r.useState)([]),[R,D]=(0,r.useState)(0),[M,F]=(0,r.useState)(0),[I,A]=(0,r.useState)({key:null,direction:"ascending"}),[P,J]=(0,r.useState)(!1),[U,W]=(0,r.useState)(!0),[O,Z]=(0,r.useState)(1),[B,K]=(0,r.useState)(10),[V,Y]=(0,r.useState)(null),Q=(0,r.useRef)(null),[X,$]=(0,r.useState)([]),[ee,es]=(0,r.useState)({}),[et,ea]=(0,r.useState)({}),[er,el]=(0,r.useState)(!1),[en,ei]=(0,r.useState)(!1),[ec,eo]=(0,r.useState)(!1),[ed,eu]=(0,r.useState)("all"),[eh,ex]=(0,r.useState)(!0),[em,ep]=(0,r.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),ej=(0,E.X)(),ef=(0,r.useRef)(0),eg=r.useMemo(()=>{if(!N||0===N.length)return!1;let e=new Set(N.map(e=>e.workspace||"default"));return e.size>1||1===e.size&&!e.has("default")},[N]),eb=r.useMemo(()=>b&&b.length>0,[b]),ev=async()=>{ep({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller?",onConfirm:async()=>{try{eo(!0),J(!0),await (0,m.Ce)("restartcontroller"),await ey()}catch(e){console.error("Error restarting controller:",e)}finally{eo(!1),J(!1)}}})},ey=r.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=!1!==e.includeStatus,a=ef.current+1;ef.current=a,J(!0),t(!0);try{let e,t;let r=e=>{let s=(n||[]).find(s=>(s.property||"").toLowerCase()===e);return s&&s.value?String(s.value):void 0};X.length>0?t=X:eh?"active"===ed?t=z.active:"finished"===ed&&(t=z.finished):t=[];let l={allUsers:!0,nameMatch:r("name"),userMatch:r("user"),workspaceMatch:r("workspace"),poolMatch:r("pool"),statuses:t,page:O,limit:B},i=null;if(f.isDataCached(l),f.isDataLoading(l),s){let[s,t]=await Promise.all([f.getPaginatedJobs(l),p.default.get(g.getClusters)]);e=s,i=t}else e=await f.getPaginatedJobs(l);let{jobs:c=[],total:o=0,totalNoFilter:d=0,controllerStopped:u=!1,cacheStatus:h="unknown",statusCounts:x={}}=e||{},m=!1,j=!1;if(s&&i){let e=null==i?void 0:i.find(e=>(0,S.Ym)(e.cluster)),s=e?e.status:"NOT_FOUND";"STOPPED"==s&&u&&(m=!0),"LAUNCHING"==s&&(j=!0)}a===ef.current&&(k(c),D(o||0),F(d||0),el(!!m),ei(!!j),ea(x),W(!1))}catch(e){console.error("Error fetching data:",e),a===ef.current&&(k([]),el(!1),W(!1))}finally{a===ef.current&&(J(!1),t(!1))}},[t,n,O,B,X,eh,ed]);r.useEffect(()=>{l&&(l.current=ey)},[l,ey]);let ew=r.useRef(ey);r.useEffect(()=>{ew.current=ey},[ey]);let eN=r.useRef(!0);r.useEffect(()=>{ey({includeStatus:!0}),eN.current=!1},[ey]),r.useEffect(()=>{eN.current||ey({includeStatus:!1})},[O,ey]),r.useEffect(()=>{eN.current||ey({includeStatus:!0})},[n,B,ey]),r.useEffect(()=>{eN.current||ey({includeStatus:!0})},[ed,X,eh,ey]),(0,r.useEffect)(()=>{let e=setInterval(()=>{ew.current&&ew.current({includeStatus:!0})},s);return()=>{clearInterval(e)}},[s]),(0,r.useEffect)(()=>{Z(1)},[ed]),(0,r.useEffect)(()=>{Z(1)},[n,B]),(0,r.useEffect)(()=>{$([]),ex(!0)},[ed]);let ek=e=>{let s="ascending";I.key===e&&"ascending"===I.direction&&(s="descending"),A({key:e,direction:s})},eC=e=>I.key===e?"ascending"===I.direction?" ↑":" ↓":"";r.useMemo(()=>{let e=N||[];return{active:e.filter(e=>z.active.includes(e.status)).length,finished:e.filter(e=>z.finished.includes(e.status)).length}},[N]);let eS=e=>X.length>0?X.includes(e):"all"===ed||z[ed].includes(e),eL=r.useMemo(()=>N,[N]),e_=r.useMemo(()=>I.key?[...eL].sort((e,s)=>e[I.key]<s[I.key]?"ascending"===I.direction?-1:1:e[I.key]>s[I.key]?"ascending"===I.direction?1:-1:0):eL,[eL,I]),eE=(O-1)*B,eR=R>0?Math.ceil(R/B):0,eD=R>0?Math.min(eE+e_.length,R):0,eM=e=>{if(X.includes(e)){let s=X.filter(s=>s!==e);0===s.length?(ex(!0),$([])):($(s),ex(!1))}else $([...X,e]),ex(!1);Z(1)};return(0,r.useEffect)(()=>{es(et)},[et]),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"flex flex-col space-y-1 mb-1",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between text-sm mb-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center",children:[(0,a.jsx)("span",{className:"mr-2 text-sm font-medium",children:"Statuses:"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[!P&&0===M&&!U&&(0,a.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(ee).map(e=>{let[s,t]=e;return(0,a.jsxs)("button",{onClick:()=>eM(s),className:"px-3 py-0.5 rounded-full flex items-center space-x-2 ".concat(eS(s)||X.includes(s)?(0,L.Cl)(s):"bg-gray-50 text-gray-600 hover:bg-gray-100"),children:[(0,a.jsx)("span",{children:s}),(0,a.jsx)("span",{className:"text-xs ".concat(eS(s)||X.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),M>0&&(0,a.jsxs)("div",{className:"flex items-center ml-2 gap-2",children:[(0,a.jsx)("span",{className:"text-gray-500",children:"("}),(0,a.jsx)("button",{onClick:()=>{r.startTransition(()=>{eu("all"),$([]),ex(!0),Z(1)})},className:"text-sm font-medium ".concat("all"===ed&&eh?"text-purple-700 underline":"text-gray-600 hover:text-purple-700 hover:underline"),children:"show all jobs"}),(0,a.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,a.jsx)("button",{onClick:()=>{r.startTransition(()=>{eu("active"),$([]),ex(!0),Z(1)})},className:"text-sm font-medium ".concat("active"===ed&&eh?"text-green-700 underline":"text-gray-600 hover:text-green-700 hover:underline"),children:"show all active jobs"}),(0,a.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,a.jsx)("button",{onClick:()=>{r.startTransition(()=>{eu("finished"),$([]),ex(!0),Z(1)})},className:"text-sm font-medium ".concat("finished"===ed&&eh?"text-blue-700 underline":"text-gray-600 hover:text-blue-700 hover:underline"),children:"show all finished jobs"}),(0,a.jsx)("span",{className:"text-gray-500",children:")"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[P&&(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,a.jsxs)("button",{onClick:()=>{j&&j()},disabled:P,className:"text-sky-blue hover:text-sky-blue-bright flex items-center text-sm",children:[(0,a.jsx)(y.Z,{className:"h-4 w-4 mr-1.5"}),(0,a.jsx)("span",{children:"Refresh"})]})]})]})}),ej&&er&&0===e_.length&&!P&&!U&&(0,a.jsx)("div",{className:"mb-4 p-4 bg-gray-50 rounded-lg border",children:(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-3",children:[(0,a.jsxs)("p",{className:"text-gray-700 text-center text-sm",children:["Job controller stopped.",(0,a.jsx)("br",{}),"Restart to check status."]}),(0,a.jsx)(o.z,{variant:"outline",size:"sm",onClick:ev,className:"text-sky-blue hover:text-sky-blue-bright",disabled:P||ec,children:ec?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Restart"]})})]})}),(0,a.jsx)(d.Zb,{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,a.jsxs)(u.iA,{className:"min-w-full",children:[(0,a.jsx)(u.xD,{children:(0,a.jsxs)(u.SC,{children:[(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("id"),children:["ID",eC("id")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("name"),children:["Name",eC("name")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("user"),children:["User",eC("user")]}),eg&&(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("workspace"),children:["Workspace",eC("workspace")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("submitted_at"),children:["Submitted",eC("submitted_at")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("job_duration"),children:["Duration",eC("job_duration")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("status"),children:["Status",eC("status")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("infra"),children:["Infra",eC("infra")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("cluster"),children:["Resources",eC("cluster")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("recoveries"),children:["Recoveries",eC("recoveries")]}),eb&&(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ek("pool"),children:["Worker Pool",eC("pool")]}),(0,a.jsx)(u.ss,{children:"Details"}),(0,a.jsx)(u.ss,{children:"Logs"})]})}),(0,a.jsx)(u.RM,{children:P&&U?(0,a.jsx)(u.SC,{children:(0,a.jsx)(u.pj,{colSpan:11+(eg?1:0)+(eb?1:0),className:"text-center py-6 text-gray-500",children:(0,a.jsxs)("div",{className:"flex justify-center items-center",children:[(0,a.jsx)(c.Z,{size:20,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]})})}):e_.length>0?(0,a.jsx)(a.Fragment,{children:e_.map(e=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(u.SC,{children:[(0,a.jsx)(u.pj,{children:(0,a.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(_.H,{username:e.user,userHash:e.user_hash})}),eg&&(0,a.jsx)(u.pj,{children:(0,a.jsx)(i(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,a.jsx)(u.pj,{children:T(e.submitted_at)}),(0,a.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(L.OE,{status:e.status})}),(0,a.jsx)(u.pj,{children:e.infra&&"-"!==e.infra?(0,a.jsx)(h.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(i(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud||e.infra.split("(")[0].trim()}),e.infra.includes("(")&&(0,a.jsx)("span",{children:" "+(()=>{let s=x.MO.NAME_TRUNCATE_LENGTH,t=e.infra.substring(e.infra.indexOf("(")),a=t.substring(1,t.length-1);if(a.length<=s)return t;let r="".concat(a.substring(0,Math.floor((s-3)/2)),"...").concat(a.substring(a.length-Math.ceil((s-3)/2)));return"(".concat(r,")")})()})]})}):(0,a.jsx)("span",{children:e.infra||"-"})}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(h.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,a.jsx)("span",{children:e.resources_str})})}),(0,a.jsx)(u.pj,{children:e.recoveries}),eb&&(0,a.jsx)(u.pj,{children:(0,a.jsx)("div",{className:v?"blur-sm transition-all duration-300":"",children:v?"-":(0,h.os)(e.pool,e.pool_hash,b)})}),(0,a.jsx)(u.pj,{children:e.details?(0,a.jsx)(G,{text:e.details,rowId:e.id,expandedRowId:V,setExpandedRowId:Y}):"-"}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(H,{jobParent:"/jobs",jobId:e.id,managed:!0,workspace:e.workspace})})]}),V===e.id&&(0,a.jsx)(q,{text:e.details,colSpan:11+(eg?1:0)+(eb?1:0),innerRef:Q})]},e.task_job_id))}):(0,a.jsx)(u.SC,{children:(0,a.jsx)(u.pj,{colSpan:11+(eg?1:0)+(eb?1:0),className:"text-center py-6",children:(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[en&&(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,a.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. It will be ready shortly."}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{size:12,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!er&&!en&&(0,a.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),!ej&&er&&(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-3 px-4",children:[(0,a.jsx)("p",{className:"text-gray-700 text-center text-sm sm:text-base max-w-md",children:"The managed job controller has been stopped. Restart to check the latest job status."}),(0,a.jsx)(o.z,{variant:"outline",size:"sm",onClick:ev,className:"text-sky-blue hover:text-sky-blue-bright",disabled:P||ec,children:ec?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})})}),(0,a.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,a.jsxs)("div",{className:"relative inline-block",children:[(0,a.jsxs)("select",{value:B,onChange:e=>{K(parseInt(e.target.value,10)),Z(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,a.jsx)("option",{value:10,children:"10"}),(0,a.jsx)("option",{value:30,children:"30"}),(0,a.jsx)("option",{value:50,children:"50"}),(0,a.jsx)("option",{value:100,children:"100"}),(0,a.jsx)("option",{value:200,children:"200"})]}),(0,a.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,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,a.jsx)("div",{children:R>0?"".concat(eE+1," – ").concat(eD," of ").concat(R):"0 – 0 of 0"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{Z(e=>Math.max(e-1,1))},disabled:1===O||!e_||0===e_.length,className:"text-gray-500 h-8 w-8 p-0",children:(0,a.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,a.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,a.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{eR>0&&O<eR&&Z(e=>e+1)},disabled:0===eR||O>=eR||!e_||0===e_.length,className:"text-gray-500 h-8 w-8 p-0",children:(0,a.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,a.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})}),(0,a.jsx)(C.cV,{isOpen:em.isOpen,onClose:()=>ep({...em,isOpen:!1}),onConfirm:em.onConfirm,title:em.title,message:em.message,confirmClassName:"bg-blue-600 hover:bg-blue-700 text-white"})]})}function H(e){let{withLabel:s=!1,jobParent:t,jobId:r,managed:n,workspace:i="default"}=e,c=(0,l.useRouter)(),o=(e,s)=>{e.preventDefault(),e.stopPropagation(),c.push({pathname:"".concat(t,"/").concat(r),query:{tab:s}})},d=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.preventDefault(),e.stopPropagation(),n)(0,m.jh)({jobId:parseInt(r),controller:s});else{let e=t.match(/\/clusters\/(.+)/);if(e){let s=e[1];(0,g.GH)({clusterName:s,jobIds:[r],workspace:i})}}};return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(h.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,a.jsxs)("button",{onClick:e=>o(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,a.jsx)(N.Z,{className:"w-4 h-4"}),s&&(0,a.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),(0,a.jsx)(h.WH,{content:"Download Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,a.jsxs)("button",{onClick:e=>d(e,!1),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,a.jsx)(k.Z,{className:"w-4 h-4"}),s&&(0,a.jsx)("span",{className:"ml-1.5",children:"Download"})]})},"downloadlogs")]})}function K(e){let{clusterName:s,clusterJobData:t,loading:l,refreshClusterJobsOnly:n,userFilter:x=null,nameFilter:m=null,workspace:p="default"}=e,[j,f]=(0,r.useState)(null),[g,b]=(0,r.useState)({key:null,direction:"ascending"}),[v,w]=(0,r.useState)(1),[N,k]=(0,r.useState)(10),C=(0,r.useRef)(null),[S,E]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=e=>{j&&C.current&&!C.current.contains(e.target)&&f(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[j]);let R=r.useMemo(()=>{let e=t||[];return x&&"ALL_USERS"!==x&&(e=W(e,x)),m&&(e=J(e,m)),e},[t,x,m]);(0,r.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(S)&&E(t)},[t,S]);let D=r.useMemo(()=>g.key?[...R].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):R,[R,g]),M=e=>{let s="ascending";g.key===e&&"ascending"===g.direction&&(s="descending"),b({key:e,direction:s})},F=e=>g.key===e?"ascending"===g.direction?" ↑":" ↓":"",I=Math.ceil(D.length/N),A=(v-1)*N,z=A+N,P=D.slice(A,z);return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)(d.Zb,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Cluster Jobs"}),(0,a.jsx)("div",{className:"flex items-center",children:n&&(0,a.jsxs)("button",{onClick:n,disabled:l,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center text-sm ml-2",children:[(0,a.jsx)(y.Z,{className:"w-4 h-4 mr-1"}),"Refresh Jobs"]})})]}),(0,a.jsxs)(u.iA,{children:[(0,a.jsx)(u.xD,{children:(0,a.jsxs)(u.SC,{children:[(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("id"),children:["ID",F("id")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("job"),children:["Name",F("job")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("user"),children:["User",F("user")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("submitted_at"),children:["Submitted",F("submitted_at")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("job_duration"),children:["Duration",F("job_duration")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("status"),children:["Status",F("status")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>M("resources"),children:["Resources",F("resources")]}),(0,a.jsx)(u.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,a.jsx)(u.RM,{children:l?(0,a.jsx)(u.SC,{children:(0,a.jsx)(u.pj,{colSpan:8,className:"text-center py-12 text-gray-500",children:(0,a.jsxs)("div",{className:"flex justify-center items-center",children:[(0,a.jsx)(c.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading cluster jobs..."})]})})}):P.length>0?P.map(e=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(u.SC,{className:j===e.id?"selected-row":"",children:[(0,a.jsx)(u.pj,{children:(0,a.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,a.jsx)(G,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:j,setExpandedRowId:f})})}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(_.H,{username:e.user,userHash:e.user_hash})}),(0,a.jsx)(u.pj,{children:T(e.submitted_at)}),(0,a.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(L.OE,{status:e.status})}),(0,a.jsx)(u.pj,{children:e.resources}),(0,a.jsx)(u.pj,{className:"flex content-center items-center",children:(0,a.jsx)(H,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1,workspace:p})})]}),j===e.id&&(0,a.jsx)(q,{text:e.job||"Unnamed job",colSpan:8,innerRef:C})]},e.id)):(0,a.jsx)(u.SC,{children:(0,a.jsx)(u.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),D&&D.length>0&&(0,a.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,a.jsxs)("div",{className:"relative inline-block",children:[(0,a.jsxs)("select",{value:N,onChange:e=>{k(parseInt(e.target.value,10)),w(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,a.jsx)("option",{value:5,children:"5"}),(0,a.jsx)("option",{value:10,children:"10"}),(0,a.jsx)("option",{value:20,children:"20"}),(0,a.jsx)("option",{value:50,children:"50"})]}),(0,a.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,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,a.jsxs)("div",{children:[A+1," – ",Math.min(z,D.length)," of"," ",D.length]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{w(e=>Math.max(e-1,1))},disabled:1===v,className:"text-gray-500 h-8 w-8 p-0",children:(0,a.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,a.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,a.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{w(e=>Math.min(e+1,I))},disabled:v===I||0===I,className:"text-gray-500 h-8 w-8 p-0",children:(0,a.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,a.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function q(e){let{text:s,colSpan:t,innerRef:r}=e;return(0,a.jsx)(u.SC,{className:"expanded-details",children:(0,a.jsx)(u.pj,{colSpan:t,children:(0,a.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:r,children:(0,a.jsx)("div",{className:"flex justify-between items-start",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Full Details"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-700",style:{whiteSpace:"pre-wrap"},children:s})]})})})})})}function G(e){let{text:s,rowId:t,expandedRowId:l,setExpandedRowId:n}=e,i=s||"",c=i.length>50,o=l===t,d=c?"".concat(i.substring(0,50)):i,u=(0,r.useRef)(null);return(0,a.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,a.jsx)("span",{className:"truncate",children:d}),c&&(0,a.jsx)("button",{ref:u,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(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"})]})}function V(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l}=e,[n,o]=(0,r.useState)([]),[x,j]=(0,r.useState)({key:null,direction:"ascending"}),[f,g]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!0),[y,w]=(0,r.useState)(1),[N,k]=(0,r.useState)(10),C=r.useCallback(async()=>{g(!0),t(!0);try{let{pools:e=[]}=await p.default.get(m.vs,[{}])||{};o(e),v(!1)}catch(e){console.error("Error fetching pools data:",e),o([]),v(!1)}finally{g(!1),t(!1)}},[t]);r.useEffect(()=>{l&&(l.current=C)},[l,C]),(0,r.useEffect)(()=>{o([]);let e=!0;C();let t=setInterval(()=>{e&&C()},s);return()=>{e=!1,clearInterval(t)}},[s,C]);let S=e=>{let s="ascending";x.key===e&&"ascending"===x.direction&&(s="descending"),j({key:e,direction:s})},_=e=>x.key===e?"ascending"===x.direction?" ↑":" ↓":"",E=r.useMemo(()=>x.key?[...n].sort((e,s)=>e[x.key]<s[x.key]?"ascending"===x.direction?-1:1:e[x.key]>s[x.key]?"ascending"===x.direction?1:-1:0):n,[n,x]),R=Math.ceil(E.length/N),D=(y-1)*N,M=D+N,F=E.slice(D,M),I=e=>{if(!e||!e.replica_info||0===e.replica_info.length)return"0 (target: 0)";let s=e.replica_info.filter(e=>"READY"===e.status).length,t=e.target_num_replicas||0;return"".concat(s," (target: ").concat(t,")")},A=e=>{let{jobCounts:s}=e;return(0,a.jsx)(h.x9,{jobCounts:s,getStatusStyle:L.Cl})},z=e=>{let{replicaInfo:s}=e;return(0,a.jsx)(h.Kl,{replicaInfo:s})};return(0,a.jsxs)(d.Zb,{children:[(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,a.jsxs)(u.iA,{className:"min-w-full table-fixed",children:[(0,a.jsx)(u.xD,{children:(0,a.jsxs)(u.SC,{children:[(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-32",onClick:()=>S("name"),children:["Pool",_("name")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-40",onClick:()=>S("job_counts"),children:["Jobs",_("job_counts")]}),(0,a.jsx)(u.ss,{className:"whitespace-nowrap w-20",children:"Workers"}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-36",onClick:()=>S("requested_resources_str"),children:["Worker Details",_("requested_resources_str")]}),(0,a.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-40",onClick:()=>S("requested_resources_str"),children:["Worker Resources",_("requested_resources_str")]})]})}),(0,a.jsx)(u.RM,{children:f&&b?(0,a.jsx)(u.SC,{children:(0,a.jsx)(u.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:(0,a.jsxs)("div",{className:"flex justify-center items-center",children:[(0,a.jsx)(c.Z,{size:20,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]})})}):F.length>0?F.map(e=>(0,a.jsxs)(u.SC,{children:[(0,a.jsx)(u.pj,{children:(0,a.jsx)(i(),{href:"/jobs/pools/".concat(e.name),className:"text-blue-600 hover:text-blue-800",children:e.name})}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(A,{jobCounts:e.jobCounts})}),(0,a.jsx)(u.pj,{children:I(e)}),(0,a.jsx)(u.pj,{children:(0,a.jsx)(z,{replicaInfo:e.replica_info})}),(0,a.jsx)(u.pj,{children:e.requested_resources_str||"-"})]},e.name)):(0,a.jsx)(u.SC,{children:(0,a.jsx)(u.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:"No pools found"})})})]})}),F.length>0&&R>1&&(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-sm text-gray-700",children:"Rows per page:"}),(0,a.jsxs)("select",{value:N,onChange:e=>{k(parseInt(e.target.value,10)),w(1)},className:"border border-gray-300 rounded px-2 py-1 text-sm",children:[(0,a.jsx)("option",{value:5,children:"5"}),(0,a.jsx)("option",{value:10,children:"10"}),(0,a.jsx)("option",{value:25,children:"25"}),(0,a.jsx)("option",{value:50,children:"50"})]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("span",{className:"text-sm text-gray-700",children:[D+1,"-",Math.min(M,E.length)," of"," ",E.length]}),(0,a.jsx)("button",{onClick:()=>{w(e=>Math.max(e-1,1))},disabled:1===y,className:"px-2 py-1 text-sm border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Previous"}),(0,a.jsx)("button",{onClick:()=>{w(e=>Math.min(e+1,R))},disabled:y===R,className:"px-2 py-1 text-sm border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Next"})]})]})]})}}}]);
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/let r=(0,s(60998).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"}]])},1125:function(e,t,s){"use strict";s.d(t,{C:function(){return o}});var r=s(85893),n=s(67294),a=s(34209),l=s(84283);let c=e=>{if(!e||"string"!=typeof e)return e;let t=e.split("\n"),s=[];for(let e=0;e<t.length;e++){let r=t[e];if(""===r.trim()){let n=!1,a=0;for(let s=e-1;s>=0;s--){let e=t[s],r=e.trim();if(r&&e.match(/:\s*[|>]\s*$/)){n=!0;for(let e=s+1;e<t.length;e++){let s=t[e];if(s.trim()){a=s.search(/\S/);break}}break}if(r&&0===e.search(/\S/))break}if(n)for(let n=e+1;n<t.length;n++){let e=t[n];if(e.trim()){e.search(/\S/)>=a?s.push(" #YAML_BLANK_LINE_MARKER#"):s.push(r);break}}else s.push(r)}else s.push(r)}return s.join("\n")};function o(e){let{children:t,className:s=""}=e,o=(0,n.useRef)(null),i=c(t);(0,n.useEffect)(()=>{if(o.current){let e=o.current;setTimeout(()=>{let t;let s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;t=s.nextNode();)t.textContent&&t.textContent.includes("#YAML_BLANK_LINE_MARKER#")&&(t.textContent=t.textContent.replace(/#YAML_BLANK_LINE_MARKER#/g,""))},0)}},[i]);let d={...l.mQ,'code[class*="language-"]':{...l.mQ['code[class*="language-"]'],whiteSpace:"pre !important"},'pre[class*="language-"]':{...l.mQ['pre[class*="language-"]'],whiteSpace:"pre !important"}};return(0,r.jsx)("div",{ref:o,className:s,children:(0,r.jsx)(a.Z,{language:"yaml",style:d,customStyle:{margin:0,padding:0,background:"transparent",fontSize:"0.875rem",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace'},wrapLines:!0,wrapLongLines:!0,showLineNumbers:!1,useInlineStyles:!0,children:i})})}},99307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return c},OE:function(){return d}});var r=s(85893);s(67294);var n=s(55739),a=s(36989),l=s(53850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":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":case"PREEMPTED":return(0,r.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":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":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":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)})})}},20546:function(e,t,s){"use strict";s.d(t,{H:function(){return d}});var r=s(85893);s(67294);var n=s(41664),a=s.n(n),l=s(45697),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}},37673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return m},ll:function(){return d}});var r=s(85893),n=s(67294),a=s(45697),l=s.n(a),c=s(32350);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}},47145:function(e,t,s){"use strict";s.d(t,{x:function(){return n}});var r=s(93225);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)}}},32350:function(e,t,s){"use strict";s.d(t,{cn:function(){return a}});var r=s(90512),n=s(98388);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))}},84303:function(e,t,s){"use strict";s.d(t,{_q:function(){return a},pJ:function(){return o}});var r=s(1272);let n={lineWidth:-1,quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2},a=e=>{if(!e)return"No YAML available";try{let t=r.ZP.load(e),s=r.ZP.dump(t,n).split("\n"),a=[],l=-1;for(let e=0;e<s.length;e++){let t=s[e],r=t.search(/\S/);0===r&&l>=0&&e>0&&a.push(""),a.push(t),l=r}return a.join("\n").trim()}catch(t){return console.error("YAML formatting error:",t),e}},l=e=>"string"==typeof e?e.substring(0,50)+"...":e&&e.name?"name: ".concat(e.name):e&&e.resources?"Task configuration":"YAML document",c=(e,t)=>{try{let s=r.ZP.load(e),a=r.ZP.dump(s,n).split("\n"),c=[],o=-1;for(let e=0;e<a.length;e++){let t=a[e],s=t.search(/\S/);0===s&&o>=0&&e>0&&c.push(""),c.push(t),o=s}return{index:t,content:c.join("\n").trim(),preview:l(s)}}catch(s){return console.error("YAML formatting error for document ".concat(t,":"),s),{index:t,content:e,preview:"Invalid YAML"}}},o=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)=>c(e,t))}catch(t){return console.error("YAML formatting error:",t),[{index:0,content:e,preview:"Invalid YAML"}]}}},88099:function(e,t,s){"use strict";s.r(t);var r=s(85893),n=s(67294),a=s(55739),l=s(11163);s(6135);var c=s(37673),o=s(68969),i=s(41664),d=s.n(i),u=s(13626),m=s(16826),x=s(70282),f=s(27325),h=s(45895),g=s(6639),N=s(36989),p=s(99307),j=s(23001),y=s(9008),b=s.n(y),v=s(84303),E=s(20546),L=s(1125),w=s(6378);function I(e){let{jobData:t,activeTab:s,setIsLoadingLogs:l,setIsLoadingControllerLogs:c,isLoadingLogs:i,isLoadingControllerLogs:u,refreshFlag:m,poolsData:j}=e,[y,b]=(0,n.useState)(""),[w,I]=(0,n.useState)(""),[C,R]=(0,n.useState)(!1),[S,A]=(0,n.useState)({}),[T,_]=(0,n.useState)(!1),[D,k]=(0,n.useState)(!1),[O,P]=(0,n.useState)(0),[F,M]=(0,n.useState)(0),[Z,H]=(0,n.useState)(!1),[U,W]=(0,n.useState)(!1),[q,G]=(0,n.useState)(!1),[Y,B]=(0,n.useState)(!1),J=(0,n.useRef)(null),K=(0,n.useRef)(null),V=(0,n.useRef)(new WeakSet),z=(0,n.useRef)(null),$=(0,n.useRef)(null),X=(0,n.useRef)(""),Q=(0,n.useRef)(""),ee=(0,n.useRef)(null);(0,n.useRef)(0);let et=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"request";if(e){if(V.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")),V.current.add(e);return}e.abort(),V.current.add(e),console.log("Successfully aborted ".concat(t))}catch(s){console.log("Caught error while aborting ".concat(t,":"),s.name,s.message),V.current.add(e),"AbortError"!==s.name&&"InvalidStateError"!==s.name&&console.warn("Unexpected error aborting ".concat(t,":"),s)}}},[]),es=(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}}},[]),er=["PENDING","SUBMITTED","STARTING"].includes(t.status),en=["PENDING","SUBMITTED"].includes(t.status),ea=["RECOVERING"].includes(t.status),el=e=>{A(t=>({...t,[e]:!t[e]}))},ec=async()=>{try{let e=(0,v.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),_(!0),setTimeout(()=>_(!1),2e3)}catch(e){console.error("Failed to copy YAML to clipboard:",e)}},eo=async()=>{try{await navigator.clipboard.writeText(t.entrypoint),k(!0),setTimeout(()=>k(!1),2e3)}catch(e){console.error("Failed to copy command to clipboard:",e)}};(0,n.useEffect)(()=>{b(""),P(0),B(!1)},[s,t.id]),(0,n.useEffect)(()=>{I(""),M(0),B(!1)},[s,t.id]);let ei=(0,n.useCallback)(function(e,t,s,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a="logs"===e?J:K;if(a.current)return console.log("Request already active for ".concat(e,", skipping...")),()=>{};let l=!0,c=new AbortController;return"logs"===e&&(er||ea)?(r(!1),n&&H(!1),()=>{}):"controllerlogs"===e&&en?(r(!1),n&&W(!1),()=>{}):t?(a.current=c,r(!0),G(!0),n&&(s(""),"logs"===e?P(0):M(0)),(0,o.NJ)({jobId:t,controller:"controllerlogs"===e,signal:c.signal,onNewLog:t=>{l&&(Y||B(!0),("logs"===e?s:I)(s=>{let r=t.split("\n").filter(e=>e.trim()),n=s;for(let e of r){let t=(0,N.Zn)(e);if(/\d+%\s*\|/.test(t)){let e=t.match(/^\(([^)]+)\)/);if(e&&n){let s=n.split("\n"),r=!1;for(let a=s.length-1;a>=0;a--){let l=s[a];if(/\d+%\s*\|/.test(l)){let c=l.match(/^\(([^)]+)\)/);if(c&&c[1]===e[1]){s[a]=t,n=s.join("\n"),r=!0;break}}}r||(n+=(n?"\n":"")+t)}else n+=(n?"\n":"")+t}else n+=(n?"\n":"")+t}return"logs"===e?P(n.length):M(n.length),n}),requestAnimationFrame(()=>{es(e)}))}}).then(()=>{l&&(r(!1),n&&("logs"===e?H(!1):W(!1)),requestAnimationFrame(()=>{es(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?H(!1):W(!1)))}).finally(()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(et(c,e),a.current=null),"logs"===e?X.current="":Q.current="",ee.current&&(clearTimeout(ee.current),ee.current=null)}),()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(et(c,"".concat(e," cleanup")),a.current=null),"logs"===e?X.current="":Q.current="",ee.current&&(clearTimeout(ee.current),ee.current=null)}):()=>{l=!1}},[er,en,ea,Y,et,es]);return((0,n.useEffect)(()=>{if(J.current&&(et(J.current,"logs"),J.current=null),!er&&!ea)return ei("logs",t.id,b,l)},[t.id,ei,l,er,ea,et]),(0,n.useEffect)(()=>{if(K.current&&(et(K.current,"controller logs"),K.current=null),!en)return ei("controllerlogs",t.id,I,c)},[t.id,ei,c,en,et]),(0,n.useEffect)(()=>{if(m>0&&"logs"===s)return J.current&&(et(J.current,"logs refresh"),J.current=null),H(!0),ei("logs",t.id,b,l,!0)},[m,s,t.id,ei,l,et]),(0,n.useEffect)(()=>{if(m>0&&"controllerlogs"===s)return K.current&&(et(K.current,"controller logs refresh"),K.current=null),W(!0),ei("controllerlogs",t.id,I,c,!0)},[m,s,t.id,ei,c,et]),(0,n.useEffect)(()=>()=>{console.log("Cleaning up managed job log requests..."),J.current&&(et(J.current,"logs cleanup"),J.current=null),K.current&&(et(K.current,"controller logs cleanup"),K.current=null),ee.current&&(clearTimeout(ee.current),ee.current=null),X.current="",Q.current="",l(!1),c(!1),H(!1),W(!1)},[et,l,c]),(0,n.useEffect)(()=>{let e=()=>{document.hidden?(console.log("Page hidden - pausing log streaming for performance"),ee.current&&(clearTimeout(ee.current),ee.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&&y||"controllerlogs"===s&&w)&&es("logs"===s?"logs":"controllerlogs")};requestAnimationFrame(()=>{requestAnimationFrame(e)})},[s,y,w,es]),"logs"===s)?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:z,children: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 start; refresh in a few moments."})}):ea?(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."})}):Y||y?(0,r.jsx)(N.$B,{logs:y}):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)(N.$B,{logs:y})}):"controllerlogs"===s?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:$,children:en?(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."})}):Y||w?(0,r.jsx)(N.$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)(N.$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)(p.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)(E.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,N.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)(N.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||"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Git Commit"}),(0,r.jsx)("div",{className:"text-base mt-1 flex items-center",children:t.git_commit&&"-"!==t.git_commit?(0,r.jsxs)("span",{className:"flex items-center mr-2",children:[t.git_commit,(0,r.jsx)(N.WH,{content:T?"Copied!":"Copy commit",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:async()=>{await navigator.clipboard.writeText(t.git_commit),_(!0),setTimeout(()=>_(!1),2e3)},className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:T?(0,r.jsx)(x.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(f.Z,{className:"w-4 h-4"})})})]}):(0,r.jsx)("span",{className:"text-gray-400",children:"-"})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Worker Pool"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,N.os)(t.pool,t.pool_hash,j)})]}),(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)(N.WH,{content:D?"Copied!":"Copy command",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:eo,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:D?(0,r.jsx)(x.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(f.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:()=>{R(!C)},className:"flex items-center text-left focus:outline-none text-gray-700 hover:text-gray-900 transition-colors duration-200",children:[C?(0,r.jsx)(h.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)(N.WH,{content:T?"Copied!":"Copy YAML",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:ec,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:T?(0,r.jsx)(x.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(f.Z,{className:"w-4 h-4"})})})]}),C&&(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,v.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)(L.C,{className:"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:()=>el(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)(h.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)(L.C,{className:"whitespace-pre-wrap",children:e.content})})]},t))})})()})]})]})]})]})}t.default=function(){var e;let t=(0,l.useRouter)(),{job:s,tab:i}=t.query,[x,f]=(0,n.useState)(0),{jobData:h,loading:g}=(0,o.UA)(s,x),[p,y]=(0,n.useState)([]),[v,E]=(0,n.useState)(!1),[L,C]=(0,n.useState)(!0),[R,S]=(0,n.useState)(!1),[A,T]=(0,n.useState)(!1),[_,D]=(0,n.useState)(!1),[k,O]=(0,n.useState)(!1),[P,F]=(0,n.useState)(!1),[M,Z]=(0,n.useState)(0),[H,U]=(0,n.useState)(0),W=(0,j.X)();n.useEffect(()=>{!g&&L&&C(!1)},[g,L]),(0,n.useEffect)(()=>{(async function(){try{let e=await w.default.get(o.vs,[{}]);y(e.pools||[])}catch(e){console.error("Error fetching pools data:",e),y([])}})()},[]);let q=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};(0,n.useEffect)(()=>{O(!0)},[]),(0,n.useEffect)(()=>{if(!P){let e=new MutationObserver(()=>{let t=document.getElementById("logs-section"),s=document.getElementById("controller-logs-section");("logs"===i&&t||"controllerlogs"===i&&s)&&(F(!0),e.disconnect())});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()}},[P,i]),(0,n.useEffect)(()=>{if(t.isReady&&k&&P&&!_){let e=setTimeout(()=>{"logs"===i?(q("logs-section"),D(!0)):"controllerlogs"===i&&(q("controller-logs-section"),D(!0))},800);return()=>clearTimeout(e)}},[t.isReady,i,_,k,P]),(0,n.useEffect)(()=>{D(!1),F(!1)},[i]);let G=async()=>{E(!0);try{f(e=>e+1),Z(e=>e+1),U(e=>e+1)}catch(e){console.error("Error refreshing data:",e)}finally{E(!1)}};if(!t.isReady)return(0,r.jsx)("div",{children:"Loading..."});let Y=null==h?void 0:null===(e=h.jobs)||void 0===e?void 0:e.find(e=>String(e.id)===String(s)),B=s?"Job: ".concat(s," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b(),{children:(0,r.jsx)("title",{children:B})}),(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==Y?void 0:Y.name)?"(".concat(Y.name,")"):""]})]}),(0,r.jsxs)("div",{className:"text-sm flex items-center",children:[(g||v||R||A)&&(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)(N.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.jsxs)("button",{onClick:G,disabled:g||v,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"}),!W&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]}),g&&L?(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..."})]}):Y?(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)(I,{jobData:Y,activeTab:"info",setIsLoadingLogs:S,setIsLoadingControllerLogs:T,isLoadingLogs:R,isLoadingControllerLogs:A,refreshFlag:0,poolsData:p})})]})}),(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.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)(N.WH,{content:"Download full logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>(0,o.jh)({jobId:parseInt(Array.isArray(s)?s[0]:s),controller:!1}),className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(m.Z,{className:"w-4 h-4"})})}),(0,r.jsx)(N.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{Z(e=>e+1)},disabled:R,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(R?"animate-spin":"")})})})]})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(I,{jobData:Y,activeTab:"logs",setIsLoadingLogs:S,setIsLoadingControllerLogs:T,isLoadingLogs:R,isLoadingControllerLogs:A,refreshFlag:M,poolsData:p})})]})}),(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.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)(N.WH,{content:"Download full controller logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>(0,o.jh)({jobId:parseInt(Array.isArray(s)?s[0]:s),controller:!0}),className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(m.Z,{className:"w-4 h-4"})})}),(0,r.jsx)(N.WH,{content:"Refresh controller logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{U(e=>e+1)},disabled:A,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(A?"animate-spin":"")})})})]})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(I,{jobData:Y,activeTab:"controllerlogs",setIsLoadingLogs:S,setIsLoadingControllerLogs:T,isLoadingLogs:R,isLoadingControllerLogs:A,refreshFlag:H,poolsData:p})})]})})]}):(0,r.jsx)("div",{className:"flex items-center justify-center py-32",children:(0,r.jsx)("span",{children:"Job not found"})})]})]})}}},function(e){e.O(0,[616,6130,5739,7411,1272,6212,6989,3850,8969,6135,2888,9774,179],function(){return e(e.s=40479)}),_N_E=e.O()}]);
|
|
16
|
+
*/let r=(0,s(60998).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"}]])},1125:function(e,t,s){"use strict";s.d(t,{C:function(){return o}});var r=s(85893),n=s(67294),a=s(34209),l=s(84283);let c=e=>{if(!e||"string"!=typeof e)return e;let t=e.split("\n"),s=[];for(let e=0;e<t.length;e++){let r=t[e];if(""===r.trim()){let n=!1,a=0;for(let s=e-1;s>=0;s--){let e=t[s],r=e.trim();if(r&&e.match(/:\s*[|>]\s*$/)){n=!0;for(let e=s+1;e<t.length;e++){let s=t[e];if(s.trim()){a=s.search(/\S/);break}}break}if(r&&0===e.search(/\S/))break}if(n)for(let n=e+1;n<t.length;n++){let e=t[n];if(e.trim()){e.search(/\S/)>=a?s.push(" #YAML_BLANK_LINE_MARKER#"):s.push(r);break}}else s.push(r)}else s.push(r)}return s.join("\n")};function o(e){let{children:t,className:s=""}=e,o=(0,n.useRef)(null),i=c(t);(0,n.useEffect)(()=>{if(o.current){let e=o.current;setTimeout(()=>{let t;let s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;t=s.nextNode();)t.textContent&&t.textContent.includes("#YAML_BLANK_LINE_MARKER#")&&(t.textContent=t.textContent.replace(/#YAML_BLANK_LINE_MARKER#/g,""))},0)}},[i]);let d={...l.mQ,'code[class*="language-"]':{...l.mQ['code[class*="language-"]'],whiteSpace:"pre !important"},'pre[class*="language-"]':{...l.mQ['pre[class*="language-"]'],whiteSpace:"pre !important"}};return(0,r.jsx)("div",{ref:o,className:s,children:(0,r.jsx)(a.Z,{language:"yaml",style:d,customStyle:{margin:0,padding:0,background:"transparent",fontSize:"0.875rem",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace'},wrapLines:!0,wrapLongLines:!0,showLineNumbers:!1,useInlineStyles:!0,children:i})})}},99307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return c},OE:function(){return d}});var r=s(85893);s(67294);var n=s(55739),a=s(36989),l=s(53850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":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":case"PREEMPTED":return(0,r.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":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":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":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)})})}},20546:function(e,t,s){"use strict";s.d(t,{H:function(){return d}});var r=s(85893);s(67294);var n=s(41664),a=s.n(n),l=s(45697),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}},37673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return m},ll:function(){return d}});var r=s(85893),n=s(67294),a=s(45697),l=s.n(a),c=s(32350);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}},47145:function(e,t,s){"use strict";s.d(t,{x:function(){return n}});var r=s(93225);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)}}},32350:function(e,t,s){"use strict";s.d(t,{cn:function(){return a}});var r=s(90512),n=s(98388);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))}},84303:function(e,t,s){"use strict";s.d(t,{_q:function(){return a},pJ:function(){return o}});var r=s(1272);let n={lineWidth:-1,quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2},a=e=>{if(!e)return"No YAML available";try{let t=r.ZP.load(e),s=r.ZP.dump(t,n).split("\n"),a=[],l=-1;for(let e=0;e<s.length;e++){let t=s[e],r=t.search(/\S/);0===r&&l>=0&&e>0&&a.push(""),a.push(t),l=r}return a.join("\n").trim()}catch(t){return console.error("YAML formatting error:",t),e}},l=e=>"string"==typeof e?e.substring(0,50)+"...":e&&e.name?"name: ".concat(e.name):e&&e.resources?"Task configuration":"YAML document",c=(e,t)=>{try{let s=r.ZP.load(e),a=r.ZP.dump(s,n).split("\n"),c=[],o=-1;for(let e=0;e<a.length;e++){let t=a[e],s=t.search(/\S/);0===s&&o>=0&&e>0&&c.push(""),c.push(t),o=s}return{index:t,content:c.join("\n").trim(),preview:l(s)}}catch(s){return console.error("YAML formatting error for document ".concat(t,":"),s),{index:t,content:e,preview:"Invalid YAML"}}},o=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)=>c(e,t))}catch(t){return console.error("YAML formatting error:",t),[{index:0,content:e,preview:"Invalid YAML"}]}}},88099:function(e,t,s){"use strict";s.r(t);var r=s(85893),n=s(67294),a=s(55739),l=s(11163);s(6135);var c=s(37673),o=s(68969),i=s(41664),d=s.n(i),u=s(13626),m=s(16826),x=s(70282),f=s(27325),h=s(45895),g=s(6639),N=s(36989),p=s(99307),j=s(23001),y=s(9008),b=s.n(y),v=s(84303),E=s(20546),L=s(1125),w=s(6378);function I(e){let{jobData:t,activeTab:s,setIsLoadingLogs:l,setIsLoadingControllerLogs:c,isLoadingLogs:i,isLoadingControllerLogs:u,refreshFlag:m,poolsData:j}=e,[y,b]=(0,n.useState)(""),[w,I]=(0,n.useState)(""),[C,R]=(0,n.useState)(!1),[S,A]=(0,n.useState)({}),[T,_]=(0,n.useState)(!1),[k,D]=(0,n.useState)(!1),[O,P]=(0,n.useState)(0),[F,M]=(0,n.useState)(0),[Z,H]=(0,n.useState)(!1),[U,W]=(0,n.useState)(!1),[q,G]=(0,n.useState)(!1),[Y,B]=(0,n.useState)(!1),J=(0,n.useRef)(null),K=(0,n.useRef)(null),V=(0,n.useRef)(new WeakSet),z=(0,n.useRef)(null),$=(0,n.useRef)(null),X=(0,n.useRef)(""),Q=(0,n.useRef)(""),ee=(0,n.useRef)(null);(0,n.useRef)(0);let et=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"request";if(e){if(V.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")),V.current.add(e);return}e.abort(),V.current.add(e),console.log("Successfully aborted ".concat(t))}catch(s){console.log("Caught error while aborting ".concat(t,":"),s.name,s.message),V.current.add(e),"AbortError"!==s.name&&"InvalidStateError"!==s.name&&console.warn("Unexpected error aborting ".concat(t,":"),s)}}},[]),es=(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}}},[]),er=["PENDING","SUBMITTED","STARTING"].includes(t.status),en=["PENDING","SUBMITTED"].includes(t.status),ea=["RECOVERING"].includes(t.status),el=e=>{A(t=>({...t,[e]:!t[e]}))},ec=async()=>{try{let e=(0,v.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),_(!0),setTimeout(()=>_(!1),2e3)}catch(e){console.error("Failed to copy YAML to clipboard:",e)}},eo=async()=>{try{await navigator.clipboard.writeText(t.entrypoint),D(!0),setTimeout(()=>D(!1),2e3)}catch(e){console.error("Failed to copy command to clipboard:",e)}};(0,n.useEffect)(()=>{b(""),P(0),B(!1)},[s,t.id]),(0,n.useEffect)(()=>{I(""),M(0),B(!1)},[s,t.id]);let ei=(0,n.useCallback)(function(e,t,s,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a="logs"===e?J:K;if(a.current)return console.log("Request already active for ".concat(e,", skipping...")),()=>{};let l=!0,c=new AbortController;return"logs"===e&&(er||ea)?(r(!1),n&&H(!1),()=>{}):"controllerlogs"===e&&en?(r(!1),n&&W(!1),()=>{}):t?(a.current=c,r(!0),G(!0),n&&(s(""),"logs"===e?P(0):M(0)),(0,o.NJ)({jobId:t,controller:"controllerlogs"===e,signal:c.signal,onNewLog:t=>{l&&(Y||B(!0),("logs"===e?s:I)(s=>{let r=t.split("\n").filter(e=>e.trim()),n=s;for(let e of r){let t=(0,N.Zn)(e);if(/\d+%\s*\|/.test(t)){let e=t.match(/^\(([^)]+)\)/);if(e&&n){let s=n.split("\n"),r=!1;for(let a=s.length-1;a>=0;a--){let l=s[a];if(/\d+%\s*\|/.test(l)){let c=l.match(/^\(([^)]+)\)/);if(c&&c[1]===e[1]){s[a]=t,n=s.join("\n"),r=!0;break}}}r||(n+=(n?"\n":"")+t)}else n+=(n?"\n":"")+t}else n+=(n?"\n":"")+t}return"logs"===e?P(n.length):M(n.length),n}),requestAnimationFrame(()=>{es(e)}))}}).then(()=>{l&&(r(!1),n&&("logs"===e?H(!1):W(!1)),requestAnimationFrame(()=>{es(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?H(!1):W(!1)))}).finally(()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(et(c,e),a.current=null),"logs"===e?X.current="":Q.current="",ee.current&&(clearTimeout(ee.current),ee.current=null)}),()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(et(c,"".concat(e," cleanup")),a.current=null),"logs"===e?X.current="":Q.current="",ee.current&&(clearTimeout(ee.current),ee.current=null)}):()=>{l=!1}},[er,en,ea,Y,et,es]);return((0,n.useEffect)(()=>{if(J.current&&(et(J.current,"logs"),J.current=null),!er&&!ea)return ei("logs",t.id,b,l)},[t.id,ei,l,er,ea,et]),(0,n.useEffect)(()=>{if(K.current&&(et(K.current,"controller logs"),K.current=null),!en)return ei("controllerlogs",t.id,I,c)},[t.id,ei,c,en,et]),(0,n.useEffect)(()=>{if(m>0&&"logs"===s)return J.current&&(et(J.current,"logs refresh"),J.current=null),H(!0),ei("logs",t.id,b,l,!0)},[m,s,t.id,ei,l,et]),(0,n.useEffect)(()=>{if(m>0&&"controllerlogs"===s)return K.current&&(et(K.current,"controller logs refresh"),K.current=null),W(!0),ei("controllerlogs",t.id,I,c,!0)},[m,s,t.id,ei,c,et]),(0,n.useEffect)(()=>()=>{console.log("Cleaning up managed job log requests..."),J.current&&(et(J.current,"logs cleanup"),J.current=null),K.current&&(et(K.current,"controller logs cleanup"),K.current=null),ee.current&&(clearTimeout(ee.current),ee.current=null),X.current="",Q.current="",l(!1),c(!1),H(!1),W(!1)},[et,l,c]),(0,n.useEffect)(()=>{let e=()=>{document.hidden?(console.log("Page hidden - pausing log streaming for performance"),ee.current&&(clearTimeout(ee.current),ee.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&&y||"controllerlogs"===s&&w)&&es("logs"===s?"logs":"controllerlogs")};requestAnimationFrame(()=>{requestAnimationFrame(e)})},[s,y,w,es]),"logs"===s)?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:z,children: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 start; refresh in a few moments."})}):ea?(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."})}):Y||y?(0,r.jsx)(N.$B,{logs:y}):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)(N.$B,{logs:y})}):"controllerlogs"===s?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:$,children:en?(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."})}):Y||w?(0,r.jsx)(N.$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)(N.$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)(p.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)(E.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:"Workspace"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(d(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:t.workspace||"default"})})]}),(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,N.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)(N.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||"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Git Commit"}),(0,r.jsx)("div",{className:"text-base mt-1 flex items-center",children:t.git_commit&&"-"!==t.git_commit?(0,r.jsxs)("span",{className:"flex items-center mr-2",children:[t.git_commit,(0,r.jsx)(N.WH,{content:T?"Copied!":"Copy commit",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:async()=>{await navigator.clipboard.writeText(t.git_commit),_(!0),setTimeout(()=>_(!1),2e3)},className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:T?(0,r.jsx)(x.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(f.Z,{className:"w-4 h-4"})})})]}):(0,r.jsx)("span",{className:"text-gray-400",children:"-"})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Worker Pool"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,N.os)(t.pool,t.pool_hash,j)})]}),(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)(N.WH,{content:k?"Copied!":"Copy command",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:eo,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:k?(0,r.jsx)(x.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(f.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:()=>{R(!C)},className:"flex items-center text-left focus:outline-none text-gray-700 hover:text-gray-900 transition-colors duration-200",children:[C?(0,r.jsx)(h.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)(N.WH,{content:T?"Copied!":"Copy YAML",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:ec,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:T?(0,r.jsx)(x.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(f.Z,{className:"w-4 h-4"})})})]}),C&&(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,v.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)(L.C,{className:"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:()=>el(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)(h.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)(L.C,{className:"whitespace-pre-wrap",children:e.content})})]},t))})})()})]})]})]})]})}t.default=function(){var e;let t=(0,l.useRouter)(),{job:s,tab:i}=t.query,[x,f]=(0,n.useState)(0),{jobData:h,loading:g}=(0,o.UA)(s,x),[p,y]=(0,n.useState)([]),[v,E]=(0,n.useState)(!1),[L,C]=(0,n.useState)(!0),[R,S]=(0,n.useState)(!1),[A,T]=(0,n.useState)(!1),[_,k]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[P,F]=(0,n.useState)(!1),[M,Z]=(0,n.useState)(0),[H,U]=(0,n.useState)(0),W=(0,j.X)();n.useEffect(()=>{!g&&L&&C(!1)},[g,L]),(0,n.useEffect)(()=>{(async function(){try{let e=await w.default.get(o.vs,[{}]);y(e.pools||[])}catch(e){console.error("Error fetching pools data:",e),y([])}})()},[]);let q=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};(0,n.useEffect)(()=>{O(!0)},[]),(0,n.useEffect)(()=>{if(!P){let e=new MutationObserver(()=>{let t=document.getElementById("logs-section"),s=document.getElementById("controller-logs-section");("logs"===i&&t||"controllerlogs"===i&&s)&&(F(!0),e.disconnect())});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()}},[P,i]),(0,n.useEffect)(()=>{if(t.isReady&&D&&P&&!_){let e=setTimeout(()=>{"logs"===i?(q("logs-section"),k(!0)):"controllerlogs"===i&&(q("controller-logs-section"),k(!0))},800);return()=>clearTimeout(e)}},[t.isReady,i,_,D,P]),(0,n.useEffect)(()=>{k(!1),F(!1)},[i]);let G=async()=>{E(!0);try{f(e=>e+1),Z(e=>e+1),U(e=>e+1)}catch(e){console.error("Error refreshing data:",e)}finally{E(!1)}};if(!t.isReady)return(0,r.jsx)("div",{children:"Loading..."});let Y=null==h?void 0:null===(e=h.jobs)||void 0===e?void 0:e.find(e=>String(e.id)===String(s)),B=s?"Job: ".concat(s," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b(),{children:(0,r.jsx)("title",{children:B})}),(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==Y?void 0:Y.name)?"(".concat(Y.name,")"):""]})]}),(0,r.jsxs)("div",{className:"text-sm flex items-center",children:[(g||v||R||A)&&(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)(N.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.jsxs)("button",{onClick:G,disabled:g||v,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"}),!W&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]}),g&&L?(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..."})]}):Y?(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)(I,{jobData:Y,activeTab:"info",setIsLoadingLogs:S,setIsLoadingControllerLogs:T,isLoadingLogs:R,isLoadingControllerLogs:A,refreshFlag:0,poolsData:p})})]})}),(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.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)(N.WH,{content:"Download full logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>(0,o.jh)({jobId:parseInt(Array.isArray(s)?s[0]:s),controller:!1}),className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(m.Z,{className:"w-4 h-4"})})}),(0,r.jsx)(N.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{Z(e=>e+1)},disabled:R,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(R?"animate-spin":"")})})})]})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(I,{jobData:Y,activeTab:"logs",setIsLoadingLogs:S,setIsLoadingControllerLogs:T,isLoadingLogs:R,isLoadingControllerLogs:A,refreshFlag:M,poolsData:p})})]})}),(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.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)(N.WH,{content:"Download full controller logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>(0,o.jh)({jobId:parseInt(Array.isArray(s)?s[0]:s),controller:!0}),className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(m.Z,{className:"w-4 h-4"})})}),(0,r.jsx)(N.WH,{content:"Refresh controller logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{U(e=>e+1)},disabled:A,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(A?"animate-spin":"")})})})]})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(I,{jobData:Y,activeTab:"controllerlogs",setIsLoadingLogs:S,setIsLoadingControllerLogs:T,isLoadingLogs:R,isLoadingControllerLogs:A,refreshFlag:H,poolsData:p})})]})})]}):(0,r.jsx)("div",{className:"flex items-center justify-center py-32",children:(0,r.jsx)("span",{children:"Job not found"})})]})]})}}},function(e){e.O(0,[616,6130,5739,7411,1272,6212,6989,3850,8969,6135,2888,9774,179],function(){return e(e.s=40479)}),_N_E=e.O()}]);
|
sky/dashboard/out/_next/static/chunks/{webpack-6a5ddd0184bfa22c.js → webpack-66f23594d38c7f16.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var t,e,n,r,c,o,u,i,f,a={},s={};function d(t){var e=s[t];if(void 0!==e)return e.exports;var n=s[t]={exports:{}},r=!0;try{a[t](n,n.exports,d),r=!1}finally{r&&delete s[t]}return n.exports}d.m=a,t=[],d.O=function(e,n,r,c){if(n){c=c||0;for(var o=t.length;o>0&&t[o-1][2]>c;o--)t[o]=t[o-1];t[o]=[n,r,c];return}for(var u=1/0,o=0;o<t.length;o++){for(var n=t[o][0],r=t[o][1],c=t[o][2],i=!0,f=0;f<n.length;f++)u>=c&&Object.keys(d.O).every(function(t){return d.O[t](n[f])})?n.splice(f--,1):(i=!1,c<u&&(u=c));if(i){t.splice(o--,1);var a=r();void 0!==a&&(e=a)}}return e},d.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return d.d(e,{a:e}),e},n=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},d.t=function(t,r){if(1&r&&(t=this(t)),8&r||"object"==typeof t&&t&&(4&r&&t.__esModule||16&r&&"function"==typeof t.then))return t;var c=Object.create(null);d.r(c);var o={};e=e||[null,n({}),n([]),n(n)];for(var u=2&r&&t;"object"==typeof u&&!~e.indexOf(u);u=n(u))Object.getOwnPropertyNames(u).forEach(function(e){o[e]=function(){return t[e]}});return o.default=function(){return t},d.d(c,o),c},d.d=function(t,e){for(var n in e)d.o(e,n)&&!d.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},d.f={},d.e=function(t){return Promise.all(Object.keys(d.f).reduce(function(e,n){return d.f[n](t,e),e},[]))},d.u=function(t){return 2350===t?"static/chunks/2350.fab69e61bac57b23.js":
|
|
1
|
+
!function(){"use strict";var t,e,n,r,c,o,u,i,f,a={},s={};function d(t){var e=s[t];if(void 0!==e)return e.exports;var n=s[t]={exports:{}},r=!0;try{a[t](n,n.exports,d),r=!1}finally{r&&delete s[t]}return n.exports}d.m=a,t=[],d.O=function(e,n,r,c){if(n){c=c||0;for(var o=t.length;o>0&&t[o-1][2]>c;o--)t[o]=t[o-1];t[o]=[n,r,c];return}for(var u=1/0,o=0;o<t.length;o++){for(var n=t[o][0],r=t[o][1],c=t[o][2],i=!0,f=0;f<n.length;f++)u>=c&&Object.keys(d.O).every(function(t){return d.O[t](n[f])})?n.splice(f--,1):(i=!1,c<u&&(u=c));if(i){t.splice(o--,1);var a=r();void 0!==a&&(e=a)}}return e},d.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return d.d(e,{a:e}),e},n=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},d.t=function(t,r){if(1&r&&(t=this(t)),8&r||"object"==typeof t&&t&&(4&r&&t.__esModule||16&r&&"function"==typeof t.then))return t;var c=Object.create(null);d.r(c);var o={};e=e||[null,n({}),n([]),n(n)];for(var u=2&r&&t;"object"==typeof u&&!~e.indexOf(u);u=n(u))Object.getOwnPropertyNames(u).forEach(function(e){o[e]=function(){return t[e]}});return o.default=function(){return t},d.d(c,o),c},d.d=function(t,e){for(var n in e)d.o(e,n)&&!d.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},d.f={},d.e=function(t){return Promise.all(Object.keys(d.f).reduce(function(e,n){return d.f[n](t,e),e},[]))},d.u=function(t){return 2350===t?"static/chunks/2350.fab69e61bac57b23.js":2369===t?"static/chunks/2369.fc20f0c2c8ed9fe7.js":3937===t?"static/chunks/3937.210053269f121201.js":9025===t?"static/chunks/9025.c12318fb6a1a9093.js":4937===t?"static/chunks/4937.a2baa2df5572a276.js":3294===t?"static/chunks/3294.1fafbf42b3bcebff.js":8640===t?"static/chunks/8640.5b9475a2d18c5416.js":2755===t?"static/chunks/2755.97300e1362fe7c98.js":9847===t?"static/chunks/9847.3aaca6bb33455140.js":4725===t?"static/chunks/4725.10f7a9a5d3ea8208.js":3785===t?"static/chunks/3785.a19328ba41517b8b.js":9360===t?"static/chunks/9360.71e83b2ddc844ec2.js":"static/chunks/"+t+"-"+({616:"3d59f75e2ccf9321",1121:"d0782b9251f0fcd3",1141:"3b40c39626f99c89",1272:"1ef0bf0237faccdb",1871:"49141c317f3a9020",3015:"7e0e8f06bb2f881c",3850:"ff4a9a69d978632b",5739:"d67458fcb1386c92",6130:"2be46d70a38f1e82",6135:"4b4d5e824b7f9d3c",6601:"06114c982db410b6",6856:"5fdc9b851a18acdb",6989:"01359c57e018caa4",6990:"f6818c84ed8f1c86",7359:"c8d04e06886000b3",7411:"b15471acd2cba716",8969:"66237729cdf9749e"})[t]+".js"},d.miniCssF=function(t){},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),d.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r={},c="_N_E:",d.l=function(t,e,n,o){if(r[t]){r[t].push(e);return}if(void 0!==n)for(var u,i,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var s=f[a];if(s.getAttribute("src")==t||s.getAttribute("data-webpack")==c+n){u=s;break}}u||(i=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,d.nc&&u.setAttribute("nonce",d.nc),u.setAttribute("data-webpack",c+n),u.src=d.tu(t)),r[t]=[e];var b=function(e,n){u.onerror=u.onload=null,clearTimeout(l);var c=r[t];if(delete r[t],u.parentNode&&u.parentNode.removeChild(u),c&&c.forEach(function(t){return t(n)}),e)return e(n)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=b.bind(null,u.onerror),u.onload=b.bind(null,u.onload),i&&document.head.appendChild(u)},d.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},d.tt=function(){return void 0===o&&(o={createScriptURL:function(t){return t}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o},d.tu=function(t){return d.tt().createScriptURL(t)},d.p="/dashboard/_next/",u={2272:0},d.f.j=function(t,e){var n=d.o(u,t)?u[t]:void 0;if(0!==n){if(n)e.push(n[2]);else if(2272!=t){var r=new Promise(function(e,r){n=u[t]=[e,r]});e.push(n[2]=r);var c=d.p+d.u(t),o=Error();d.l(c,function(e){if(d.o(u,t)&&(0!==(n=u[t])&&(u[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),c=e&&e.target&&e.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+c+")",o.name="ChunkLoadError",o.type=r,o.request=c,n[1](o)}},"chunk-"+t,t)}else u[t]=0}},d.O.j=function(t){return 0===u[t]},i=function(t,e){var n,r,c=e[0],o=e[1],i=e[2],f=0;if(c.some(function(t){return 0!==u[t]})){for(n in o)d.o(o,n)&&(d.m[n]=o[n]);if(i)var a=i(d)}for(t&&t(e);f<c.length;f++)r=c[f],d.o(u,r)&&u[r]&&u[r][0](),u[r]=0;return d.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(i.bind(null,0)),f.push=i.bind(null,f.push.bind(f)),d.nc=void 0}();
|
sky/dashboard/out/_next/static/{hIViZcQBkn0HE8SpaSsUU → yOfMelBaFp8uL5F9atyAK}/_buildManifest.js
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,t,e,f,u,n,b,o,j,r,i,k,
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,t,e,f,u,n,b,o,j,r,i,k,h){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-444f1804401f04ea.js"],"/_error":["static/chunks/pages/_error-c66a4e8afc46f17b.js"],"/clusters":["static/chunks/pages/clusters-2f61f65487f6d8ff.js"],"/clusters/[cluster]":[s,c,a,f,u,j,o,t,e,n,r,b,i,k,h,"static/chunks/6856-5fdc9b851a18acdb.js","static/chunks/1871-49141c317f3a9020.js","static/chunks/pages/clusters/[cluster]-477555ab7c0b13d8.js"],"/clusters/[cluster]/[job]":[s,c,a,f,t,e,b,"static/chunks/pages/clusters/[cluster]/[job]-8f058b0346db2aff.js"],"/config":["static/chunks/pages/config-dfb9bf07b13045f4.js"],"/infra":["static/chunks/pages/infra-910a22500c50596f.js"],"/infra/[context]":["static/chunks/pages/infra/[context]-553b8b5cb65e100b.js"],"/jobs":["static/chunks/pages/jobs-a35a9dc3c5ccd657.js"],"/jobs/pools/[pool]":[s,c,a,u,o,t,e,n,"static/chunks/pages/jobs/pools/[pool]-bc979970c247d8f3.js"],"/jobs/[job]":[s,c,a,f,u,o,t,e,n,b,"static/chunks/pages/jobs/[job]-e5c9ce6a24fc0de4.js"],"/users":["static/chunks/pages/users-98d2ed979084162a.js"],"/volumes":["static/chunks/pages/volumes-835d14ba94808f79.js"],"/workspace/new":["static/chunks/pages/workspace/new-3f88a1c7e86a3f86.js"],"/workspaces":["static/chunks/pages/workspaces-69c80d677d3c2949.js"],"/workspaces/[name]":[s,c,a,f,u,j,t,e,n,r,b,i,k,h,"static/chunks/1141-3b40c39626f99c89.js","static/chunks/pages/workspaces/[name]-e8688c35c06f0ac5.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/config","/infra","/infra/[context]","/jobs","/jobs/pools/[pool]","/jobs/[job]","/users","/volumes","/workspace/new","/workspaces","/workspaces/[name]"]}}("static/chunks/616-3d59f75e2ccf9321.js","static/chunks/6130-2be46d70a38f1e82.js","static/chunks/5739-d67458fcb1386c92.js","static/chunks/6989-01359c57e018caa4.js","static/chunks/3850-ff4a9a69d978632b.js","static/chunks/7411-b15471acd2cba716.js","static/chunks/1272-1ef0bf0237faccdb.js","static/chunks/8969-66237729cdf9749e.js","static/chunks/6135-4b4d5e824b7f9d3c.js","static/chunks/6212-7bd06f60ba693125.js","static/chunks/7359-c8d04e06886000b3.js","static/chunks/6990-f6818c84ed8f1c86.js","static/chunks/1121-d0782b9251f0fcd3.js","static/chunks/6601-06114c982db410b6.js","static/chunks/3015-7e0e8f06bb2f881c.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-
|
|
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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-66f23594d38c7f16.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-ce361c6959bc2001.js" defer=""></script><script src="/dashboard/_next/static/chunks/616-3d59f75e2ccf9321.js" defer=""></script><script src="/dashboard/_next/static/chunks/6130-2be46d70a38f1e82.js" defer=""></script><script src="/dashboard/_next/static/chunks/5739-d67458fcb1386c92.js" defer=""></script><script src="/dashboard/_next/static/chunks/7411-b15471acd2cba716.js" defer=""></script><script src="/dashboard/_next/static/chunks/6989-01359c57e018caa4.js" defer=""></script><script src="/dashboard/_next/static/chunks/3850-ff4a9a69d978632b.js" defer=""></script><script src="/dashboard/_next/static/chunks/6135-4b4d5e824b7f9d3c.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters/%5Bcluster%5D/%5Bjob%5D-8f058b0346db2aff.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters/[cluster]/[job]","query":{},"buildId":"yOfMelBaFp8uL5F9atyAK","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-
|
|
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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-66f23594d38c7f16.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-ce361c6959bc2001.js" defer=""></script><script src="/dashboard/_next/static/chunks/616-3d59f75e2ccf9321.js" defer=""></script><script src="/dashboard/_next/static/chunks/6130-2be46d70a38f1e82.js" defer=""></script><script src="/dashboard/_next/static/chunks/5739-d67458fcb1386c92.js" defer=""></script><script src="/dashboard/_next/static/chunks/7411-b15471acd2cba716.js" defer=""></script><script src="/dashboard/_next/static/chunks/1272-1ef0bf0237faccdb.js" defer=""></script><script src="/dashboard/_next/static/chunks/7359-c8d04e06886000b3.js" defer=""></script><script src="/dashboard/_next/static/chunks/6212-7bd06f60ba693125.js" defer=""></script><script src="/dashboard/_next/static/chunks/6989-01359c57e018caa4.js" defer=""></script><script src="/dashboard/_next/static/chunks/3850-ff4a9a69d978632b.js" defer=""></script><script src="/dashboard/_next/static/chunks/8969-66237729cdf9749e.js" defer=""></script><script src="/dashboard/_next/static/chunks/6990-f6818c84ed8f1c86.js" defer=""></script><script src="/dashboard/_next/static/chunks/6135-4b4d5e824b7f9d3c.js" defer=""></script><script src="/dashboard/_next/static/chunks/1121-d0782b9251f0fcd3.js" defer=""></script><script src="/dashboard/_next/static/chunks/6601-06114c982db410b6.js" defer=""></script><script src="/dashboard/_next/static/chunks/3015-7e0e8f06bb2f881c.js" defer=""></script><script src="/dashboard/_next/static/chunks/6856-5fdc9b851a18acdb.js" defer=""></script><script src="/dashboard/_next/static/chunks/1871-49141c317f3a9020.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters/%5Bcluster%5D-477555ab7c0b13d8.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters/[cluster]","query":{},"buildId":"yOfMelBaFp8uL5F9atyAK","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
sky/dashboard/out/clusters.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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-
|
|
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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-66f23594d38c7f16.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-ce361c6959bc2001.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters-2f61f65487f6d8ff.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters","query":{},"buildId":"yOfMelBaFp8uL5F9atyAK","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
sky/dashboard/out/config.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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-
|
|
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/4614e06482d7309e.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/4614e06482d7309e.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-66f23594d38c7f16.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-ce361c6959bc2001.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/config-dfb9bf07b13045f4.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/yOfMelBaFp8uL5F9atyAK/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/config","query":{},"buildId":"yOfMelBaFp8uL5F9atyAK","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|