skypilot-nightly 1.0.0.dev20250520__py3-none-any.whl → 1.0.0.dev20250522__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 (85) 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 +92 -4
  8. sky/clouds/__init__.py +2 -0
  9. sky/clouds/cloud.py +6 -0
  10. sky/clouds/gcp.py +156 -21
  11. sky/clouds/service_catalog/__init__.py +3 -0
  12. sky/clouds/service_catalog/common.py +9 -2
  13. sky/clouds/service_catalog/constants.py +1 -0
  14. sky/core.py +6 -8
  15. sky/dashboard/out/404.html +1 -1
  16. sky/dashboard/out/_next/static/CzOVV6JpRQBRt5GhZuhyK/_buildManifest.js +1 -0
  17. sky/dashboard/out/_next/static/chunks/236-1a3a9440417720eb.js +6 -0
  18. sky/dashboard/out/_next/static/chunks/37-d584022b0da4ac3b.js +6 -0
  19. sky/dashboard/out/_next/static/chunks/393-e1eaa440481337ec.js +1 -0
  20. sky/dashboard/out/_next/static/chunks/480-f28cd152a98997de.js +1 -0
  21. sky/dashboard/out/_next/static/chunks/{678-206dddca808e6d16.js → 582-683f4f27b81996dc.js} +2 -2
  22. sky/dashboard/out/_next/static/chunks/pages/_app-8cfab319f9fb3ae8.js +1 -0
  23. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-33bc2bec322249b1.js +1 -0
  24. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-e2fc2dd1955e6c36.js +1 -0
  25. sky/dashboard/out/_next/static/chunks/pages/clusters-3a748bd76e5c2984.js +1 -0
  26. sky/dashboard/out/_next/static/chunks/pages/infra-9180cd91cee64b96.js +1 -0
  27. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-70756c2dad850a7e.js +1 -0
  28. sky/dashboard/out/_next/static/chunks/pages/jobs-ecd804b9272f4a7c.js +1 -0
  29. sky/dashboard/out/_next/static/css/7e7ce4ff31d3977b.css +3 -0
  30. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  31. sky/dashboard/out/clusters/[cluster].html +1 -1
  32. sky/dashboard/out/clusters.html +1 -1
  33. sky/dashboard/out/index.html +1 -1
  34. sky/dashboard/out/infra.html +1 -0
  35. sky/dashboard/out/jobs/[job].html +1 -1
  36. sky/dashboard/out/jobs.html +1 -1
  37. sky/data/storage.py +1 -0
  38. sky/execution.py +57 -8
  39. sky/jobs/server/core.py +5 -3
  40. sky/jobs/utils.py +38 -7
  41. sky/optimizer.py +41 -39
  42. sky/provision/gcp/constants.py +147 -4
  43. sky/provision/gcp/instance_utils.py +10 -0
  44. sky/provision/gcp/volume_utils.py +247 -0
  45. sky/provision/provisioner.py +16 -7
  46. sky/resources.py +233 -18
  47. sky/serve/serve_utils.py +5 -13
  48. sky/serve/server/core.py +2 -4
  49. sky/server/common.py +60 -14
  50. sky/server/constants.py +2 -0
  51. sky/server/html/token_page.html +154 -0
  52. sky/server/requests/executor.py +3 -6
  53. sky/server/requests/payloads.py +3 -3
  54. sky/server/server.py +40 -8
  55. sky/skypilot_config.py +117 -31
  56. sky/task.py +24 -1
  57. sky/templates/gcp-ray.yml.j2 +44 -1
  58. sky/templates/nebius-ray.yml.j2 +0 -2
  59. sky/utils/admin_policy_utils.py +26 -22
  60. sky/utils/cli_utils/status_utils.py +95 -56
  61. sky/utils/common_utils.py +35 -2
  62. sky/utils/context.py +36 -6
  63. sky/utils/context_utils.py +15 -0
  64. sky/utils/infra_utils.py +175 -0
  65. sky/utils/resources_utils.py +55 -21
  66. sky/utils/schemas.py +111 -5
  67. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250522.dist-info}/METADATA +1 -1
  68. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250522.dist-info}/RECORD +73 -68
  69. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250522.dist-info}/WHEEL +1 -1
  70. sky/dashboard/out/_next/static/8hlc2dkbIDDBOkxtEW7X6/_buildManifest.js +0 -1
  71. sky/dashboard/out/_next/static/chunks/236-f49500b82ad5392d.js +0 -6
  72. sky/dashboard/out/_next/static/chunks/37-0a572fe0dbb89c4d.js +0 -6
  73. sky/dashboard/out/_next/static/chunks/845-0ca6f2c1ba667c3b.js +0 -1
  74. sky/dashboard/out/_next/static/chunks/979-7bf73a4c7cea0f5c.js +0 -1
  75. sky/dashboard/out/_next/static/chunks/pages/_app-e6b013bc3f77ad60.js +0 -1
  76. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-e15db85d0ea1fbe1.js +0 -1
  77. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-f383db7389368ea7.js +0 -1
  78. sky/dashboard/out/_next/static/chunks/pages/clusters-a93b93e10b8b074e.js +0 -1
  79. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-03f279c6741fb48b.js +0 -1
  80. sky/dashboard/out/_next/static/chunks/pages/jobs-a75029b67aab6a2e.js +0 -1
  81. sky/dashboard/out/_next/static/css/c6933bbb2ce7f4dd.css +0 -3
  82. /sky/dashboard/out/_next/static/{8hlc2dkbIDDBOkxtEW7X6 → CzOVV6JpRQBRt5GhZuhyK}/_ssgManifest.js +0 -0
  83. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250522.dist-info}/entry_points.txt +0 -0
  84. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250522.dist-info}/licenses/LICENSE +0 -0
  85. {skypilot_nightly-1.0.0.dev20250520.dist-info → skypilot_nightly-1.0.0.dev20250522.dist-info}/top_level.txt +0 -0
sky/clouds/gcp.py CHANGED
@@ -18,6 +18,7 @@ from sky.adaptors import gcp
18
18
  from sky.clouds import service_catalog
19
19
  from sky.clouds.utils import gcp_utils
20
20
  from sky.provision.gcp import constants
21
+ from sky.provision.gcp import volume_utils
21
22
  from sky.utils import annotations
22
23
  from sky.utils import common_utils
23
24
  from sky.utils import registry
@@ -443,6 +444,25 @@ class GCP(clouds.Cloud):
443
444
  disk_tier=disk_tier,
444
445
  clouds='gcp')
445
446
 
447
+ @classmethod
448
+ def failover_disk_tier(
449
+ cls, instance_type: Optional[str],
450
+ disk_tier: Optional[resources_utils.DiskTier]
451
+ ) -> Optional[resources_utils.DiskTier]:
452
+ if (disk_tier is not None and
453
+ disk_tier != resources_utils.DiskTier.BEST):
454
+ return disk_tier
455
+ # Failover disk tier from ultra to low.
456
+ all_tiers = list(reversed(resources_utils.DiskTier))
457
+ start_index = all_tiers.index(GCP._translate_disk_tier(disk_tier))
458
+ while start_index < len(all_tiers):
459
+ disk_tier = all_tiers[start_index]
460
+ ok, _ = GCP.check_disk_tier(instance_type, disk_tier)
461
+ if ok:
462
+ return disk_tier
463
+ start_index += 1
464
+ assert False, 'Low disk tier should always be supported on GCP.'
465
+
446
466
  def make_deploy_resources_variables(
447
467
  self,
448
468
  resources: 'resources.Resources',
@@ -463,21 +483,6 @@ class GCP(clouds.Cloud):
463
483
  # issue when first booted.
464
484
  image_id = _DEFAULT_CPU_IMAGE_ID
465
485
 
466
- def _failover_disk_tier() -> Optional[resources_utils.DiskTier]:
467
- if (r.disk_tier is not None and
468
- r.disk_tier != resources_utils.DiskTier.BEST):
469
- return r.disk_tier
470
- # Failover disk tier from ultra to low.
471
- all_tiers = list(reversed(resources_utils.DiskTier))
472
- start_index = all_tiers.index(GCP._translate_disk_tier(r.disk_tier))
473
- while start_index < len(all_tiers):
474
- disk_tier = all_tiers[start_index]
475
- ok, _ = GCP.check_disk_tier(r.instance_type, disk_tier)
476
- if ok:
477
- return disk_tier
478
- start_index += 1
479
- assert False, 'Low disk tier should always be supported on GCP.'
480
-
481
486
  r = resources
482
487
  # Find GPU spec, if any.
483
488
  resources_vars = {
@@ -491,7 +496,9 @@ class GCP(clouds.Cloud):
491
496
  'custom_resources': None,
492
497
  'use_spot': r.use_spot,
493
498
  'gcp_project_id': self.get_project_id(dryrun),
494
- **GCP._get_disk_specs(r.instance_type, _failover_disk_tier()),
499
+ **GCP._get_disk_specs(
500
+ r.instance_type,
501
+ GCP.failover_disk_tier(r.instance_type, r.disk_tier)),
495
502
  }
496
503
  enable_gpu_direct = skypilot_config.get_nested(
497
504
  ('gcp', 'enable_gpu_direct'),
@@ -593,6 +600,27 @@ class GCP(clouds.Cloud):
593
600
  'force_enable_external_ips'] = skypilot_config.get_nested(
594
601
  ('gcp', 'force_enable_external_ips'), False)
595
602
 
603
+ volumes, device_mount_points = GCP._get_volumes_specs(
604
+ region, zones, r.instance_type, r.volumes, use_mig,
605
+ resources_vars['tpu_vm'])
606
+ resources_vars['volumes'] = volumes
607
+
608
+ resources_vars['user_data'] = None
609
+ user_data = ''
610
+ docker_run_options = []
611
+ if device_mount_points:
612
+ # Build the device_mounts array
613
+ device_mounts_array = []
614
+ for device_name, mount_point in device_mount_points.items():
615
+ device_mounts_array.append(f'["{device_name}"]="{mount_point}"')
616
+ docker_run_options.append(
617
+ f'--volume={mount_point}:{mount_point}')
618
+ device_mounts_str = '\n '.join(device_mounts_array)
619
+
620
+ # Format the template with the device_mounts array
621
+ user_data += constants.DISK_MOUNT_USER_DATA_TEMPLATE.format(
622
+ device_mounts=device_mounts_str)
623
+
596
624
  # Add gVNIC from config
597
625
  resources_vars['enable_gvnic'] = skypilot_config.get_nested(
598
626
  ('gcp', 'enable_gvnic'),
@@ -602,13 +630,16 @@ class GCP(clouds.Cloud):
602
630
  ('gcp', 'placement_policy'),
603
631
  None,
604
632
  override_configs=resources.cluster_config_overrides)
605
- resources_vars['user_data'] = None
606
633
  if enable_gpu_direct:
607
- resources_vars['user_data'] = constants.GPU_DIRECT_TCPX_USER_DATA
608
- resources_vars[
609
- 'docker_run_options'] = constants.GPU_DIRECT_TCPX_SPECIFIC_OPTIONS
634
+ user_data += constants.GPU_DIRECT_TCPX_USER_DATA
635
+ docker_run_options += constants.GPU_DIRECT_TCPX_SPECIFIC_OPTIONS
610
636
  if placement_policy is None:
611
637
  placement_policy = constants.COMPACT_GROUP_PLACEMENT_POLICY
638
+ if user_data:
639
+ resources_vars[
640
+ 'user_data'] = constants.BASH_SCRIPT_START + user_data
641
+ if docker_run_options:
642
+ resources_vars['docker_run_options'] = docker_run_options
612
643
  resources_vars['placement_policy'] = placement_policy
613
644
 
614
645
  return resources_vars
@@ -1122,6 +1153,17 @@ class GCP(clouds.Cloud):
1122
1153
 
1123
1154
  return tier2name[tier]
1124
1155
 
1156
+ @classmethod
1157
+ def _get_data_disk_type(
1158
+ cls,
1159
+ instance_type: Optional[str],
1160
+ disk_tier: Optional[resources_utils.DiskTier],
1161
+ ) -> str:
1162
+
1163
+ tier = cls._translate_disk_tier(disk_tier)
1164
+ tier2name = volume_utils.get_data_disk_tier_mapping(instance_type)
1165
+ return tier2name[tier]
1166
+
1125
1167
  @classmethod
1126
1168
  def _get_disk_specs(
1127
1169
  cls, instance_type: Optional[str],
@@ -1133,9 +1175,102 @@ class GCP(clouds.Cloud):
1133
1175
  specs['disk_tier'] == 'pd-extreme'):
1134
1176
  # Only pd-extreme supports custom iops.
1135
1177
  # see https://cloud.google.com/compute/docs/disks#disk-types
1136
- specs['disk_iops'] = 20000
1178
+ specs['disk_iops'] = constants.PD_EXTREME_IOPS
1137
1179
  return specs
1138
1180
 
1181
+ @classmethod
1182
+ def _get_volumes_specs(
1183
+ cls,
1184
+ region: 'clouds.Region',
1185
+ zones: Optional[List['clouds.Zone']],
1186
+ instance_type: Optional[str],
1187
+ volumes: Optional[List[Dict[str, Any]]],
1188
+ use_mig: bool,
1189
+ tpu_vm: bool,
1190
+ ) -> Tuple[List[Dict[str, Any]], Dict[str, str]]:
1191
+ if volumes is None:
1192
+ return [], {}
1193
+
1194
+ project_id = cls.get_project_id()
1195
+
1196
+ volume_utils.validate_instance_volumes(instance_type, volumes)
1197
+
1198
+ volumes_specs: List[Dict[str, Any]] = []
1199
+ device_mount_points: Dict[str, str] = {}
1200
+ ssd_index = 0
1201
+ # TPU data disk index starts from 1, 0 is the boot disk
1202
+ tpu_disk_index = 1
1203
+ for i, volume in enumerate(volumes):
1204
+ volume_spec = {
1205
+ 'device_name': f'sky-disk-{i}',
1206
+ 'auto_delete': volume['auto_delete'],
1207
+ }
1208
+ if ('name' in volume and volume['storage_type']
1209
+ == resources_utils.StorageType.NETWORK):
1210
+ volume_info = volume_utils.check_volume_name_exist_in_region(
1211
+ project_id, region, use_mig, volume['name'])
1212
+ if volume_info is not None:
1213
+ volume_utils.check_volume_zone_match(
1214
+ volume['name'], zones, volume_info['available_zones'])
1215
+ volume_spec['source'] = volume_info['selfLink']
1216
+ volume_spec[
1217
+ 'attach_mode'] = volume_utils.translate_attach_mode(
1218
+ volume['attach_mode'])
1219
+ volume_spec['storage_type'] = constants.NETWORK_STORAGE_TYPE
1220
+ volumes_specs.append(volume_spec)
1221
+ device_name = f'{constants.DEVICE_NAME_PREFIX}sky-disk-{i}'
1222
+ if tpu_vm:
1223
+ # TPU VM does not support specifying the device name,
1224
+ # so we use the default device name.
1225
+ device_name = f'{constants.DEVICE_NAME_PREFIX}persistent-disk-{tpu_disk_index}'
1226
+ tpu_disk_index += 1
1227
+ device_mount_points[device_name] = volume['path']
1228
+ continue
1229
+ if tpu_vm:
1230
+ # TODO(hailong): support creating block storage for TPU VM
1231
+ continue
1232
+ if volume['storage_type'] == resources_utils.StorageType.INSTANCE:
1233
+ device_name = f'{constants.INSTANCE_STORAGE_DEVICE_NAME_PREFIX}{ssd_index}'
1234
+ ssd_index += 1
1235
+ device_mount_points[device_name] = volume['path']
1236
+
1237
+ if instance_type is not None and instance_type in constants.SSD_AUTO_ATTACH_MACHINE_TYPES:
1238
+ # The instance storage will be attached automatically,
1239
+ # so we skip the following steps.
1240
+ continue
1241
+
1242
+ volume_spec['disk_tier'] = constants.INSTANCE_STORAGE_DISK_TYPE
1243
+ volume_spec[
1244
+ 'interface_type'] = constants.INSTANCE_STORAGE_INTERFACE_TYPE
1245
+ volume_spec['storage_type'] = constants.INSTANCE_STORAGE_TYPE
1246
+ # Disk size of instance storage is fixed to 375GB
1247
+ volume_spec['disk_size'] = None
1248
+ volume_spec['auto_delete'] = True
1249
+ else:
1250
+ # TODO(hailong): this should be fixed when move the
1251
+ # disk creation out of the instance creation phase
1252
+ if not use_mig:
1253
+ volume_spec['disk_name'] = volume['name']
1254
+ device_name = f'{constants.DEVICE_NAME_PREFIX}sky-disk-{i}'
1255
+ device_mount_points[device_name] = volume['path']
1256
+
1257
+ volume_spec['storage_type'] = constants.NETWORK_STORAGE_TYPE
1258
+ if 'disk_size' in volume:
1259
+ volume_spec['disk_size'] = volume['disk_size']
1260
+ else:
1261
+ volume_spec['disk_size'] = constants.DEFAULT_DISK_SIZE
1262
+ disk_tier = cls.failover_disk_tier(instance_type,
1263
+ volume['disk_tier'])
1264
+ volume_spec['disk_tier'] = cls._get_data_disk_type(
1265
+ instance_type, disk_tier)
1266
+ if volume_spec['disk_tier'] == 'pd-extreme':
1267
+ # Only pd-extreme supports custom iops.
1268
+ # see https://cloud.google.com/compute/docs/disks#disk-types
1269
+ volume_spec['disk_iops'] = constants.PD_EXTREME_IOPS
1270
+ volumes_specs.append(volume_spec)
1271
+
1272
+ return volumes_specs, device_mount_points
1273
+
1139
1274
  @classmethod
1140
1275
  def _label_filter_str(cls, tag_filters: Dict[str, str]) -> str:
1141
1276
  return ' '.join(f'labels.{k}={v}' for k, v in tag_filters.items())
@@ -9,6 +9,8 @@ from sky.clouds.service_catalog.constants import ALL_CLOUDS
9
9
  from sky.clouds.service_catalog.constants import CATALOG_DIR
10
10
  from sky.clouds.service_catalog.constants import CATALOG_SCHEMA_VERSION
11
11
  from sky.clouds.service_catalog.constants import HOSTED_CATALOG_DIR_URL
12
+ from sky.clouds.service_catalog.constants import (
13
+ HOSTED_CATALOG_DIR_URL_S3_MIRROR)
12
14
  from sky.utils import resources_utils
13
15
  from sky.utils import subprocess_utils
14
16
 
@@ -383,6 +385,7 @@ __all__ = [
383
385
  # Constants
384
386
  'ALL_CLOUDS',
385
387
  'HOSTED_CATALOG_DIR_URL',
388
+ 'HOSTED_CATALOG_DIR_URL_S3_MIRROR',
386
389
  'CATALOG_SCHEMA_VERSION',
387
390
  'CATALOG_DIR',
388
391
  ]
@@ -197,6 +197,8 @@ def read_catalog(filename: str,
197
197
  with filelock.FileLock(meta_path + '.lock'):
198
198
  if _need_update():
199
199
  url = f'{constants.HOSTED_CATALOG_DIR_URL}/{constants.CATALOG_SCHEMA_VERSION}/{filename}' # pylint: disable=line-too-long
200
+ url_fallback = f'{constants.HOSTED_CATALOG_DIR_URL_S3_MIRROR}/{constants.CATALOG_SCHEMA_VERSION}/{filename}' # pylint: disable=line-too-long
201
+ headers = {'User-Agent': 'SkyPilot/0.7'}
200
202
  update_frequency_str = ''
201
203
  if pull_frequency_hours is not None:
202
204
  update_frequency_str = (
@@ -206,8 +208,13 @@ def read_catalog(filename: str,
206
208
  f'Updating {cloud} catalog: {filename}') +
207
209
  f'{update_frequency_str}'):
208
210
  try:
209
- r = requests.get(url=url,
210
- headers={'User-Agent': 'SkyPilot/0.7'})
211
+ r = requests.get(url=url, headers=headers)
212
+ if r.status_code == 429:
213
+ # fallback to s3 mirror, github introduced rate
214
+ # limit after 2025-05, see
215
+ # https://github.com/skypilot-org/skypilot/issues/5438
216
+ # for more details
217
+ r = requests.get(url=url_fallback, headers=headers)
211
218
  r.raise_for_status()
212
219
  except requests.exceptions.RequestException as e:
213
220
  error_str = (f'Failed to fetch {cloud} catalog '
@@ -1,5 +1,6 @@
1
1
  """Constants used for service catalog."""
2
2
  HOSTED_CATALOG_DIR_URL = 'https://raw.githubusercontent.com/skypilot-org/skypilot-catalog/master/catalogs' # pylint: disable=line-too-long
3
+ HOSTED_CATALOG_DIR_URL_S3_MIRROR = 'https://skypilot-catalog.s3.us-east-1.amazonaws.com/catalogs' # pylint: disable=line-too-long
3
4
  CATALOG_SCHEMA_VERSION = 'v7'
4
5
  CATALOG_DIR = '~/.sky/catalogs'
5
6
  ALL_CLOUDS = ('aws', 'azure', 'gcp', 'ibm', 'lambda', 'scp', 'oci',
sky/core.py CHANGED
@@ -78,14 +78,12 @@ def optimize(
78
78
  # is shown on `sky launch`. The optimizer is also invoked during failover,
79
79
  # but we do not apply the admin policy there. We should apply the admin
80
80
  # policy in the optimizer, but that will require some refactoring.
81
- dag, _ = admin_policy_utils.apply(
82
- dag,
83
- use_mutated_config_in_current_request=True,
84
- request_options=request_options)
85
- return optimizer.Optimizer.optimize(dag=dag,
86
- minimize=minimize,
87
- blocked_resources=blocked_resources,
88
- quiet=quiet)
81
+ with admin_policy_utils.apply_and_use_config_in_current_request(
82
+ dag, request_options=request_options) as dag:
83
+ return optimizer.Optimizer.optimize(dag=dag,
84
+ minimize=minimize,
85
+ blocked_resources=blocked_resources,
86
+ quiet=quiet)
89
87
 
90
88
 
91
89
  @usage_lib.entrypoint
@@ -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/CzOVV6JpRQBRt5GhZuhyK/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/CzOVV6JpRQBRt5GhZuhyK/_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":"CzOVV6JpRQBRt5GhZuhyK","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ self.__BUILD_MANIFEST=function(s,c,e,t,a,r){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-6b0d9e5031b70c58.js"],"/_error":["static/chunks/pages/_error-1be831200e60c5c0.js"],"/clusters":[s,e,c,t,a,"static/chunks/pages/clusters-3a748bd76e5c2984.js"],"/clusters/[cluster]":[s,e,c,t,r,a,"static/chunks/pages/clusters/[cluster]-e2fc2dd1955e6c36.js"],"/clusters/[cluster]/[job]":[s,c,"static/chunks/pages/clusters/[cluster]/[job]-33bc2bec322249b1.js"],"/infra":[s,c,"static/chunks/pages/infra-9180cd91cee64b96.js"],"/jobs":[s,e,c,t,r,"static/chunks/pages/jobs-ecd804b9272f4a7c.js"],"/jobs/[job]":[s,c,"static/chunks/pages/jobs/[job]-70756c2dad850a7e.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/infra","/jobs","/jobs/[job]"]}}("static/chunks/582-683f4f27b81996dc.js","static/chunks/480-f28cd152a98997de.js","static/chunks/312-c3c8845990db8ffc.js","static/chunks/393-e1eaa440481337ec.js","static/chunks/37-d584022b0da4ac3b.js","static/chunks/236-1a3a9440417720eb.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -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))}}}]);