skypilot-nightly 1.0.0.dev20250520__py3-none-any.whl → 1.0.0.dev20250521__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. sky/__init__.py +2 -2
  2. sky/backends/backend_utils.py +4 -1
  3. sky/backends/cloud_vm_ray_backend.py +56 -37
  4. sky/check.py +3 -3
  5. sky/cli.py +89 -16
  6. sky/client/cli.py +89 -16
  7. sky/client/sdk.py +20 -3
  8. sky/dashboard/out/404.html +1 -1
  9. sky/dashboard/out/_next/static/chunks/236-1a3a9440417720eb.js +6 -0
  10. sky/dashboard/out/_next/static/chunks/37-d584022b0da4ac3b.js +6 -0
  11. sky/dashboard/out/_next/static/chunks/393-e1eaa440481337ec.js +1 -0
  12. sky/dashboard/out/_next/static/chunks/480-f28cd152a98997de.js +1 -0
  13. sky/dashboard/out/_next/static/chunks/{678-206dddca808e6d16.js → 582-683f4f27b81996dc.js} +2 -2
  14. sky/dashboard/out/_next/static/chunks/pages/_app-8cfab319f9fb3ae8.js +1 -0
  15. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-33bc2bec322249b1.js +1 -0
  16. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-e2fc2dd1955e6c36.js +1 -0
  17. sky/dashboard/out/_next/static/chunks/pages/clusters-3a748bd76e5c2984.js +1 -0
  18. sky/dashboard/out/_next/static/chunks/pages/infra-9180cd91cee64b96.js +1 -0
  19. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-70756c2dad850a7e.js +1 -0
  20. sky/dashboard/out/_next/static/chunks/pages/jobs-ecd804b9272f4a7c.js +1 -0
  21. sky/dashboard/out/_next/static/css/7e7ce4ff31d3977b.css +3 -0
  22. sky/dashboard/out/_next/static/hvWzC5E6Q4CcKzXcWbgig/_buildManifest.js +1 -0
  23. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  24. sky/dashboard/out/clusters/[cluster].html +1 -1
  25. sky/dashboard/out/clusters.html +1 -1
  26. sky/dashboard/out/index.html +1 -1
  27. sky/dashboard/out/infra.html +1 -0
  28. sky/dashboard/out/jobs/[job].html +1 -1
  29. sky/dashboard/out/jobs.html +1 -1
  30. sky/execution.py +1 -1
  31. sky/jobs/server/core.py +1 -1
  32. sky/jobs/utils.py +38 -7
  33. sky/optimizer.py +36 -29
  34. sky/provision/provisioner.py +16 -7
  35. sky/resources.py +60 -15
  36. sky/serve/serve_utils.py +5 -13
  37. sky/server/common.py +14 -5
  38. sky/server/requests/payloads.py +3 -3
  39. sky/utils/cli_utils/status_utils.py +95 -56
  40. sky/utils/common_utils.py +35 -2
  41. sky/utils/infra_utils.py +175 -0
  42. sky/utils/resources_utils.py +41 -21
  43. sky/utils/schemas.py +65 -5
  44. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250521.dist-info}/METADATA +1 -1
  45. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250521.dist-info}/RECORD +50 -47
  46. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250521.dist-info}/WHEEL +1 -1
  47. sky/dashboard/out/_next/static/8hlc2dkbIDDBOkxtEW7X6/_buildManifest.js +0 -1
  48. sky/dashboard/out/_next/static/chunks/236-f49500b82ad5392d.js +0 -6
  49. sky/dashboard/out/_next/static/chunks/37-0a572fe0dbb89c4d.js +0 -6
  50. sky/dashboard/out/_next/static/chunks/845-0ca6f2c1ba667c3b.js +0 -1
  51. sky/dashboard/out/_next/static/chunks/979-7bf73a4c7cea0f5c.js +0 -1
  52. sky/dashboard/out/_next/static/chunks/pages/_app-e6b013bc3f77ad60.js +0 -1
  53. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-e15db85d0ea1fbe1.js +0 -1
  54. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-f383db7389368ea7.js +0 -1
  55. sky/dashboard/out/_next/static/chunks/pages/clusters-a93b93e10b8b074e.js +0 -1
  56. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-03f279c6741fb48b.js +0 -1
  57. sky/dashboard/out/_next/static/chunks/pages/jobs-a75029b67aab6a2e.js +0 -1
  58. sky/dashboard/out/_next/static/css/c6933bbb2ce7f4dd.css +0 -3
  59. /sky/dashboard/out/_next/static/{8hlc2dkbIDDBOkxtEW7X6 → hvWzC5E6Q4CcKzXcWbgig}/_ssgManifest.js +0 -0
  60. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250521.dist-info}/entry_points.txt +0 -0
  61. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250521.dist-info}/licenses/LICENSE +0 -0
  62. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250521.dist-info}/top_level.txt +0 -0
sky/client/cli.py CHANGED
@@ -78,6 +78,7 @@ from sky.utils import common_utils
78
78
  from sky.utils import controller_utils
79
79
  from sky.utils import dag_utils
80
80
  from sky.utils import env_options
81
+ from sky.utils import infra_utils
81
82
  from sky.utils import log_utils
82
83
  from sky.utils import registry
83
84
  from sky.utils import resources_utils
@@ -345,24 +346,39 @@ _TASK_OPTIONS = [
345
346
  'where the task will be invoked. '
346
347
  'Overrides the "workdir" config in the YAML if both are supplied.'
347
348
  )),
349
+ click.option(
350
+ '--infra',
351
+ required=False,
352
+ type=str,
353
+ help='Infrastructure to use. '
354
+ 'Format: cloud, cloud/region, cloud/region/zone, '
355
+ 'or kubernetes/context-name. '
356
+ 'Examples: aws, aws/us-east-1, aws/us-east-1/us-east-1a, '
357
+ # TODO(zhwu): we have to use `\*` to make sure the docs build
358
+ # not complaining about the `*`, but this will cause `--help`
359
+ # to show `\*` instead of `*`.
360
+ 'aws/\\*/us-east-1a, kubernetes/my-cluster-context.'),
348
361
  click.option(
349
362
  '--cloud',
350
363
  required=False,
351
364
  type=str,
352
365
  help=('The cloud to use. If specified, overrides the "resources.cloud" '
353
- 'config. Passing "none" resets the config.')),
366
+ 'config. Passing "none" resets the config.'),
367
+ hidden=True),
354
368
  click.option(
355
369
  '--region',
356
370
  required=False,
357
371
  type=str,
358
372
  help=('The region to use. If specified, overrides the '
359
- '"resources.region" config. Passing "none" resets the config.')),
373
+ '"resources.region" config. Passing "none" resets the config.'),
374
+ hidden=True),
360
375
  click.option(
361
376
  '--zone',
362
377
  required=False,
363
378
  type=str,
364
379
  help=('The zone to use. If specified, overrides the '
365
- '"resources.zone" config. Passing "none" resets the config.')),
380
+ '"resources.zone" config. Passing "none" resets the config.'),
381
+ hidden=True),
366
382
  click.option(
367
383
  '--num-nodes',
368
384
  required=False,
@@ -1063,6 +1079,33 @@ def cli():
1063
1079
  pass
1064
1080
 
1065
1081
 
1082
+ def _handle_infra_cloud_region_zone_options(infra: Optional[str],
1083
+ cloud: Optional[str],
1084
+ region: Optional[str],
1085
+ zone: Optional[str]):
1086
+ """Handle the backward compatibility for --infra and --cloud/region/zone.
1087
+
1088
+ Returns:
1089
+ cloud, region, zone
1090
+ """
1091
+ if cloud is not None or region is not None or zone is not None:
1092
+ click.secho(
1093
+ 'The --cloud, --region, and --zone options are deprecated. '
1094
+ 'Use --infra instead.',
1095
+ fg='yellow')
1096
+ if infra is not None:
1097
+ with ux_utils.print_exception_no_traceback():
1098
+ raise ValueError('Cannot specify both --infra and '
1099
+ '--cloud, --region, or --zone.')
1100
+
1101
+ if infra is not None:
1102
+ infra_info = infra_utils.InfraInfo.from_str(infra)
1103
+ cloud = infra_info.cloud
1104
+ region = infra_info.region
1105
+ zone = infra_info.zone
1106
+ return cloud, region, zone
1107
+
1108
+
1066
1109
  @cli.command(cls=_DocumentedCodeCommand)
1067
1110
  @config_option(expose_value=True)
1068
1111
  @click.argument('entrypoint',
@@ -1172,6 +1215,7 @@ def launch(
1172
1215
  backend_name: Optional[str],
1173
1216
  name: Optional[str],
1174
1217
  workdir: Optional[str],
1218
+ infra: Optional[str],
1175
1219
  cloud: Optional[str],
1176
1220
  region: Optional[str],
1177
1221
  zone: Optional[str],
@@ -1219,6 +1263,9 @@ def launch(
1219
1263
  if backend_name is None:
1220
1264
  backend_name = backends.CloudVmRayBackend.NAME
1221
1265
 
1266
+ cloud, region, zone = _handle_infra_cloud_region_zone_options(
1267
+ infra, cloud, region, zone)
1268
+
1222
1269
  task_or_dag = _make_task_or_dag_from_entrypoint_with_overrides(
1223
1270
  entrypoint=entrypoint,
1224
1271
  name=name,
@@ -1336,6 +1383,7 @@ def exec(cluster: Optional[str],
1336
1383
  entrypoint: Tuple[str, ...],
1337
1384
  detach_run: bool,
1338
1385
  name: Optional[str],
1386
+ infra: Optional[str],
1339
1387
  cloud: Optional[str],
1340
1388
  region: Optional[str],
1341
1389
  zone: Optional[str],
@@ -1427,6 +1475,9 @@ def exec(cluster: Optional[str],
1427
1475
  controller_utils.check_cluster_name_not_controller(
1428
1476
  cluster, operation_str='Executing task on it')
1429
1477
 
1478
+ cloud, region, zone = _handle_infra_cloud_region_zone_options(
1479
+ infra, cloud, region, zone)
1480
+
1430
1481
  task_or_dag = _make_task_or_dag_from_entrypoint_with_overrides(
1431
1482
  entrypoint=entrypoint,
1432
1483
  name=name,
@@ -3265,7 +3316,7 @@ def _down_or_stop_clusters(
3265
3316
 
3266
3317
  @cli.command(cls=_DocumentedCodeCommand)
3267
3318
  @config_option(expose_value=False)
3268
- @click.argument('clouds', required=False, type=str, nargs=-1)
3319
+ @click.argument('infra_list', required=False, type=str, nargs=-1)
3269
3320
  @click.option('--verbose',
3270
3321
  '-v',
3271
3322
  is_flag=True,
@@ -3273,7 +3324,7 @@ def _down_or_stop_clusters(
3273
3324
  help='Show the activated account for each cloud.')
3274
3325
  @usage_lib.entrypoint
3275
3326
  # pylint: disable=redefined-outer-name
3276
- def check(clouds: Tuple[str], verbose: bool):
3327
+ def check(infra_list: Tuple[str], verbose: bool):
3277
3328
  """Check which clouds are available to use.
3278
3329
 
3279
3330
  This checks access credentials for all clouds supported by SkyPilot. If a
@@ -3295,8 +3346,8 @@ def check(clouds: Tuple[str], verbose: bool):
3295
3346
  # Check only specific clouds - AWS and GCP.
3296
3347
  sky check aws gcp
3297
3348
  """
3298
- clouds_arg = clouds if len(clouds) > 0 else None
3299
- request_id = sdk.check(clouds=clouds_arg, verbose=verbose)
3349
+ infra_arg = infra_list if len(infra_list) > 0 else None
3350
+ request_id = sdk.check(infra_list=infra_arg, verbose=verbose)
3300
3351
  sdk.stream_and_get(request_id)
3301
3352
  api_server_url = server_common.get_server_url()
3302
3353
  click.echo()
@@ -3312,10 +3363,15 @@ def check(clouds: Tuple[str], verbose: bool):
3312
3363
  is_flag=True,
3313
3364
  default=False,
3314
3365
  help='Show details of all GPU/TPU/accelerator offerings.')
3366
+ @click.option('--infra',
3367
+ default=None,
3368
+ type=str,
3369
+ help='Infrastructure to query. Examples: "aws", "aws/us-east-1"')
3315
3370
  @click.option('--cloud',
3316
3371
  default=None,
3317
3372
  type=str,
3318
- help='Cloud provider to query.')
3373
+ help='Cloud provider to query.',
3374
+ hidden=True)
3319
3375
  @click.option(
3320
3376
  '--region',
3321
3377
  required=False,
@@ -3323,6 +3379,7 @@ def check(clouds: Tuple[str], verbose: bool):
3323
3379
  help=
3324
3380
  ('The region to use. If not specified, shows accelerators from all regions.'
3325
3381
  ),
3382
+ hidden=True,
3326
3383
  )
3327
3384
  @click.option(
3328
3385
  '--all-regions',
@@ -3335,6 +3392,7 @@ def check(clouds: Tuple[str], verbose: bool):
3335
3392
  def show_gpus(
3336
3393
  accelerator_str: Optional[str],
3337
3394
  all: bool, # pylint: disable=redefined-builtin
3395
+ infra: Optional[str],
3338
3396
  cloud: Optional[str],
3339
3397
  region: Optional[str],
3340
3398
  all_regions: Optional[bool]):
@@ -3376,6 +3434,11 @@ def show_gpus(
3376
3434
  * ``UTILIZATION`` (Kubernetes only): Total number of GPUs free / available
3377
3435
  in the Kubernetes cluster.
3378
3436
  """
3437
+ cloud, region, _ = _handle_infra_cloud_region_zone_options(infra,
3438
+ cloud,
3439
+ region,
3440
+ zone=None)
3441
+
3379
3442
  # validation for the --region flag
3380
3443
  if region is not None and cloud is None:
3381
3444
  raise click.UsageError(
@@ -3991,6 +4054,7 @@ def jobs_launch(
3991
4054
  name: Optional[str],
3992
4055
  cluster: Optional[str],
3993
4056
  workdir: Optional[str],
4057
+ infra: Optional[str],
3994
4058
  cloud: Optional[str],
3995
4059
  region: Optional[str],
3996
4060
  zone: Optional[str],
@@ -4032,6 +4096,8 @@ def jobs_launch(
4032
4096
  'Use one of the flags as they are alias.')
4033
4097
  name = cluster
4034
4098
  env = _merge_env_vars(env_file, env)
4099
+ cloud, region, zone = _handle_infra_cloud_region_zone_options(
4100
+ infra, cloud, region, zone)
4035
4101
  task_or_dag = _make_task_or_dag_from_entrypoint_with_overrides(
4036
4102
  entrypoint,
4037
4103
  name=name,
@@ -4509,6 +4575,7 @@ def serve_up(
4509
4575
  service_yaml: Tuple[str, ...],
4510
4576
  service_name: Optional[str],
4511
4577
  workdir: Optional[str],
4578
+ infra: Optional[str],
4512
4579
  cloud: Optional[str],
4513
4580
  region: Optional[str],
4514
4581
  zone: Optional[str],
@@ -4555,6 +4622,8 @@ def serve_up(
4555
4622
 
4556
4623
  sky serve up service.yaml
4557
4624
  """
4625
+ cloud, region, zone = _handle_infra_cloud_region_zone_options(
4626
+ infra, cloud, region, zone)
4558
4627
  if service_name is None:
4559
4628
  service_name = serve_lib.generate_service_name()
4560
4629
 
@@ -4621,13 +4690,13 @@ def serve_up(
4621
4690
  @timeline.event
4622
4691
  @usage_lib.entrypoint
4623
4692
  def serve_update(service_name: str, service_yaml: Tuple[str, ...],
4624
- workdir: Optional[str], cloud: Optional[str],
4625
- region: Optional[str], zone: Optional[str],
4626
- num_nodes: Optional[int], use_spot: Optional[bool],
4627
- image_id: Optional[str], env_file: Optional[Dict[str, str]],
4628
- env: List[Tuple[str, str]], gpus: Optional[str],
4629
- instance_type: Optional[str], ports: Tuple[str],
4630
- cpus: Optional[str], memory: Optional[str],
4693
+ workdir: Optional[str], infra: Optional[str],
4694
+ cloud: Optional[str], region: Optional[str],
4695
+ zone: Optional[str], num_nodes: Optional[int],
4696
+ use_spot: Optional[bool], image_id: Optional[str],
4697
+ env_file: Optional[Dict[str, str]], env: List[Tuple[str, str]],
4698
+ gpus: Optional[str], instance_type: Optional[str],
4699
+ ports: Tuple[str], cpus: Optional[str], memory: Optional[str],
4631
4700
  disk_size: Optional[int], disk_tier: Optional[str], mode: str,
4632
4701
  yes: bool, async_call: bool):
4633
4702
  """Update a SkyServe service.
@@ -4659,6 +4728,8 @@ def serve_update(service_name: str, service_yaml: Tuple[str, ...],
4659
4728
  sky serve update --mode blue_green sky-service-16aa new_service.yaml
4660
4729
 
4661
4730
  """
4731
+ cloud, region, zone = _handle_infra_cloud_region_zone_options(
4732
+ infra, cloud, region, zone)
4662
4733
  task = _generate_task_with_service(
4663
4734
  service_name=service_name,
4664
4735
  service_yaml_args=service_yaml,
@@ -5173,6 +5244,7 @@ def benchmark_launch(
5173
5244
  benchmark: str,
5174
5245
  name: Optional[str],
5175
5246
  workdir: Optional[str],
5247
+ infra: Optional[str],
5176
5248
  cloud: Optional[str],
5177
5249
  region: Optional[str],
5178
5250
  zone: Optional[str],
@@ -5206,7 +5278,6 @@ def benchmark_launch(
5206
5278
  raise click.BadParameter(f'Benchmark {benchmark} already exists. '
5207
5279
  'To delete the previous benchmark result, '
5208
5280
  f'run `sky bench delete {benchmark}`.')
5209
-
5210
5281
  entrypoint = ' '.join(entrypoint)
5211
5282
  if not entrypoint:
5212
5283
  raise click.BadParameter('Please specify a task yaml to benchmark.')
@@ -5217,6 +5288,8 @@ def benchmark_launch(
5217
5288
  'Sky Benchmark does not support command line tasks. '
5218
5289
  'Please provide a YAML file.')
5219
5290
  assert config is not None, (is_yaml, config)
5291
+ cloud, region, zone = _handle_infra_cloud_region_zone_options(
5292
+ infra, cloud, region, zone)
5220
5293
 
5221
5294
  click.secho('Benchmarking a task from YAML: ', fg='cyan', nl=False)
5222
5295
  click.secho(entrypoint, bold=True)
sky/client/sdk.py CHANGED
@@ -42,6 +42,7 @@ from sky.utils import common
42
42
  from sky.utils import common_utils
43
43
  from sky.utils import dag_utils
44
44
  from sky.utils import env_options
45
+ from sky.utils import infra_utils
45
46
  from sky.utils import rich_utils
46
47
  from sky.utils import status_lib
47
48
  from sky.utils import subprocess_utils
@@ -87,12 +88,12 @@ def stream_response(request_id: Optional[str],
87
88
  @usage_lib.entrypoint
88
89
  @server_common.check_server_healthy_or_start
89
90
  @annotations.client_api
90
- def check(clouds: Optional[Tuple[str]],
91
+ def check(infra_list: Optional[Tuple[str, ...]],
91
92
  verbose: bool) -> server_common.RequestId:
92
93
  """Checks the credentials to enable clouds.
93
94
 
94
95
  Args:
95
- clouds: The clouds to check.
96
+ infra: The infra to check.
96
97
  verbose: Whether to show verbose output.
97
98
 
98
99
  Returns:
@@ -101,6 +102,22 @@ def check(clouds: Optional[Tuple[str]],
101
102
  Request Returns:
102
103
  None
103
104
  """
105
+ if infra_list is None:
106
+ clouds = None
107
+ else:
108
+ specified_clouds = []
109
+ for infra_str in infra_list:
110
+ infra = infra_utils.InfraInfo.from_str(infra_str)
111
+ if infra.cloud is None:
112
+ with ux_utils.print_exception_no_traceback():
113
+ raise ValueError(f'Invalid infra to check: {infra_str}')
114
+ if infra.region is not None or infra.zone is not None:
115
+ region_zone = infra_str.partition('/')[-1]
116
+ logger.warning(f'Infra {infra_str} is specified, but `check` '
117
+ f'only supports checking {infra.cloud}, '
118
+ f'ignoring {region_zone}')
119
+ specified_clouds.append(infra.cloud)
120
+ clouds = tuple(specified_clouds)
104
121
  body = payloads.CheckBody(clouds=clouds, verbose=verbose)
105
122
  response = requests.post(f'{server_common.get_server_url()}/check',
106
123
  json=json.loads(body.model_dump_json()),
@@ -344,7 +361,7 @@ def launch(
344
361
  import sky
345
362
  task = sky.Task(run='echo hello SkyPilot')
346
363
  task.set_resources(
347
- sky.Resources(cloud=sky.AWS(), accelerators='V100:4'))
364
+ sky.Resources(infra='aws', accelerators='V100:4'))
348
365
  sky.launch(task, cluster_name='my-cluster')
349
366
 
350
367
 
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/dashboard/_next/static/css/c6933bbb2ce7f4dd.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/c6933bbb2ce7f4dd.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-830f59b8404e96b8.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-87d061ee6ed71b28.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-e0e2335212e72357.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-e6b013bc3f77ad60.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-1be831200e60c5c0.js" defer=""></script><script src="/dashboard/_next/static/8hlc2dkbIDDBOkxtEW7X6/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/8hlc2dkbIDDBOkxtEW7X6/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"8hlc2dkbIDDBOkxtEW7X6","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/dashboard/_next/static/css/7e7ce4ff31d3977b.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/7e7ce4ff31d3977b.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-830f59b8404e96b8.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-87d061ee6ed71b28.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-e0e2335212e72357.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-8cfab319f9fb3ae8.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-1be831200e60c5c0.js" defer=""></script><script src="/dashboard/_next/static/hvWzC5E6Q4CcKzXcWbgig/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/hvWzC5E6Q4CcKzXcWbgig/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"hvWzC5E6Q4CcKzXcWbgig","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1,6 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[236],{8236:function(e,s,t){t.d(s,{L4:function(){return E},Nk:function(){return C}});var r=t(5893),n=t(7294),a=t(1163),l=t(1664),c=t.n(l),i=t(8799),o=t(803),d=t(7673),h=t(8764),u=t(7469),x=t(8969),m=t(3266),j=t(9470),p=t(3626),f=t(998);/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let g=(0,f.Z)("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),b=(0,f.Z)("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]),N=(0,f.Z)("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var y=t(1266),w=t(4545),v=t(9307),k=t(3001);function C(){let[e,s]=(0,n.useState)(!1),t=n.useRef(null),[a,l]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),d=(0,k.X)();return(0,r.jsxs)(j.A,{highlighted:"jobs",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsx)("div",{className:"text-base",children:(0,r.jsx)(c(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"})}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[e&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(i.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,r.jsxs)(o.z,{variant:"ghost",size:"sm",onClick:()=>{t.current&&t.current()},disabled:e,className:"text-sky-blue hover:text-sky-blue-bright",title:"Refresh",children:[(0,r.jsx)(p.Z,{className:"h-4 w-4 mr-1.5"}),!d&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(_,{refreshInterval:u.yc,setLoading:s,refreshDataRef:t}),(0,r.jsx)(y.cV,{isOpen:a.isOpen,onClose:()=>l({...a,isOpen:!1}),onConfirm:a.onConfirm,title:a.title,message:a.message})]})}function _(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a}=e,[l,j]=(0,n.useState)([]),[p,f]=(0,n.useState)({key:null,direction:"ascending"}),[b,N]=(0,n.useState)(!1),[k,C]=(0,n.useState)(!0),[_,E]=(0,n.useState)(1),[M,D]=(0,n.useState)(10),[O,I]=(0,n.useState)(null),z=(0,n.useRef)(null),[J,P]=(0,n.useState)([]),[T,A]=(0,n.useState)({}),[U,F]=(0,n.useState)(!1),[q,W]=(0,n.useState)(!1),[Z,V]=(0,n.useState)(!1),[G,B]=(0,n.useState)("active"),[H,X]=(0,n.useState)(!0),[K,Y]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),Q=async()=>{Y({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller? This will temporarily interrupt job management.",onConfirm:async()=>{try{V(!0),N(!0),await (0,x.Ce)("restartcontroller",null,null,!0),await $()}catch(e){console.error("Error restarting controller:",e)}finally{V(!1),N(!1)}}})},$=n.useCallback(async()=>{N(!0),t(!0);try{let[e,s]=await Promise.all([(0,x.Vp)(),(0,m.zd)()]),{jobs:t,controllerStopped:r}=e,n=s.find(e=>(0,w.Ym)(e.cluster)),a=n?n.status:"NOT_FOUND",l=!1;"STOPPED"==a&&r&&(l=!0),"LAUNCHING"==a?W(!0):W(!1),j(t),F(l)}catch(e){console.error("Error fetching data:",e),j([])}finally{N(!1),t(!1),C(!1)}},[t]);n.useEffect(()=>{a&&(a.current=$)},[a,$]),(0,n.useEffect)(()=>{j([]);let e=!0;$();let t=setInterval(()=>{e&&$()},s);return()=>{e=!1,clearInterval(t)}},[s,$]),(0,n.useEffect)(()=>{E(1)},[G,l.length]),(0,n.useEffect)(()=>{P([]),X(!0)},[G]);let ee=e=>{let s="ascending";p.key===e&&"ascending"===p.direction&&(s="descending"),f({key:e,direction:s})},es=e=>p.key===e?"ascending"===p.direction?" ↑":" ↓":"",et=n.useMemo(()=>({active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]}),[]);n.useMemo(()=>({active:l.filter(e=>et.active.includes(e.status)).length,finished:l.filter(e=>et.finished.includes(e.status)).length}),[l,et]);let er=e=>J.length>0?J.includes(e):et[G].includes(e),en=n.useMemo(()=>J.length>0?l.filter(e=>J.includes(e.status)):H?l.filter(e=>et[G].includes(e.status)):[],[l,G,J,H,et]),ea=n.useMemo(()=>p.key?[...en].sort((e,s)=>e[p.key]<s[p.key]?"ascending"===p.direction?-1:1:e[p.key]>s[p.key]?"ascending"===p.direction?1:-1:0):en,[en,p]),el=Math.ceil(ea.length/M),ec=(_-1)*M,ei=ec+M,eo=ea.slice(ec,ei),ed=e=>{if(J.includes(e)){let s=J.filter(s=>s!==e);0===s.length?(X(!0),P([])):(P(s),X(!1))}else P([...J,e]),X(!1)};return(0,n.useEffect)(()=>{A(l.reduce((e,s)=>(e[s.status]=(e[s.status]||0)+1,e),{}))},[l]),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"flex flex-col space-y-1 mb-1",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center text-sm mb-1",children:[(0,r.jsx)("span",{className:"mr-2 text-sm font-medium",children:"Statuses:"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[!b&&0===l.length&&!k&&(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(T).map(e=>{let[s,t]=e;return(0,r.jsxs)("button",{onClick:()=>ed(s),className:"px-3 py-1 rounded-full flex items-center space-x-2 ".concat(er(s)||J.includes(s)?(0,v.Cl)(s):"bg-gray-50 text-gray-600 hover:bg-gray-100"),children:[(0,r.jsx)("span",{children:s}),(0,r.jsx)("span",{className:"text-xs ".concat(er(s)||J.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),l.length>0&&(0,r.jsxs)("div",{className:"flex items-center ml-2 gap-2",children:[(0,r.jsx)("span",{className:"text-gray-500",children:"("}),(0,r.jsx)("button",{onClick:()=>{B("active"),P([]),X(!0)},className:"text-sm font-medium ".concat("active"===G&&H?"text-green-700 underline":"text-gray-600 hover:text-green-700 hover:underline"),children:"show all active jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{B("finished"),P([]),X(!0)},className:"text-sm font-medium ".concat("finished"===G&&H?"text-blue-700 underline":"text-gray-600 hover:text-blue-700 hover:underline"),children:"show all finished jobs"}),(0,r.jsx)("span",{className:"text-gray-500",children:")"})]})]})]})}),(0,r.jsx)(d.Zb,{children:(0,r.jsxs)(h.iA,{children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("id"),children:["ID",es("id")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("name"),children:["Name",es("name")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("user"),children:["User",es("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("submitted_at"),children:["Submitted",es("submitted_at")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("job_duration"),children:["Duration",es("job_duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("status"),children:["Status",es("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("resources_str"),children:["Requested",es("resources_str")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("infra"),children:["Infra",es("infra")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("cluster"),children:["Resources",es("cluster")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ee("recoveries"),children:["Recoveries",es("recoveries")]}),(0,r.jsx)(h.ss,{children:"Details"}),(0,r.jsx)(h.ss,{children:"Logs"})]})}),(0,r.jsx)(h.RM,{children:b&&k?(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:11,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(i.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):eo.length>0?(0,r.jsx)(r.Fragment,{children:eo.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(h.SC,{children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(c(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(c(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,r.jsx)(h.pj,{children:e.user}),(0,r.jsx)(h.pj,{children:(0,u.GV)(e.submitted_at)}),(0,r.jsx)(h.pj,{children:(0,u.LU)(e.job_duration)}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(h.pj,{children:e.requested_resources}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(u.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.infra})})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(u.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(h.pj,{children:e.recoveries}),(0,r.jsx)(h.pj,{children:e.details?(0,r.jsx)(R,{text:e.details,rowId:e.id,expandedRowId:O,setExpandedRowId:I}):"-"}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(S,{jobParent:"/jobs",jobId:e.id,managed:!0})})]}),O===e.id&&(0,r.jsx)(L,{text:e.details,colSpan:11,innerRef:z})]},e.id))}):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:11,className:"text-center py-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[q&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. Please wait for it to be ready."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!U&&!q&&(0,r.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),U&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller has been stopped. Please restart it to check the latest job status."}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:Q,className:"text-sky-blue hover:text-sky-blue-bright",disabled:b||Z,children:Z?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})}),ea.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:M,onChange:e=>{D(parseInt(e.target.value,10)),E(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[ec+1," – ",Math.min(ei,ea.length)," of"," ",ea.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{E(e=>Math.max(e-1,1))},disabled:1===_,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{E(e=>Math.min(e+1,el))},disabled:_===el||0===el,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})}),(0,r.jsx)(y.cV,{isOpen:K.isOpen,onClose:()=>Y({...K,isOpen:!1}),onConfirm:K.onConfirm,title:K.title,message:K.message})]})}function S(e){let{withLabel:s=!1,jobParent:t,jobId:n,managed:l}=e,c=(0,a.useRouter)(),i=(e,s)=>{e.preventDefault(),e.stopPropagation(),c.push({pathname:"".concat(t,"/").concat(n),query:{tab:s}})};return(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(u.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>i(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(b,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),l&&(0,r.jsx)(u.WH,{content:"View Controller Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>i(e,"controllerlogs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(N,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-2",children:"Controller Logs"})]})},"controllerlogs")]})}function E(e){let{clusterName:s,clusterJobData:t,loading:a}=e,[l,x]=(0,n.useState)(null),[m,j]=(0,n.useState)({key:null,direction:"ascending"}),[p,f]=(0,n.useState)(1),[g,b]=(0,n.useState)(10),N=(0,n.useRef)(null),[y,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{l&&N.current&&!N.current.contains(e.target)&&x(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l]);let k=n.useMemo(()=>t||[],[t]);(0,n.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(y)&&w(t)},[t,y]);let C=n.useMemo(()=>m.key?[...k].sort((e,s)=>e[m.key]<s[m.key]?"ascending"===m.direction?-1:1:e[m.key]>s[m.key]?"ascending"===m.direction?1:-1:0):k,[k,m]),_=e=>{let s="ascending";m.key===e&&"ascending"===m.direction&&(s="descending"),j({key:e,direction:s})},E=e=>m.key===e?"ascending"===m.direction?" ↑":" ↓":"",M=Math.ceil(C.length/g),D=(p-1)*g,O=D+g,I=C.slice(D,O);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)(d.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Cluster Jobs"}),a&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(i.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]})]}),(0,r.jsxs)(h.iA,{children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("id"),children:["ID",E("id")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("job"),children:["Name",E("job")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("user"),children:["User",E("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("submitted_at"),children:["Submitted",E("submitted_at")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("job_duration"),children:["Duration",E("job_duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("status"),children:["Status",E("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("resources"),children:["Resources",E("resources")]}),(0,r.jsx)(h.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,r.jsx)(h.RM,{children:I.length>0?I.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(h.SC,{className:l===e.id?"selected-row":"",children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(c(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(c(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,r.jsx)(R,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:l,setExpandedRowId:x})})}),(0,r.jsx)(h.pj,{children:e.user}),(0,r.jsx)(h.pj,{children:(0,u.GV)(e.submitted_at)}),(0,r.jsx)(h.pj,{children:(0,u.LU)(e.job_duration)}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(h.pj,{children:e.resources}),(0,r.jsx)(h.pj,{className:"flex content-center items-center",children:(0,r.jsx)(S,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1})})]}),l===e.id&&(0,r.jsx)(L,{text:e.job||"Unnamed job",colSpan:8,innerRef:N})]},e.id)):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),C.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:g,onChange:e=>{b(parseInt(e.target.value,10)),f(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:5,children:"5"}),(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:20,children:"20"}),(0,r.jsx)("option",{value:50,children:"50"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[D+1," – ",Math.min(O,C.length)," of"," ",C.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{f(e=>Math.max(e-1,1))},disabled:1===p,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{f(e=>Math.min(e+1,M))},disabled:p===M||0===M,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function L(e){let{text:s,colSpan:t,innerRef:n}=e;return(0,r.jsx)(h.SC,{className:"expanded-details",children:(0,r.jsx)(h.pj,{colSpan:t,children:(0,r.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:n,children:(0,r.jsx)("div",{className:"flex justify-between items-start",children:(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Full Details"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-700",style:{whiteSpace:"pre-wrap"},children:s})]})})})})})}function R(e){let{text:s,rowId:t,expandedRowId:a,setExpandedRowId:l}=e,c=s.length>50,i=a===t,o=c?"".concat(s.substring(0,50)):s,d=(0,n.useRef)(null);return(0,r.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,r.jsx)("span",{className:"truncate",children:o}),c&&(0,r.jsx)("button",{ref:d,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(i?null:t)},className:"text-blue-600 hover:text-blue-800 font-medium ml-1 flex-shrink-0","data-button-type":"show-more-less",children:i?"... show less":"... show more"})]})}},8969:function(e,s,t){t.d(s,{Ce:function(){return o},NJ:function(){return i},Pr:function(){return c},Vp:function(){return l}});var r=t(7294),n=t(5821),a=t(3225);async function l(){let{allUsers:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let s=(await fetch("".concat(a.f4,"/jobs/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({all_users:e})})).headers.get("X-Skypilot-Request-ID"),t=await fetch("".concat(a.f4,"/api/get?request_id=").concat(s));if(500===t.status){try{let e=await t.json();if(e.detail&&e.detail.error)try{let s=JSON.parse(e.detail.error);if(s.type&&s.type===a.iW)return{jobs:[],controllerStopped:!0}}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{jobs:[],controllerStopped:!1}}let r=await t.json();return{jobs:(r.return_value?JSON.parse(r.return_value):[]).map(e=>{let s=[];e.submitted_at&&s.push({time:new Date(1e3*e.submitted_at),event:"Job submitted."}),e.start_at&&s.push({time:new Date(1e3*e.start_at),event:"Job started."}),e.end_at&&("CANCELLING"==e.status||"CANCELLED"==e.status?s.push({time:new Date(1e3*e.end_at),event:"Job cancelled."}):s.push({time:new Date(1e3*e.end_at),event:"Job completed."})),e.last_recovered_at&&e.last_recovered_at!=e.start_at&&s.push({time:new Date(1e3*e.last_recovered_at),event:"Job recovered."});let t=(e.end_at?e.end_at:Date.now()/1e3)-e.submitted_at,r=e.cloud,n=e.cluster_resources;if(!r){if(e.cluster_resources&&"-"!==e.cluster_resources)try{r=e.cluster_resources.split("(")[0].split("x").pop().trim(),n=e.cluster_resources.replace("".concat(r,"("),"(").replace("x ","x")}catch(e){r="Unknown"}else r="Unknown"}let a="",l=a=e.zone?e.zone:e.region;a&&a.length>15&&(a=a.substring(0,15)+"...");let c=r+" ("+a+")";"-"===a&&(c=r);let i=r+" ("+l+")";return"-"===l&&(i=r),{id:e.job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:t,status:e.status,requested_resources:e.resources,resources_str:n,resources_str_full:e.cluster_resources_full||n,cloud:r,infra:c,full_infra:i,recoveries:e.recovery_count,details:e.failure_reason,user:e.user_name,submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,events:s}}),controllerStopped:!1}}catch(e){return console.error("Error fetching managed job data:",e),{jobs:[],controllerStopped:!1}}}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[s,t]=(0,r.useState)(null),[n,a]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async function(){try{a(!0);let e=await l({allUsers:!0});t(e)}catch(e){console.error("Error fetching managed job data:",e)}finally{a(!1)}})()},[e]),{jobData:s,loading:n}}async function i(e){let{jobId:s,controller:t=!1,signal:r,onNewLog:l}=e,c=new Promise(e=>{setTimeout(()=>{e({timeout:!0})},1e4)}),i=(async()=>{try{let e=(await fetch("".concat(a.f4,"/jobs/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({controller:t,follow:!1,job_id:s}),...r?{signal:r}:{}})).body.getReader();try{for(;;){let{done:s,value:t}=await e.read();if(s)break;let r=new TextDecoder().decode(t);l(r)}}finally{e.cancel()}return{timeout:!1}}catch(e){if("AbortError"===e.name)return{timeout:!1};throw e}})();if((await Promise.race([i,c])).timeout){(0,n.C)("Log request for job ".concat(s," timed out after ").concat(1e4,"ms"),"error");return}}async function o(e,s,t){let r="",l="",c="",i={};if("restartcontroller"===e)r="Restarting",l="restarted",c="jobs/queue",i={all_users:!0,refresh:!0},s="controller";else throw Error("Invalid action: ".concat(e));(0,n.C)("".concat(r," job ").concat(s,"..."),"info");try{try{let e=(await fetch("".concat(a.f4,"/").concat(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})).headers.get("X-Skypilot-Request-ID"),o=await fetch("".concat(a.f4,"/api/get?request_id=").concat(e));if(200===o.status)(0,n.C)("Job ".concat(s," ").concat(l," successfully."),"success");else if(500===o.status)try{let e=await o.json();if(e.detail&&e.detail.error)try{let l=JSON.parse(e.detail.error);l.type&&l.type===a.Bo?(0,n.C)("".concat(r," job ").concat(s," is not supported!"),"error",1e4):l.type&&l.type===a.mF?(0,n.C)("Cluster ".concat(t," does not exist."),"error"):l.type&&l.type===a.iW?(0,n.C)("Cluster ".concat(t," is not up."),"error"):(0,n.C)("".concat(r," job ").concat(s," failed: ").concat(l.type),"error")}catch(t){(0,n.C)("".concat(r," job ").concat(s," failed: ").concat(e.detail.error),"error")}else(0,n.C)("".concat(r," job ").concat(s," failed with no details."),"error")}catch(e){(0,n.C)("".concat(r," job ").concat(s," failed with parse error."),"error")}else(0,n.C)("".concat(r," job ").concat(s," failed with status ").concat(o.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,n.C)("Network error ".concat(r," job ").concat(s,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,n.C)("Critical error ".concat(r," job ").concat(s,": ").concat(e.message),"error")}}}}]);
@@ -0,0 +1,6 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37],{9037:function(e,s,t){t.d(s,{Cc:function(){return v},GV:function(){return _}});var n=t(5893),r=t(7294),l=t(8799),a=t(7469),c=t(1664),i=t.n(c),o=t(803),d=t(7673),h=t(8764),x=t(3266),u=t(4545),j=t(3626),m=t(998);/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let p=(0,m.Z)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),f=(0,m.Z)("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var g=t(9470),N=t(1266),k=t(9307),w=t(3001);function v(){let[e,s]=(0,r.useState)(!1),t=r.useRef(null),[c,d]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[u,m]=(0,r.useState)(null),p=(0,w.X)();return(0,n.jsxs)(g.A,{highlighted:"clusters",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,n.jsx)("div",{className:"text-base",children:(0,n.jsx)(i(),{href:"/clusters",className:"text-sky-blue hover:underline leading-none",children:"Sky Clusters"})}),(0,n.jsxs)("div",{className:"flex items-center",children:[e&&(0,n.jsxs)("div",{className:"flex items-center mr-2",children:[(0,n.jsx)(l.Z,{size:15,className:"mt-0"}),(0,n.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,n.jsxs)(o.z,{variant:"ghost",onClick:()=>{t.current&&t.current()},disabled:e,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,n.jsx)(j.Z,{className:"h-4 w-4 mr-1.5"}),!p&&(0,n.jsx)("span",{children:"Refresh"})]})]})]}),(0,n.jsx)(y,{refreshInterval:a.yc,setLoading:s,refreshDataRef:t,onOpenSSHModal:e=>{m(e),d(!0)},onOpenVSCodeModal:e=>{m(e),x(!0)}}),(0,n.jsx)(N.Oh,{isOpen:c,onClose:()=>d(!1),cluster:u}),(0,n.jsx)(N._R,{isOpen:h,onClose:()=>x(!1),cluster:u})]})}function y(e){let{refreshInterval:s,setLoading:t,refreshDataRef:c,onOpenSSHModal:j,onOpenVSCodeModal:m}=e,[p,f]=(0,r.useState)([]),[g,N]=(0,r.useState)({key:null,direction:"ascending"}),[w,v]=(0,r.useState)(!1),[y,b]=(0,r.useState)(!0),[C,S]=(0,r.useState)(1),[M,O]=(0,r.useState)(10),z=r.useCallback(async()=>{t(!0),v(!0),f(await (0,x.zd)()),t(!1),v(!1),b(!1)},[t]),V=r.useMemo(()=>(0,u.R0)(p,g.key,g.direction),[p,g]);r.useEffect(()=>{c&&(c.current=z)},[c,z]),(0,r.useEffect)(()=>{f([]);let e=!0;z();let t=setInterval(()=>{e&&z()},s);return()=>{e=!1,clearInterval(t)}},[s,z]),(0,r.useEffect)(()=>{S(1)},[p.length]);let L=e=>{let s="ascending";g.key===e&&"ascending"===g.direction&&(s="descending"),N({key:e,direction:s})},R=e=>g.key===e?"ascending"===g.direction?" ↑":" ↓":"",E=Math.ceil(V.length/M),I=(C-1)*M,W=I+M,Z=V.slice(I,W);return(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Zb,{children:(0,n.jsxs)(h.iA,{children:[(0,n.jsx)(h.xD,{children:(0,n.jsxs)(h.SC,{children:[(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>L("status"),children:["Status",R("status")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>L("cluster"),children:["Cluster",R("cluster")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>L("user"),children:["User",R("user")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>L("infra"),children:["Infra",R("infra")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>L("resources_str"),children:["Resources",R("resources_str")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>L("time"),children:["Started",R("time")]}),(0,n.jsx)(h.ss,{children:"Actions"})]})}),(0,n.jsx)(h.RM,{children:w&&y?(0,n.jsx)(h.SC,{children:(0,n.jsx)(h.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:(0,n.jsxs)("div",{className:"flex justify-center items-center",children:[(0,n.jsx)(l.Z,{size:20,className:"mr-2"}),(0,n.jsx)("span",{children:"Loading..."})]})})}):Z.length>0?Z.map((e,s)=>(0,n.jsxs)(h.SC,{children:[(0,n.jsx)(h.pj,{children:(0,n.jsx)(k.OE,{status:e.status})}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/clusters/".concat(e.cluster),className:"text-blue-600",children:e.cluster})}),(0,n.jsx)(h.pj,{children:e.user}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(a.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,n.jsxs)("span",{children:[(0,n.jsx)(i(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud}),e.infra.includes("(")&&(0,n.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})})}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(a.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,n.jsx)("span",{children:e.resources_str})})}),(0,n.jsx)(h.pj,{children:(0,a.GV)(e.time)}),(0,n.jsx)(h.pj,{className:"text-left",children:(0,n.jsx)(_,{cluster:e.cluster,status:e.status,onOpenSSHModal:j,onOpenVSCodeModal:m})})]},s)):(0,n.jsx)(h.SC,{children:(0,n.jsx)(h.pj,{colSpan:7,className:"text-center py-6 text-gray-500",children:"No active clusters"})})})]})}),p.length>0&&(0,n.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,n.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,n.jsxs)("div",{className:"relative inline-block",children:[(0,n.jsxs)("select",{value:M,onChange:e=>{O(parseInt(e.target.value,10)),S(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,n.jsx)("option",{value:10,children:"10"}),(0,n.jsx)("option",{value:30,children:"30"}),(0,n.jsx)("option",{value:50,children:"50"}),(0,n.jsx)("option",{value:100,children:"100"}),(0,n.jsx)("option",{value:200,children:"200"})]}),(0,n.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,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,n.jsxs)("div",{children:[I+1," – ",Math.min(W,p.length)," of"," ",p.length]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{S(e=>Math.max(e-1,1))},disabled:1===C,className:"text-gray-500 h-8 w-8 p-0",children:(0,n.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,n.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,n.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{S(e=>Math.min(e+1,E))},disabled:C===E||0===E,className:"text-gray-500 h-8 w-8 p-0",children:(0,n.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,n.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}let b=(e,s)=>{s&&s(e)},C=(e,s)=>{s?s(e):window.open("ssh://".concat(e))},S=e=>"RUNNING"===e?["connect","VSCode"]:[],M={connect:(0,n.jsx)(p,{className:"w-4 h-4 text-gray-500 inline-block"}),VSCode:(0,n.jsx)(f,{className:"w-4 h-4 text-gray-500 inline-block"})};function _(e){let{withLabel:s=!1,cluster:t,status:r,onOpenSSHModal:l,onOpenVSCodeModal:c}=e,i=S(r),o=(0,w.X)(),d=e=>{switch(e){case"connect":C(t,l);break;case"VSCode":b(t,c);break;default:return}};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"flex items-center space-x-4",children:Object.entries(M).map(e=>{let t,r,[l,c]=e;switch(l){case"connect":t="Connect",r="Connect with SSH";break;case"VSCode":t="VSCode",r="Open in VS Code"}return(s||(t=""),i.includes(l))?(0,n.jsx)(a.WH,{content:r,className:"capitalize text-sm text-muted-foreground",children:(0,n.jsxs)("button",{onClick:()=>d(l),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[c,!o&&(0,n.jsx)("span",{className:"ml-1.5",children:t})]})},l):(0,n.jsx)(a.WH,{content:r,className:"capitalize text-sm text-muted-foreground",children:(0,n.jsxs)("span",{className:"opacity-30 flex items-center cursor-not-allowed text-sm",title:l,children:[c,!o&&(0,n.jsx)("span",{className:"ml-1.5",children:t})]})},l)})})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[393],{9307:function(e,t,s){s.d(t,{Cl:function(){return c},OE:function(){return d}});var r=s(5893);s(7294);var a=s(8799),n=s(7469),l=s(3850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(a.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":default:return(0,r.jsx)(l.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(l.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.jsx)(l.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return(0,r.jsx)(l.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=c(e),s=o(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,r.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:i(t)})})}},1266:function(e,t,s){s.d(t,{cV:function(){return C},Oh:function(){return w},_R:function(){return v}});var r=s(5893),a=s(7294),n=s(5235),l=s(2350),c=s(3767);let o=n.fC;n.xz;let i=n.h_;n.x8;let d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.aV,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...a})});d.displayName=n.aV.displayName;let u=a.forwardRef((e,t)=>{let{className:s,children:a,...o}=e;return(0,r.jsxs)(i,{children:[(0,r.jsx)(d,{}),(0,r.jsxs)(n.VY,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...o,children:[a,(0,r.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500",children:[(0,r.jsx)(c.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=n.VY.displayName;let m=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...s})};m.displayName="DialogHeader";let f=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};f.displayName="DialogFooter";let x=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",s),...a})});x.displayName=n.Dx.displayName;let h=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.dk,{ref:t,className:(0,l.cn)("text-sm text-gray-500",s),...a})});h.displayName=n.dk.displayName;var p=s(803),g=s(7673),N=s(8671),b=s(7469),y=s(3225),j=s(3001);function w(e){let{isOpen:t,onClose:s,cluster:n}=e,[l,c]=a.useState(!1),i=e=>{navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)},d=["sky status ".concat(n),"ssh ".concat(n)],f=d.join("\n");return(0,r.jsx)(o,{open:t,onOpenChange:s,children:(0,r.jsxs)(u,{className:"sm:max-w-md",children:[(0,r.jsxs)(m,{children:[(0,r.jsxs)(x,{children:["Connect to: ",(0,r.jsx)("span",{className:"font-light",children:n})]}),(0,r.jsx)(h,{children:"Use these instructions to connect to your cluster via SSH."})]}),(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"SSH Command"}),(0,r.jsx)(g.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm w-full whitespace-pre-wrap",children:d.map((e,t)=>(0,r.jsx)("code",{className:"block",children:e},t))}),(0,r.jsx)(b.WH,{content:l?"Copied!":"Copy command",children:(0,r.jsx)(p.z,{variant:"ghost",size:"icon",onClick:()=>i(f),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(N.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Additional Information"}),(0,r.jsxs)("p",{className:"text-sm text-secondary-foreground",children:["Make sure to run"," ",(0,r.jsxs)("code",{className:"text-sm",children:["sky status ",n]})," first to have SkyPilot set up the SSH access."]})]})]})]})})}function v(e){let{isOpen:t,onClose:s,cluster:a}=e,n=(0,j.X)();return(0,r.jsx)(o,{open:t,onOpenChange:s,children:(0,r.jsx)(u,{className:"sm:max-w-3xl",children:(0,r.jsxs)(m,{children:[(0,r.jsxs)(x,{children:["Connect to: ",(0,r.jsx)("span",{className:"font-light",children:a})]}),(0,r.jsx)(h,{children:(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Setup SSH access"}),(0,r.jsx)(g.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm",children:(0,r.jsxs)("code",{children:["sky status ",a]})}),(0,r.jsx)(b.WH,{content:"Copy command",children:(0,r.jsx)(p.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("sky status ".concat(a)),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(N.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Connect with VSCode/Cursor"}),(0,r.jsx)(g.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm",children:(0,r.jsxs)("code",{children:["code --remote ssh-remote+",a]})}),(0,r.jsx)(b.WH,{content:"Copy command",children:(0,r.jsx)(p.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("code --remote ssh-remote+".concat(a)),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(N.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium",children:"Or use the GUI to connect"}),(0,r.jsx)("div",{className:"relative ".concat(n?"-mt-5":"-mt-10"),style:{paddingBottom:"70%"},children:(0,r.jsxs)("video",{className:"absolute top-0 left-0 w-full h-full rounded-lg",controls:!0,autoPlay:!0,muted:!0,preload:"metadata",children:[(0,r.jsx)("source",{src:"".concat(y.GW,"/videos/cursor-small.mp4"),type:"video/mp4"}),"Your browser does not support the video tag."]})})]})]})})]})})})}function C(e){let{isOpen:t,onClose:s,onConfirm:a,title:n,message:l,confirmText:c="Confirm",confirmVariant:i="destructive"}=e;return(0,r.jsx)(o,{open:t,onOpenChange:s,children:(0,r.jsxs)(u,{className:"sm:max-w-md",children:[(0,r.jsxs)(m,{children:[(0,r.jsx)(x,{children:n}),(0,r.jsx)(h,{children:l})]}),(0,r.jsxs)(f,{className:"flex justify-end gap-2 pt-4",children:[(0,r.jsx)(p.z,{variant:"outline",onClick:s,children:"Cancel"}),(0,r.jsx)(p.z,{variant:i,onClick:()=>{a(),s()},children:c})]})]})})}},803:function(e,t,s){s.d(t,{z:function(){return i}});var r=s(5893),a=s(7294),n=s(8426),l=s(5139),c=s(2350);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),i=a.forwardRef((e,t)=>{let{className:s,variant:a,size:l,asChild:i=!1,...d}=e,u=i?n.g7:"button";return(0,r.jsx)(u,{className:(0,c.cn)(o({variant:a,size:l,className:s})),ref:t,...d})});i.displayName="Button"},7673:function(e,t,s){s.d(t,{Zb:function(){return o}});var r=s(5893),a=s(7294),n=s(5697),l=s.n(n),c=s(2350);let o=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:a})});o.displayName="Card",o.propTypes={className:l().string,children:l().node};let i=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:a})});i.displayName="CardHeader",i.propTypes={className:l().string,children:l().node};let d=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:a})});d.displayName="CardTitle",d.propTypes={className:l().string,children:l().node};let u=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",s),...n,children:a})});u.displayName="CardDescription",u.propTypes={className:l().string,children:l().node};let m=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",s),...n,children:a})});m.displayName="CardContent",m.propTypes={className:l().string,children:l().node};let f=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",s),...n,children:a})});f.displayName="CardFooter",f.propTypes={className:l().string,children:l().node}},8764:function(e,t,s){s.d(t,{RM:function(){return o},SC:function(){return i},iA:function(){return l},pj:function(){return u},ss:function(){return d},xD:function(){return c}});var r=s(5893),a=s(7294),n=s(2350);let l=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:t,className:(0,n.cn)("w-full caption-bottom text-base",s),...a})})});l.displayName="Table";let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("thead",{ref:t,className:(0,n.cn)("[&_tr]:border-b",s),...a})});c.displayName="TableHeader";let o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tbody",{ref:t,className:(0,n.cn)("[&_tr:last-child]:border-0",s),...a})});o.displayName="TableBody",a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tfoot",{ref:t,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a})}).displayName="TableFooter";let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tr",{ref:t,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a})});i.displayName="TableRow";let d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("th",{ref:t,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",s),...a})});d.displayName="TableHead";let u=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("td",{ref:t,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a})});u.displayName="TableCell",a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("caption",{ref:t,className:(0,n.cn)("mt-4 text-base text-muted-foreground",s),...a})}).displayName="TableCaption"},3266:function(e,t,s){s.d(t,{QL:function(){return d},Sl:function(){return o},zd:function(){return c}});var r=s(7294),a=s(5821),n=s(3225);let l={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function c(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=await fetch("".concat(n.f4,"/status"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_names:e,all_users:!0})}),s=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("X-Request-ID"),r=await fetch("".concat(n.f4,"/api/get?request_id=").concat(s)),a=await r.json();return(a.return_value?JSON.parse(a.return_value):[]).map(e=>{let t="",s=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let s=Math.floor((t-3)/2),r=s+(t-3)%2;return 0===s?e.substring(0,r)+"...":e.substring(0,r)+"..."+e.substring(e.length-s)}(t,25)),{status:l[e.status],cluster:e.name,user:e.user_name,cloud:e.cloud,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:s?"".concat(e.cloud," (").concat(s,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,jobs:[],events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function o(e){let{clusterName:t,jobId:s,onNewLog:r}=e;try{let e=(await fetch("".concat(n.f4,"/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({follow:!1,cluster_name:t,job_id:s})})).body.getReader();for(;;){let{done:t,value:s}=await e.read();if(t)break;let a=new TextDecoder().decode(s);r(a)}}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,a.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function i(e){let{clusterName:t}=e;try{let e=await fetch("".concat(n.f4,"/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_name:t,all_users:!0})}),s=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),r=await fetch("".concat(n.f4,"/api/get?request_id=").concat(s)),a=await r.json();return JSON.parse(a.return_value).map(e=>{let s=e.end_at?e.end_at:Date.now()/1e3,r=0,a=0;return e.submitted_at&&(r=s-e.submitted_at),e.start_at&&(a=s-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:r,job_duration:a,infra:"",logs:""}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function d(e){let{cluster:t,job:s=null}=e,[a,n]=(0,r.useState)(null),[l,o]=(0,r.useState)(null),[d,u]=(0,r.useState)(!0),[m,f]=(0,r.useState)(!0),x=(0,r.useCallback)(async()=>{if(t)try{u(!0);let e=await c({clusterNames:[t]});n(e[0])}catch(e){console.error("Error fetching cluster data:",e)}finally{u(!1)}},[t]),h=(0,r.useCallback)(async()=>{if(t)try{f(!0);let e=await i({clusterName:t});o(e)}catch(e){console.error("Error fetching cluster job data:",e)}finally{f(!1)}},[t]),p=(0,r.useCallback)(async()=>{await Promise.all([x(),h()])},[x,h]);return(0,r.useEffect)(()=>{x(),h()},[t,s,x,h]),{clusterData:a,clusterJobData:l,loading:d||m,refreshData:p}}},4545:function(e,t,s){function r(e){return e.startsWith("sky-jobs-controller-")}function a(e,t,s){return null===t?e:[...e].sort((e,r)=>e[t]<r[t]?"ascending"===s?-1:1:e[t]>r[t]?"ascending"===s?1:-1:0)}s.d(t,{R0:function(){return a},Ym:function(){return r}})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[480],{3850:function(e,t,n){n.d(t,{J$:function(){return i},PC:function(){return h},Ps:function(){return s},QT:function(){return c},Vp:function(){return d},W2:function(){return o},Ye:function(){return l},aD:function(){return p},fp:function(){return a},fy:function(){return f},h0:function(){return x},mU:function(){return m},yN:function(){return u}});var r=n(5893);function s(e){return(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"})})}function o(e){return(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("circle",{cx:"10",cy:"10",r:"8"})})}function i(e){return(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("circle",{cx:"10",cy:"10",r:"8"})})}function l(e){return(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M6 12l4 4 8-8"})})}function a(e){return(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),(0,r.jsx)("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1"})]})}function c(e){return(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}),(0,r.jsx)("rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}),(0,r.jsx)("line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}),(0,r.jsx)("line",{x1:"6",x2:"6.01",y1:"18",y2:"18"})]})}function d(e){return(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"}),(0,r.jsx)("rect",{width:"20",height:"14",x:"2",y:"6",rx:"2"})]})}function h(e){return(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",ry:"2"}),(0,r.jsx)("rect",{x:"9",y:"9",width:"6",height:"6"}),(0,r.jsx)("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),(0,r.jsx)("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),(0,r.jsx)("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),(0,r.jsx)("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),(0,r.jsx)("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),(0,r.jsx)("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),(0,r.jsx)("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),(0,r.jsx)("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]})}function u(e){return(0,r.jsxs)("svg",{...e,viewBox:"0 0 423.683 423.683",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),(0,r.jsx)("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("g",{id:"SVGRepo_iconCarrier",children:(0,r.jsx)("g",{children:(0,r.jsx)("path",{d:"M54.376,287.577h310.459c26.48,0,48.02-13.979,48.02-40.453c0-17.916-10.001-34.07-25.559-42.292 c-19.021-72.951-86.061-125.196-162.002-125.223v-3.431h-3.854V61.814h3.854v-9.569h-31.38v9.569h3.854v14.363h-3.854v3.431 c-75.941,0.026-142.97,52.272-161.988,125.217c-15.56,8.216-25.573,24.376-25.573,42.291 C6.36,273.597,27.896,287.577,54.376,287.577z M47.676,227.145l7.214-2.424l1.617-7.447 c13.884-64.232,71.707-110.862,137.467-110.862h31.274c65.763,0,123.582,46.63,137.473,110.862l1.607,7.447l7.223,2.424 c8.678,2.92,14.506,10.946,14.506,19.979c0,11.703-9.517,13.647-21.221,13.647H54.376c-11.7,0-21.22-1.944-21.22-13.647 C33.162,238.091,38.984,230.065,47.676,227.145z M423.683,334.602v36.836H0v-36.836h25.348v-18.418h372.99v18.418H423.683z"})})})]})}function x(e){return(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,r.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,r.jsx)("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function f(e){return(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}function m(e){return(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{transform:"scale(0.85) translate(1.8, 1.8)",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"})})}function p(e){return(0,r.jsx)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.jsx)("path",{d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455zM4 18.385L5.763 17H20V5H4v13.385zM11 13h2v2h-2v-2zm0-6h2v5h-2V7z"})]})})}n(7294)},9470:function(e,t,n){n.d(t,{A:function(){return w}});var r=n(5893),s=n(7294),o=n(5675),i=n.n(o),l=n(1163),a=n(1664),c=n.n(a),d=n(3850),h=n(3225),u=n(7469),x=n(3001);let f=(0,s.createContext)(null);function m(e){let{children:t}=e,[n,o]=(0,s.useState)(!0);return(0,r.jsx)(f.Provider,{value:{isSidebarOpen:n,toggleSidebar:()=>{o(e=>!e)}},children:t})}function p(){let e=(0,l.useRouter)(),t=(0,x.X)(),n=t=>e.pathname.startsWith(t),s=e=>{let r=n(e);return"inline-flex items-center border-b-2 ".concat(r?"border-transparent text-blue-600":"border-transparent hover:text-blue-600"," ").concat(t?"px-2 py-1":"px-1 pt-1 space-x-2")};return(0,r.jsx)("div",{className:"fixed top-0 left-0 right-0 bg-white z-30 h-14 px-4 border-b border-gray-200 shadow-sm",children:(0,r.jsxs)("div",{className:"flex items-center h-full",children:[(0,r.jsx)("div",{className:"flex items-center ".concat(t?"space-x-2 mr-2":"space-x-4 mr-6"),children:(0,r.jsx)(c(),{href:"/",className:"flex items-center px-1 pt-1 h-full",prefetch:!1,children:(0,r.jsx)("div",{className:"".concat(t?"h-16 w-16":"h-20 w-20"," flex items-center justify-center"),children:(0,r.jsx)(i(),{src:"".concat(h.GW,"/skypilot.svg"),alt:"SkyPilot Logo",width:80,height:80,priority:!0,className:"w-full h-full object-contain"})})})}),(0,r.jsxs)("div",{className:"flex items-center ".concat(t?"space-x-1":"space-x-2 md:space-x-6"," ").concat(t?"mr-2":"mr-6"),children:[(0,r.jsxs)(c(),{href:"/clusters",className:s("/clusters"),prefetch:!1,children:[(0,r.jsx)(d.QT,{className:"w-4 h-4"}),!t&&(0,r.jsx)("span",{children:"Clusters"})]}),(0,r.jsxs)(c(),{href:"/jobs",className:s("/jobs"),prefetch:!1,children:[(0,r.jsx)(d.Vp,{className:"w-4 h-4"}),!t&&(0,r.jsx)("span",{children:"Jobs"})]}),(0,r.jsxs)("div",{className:"inline-flex items-center ".concat(t?"px-2 py-1":"px-1 pt-1"," text-gray-400"),children:[(0,r.jsx)(d.yN,{className:"w-4 h-4"}),!t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"ml-2",children:"Services"}),(0,r.jsx)("span",{className:"text-xs ml-2 px-1.5 py-0.5 bg-gray-100 text-gray-500 rounded",children:"Soon"})]})]}),(0,r.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"}),(0,r.jsxs)(c(),{href:"/infra",className:s("/infra"),prefetch:!1,children:[(0,r.jsx)(d.PC,{className:"w-4 h-4"}),!t&&(0,r.jsx)("span",{children:"Infra"})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-1 ".concat(t?"ml-0":"ml-auto"),children:[(0,r.jsx)(u.WH,{content:"Documentation",className:"text-sm text-muted-foreground",children:(0,r.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-2 py-1 text-gray-600 hover:text-blue-600 transition-colors duration-150 cursor-pointer",title:"Docs",children:[!t&&(0,r.jsx)("span",{className:"mr-1",children:"Docs"}),(0,r.jsx)(d.h0,{className:"".concat(t?"w-4 h-4":"w-3.5 h-3.5")})]})}),(0,r.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"}),(0,r.jsx)(u.WH,{content:"GitHub Repository",className:"text-sm text-muted-foreground",children:(0,r.jsx)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"GitHub",children:(0,r.jsx)(d.fy,{className:"".concat(t?"w-4 h-4":"w-5 h-5")})})}),(0,r.jsx)(u.WH,{content:"Join Slack",className:"text-sm text-muted-foreground",children:(0,r.jsx)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Slack",children:(0,r.jsx)(d.mU,{className:"".concat(t?"w-4 h-4":"w-5 h-5")})})}),(0,r.jsx)(u.WH,{content:"Leave Feedback",className:"text-sm text-muted-foreground",children:(0,r.jsx)("a",{href:"https://github.com/skypilot-org/skypilot/issues/new",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Leave Feedback",children:(0,r.jsx)(d.aD,{className:"".concat(t?"w-4 h-4":"w-5 h-5")})})})]})]})})}function g(e){let{children:t,highlighted:n}=e;return(0,x.X)(),(0,r.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,r.jsx)("div",{className:"fixed top-0 left-0 right-0 z-50 shadow-sm",children:(0,r.jsx)(p,{})}),(0,r.jsx)("div",{className:"transition-all duration-200 ease-in-out min-h-screen",style:{paddingTop:"56px"},children:(0,r.jsx)("main",{className:"p-6",children:t})})]})}function w(e){return(0,r.jsx)(m,{children:(0,r.jsx)(g,{...e})})}},7469:function(e,t,n){n.d(t,{WH:function(){return k},$B:function(){return M},Md:function(){return C},yc:function(){return j},LU:function(){return L},q8:function(){return z},GV:function(){return y}});var r=n(5893),s=n(7294),o=n(9515),i=n(1886),l=n(4461),a=n(5895),c=n(7242),d=n(282),h=n(2350);let u=l.fC;l.ZA;let x=l.B4,f=s.forwardRef((e,t)=>{let{className:n,children:s,...o}=e;return(0,r.jsxs)(l.xz,{ref:t,className:(0,h.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...o,children:[s,(0,r.jsx)(l.JO,{asChild:!0,children:(0,r.jsx)(a.Z,{className:"h-4 w-4 opacity-50"})})]})});f.displayName=l.xz.displayName;let m=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,r.jsx)(l.u_,{ref:t,className:(0,h.cn)("flex cursor-default items-center justify-center py-1",n),...s,children:(0,r.jsx)(c.Z,{className:"h-4 w-4"})})});m.displayName=l.u_.displayName;let p=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,r.jsx)(l.$G,{ref:t,className:(0,h.cn)("flex cursor-default items-center justify-center py-1",n),...s,children:(0,r.jsx)(a.Z,{className:"h-4 w-4"})})});p.displayName=l.$G.displayName;let g=s.forwardRef((e,t)=>{let{className:n,children:s,position:o="popper",...i}=e;return(0,r.jsx)(l.h_,{children:(0,r.jsxs)(l.VY,{ref:t,className:(0,h.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:o,...i,children:[(0,r.jsx)(m,{}),(0,r.jsx)(l.l_,{className:(0,h.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,r.jsx)(p,{})]})})});g.displayName=l.VY.displayName,s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,r.jsx)(l.__,{ref:t,className:(0,h.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...s})}).displayName=l.__.displayName;let w=s.forwardRef((e,t)=>{let{className:n,children:s,...o}=e;return(0,r.jsxs)(l.ck,{ref:t,className:(0,h.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...o,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(l.wU,{children:(0,r.jsx)(d.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(l.eT,{children:s})]})});w.displayName=l.ck.displayName,s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,r.jsx)(l.Z0,{ref:t,className:(0,h.cn)("-mx-1 my-1 h-px bg-muted",n),...s})}).displayName=l.Z0.displayName;let j=3e4;function v(e){return e.charAt(0).toUpperCase()+e.slice(1)}function y(e){if(!e)return"N/A";let t=new Date;return 7>Math.abs((t-e)/864e5)?(0,r.jsx)(k,{content:b(e),className:"capitalize text-sm text-muted-foreground",children:v((0,i.B)(e,t,{addSuffix:!0}))}):(0,r.jsx)(k,{content:v(b(e)),className:"text-sm text-muted-foreground",children:v(e.toLocaleString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(",",""))})}function b(e){return e.toLocaleString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZoneName:"short"}).replace(",","")}let N={placement:"bottom",color:"default"},k=e=>{let{children:t,...n}=e,s=n.content;return n.content=void 0,(0,r.jsx)(o.e,{...N,...n,content:(0,r.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm capitalize rounded",children:s}),children:t})},C=e=>{let{children:t,...n}=e,s=n.content;return n.content=void 0,(0,r.jsx)(o.e,{...N,...n,content:(0,r.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm rounded",children:s}),children:t})};function L(e){if(!e&&0!==e)return"-";let t=e=Math.floor(e),n="",r=0;for(let e of[{value:86400,label:"d"},{value:3600,label:"h"},{value:60,label:"m"},{value:1,label:"s"}])if(t>=e.value&&r<2){let s=Math.floor(t/e.value);n+="".concat(s).concat(e.label," "),t%=e.value,r++}return n.trim()||"0s"}function z(e){return e?(e=e.split("\n").filter(e=>!e.match(/<rich_.*?\[bold cyan\]/)&&!e.match(/<rich_.*>.*<\/rich_.*>/)&&!e.match(/├──/)&&!e.match(/└──/)).join("\n").replace(/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKH]/g,"")).split("\n").map(e=>{let t=e.match(/^([IWED])\s+(\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+([^:]+:\d+\])(.*)/);if(t){let[e,n,r,s,o]=t,i={I:"INFO",W:"WARNING",E:"ERROR",D:"DEBUG"}[n]||"";return'<span class="log-line '.concat(i,'"><span class="level">').concat(n,'</span><span class="timestamp">').concat(r,'</span><span class="location">').concat(s,'</span><span class="message">').concat(o,"</span></span>")}let n=e.match(/^(\([^)]+\))(.*)$/);if(n){let[e,t,r]=n;return'<span class="log-line"><span class="log-prefix">'.concat(t,'</span><span class="log-rest">').concat(r,"</span></span>")}return'<span class="log-line"><span class="message">'.concat(e,"</span></span>")}).join("\n"):""}function M(e){let{logs:t,controller:n=!1}=e,[o,i]=(0,s.useState)("all"),[l,a]=(0,s.useState)(t),[c,d]=(0,s.useState)([]);return(0,s.useEffect)(()=>{d(function(e){let t;let n=/\((head|worker\d+),/g,r=new Set;for(;null!==(t=n.exec(e));)r.add(t[1]);return Array.from(r).sort((e,t)=>"head"===e?-1:"head"===t?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}))}(t))},[t]),(0,s.useEffect)(()=>{"all"===o?a(t):a(t.split("\n").filter(e=>e.includes("(".concat(o,","))).join("\n"))},[o,t]),(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{children:'\n .logs-container {\n background-color: #f7f7f7;\n padding: 16px;\n max-height: calc(100vh - 300px);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n line-height: 1.5;\n border-radius: 6px;\n min-height: fit-content;\n }\n\n .log-line {\n display: block;\n white-space: pre-wrap;\n margin: 2px 0;\n }\n\n .log-line .level {\n display: inline;\n width: 1ch;\n margin-right: 1ch;\n font-weight: bold;\n }\n\n .log-line.INFO .level {\n color: #2563eb;\n }\n\n .log-line.WARNING .level {\n color: #d97706;\n }\n\n .log-line.ERROR .level {\n color: #dc2626;\n }\n\n .log-line.DEBUG .level {\n color: #6b7280;\n }\n\n .log-line .timestamp {\n color: #059669;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .location {\n color: #6366f1;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .message {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n\n .log-line .log-prefix {\n color: #6366f1;\n font-weight: 500;\n }\n\n .log-line .log-rest {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n'}),!n&&(0,r.jsx)("div",{style:{marginBottom:"1rem"},children:(0,r.jsxs)(u,{onValueChange:e=>i(e),value:o,children:[(0,r.jsx)(f,{"aria-label":"Node",className:"focus:ring-0 focus:ring-offset-0",children:(0,r.jsx)(x,{placeholder:"Select Node"})}),(0,r.jsxs)(g,{children:[(0,r.jsx)(w,{value:"all",children:"All Nodes"}),c.map(e=>(0,r.jsx)(w,{value:e,children:e},e))]})]})}),(0,r.jsx)("div",{className:"logs-container",dangerouslySetInnerHTML:{__html:z(l)}})]})}},5821:function(e,t,n){n.d(t,{C:function(){return r}});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=document.getElementById("toast-container");r||((r=document.createElement("div")).id="toast-container",r.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(r));let s=document.createElement("div");switch(s.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":s.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":s.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":s.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:s.className+=" bg-blue-100 border-blue-500 text-blue-800"}return s.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),r.appendChild(s),s.querySelector("button").addEventListener("click",()=>{r.removeChild(s)}),setTimeout(()=>{r.contains(s)&&r.removeChild(s)},n),s}},3001:function(e,t,n){n.d(t,{X:function(){return s}});var r=n(7294);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=()=>{n(window.innerWidth<e)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]),t}},2350:function(e,t,n){n.d(t,{cn:function(){return o}});var r=n(512),s=n(8388);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,s.m6)((0,r.W)(t))}}}]);