skypilot-nightly 1.0.0.dev20250509__py3-none-any.whl → 1.0.0.dev20251107__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of skypilot-nightly might be problematic. Click here for more details.

Files changed (512) hide show
  1. sky/__init__.py +22 -6
  2. sky/adaptors/aws.py +25 -7
  3. sky/adaptors/common.py +24 -1
  4. sky/adaptors/coreweave.py +278 -0
  5. sky/adaptors/do.py +8 -2
  6. sky/adaptors/hyperbolic.py +8 -0
  7. sky/adaptors/kubernetes.py +149 -18
  8. sky/adaptors/nebius.py +170 -17
  9. sky/adaptors/primeintellect.py +1 -0
  10. sky/adaptors/runpod.py +68 -0
  11. sky/adaptors/seeweb.py +167 -0
  12. sky/adaptors/shadeform.py +89 -0
  13. sky/admin_policy.py +187 -4
  14. sky/authentication.py +179 -225
  15. sky/backends/__init__.py +4 -2
  16. sky/backends/backend.py +22 -9
  17. sky/backends/backend_utils.py +1299 -380
  18. sky/backends/cloud_vm_ray_backend.py +1715 -518
  19. sky/backends/docker_utils.py +1 -1
  20. sky/backends/local_docker_backend.py +11 -6
  21. sky/backends/wheel_utils.py +37 -9
  22. sky/{clouds/service_catalog → catalog}/__init__.py +21 -19
  23. sky/{clouds/service_catalog → catalog}/aws_catalog.py +27 -8
  24. sky/{clouds/service_catalog → catalog}/azure_catalog.py +10 -7
  25. sky/{clouds/service_catalog → catalog}/common.py +89 -48
  26. sky/{clouds/service_catalog → catalog}/cudo_catalog.py +8 -5
  27. sky/{clouds/service_catalog → catalog}/data_fetchers/analyze.py +1 -1
  28. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_aws.py +30 -40
  29. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_cudo.py +38 -38
  30. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_gcp.py +42 -15
  31. sky/catalog/data_fetchers/fetch_hyperbolic.py +136 -0
  32. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_lambda_cloud.py +1 -0
  33. sky/catalog/data_fetchers/fetch_nebius.py +335 -0
  34. sky/catalog/data_fetchers/fetch_runpod.py +698 -0
  35. sky/catalog/data_fetchers/fetch_seeweb.py +329 -0
  36. sky/catalog/data_fetchers/fetch_shadeform.py +142 -0
  37. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_vast.py +1 -1
  38. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_vsphere.py +1 -1
  39. sky/{clouds/service_catalog → catalog}/do_catalog.py +5 -2
  40. sky/{clouds/service_catalog → catalog}/fluidstack_catalog.py +6 -3
  41. sky/{clouds/service_catalog → catalog}/gcp_catalog.py +41 -15
  42. sky/catalog/hyperbolic_catalog.py +136 -0
  43. sky/{clouds/service_catalog → catalog}/ibm_catalog.py +9 -6
  44. sky/{clouds/service_catalog → catalog}/kubernetes_catalog.py +36 -24
  45. sky/{clouds/service_catalog → catalog}/lambda_catalog.py +9 -6
  46. sky/{clouds/service_catalog → catalog}/nebius_catalog.py +9 -7
  47. sky/{clouds/service_catalog → catalog}/oci_catalog.py +9 -6
  48. sky/{clouds/service_catalog → catalog}/paperspace_catalog.py +5 -2
  49. sky/catalog/primeintellect_catalog.py +95 -0
  50. sky/{clouds/service_catalog → catalog}/runpod_catalog.py +11 -4
  51. sky/{clouds/service_catalog → catalog}/scp_catalog.py +9 -6
  52. sky/catalog/seeweb_catalog.py +184 -0
  53. sky/catalog/shadeform_catalog.py +165 -0
  54. sky/catalog/ssh_catalog.py +167 -0
  55. sky/{clouds/service_catalog → catalog}/vast_catalog.py +6 -3
  56. sky/{clouds/service_catalog → catalog}/vsphere_catalog.py +5 -2
  57. sky/check.py +491 -203
  58. sky/cli.py +5 -6005
  59. sky/client/{cli.py → cli/command.py} +2477 -1885
  60. sky/client/cli/deprecation_utils.py +99 -0
  61. sky/client/cli/flags.py +359 -0
  62. sky/client/cli/table_utils.py +320 -0
  63. sky/client/common.py +70 -32
  64. sky/client/oauth.py +82 -0
  65. sky/client/sdk.py +1203 -297
  66. sky/client/sdk_async.py +833 -0
  67. sky/client/service_account_auth.py +47 -0
  68. sky/cloud_stores.py +73 -0
  69. sky/clouds/__init__.py +13 -0
  70. sky/clouds/aws.py +358 -93
  71. sky/clouds/azure.py +105 -83
  72. sky/clouds/cloud.py +127 -36
  73. sky/clouds/cudo.py +68 -50
  74. sky/clouds/do.py +66 -48
  75. sky/clouds/fluidstack.py +63 -44
  76. sky/clouds/gcp.py +339 -110
  77. sky/clouds/hyperbolic.py +293 -0
  78. sky/clouds/ibm.py +70 -49
  79. sky/clouds/kubernetes.py +563 -162
  80. sky/clouds/lambda_cloud.py +74 -54
  81. sky/clouds/nebius.py +206 -80
  82. sky/clouds/oci.py +88 -66
  83. sky/clouds/paperspace.py +61 -44
  84. sky/clouds/primeintellect.py +317 -0
  85. sky/clouds/runpod.py +164 -74
  86. sky/clouds/scp.py +89 -83
  87. sky/clouds/seeweb.py +466 -0
  88. sky/clouds/shadeform.py +400 -0
  89. sky/clouds/ssh.py +263 -0
  90. sky/clouds/utils/aws_utils.py +10 -4
  91. sky/clouds/utils/gcp_utils.py +87 -11
  92. sky/clouds/utils/oci_utils.py +38 -14
  93. sky/clouds/utils/scp_utils.py +177 -124
  94. sky/clouds/vast.py +99 -77
  95. sky/clouds/vsphere.py +51 -40
  96. sky/core.py +349 -139
  97. sky/dag.py +15 -0
  98. sky/dashboard/out/404.html +1 -1
  99. sky/dashboard/out/_next/static/chunks/1141-e6aa9ab418717c59.js +11 -0
  100. sky/dashboard/out/_next/static/chunks/1272-1ef0bf0237faccdb.js +1 -0
  101. sky/dashboard/out/_next/static/chunks/1871-74503c8e80fd253b.js +6 -0
  102. sky/dashboard/out/_next/static/chunks/2260-7703229c33c5ebd5.js +1 -0
  103. sky/dashboard/out/_next/static/chunks/2350.fab69e61bac57b23.js +1 -0
  104. sky/dashboard/out/_next/static/chunks/2369.fc20f0c2c8ed9fe7.js +15 -0
  105. sky/dashboard/out/_next/static/chunks/2755.fff53c4a3fcae910.js +26 -0
  106. sky/dashboard/out/_next/static/chunks/3294.72362fa129305b19.js +1 -0
  107. sky/dashboard/out/_next/static/chunks/3785.ad6adaa2a0fa9768.js +1 -0
  108. sky/dashboard/out/_next/static/chunks/3850-ff4a9a69d978632b.js +1 -0
  109. sky/dashboard/out/_next/static/chunks/3937.210053269f121201.js +1 -0
  110. sky/dashboard/out/_next/static/chunks/4725.a830b5c9e7867c92.js +1 -0
  111. sky/dashboard/out/_next/static/chunks/4937.a2baa2df5572a276.js +15 -0
  112. sky/dashboard/out/_next/static/chunks/5739-d67458fcb1386c92.js +8 -0
  113. sky/dashboard/out/_next/static/chunks/6130-2be46d70a38f1e82.js +1 -0
  114. sky/dashboard/out/_next/static/chunks/616-3d59f75e2ccf9321.js +39 -0
  115. sky/dashboard/out/_next/static/chunks/6212-7bd06f60ba693125.js +13 -0
  116. sky/dashboard/out/_next/static/chunks/6601-06114c982db410b6.js +1 -0
  117. sky/dashboard/out/_next/static/chunks/6856-ef8ba11f96d8c4a3.js +1 -0
  118. sky/dashboard/out/_next/static/chunks/6989-01359c57e018caa4.js +1 -0
  119. sky/dashboard/out/_next/static/chunks/6990-32b6e2d3822301fa.js +1 -0
  120. sky/dashboard/out/_next/static/chunks/7359-c8d04e06886000b3.js +30 -0
  121. sky/dashboard/out/_next/static/chunks/7411-b15471acd2cba716.js +41 -0
  122. sky/dashboard/out/_next/static/chunks/7615-3301e838e5f25772.js +1 -0
  123. sky/dashboard/out/_next/static/chunks/8640.5b9475a2d18c5416.js +16 -0
  124. sky/dashboard/out/_next/static/chunks/8969-1e4613c651bf4051.js +1 -0
  125. sky/dashboard/out/_next/static/chunks/9025.fa408f3242e9028d.js +6 -0
  126. sky/dashboard/out/_next/static/chunks/9353-cff34f7e773b2e2b.js +1 -0
  127. sky/dashboard/out/_next/static/chunks/9360.7310982cf5a0dc79.js +31 -0
  128. sky/dashboard/out/_next/static/chunks/9847.3aaca6bb33455140.js +30 -0
  129. sky/dashboard/out/_next/static/chunks/fd9d1056-86323a29a8f7e46a.js +1 -0
  130. sky/dashboard/out/_next/static/chunks/framework-cf60a09ccd051a10.js +33 -0
  131. sky/dashboard/out/_next/static/chunks/main-app-587214043926b3cc.js +1 -0
  132. sky/dashboard/out/_next/static/chunks/main-f15ccb73239a3bf1.js +1 -0
  133. sky/dashboard/out/_next/static/chunks/pages/_app-bde01e4a2beec258.js +34 -0
  134. sky/dashboard/out/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js +1 -0
  135. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-c736ead69c2d86ec.js +16 -0
  136. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-a37d2063af475a1c.js +1 -0
  137. sky/dashboard/out/_next/static/chunks/pages/clusters-d44859594e6f8064.js +1 -0
  138. sky/dashboard/out/_next/static/chunks/pages/config-dfb9bf07b13045f4.js +1 -0
  139. sky/dashboard/out/_next/static/chunks/pages/index-444f1804401f04ea.js +1 -0
  140. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-c0b5935149902e6f.js +1 -0
  141. sky/dashboard/out/_next/static/chunks/pages/infra-aed0ea19df7cf961.js +1 -0
  142. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-5796e8d6aea291a0.js +16 -0
  143. sky/dashboard/out/_next/static/chunks/pages/jobs/pools/[pool]-6edeb7d06032adfc.js +21 -0
  144. sky/dashboard/out/_next/static/chunks/pages/jobs-479dde13399cf270.js +1 -0
  145. sky/dashboard/out/_next/static/chunks/pages/users-5ab3b907622cf0fe.js +1 -0
  146. sky/dashboard/out/_next/static/chunks/pages/volumes-b84b948ff357c43e.js +1 -0
  147. sky/dashboard/out/_next/static/chunks/pages/workspace/new-3f88a1c7e86a3f86.js +1 -0
  148. sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-c5a3eeee1c218af1.js +1 -0
  149. sky/dashboard/out/_next/static/chunks/pages/workspaces-22b23febb3e89ce1.js +1 -0
  150. sky/dashboard/out/_next/static/chunks/webpack-2679be77fc08a2f8.js +1 -0
  151. sky/dashboard/out/_next/static/css/0748ce22df867032.css +3 -0
  152. sky/dashboard/out/_next/static/zB0ed6ge_W1MDszVHhijS/_buildManifest.js +1 -0
  153. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  154. sky/dashboard/out/clusters/[cluster].html +1 -1
  155. sky/dashboard/out/clusters.html +1 -1
  156. sky/dashboard/out/config.html +1 -0
  157. sky/dashboard/out/index.html +1 -1
  158. sky/dashboard/out/infra/[context].html +1 -0
  159. sky/dashboard/out/infra.html +1 -0
  160. sky/dashboard/out/jobs/[job].html +1 -1
  161. sky/dashboard/out/jobs/pools/[pool].html +1 -0
  162. sky/dashboard/out/jobs.html +1 -1
  163. sky/dashboard/out/users.html +1 -0
  164. sky/dashboard/out/volumes.html +1 -0
  165. sky/dashboard/out/workspace/new.html +1 -0
  166. sky/dashboard/out/workspaces/[name].html +1 -0
  167. sky/dashboard/out/workspaces.html +1 -0
  168. sky/data/data_utils.py +137 -1
  169. sky/data/mounting_utils.py +269 -84
  170. sky/data/storage.py +1451 -1807
  171. sky/data/storage_utils.py +43 -57
  172. sky/exceptions.py +132 -2
  173. sky/execution.py +206 -63
  174. sky/global_user_state.py +2374 -586
  175. sky/jobs/__init__.py +5 -0
  176. sky/jobs/client/sdk.py +242 -65
  177. sky/jobs/client/sdk_async.py +143 -0
  178. sky/jobs/constants.py +9 -8
  179. sky/jobs/controller.py +839 -277
  180. sky/jobs/file_content_utils.py +80 -0
  181. sky/jobs/log_gc.py +201 -0
  182. sky/jobs/recovery_strategy.py +398 -152
  183. sky/jobs/scheduler.py +315 -189
  184. sky/jobs/server/core.py +829 -255
  185. sky/jobs/server/server.py +156 -115
  186. sky/jobs/server/utils.py +136 -0
  187. sky/jobs/state.py +2092 -701
  188. sky/jobs/utils.py +1242 -160
  189. sky/logs/__init__.py +21 -0
  190. sky/logs/agent.py +108 -0
  191. sky/logs/aws.py +243 -0
  192. sky/logs/gcp.py +91 -0
  193. sky/metrics/__init__.py +0 -0
  194. sky/metrics/utils.py +443 -0
  195. sky/models.py +78 -1
  196. sky/optimizer.py +164 -70
  197. sky/provision/__init__.py +90 -4
  198. sky/provision/aws/config.py +147 -26
  199. sky/provision/aws/instance.py +135 -50
  200. sky/provision/azure/instance.py +10 -5
  201. sky/provision/common.py +13 -1
  202. sky/provision/cudo/cudo_machine_type.py +1 -1
  203. sky/provision/cudo/cudo_utils.py +14 -8
  204. sky/provision/cudo/cudo_wrapper.py +72 -71
  205. sky/provision/cudo/instance.py +10 -6
  206. sky/provision/do/instance.py +10 -6
  207. sky/provision/do/utils.py +4 -3
  208. sky/provision/docker_utils.py +114 -23
  209. sky/provision/fluidstack/instance.py +13 -8
  210. sky/provision/gcp/__init__.py +1 -0
  211. sky/provision/gcp/config.py +301 -19
  212. sky/provision/gcp/constants.py +218 -0
  213. sky/provision/gcp/instance.py +36 -8
  214. sky/provision/gcp/instance_utils.py +18 -4
  215. sky/provision/gcp/volume_utils.py +247 -0
  216. sky/provision/hyperbolic/__init__.py +12 -0
  217. sky/provision/hyperbolic/config.py +10 -0
  218. sky/provision/hyperbolic/instance.py +437 -0
  219. sky/provision/hyperbolic/utils.py +373 -0
  220. sky/provision/instance_setup.py +93 -14
  221. sky/provision/kubernetes/__init__.py +5 -0
  222. sky/provision/kubernetes/config.py +9 -52
  223. sky/provision/kubernetes/constants.py +17 -0
  224. sky/provision/kubernetes/instance.py +789 -247
  225. sky/provision/kubernetes/manifests/fusermount-server-daemonset.yaml +1 -2
  226. sky/provision/kubernetes/network.py +27 -17
  227. sky/provision/kubernetes/network_utils.py +40 -43
  228. sky/provision/kubernetes/utils.py +1192 -531
  229. sky/provision/kubernetes/volume.py +282 -0
  230. sky/provision/lambda_cloud/instance.py +22 -16
  231. sky/provision/nebius/constants.py +50 -0
  232. sky/provision/nebius/instance.py +19 -6
  233. sky/provision/nebius/utils.py +196 -91
  234. sky/provision/oci/instance.py +10 -5
  235. sky/provision/paperspace/instance.py +10 -7
  236. sky/provision/paperspace/utils.py +1 -1
  237. sky/provision/primeintellect/__init__.py +10 -0
  238. sky/provision/primeintellect/config.py +11 -0
  239. sky/provision/primeintellect/instance.py +454 -0
  240. sky/provision/primeintellect/utils.py +398 -0
  241. sky/provision/provisioner.py +110 -36
  242. sky/provision/runpod/__init__.py +5 -0
  243. sky/provision/runpod/instance.py +27 -6
  244. sky/provision/runpod/utils.py +51 -18
  245. sky/provision/runpod/volume.py +180 -0
  246. sky/provision/scp/__init__.py +15 -0
  247. sky/provision/scp/config.py +93 -0
  248. sky/provision/scp/instance.py +531 -0
  249. sky/provision/seeweb/__init__.py +11 -0
  250. sky/provision/seeweb/config.py +13 -0
  251. sky/provision/seeweb/instance.py +807 -0
  252. sky/provision/shadeform/__init__.py +11 -0
  253. sky/provision/shadeform/config.py +12 -0
  254. sky/provision/shadeform/instance.py +351 -0
  255. sky/provision/shadeform/shadeform_utils.py +83 -0
  256. sky/provision/ssh/__init__.py +18 -0
  257. sky/provision/vast/instance.py +13 -8
  258. sky/provision/vast/utils.py +10 -7
  259. sky/provision/vsphere/common/vim_utils.py +1 -2
  260. sky/provision/vsphere/instance.py +15 -10
  261. sky/provision/vsphere/vsphere_utils.py +9 -19
  262. sky/py.typed +0 -0
  263. sky/resources.py +844 -118
  264. sky/schemas/__init__.py +0 -0
  265. sky/schemas/api/__init__.py +0 -0
  266. sky/schemas/api/responses.py +225 -0
  267. sky/schemas/db/README +4 -0
  268. sky/schemas/db/env.py +90 -0
  269. sky/schemas/db/global_user_state/001_initial_schema.py +124 -0
  270. sky/schemas/db/global_user_state/002_add_workspace_to_cluster_history.py +35 -0
  271. sky/schemas/db/global_user_state/003_fix_initial_revision.py +61 -0
  272. sky/schemas/db/global_user_state/004_is_managed.py +34 -0
  273. sky/schemas/db/global_user_state/005_cluster_event.py +32 -0
  274. sky/schemas/db/global_user_state/006_provision_log.py +41 -0
  275. sky/schemas/db/global_user_state/007_cluster_event_request_id.py +34 -0
  276. sky/schemas/db/global_user_state/008_skylet_ssh_tunnel_metadata.py +34 -0
  277. sky/schemas/db/global_user_state/009_last_activity_and_launched_at.py +89 -0
  278. sky/schemas/db/global_user_state/010_save_ssh_key.py +66 -0
  279. sky/schemas/db/script.py.mako +28 -0
  280. sky/schemas/db/serve_state/001_initial_schema.py +67 -0
  281. sky/schemas/db/skypilot_config/001_initial_schema.py +30 -0
  282. sky/schemas/db/spot_jobs/001_initial_schema.py +97 -0
  283. sky/schemas/db/spot_jobs/002_cluster_pool.py +42 -0
  284. sky/schemas/db/spot_jobs/003_pool_hash.py +34 -0
  285. sky/schemas/db/spot_jobs/004_job_file_contents.py +42 -0
  286. sky/schemas/db/spot_jobs/005_logs_gc.py +38 -0
  287. sky/schemas/generated/__init__.py +0 -0
  288. sky/schemas/generated/autostopv1_pb2.py +36 -0
  289. sky/schemas/generated/autostopv1_pb2.pyi +43 -0
  290. sky/schemas/generated/autostopv1_pb2_grpc.py +146 -0
  291. sky/schemas/generated/jobsv1_pb2.py +86 -0
  292. sky/schemas/generated/jobsv1_pb2.pyi +254 -0
  293. sky/schemas/generated/jobsv1_pb2_grpc.py +542 -0
  294. sky/schemas/generated/managed_jobsv1_pb2.py +74 -0
  295. sky/schemas/generated/managed_jobsv1_pb2.pyi +278 -0
  296. sky/schemas/generated/managed_jobsv1_pb2_grpc.py +278 -0
  297. sky/schemas/generated/servev1_pb2.py +58 -0
  298. sky/schemas/generated/servev1_pb2.pyi +115 -0
  299. sky/schemas/generated/servev1_pb2_grpc.py +322 -0
  300. sky/serve/autoscalers.py +357 -5
  301. sky/serve/client/impl.py +310 -0
  302. sky/serve/client/sdk.py +47 -139
  303. sky/serve/client/sdk_async.py +130 -0
  304. sky/serve/constants.py +10 -8
  305. sky/serve/controller.py +64 -19
  306. sky/serve/load_balancer.py +106 -60
  307. sky/serve/load_balancing_policies.py +115 -1
  308. sky/serve/replica_managers.py +273 -162
  309. sky/serve/serve_rpc_utils.py +179 -0
  310. sky/serve/serve_state.py +554 -251
  311. sky/serve/serve_utils.py +733 -220
  312. sky/serve/server/core.py +66 -711
  313. sky/serve/server/impl.py +1093 -0
  314. sky/serve/server/server.py +21 -18
  315. sky/serve/service.py +133 -48
  316. sky/serve/service_spec.py +135 -16
  317. sky/serve/spot_placer.py +3 -0
  318. sky/server/auth/__init__.py +0 -0
  319. sky/server/auth/authn.py +50 -0
  320. sky/server/auth/loopback.py +38 -0
  321. sky/server/auth/oauth2_proxy.py +200 -0
  322. sky/server/common.py +475 -181
  323. sky/server/config.py +81 -23
  324. sky/server/constants.py +44 -6
  325. sky/server/daemons.py +229 -0
  326. sky/server/html/token_page.html +185 -0
  327. sky/server/metrics.py +160 -0
  328. sky/server/requests/executor.py +528 -138
  329. sky/server/requests/payloads.py +351 -17
  330. sky/server/requests/preconditions.py +21 -17
  331. sky/server/requests/process.py +112 -29
  332. sky/server/requests/request_names.py +120 -0
  333. sky/server/requests/requests.py +817 -224
  334. sky/server/requests/serializers/decoders.py +82 -31
  335. sky/server/requests/serializers/encoders.py +140 -22
  336. sky/server/requests/threads.py +106 -0
  337. sky/server/rest.py +417 -0
  338. sky/server/server.py +1290 -284
  339. sky/server/state.py +20 -0
  340. sky/server/stream_utils.py +345 -57
  341. sky/server/uvicorn.py +217 -3
  342. sky/server/versions.py +270 -0
  343. sky/setup_files/MANIFEST.in +5 -0
  344. sky/setup_files/alembic.ini +156 -0
  345. sky/setup_files/dependencies.py +136 -31
  346. sky/setup_files/setup.py +44 -42
  347. sky/sky_logging.py +102 -5
  348. sky/skylet/attempt_skylet.py +1 -0
  349. sky/skylet/autostop_lib.py +129 -8
  350. sky/skylet/configs.py +27 -20
  351. sky/skylet/constants.py +171 -19
  352. sky/skylet/events.py +105 -21
  353. sky/skylet/job_lib.py +335 -104
  354. sky/skylet/log_lib.py +297 -18
  355. sky/skylet/log_lib.pyi +44 -1
  356. sky/skylet/ray_patches/__init__.py +17 -3
  357. sky/skylet/ray_patches/autoscaler.py.diff +18 -0
  358. sky/skylet/ray_patches/cli.py.diff +19 -0
  359. sky/skylet/ray_patches/command_runner.py.diff +17 -0
  360. sky/skylet/ray_patches/log_monitor.py.diff +20 -0
  361. sky/skylet/ray_patches/resource_demand_scheduler.py.diff +32 -0
  362. sky/skylet/ray_patches/updater.py.diff +18 -0
  363. sky/skylet/ray_patches/worker.py.diff +41 -0
  364. sky/skylet/services.py +564 -0
  365. sky/skylet/skylet.py +63 -4
  366. sky/skylet/subprocess_daemon.py +103 -29
  367. sky/skypilot_config.py +506 -99
  368. sky/ssh_node_pools/__init__.py +1 -0
  369. sky/ssh_node_pools/core.py +135 -0
  370. sky/ssh_node_pools/server.py +233 -0
  371. sky/task.py +621 -137
  372. sky/templates/aws-ray.yml.j2 +10 -3
  373. sky/templates/azure-ray.yml.j2 +1 -1
  374. sky/templates/do-ray.yml.j2 +1 -1
  375. sky/templates/gcp-ray.yml.j2 +57 -0
  376. sky/templates/hyperbolic-ray.yml.j2 +67 -0
  377. sky/templates/jobs-controller.yaml.j2 +27 -24
  378. sky/templates/kubernetes-loadbalancer.yml.j2 +2 -0
  379. sky/templates/kubernetes-ray.yml.j2 +607 -51
  380. sky/templates/lambda-ray.yml.j2 +1 -1
  381. sky/templates/nebius-ray.yml.j2 +33 -12
  382. sky/templates/paperspace-ray.yml.j2 +1 -1
  383. sky/templates/primeintellect-ray.yml.j2 +71 -0
  384. sky/templates/runpod-ray.yml.j2 +9 -1
  385. sky/templates/scp-ray.yml.j2 +3 -50
  386. sky/templates/seeweb-ray.yml.j2 +108 -0
  387. sky/templates/shadeform-ray.yml.j2 +72 -0
  388. sky/templates/sky-serve-controller.yaml.j2 +22 -2
  389. sky/templates/websocket_proxy.py +178 -18
  390. sky/usage/usage_lib.py +18 -11
  391. sky/users/__init__.py +0 -0
  392. sky/users/model.conf +15 -0
  393. sky/users/permission.py +387 -0
  394. sky/users/rbac.py +121 -0
  395. sky/users/server.py +720 -0
  396. sky/users/token_service.py +218 -0
  397. sky/utils/accelerator_registry.py +34 -5
  398. sky/utils/admin_policy_utils.py +84 -38
  399. sky/utils/annotations.py +16 -5
  400. sky/utils/asyncio_utils.py +78 -0
  401. sky/utils/auth_utils.py +153 -0
  402. sky/utils/benchmark_utils.py +60 -0
  403. sky/utils/cli_utils/status_utils.py +159 -86
  404. sky/utils/cluster_utils.py +31 -9
  405. sky/utils/command_runner.py +354 -68
  406. sky/utils/command_runner.pyi +93 -3
  407. sky/utils/common.py +35 -8
  408. sky/utils/common_utils.py +310 -87
  409. sky/utils/config_utils.py +87 -5
  410. sky/utils/context.py +402 -0
  411. sky/utils/context_utils.py +222 -0
  412. sky/utils/controller_utils.py +264 -89
  413. sky/utils/dag_utils.py +31 -12
  414. sky/utils/db/__init__.py +0 -0
  415. sky/utils/db/db_utils.py +470 -0
  416. sky/utils/db/migration_utils.py +133 -0
  417. sky/utils/directory_utils.py +12 -0
  418. sky/utils/env_options.py +13 -0
  419. sky/utils/git.py +567 -0
  420. sky/utils/git_clone.sh +460 -0
  421. sky/utils/infra_utils.py +195 -0
  422. sky/utils/kubernetes/cleanup-tunnel.sh +62 -0
  423. sky/utils/kubernetes/config_map_utils.py +133 -0
  424. sky/utils/kubernetes/create_cluster.sh +13 -27
  425. sky/utils/kubernetes/delete_cluster.sh +10 -7
  426. sky/utils/kubernetes/deploy_remote_cluster.py +1299 -0
  427. sky/utils/kubernetes/exec_kubeconfig_converter.py +22 -31
  428. sky/utils/kubernetes/generate_kind_config.py +6 -66
  429. sky/utils/kubernetes/generate_kubeconfig.sh +4 -1
  430. sky/utils/kubernetes/gpu_labeler.py +5 -5
  431. sky/utils/kubernetes/kubernetes_deploy_utils.py +354 -47
  432. sky/utils/kubernetes/ssh-tunnel.sh +379 -0
  433. sky/utils/kubernetes/ssh_utils.py +221 -0
  434. sky/utils/kubernetes_enums.py +8 -15
  435. sky/utils/lock_events.py +94 -0
  436. sky/utils/locks.py +368 -0
  437. sky/utils/log_utils.py +300 -6
  438. sky/utils/perf_utils.py +22 -0
  439. sky/utils/resource_checker.py +298 -0
  440. sky/utils/resources_utils.py +249 -32
  441. sky/utils/rich_utils.py +213 -37
  442. sky/utils/schemas.py +905 -147
  443. sky/utils/serialize_utils.py +16 -0
  444. sky/utils/status_lib.py +10 -0
  445. sky/utils/subprocess_utils.py +38 -15
  446. sky/utils/tempstore.py +70 -0
  447. sky/utils/timeline.py +24 -52
  448. sky/utils/ux_utils.py +84 -15
  449. sky/utils/validator.py +11 -1
  450. sky/utils/volume.py +86 -0
  451. sky/utils/yaml_utils.py +111 -0
  452. sky/volumes/__init__.py +13 -0
  453. sky/volumes/client/__init__.py +0 -0
  454. sky/volumes/client/sdk.py +149 -0
  455. sky/volumes/server/__init__.py +0 -0
  456. sky/volumes/server/core.py +258 -0
  457. sky/volumes/server/server.py +122 -0
  458. sky/volumes/volume.py +212 -0
  459. sky/workspaces/__init__.py +0 -0
  460. sky/workspaces/core.py +655 -0
  461. sky/workspaces/server.py +101 -0
  462. sky/workspaces/utils.py +56 -0
  463. skypilot_nightly-1.0.0.dev20251107.dist-info/METADATA +675 -0
  464. skypilot_nightly-1.0.0.dev20251107.dist-info/RECORD +594 -0
  465. {skypilot_nightly-1.0.0.dev20250509.dist-info → skypilot_nightly-1.0.0.dev20251107.dist-info}/WHEEL +1 -1
  466. sky/benchmark/benchmark_state.py +0 -256
  467. sky/benchmark/benchmark_utils.py +0 -641
  468. sky/clouds/service_catalog/constants.py +0 -7
  469. sky/dashboard/out/_next/static/LksQgChY5izXjokL3LcEu/_buildManifest.js +0 -1
  470. sky/dashboard/out/_next/static/chunks/236-f49500b82ad5392d.js +0 -6
  471. sky/dashboard/out/_next/static/chunks/312-c3c8845990db8ffc.js +0 -15
  472. sky/dashboard/out/_next/static/chunks/37-0a572fe0dbb89c4d.js +0 -6
  473. sky/dashboard/out/_next/static/chunks/678-206dddca808e6d16.js +0 -59
  474. sky/dashboard/out/_next/static/chunks/845-0f8017370869e269.js +0 -1
  475. sky/dashboard/out/_next/static/chunks/979-7bf73a4c7cea0f5c.js +0 -1
  476. sky/dashboard/out/_next/static/chunks/fd9d1056-2821b0f0cabcd8bd.js +0 -1
  477. sky/dashboard/out/_next/static/chunks/framework-87d061ee6ed71b28.js +0 -33
  478. sky/dashboard/out/_next/static/chunks/main-app-241eb28595532291.js +0 -1
  479. sky/dashboard/out/_next/static/chunks/main-e0e2335212e72357.js +0 -1
  480. sky/dashboard/out/_next/static/chunks/pages/_app-e6b013bc3f77ad60.js +0 -1
  481. sky/dashboard/out/_next/static/chunks/pages/_error-1be831200e60c5c0.js +0 -1
  482. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-e15db85d0ea1fbe1.js +0 -1
  483. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-f383db7389368ea7.js +0 -1
  484. sky/dashboard/out/_next/static/chunks/pages/clusters-a93b93e10b8b074e.js +0 -1
  485. sky/dashboard/out/_next/static/chunks/pages/index-f9f039532ca8cbc4.js +0 -1
  486. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-03f279c6741fb48b.js +0 -1
  487. sky/dashboard/out/_next/static/chunks/pages/jobs-a75029b67aab6a2e.js +0 -1
  488. sky/dashboard/out/_next/static/chunks/webpack-830f59b8404e96b8.js +0 -1
  489. sky/dashboard/out/_next/static/css/c6933bbb2ce7f4dd.css +0 -3
  490. sky/jobs/dashboard/dashboard.py +0 -223
  491. sky/jobs/dashboard/static/favicon.ico +0 -0
  492. sky/jobs/dashboard/templates/index.html +0 -831
  493. sky/jobs/server/dashboard_utils.py +0 -69
  494. sky/skylet/providers/scp/__init__.py +0 -2
  495. sky/skylet/providers/scp/config.py +0 -149
  496. sky/skylet/providers/scp/node_provider.py +0 -578
  497. sky/templates/kubernetes-ssh-jump.yml.j2 +0 -94
  498. sky/utils/db_utils.py +0 -100
  499. sky/utils/kubernetes/deploy_remote_cluster.sh +0 -308
  500. sky/utils/kubernetes/ssh_jump_lifecycle_manager.py +0 -191
  501. skypilot_nightly-1.0.0.dev20250509.dist-info/METADATA +0 -361
  502. skypilot_nightly-1.0.0.dev20250509.dist-info/RECORD +0 -396
  503. /sky/{clouds/service_catalog → catalog}/config.py +0 -0
  504. /sky/{benchmark → catalog/data_fetchers}/__init__.py +0 -0
  505. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_azure.py +0 -0
  506. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_fluidstack.py +0 -0
  507. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_ibm.py +0 -0
  508. /sky/{clouds/service_catalog/data_fetchers → client/cli}/__init__.py +0 -0
  509. /sky/dashboard/out/_next/static/{LksQgChY5izXjokL3LcEu → zB0ed6ge_W1MDszVHhijS}/_ssgManifest.js +0 -0
  510. {skypilot_nightly-1.0.0.dev20250509.dist-info → skypilot_nightly-1.0.0.dev20251107.dist-info}/entry_points.txt +0 -0
  511. {skypilot_nightly-1.0.0.dev20250509.dist-info → skypilot_nightly-1.0.0.dev20251107.dist-info}/licenses/LICENSE +0 -0
  512. {skypilot_nightly-1.0.0.dev20250509.dist-info → skypilot_nightly-1.0.0.dev20251107.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6601],{99307:function(e,s,t){t.d(s,{Cl:function(){return l},OE:function(){return d}});var a=t(85893);t(67294);var r=t(55739),n=t(36989),c=t(53850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},i=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":return(0,a.jsx)(r.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,a.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":case"PREEMPTED":return(0,a.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":return(0,a.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,a.jsx)(c.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":return(0,a.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},o=e=>{let s=l(e),t=i(e);return(0,a.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(s),children:[t,e]})},d=e=>{let{status:s}=e;return(0,a.jsx)(n.WH,{content:s,className:"text-muted-foreground text-sm",children:(0,a.jsx)("span",{children:o(s)})})}},20546:function(e,s,t){t.d(s,{H:function(){return d}});var a=t(85893);t(67294);var r=t(41664),n=t.n(r),c=t(45697),l=t.n(c);function i(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let o=()=>(0,a.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:s,userHash:t,className:r="flex items-center gap-1",linkClassName:c="text-gray-700 hover:text-blue-600 hover:underline",showBadge:l=!0}=e,d=i(t),u=i(t)?"/users?tab=service-accounts":"/users";return(0,a.jsxs)("div",{className:r,children:[(0,a.jsx)(n(),{href:u,className:c,children:s}),l&&d&&(0,a.jsx)(o,{})]})};d.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},92128:function(e,s,t){t.d(s,{Oh:function(){return m},_R:function(){return x},cV:function(){return N}});var a=t(85893),r=t(67294),n=t(50326),c=t(30803),l=t(37673),i=t(27325),o=t(36989),d=t(93225),u=t(23001);function m(e){let{isOpen:s,onClose:t,cluster:d}=e,[u,m]=r.useState(!1),x=e=>{navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)},N=["sky status ".concat(d),"ssh ".concat(d)],h=N.join("\n");return(0,a.jsx)(n.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(n.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(n.fK,{children:[(0,a.jsxs)(n.$N,{children:["Connect to: ",(0,a.jsx)("span",{className:"font-light",children:d})]}),(0,a.jsx)(n.Be,{children:"Use these instructions to connect to your cluster via SSH."})]}),(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2",children:"SSH Command"}),(0,a.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("pre",{className:"text-sm w-full whitespace-pre-wrap",children:N.map((e,s)=>(0,a.jsx)("code",{className:"block",children:e},s))}),(0,a.jsx)(o.WH,{content:u?"Copied!":"Copy command",children:(0,a.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>x(h),className:"h-8 w-8 rounded-full",children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Additional Information"}),(0,a.jsxs)("p",{className:"text-sm text-secondary-foreground",children:["Make sure to run"," ",(0,a.jsxs)("code",{className:"text-sm",children:["sky status ",d]})," first to have SkyPilot set up the SSH access."]})]})]})]})})}function x(e){let{isOpen:s,onClose:t,cluster:r}=e,m=(0,u.X)();return(0,a.jsx)(n.Vq,{open:s,onOpenChange:t,children:(0,a.jsx)(n.cZ,{className:"sm:max-w-3xl",children:(0,a.jsxs)(n.fK,{children:[(0,a.jsxs)(n.$N,{children:["Connect to: ",(0,a.jsx)("span",{className:"font-light",children:r})]}),(0,a.jsx)(n.Be,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Setup SSH access"}),(0,a.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("pre",{className:"text-sm",children:(0,a.jsxs)("code",{children:["sky status ",r]})}),(0,a.jsx)(o.WH,{content:"Copy command",children:(0,a.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("sky status ".concat(r)),className:"h-8 w-8 rounded-full",children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Connect with VSCode/Cursor"}),(0,a.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("pre",{className:"text-sm",children:(0,a.jsxs)("code",{children:["code --remote ssh-remote+",r,' "/home"']})}),(0,a.jsx)(o.WH,{content:"Copy command",children:(0,a.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("code --remote ssh-remote+".concat(r,' "/home"')),className:"h-8 w-8 rounded-full",children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium",children:"Or use the GUI to connect"}),(0,a.jsx)("div",{className:"relative ".concat(m?"-mt-5":"-mt-10"),style:{paddingBottom:"70%"},children:(0,a.jsxs)("video",{className:"absolute top-0 left-0 w-full h-full rounded-lg",controls:!0,autoPlay:!0,muted:!0,preload:"metadata",children:[(0,a.jsx)("source",{src:"".concat(d.GW,"/videos/cursor-small.mp4"),type:"video/mp4"}),"Your browser does not support the video tag."]})})]})]})})]})})})}function N(e){let{isOpen:s,onClose:t,onConfirm:r,title:l,message:i,confirmText:o="Confirm",confirmVariant:d="destructive",confirmClassName:u=null}=e;return(0,a.jsx)(n.Vq,{open:s,onOpenChange:t,children:(0,a.jsxs)(n.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(n.fK,{children:[(0,a.jsx)(n.$N,{children:l}),(0,a.jsx)(n.Be,{children:i})]}),(0,a.jsxs)(n.cN,{className:"flex justify-end gap-2 pt-4",children:[(0,a.jsx)(c.z,{variant:"outline",onClick:t,children:"Cancel"}),(0,a.jsx)(c.z,{variant:u?void 0:d,className:u,onClick:()=>{r(),t()},children:o})]})]})})}},68764:function(e,s,t){t.d(s,{RM:function(){return i},SC:function(){return o},iA:function(){return c},pj:function(){return u},ss:function(){return d},xD:function(){return l}});var a=t(85893),r=t(67294),n=t(32350);let c=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:"relative w-full overflow-auto",children:(0,a.jsx)("table",{ref:s,className:(0,n.cn)("w-full caption-bottom text-base",t),...r})})});c.displayName="Table";let l=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("thead",{ref:s,className:(0,n.cn)("[&_tr]:border-b",t),...r})});l.displayName="TableHeader";let i=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("tbody",{ref:s,className:(0,n.cn)("[&_tr:last-child]:border-0",t),...r})});i.displayName="TableBody",r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("tfoot",{ref:s,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...r})}).displayName="TableFooter";let o=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("tr",{ref:s,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...r})});o.displayName="TableRow";let d=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("th",{ref:s,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",t),...r})});d.displayName="TableHead";let u=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("td",{ref:s,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...r})});u.displayName="TableCell",r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("caption",{ref:s,className:(0,n.cn)("mt-4 text-base text-muted-foreground",t),...r})}).displayName="TableCaption"},94545:function(e,s,t){function a(e){return e.startsWith("sky-jobs-controller-")}function r(e,s,t){return null===s?e:[...e].sort((e,a)=>e[s]<a[s]?"ascending"===t?-1:1:e[s]>a[s]?"ascending"===t?1:-1:0)}t.d(s,{R0:function(){return r},Ym:function(){return a}})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6856],{32045:function(e,t,o){o.d(t,{R8:function(){return i},Xg:function(){return n},ef:function(){return s}});var r=o(93225),a=o(47145);async function s(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(await Promise.resolve().then(o.bind(o,6378))).default,{getClusters:s}=await Promise.resolve().then(o.bind(o,23266)),{getManagedJobs:n}=await Promise.resolve().then(o.bind(o,68969));try{let o={jobs:[]};try{o=await t.get(n,[{allUsers:!0,skipFinished:!0,fields:["cloud","region"]}])}catch(e){console.error("Error fetching managed jobs:",e)}let c=(null==o?void 0:o.jobs)||[],l=[];try{l=await t.get(s)}catch(e){console.error("Error fetching clusters:",e)}let i=l||[],u=[];try{if(e){console.log("Force refreshing clouds by running sky check...");try{let e=await a.x.post("/check",{});if(!e.ok){let t="Failed to run sky check with status ".concat(e.status);throw Error(t)}let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID");if(!t)throw Error("No request ID received from server for sky check");let o=await a.x.get("/api/get?request_id=".concat(t));if(!o.ok){let e="Failed to get sky check result with status ".concat(o.status);throw Error(e)}let r=await o.json();console.log("Sky check completed:",r)}catch(e){console.error("Error running sky check:",e)}}let t=await a.x.get("/enabled_clouds");if(!t.ok){let e="Failed to get enabled clouds with status ".concat(t.status);throw Error(e)}let o=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("X-Request-ID");if(!o)throw Error("No request ID received from server for enabled clouds");let r=await a.x.get("/api/get?request_id=".concat(o));if(!r.ok){let e="Failed to get enabled clouds result with status ".concat(r.status);throw Error(e)}let s=await r.json();u=s.return_value?JSON.parse(s.return_value):[],console.log("Enabled clouds:",u)}catch(e){console.error("Error fetching enabled clouds:",e),u=[]}let d={};r.$m.forEach(e=>{let t=u.includes(e.toLowerCase());d[e]={name:e,clusters:0,jobs:0,enabled:t}}),i.forEach(e=>{if(e.cloud){let t=e.cloud;d[t]&&(d[t].clusters+=1,d[t].enabled=!0)}}),c.forEach(e=>{if(e.cloud){let t=e.cloud;d[t]&&(d[t].jobs+=1,d[t].enabled=!0)}});let g=r.$m.length,f=Object.values(d).filter(e=>e.enabled).length;return{clouds:Object.values(d).filter(e=>e.enabled).sort((e,t)=>e.name.localeCompare(t.name)),totalClouds:g,enabledClouds:f}}catch(e){throw console.error("Error fetching cloud infrastructure:",e),e}}async function n(){try{console.log("[DEBUG] Starting workspace-aware infrastructure fetch");let{getWorkspaces:e}=await Promise.resolve().then(o.bind(o,17324));console.log("[DEBUG] About to call getWorkspaces()");let t=await e();if(console.log("[DEBUG] Workspaces data received:",t),console.log("[DEBUG] Number of accessible workspaces:",Object.keys(t||{}).length),console.log("[DEBUG] Workspace names:",Object.keys(t||{})),!t||0===Object.keys(t).length)return console.log("[DEBUG] No accessible workspaces found - returning empty result"),{workspaces:{},allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{},contextWorkspaceMap:{}};let{getEnabledClouds:r}=await Promise.resolve().then(o.bind(o,17324)),a={},s=[],n={};await Promise.allSettled(Object.entries(t).map(async e=>{let[t,o]=e;console.log("Fetching infrastructure for workspace: ".concat(t));try{console.log("[DEBUG] Fetching enabled clouds for workspace: ".concat(t));let e=await r(t,!0);console.log("[DEBUG] Expanded clouds for ".concat(t,":"),e),a[t]={config:o,clouds:e,contexts:[]},console.log("[DEBUG] Processing expandedClouds for ".concat(t,":"),e),e&&Array.isArray(e)?e.forEach(e=>{if(console.log("[DEBUG] Processing infraItem: ".concat(e)),e.toLowerCase().startsWith("kubernetes/")){let o=e.replace(/^kubernetes\//i,"");console.log("[DEBUG] Extracted kubernetes context: ".concat(o)),s.push(o),n[o]||(n[o]=[]),n[o].includes(t)||n[o].push(t),a[t].contexts.push(o)}else if(e.toLowerCase().startsWith("ssh/")){let o=e.replace(/^ssh\//i,""),r="ssh-".concat(o);console.log("[DEBUG] Extracted SSH context: ".concat(r)),s.push(r),n[r]||(n[r]=[]),n[r].includes(t)||n[r].push(t),a[t].contexts.push(r)}}):console.log("[DEBUG] No expanded clouds or not an array for ".concat(t))}catch(e){throw console.error("Failed to fetch infrastructure for workspace ".concat(t,":"),e),e}}));let{getClusters:l}=await Promise.resolve().then(o.bind(o,23266)),i=(await Promise.resolve().then(o.bind(o,6378))).default,d=[];try{d=await i.get(l)}catch(e){console.error("Error fetching clusters:",e)}let g=d||[],f={};try{f=await u(g)}catch(e){console.error("Error fetching context clusters:",e)}let h=[...new Set(s)].filter(e=>e&&"string"==typeof e),p={allGPUs:[],perContextGPUs:[],perNodeGPUs:[]};try{p=await c(h)}catch(e){console.error("Error fetching Kubernetes GPUs:",e)}let w={workspaces:a,allContextNames:[...new Set(s)].sort(),allGPUs:p.allGPUs||[],perContextGPUs:p.perContextGPUs||[],perNodeGPUs:p.perNodeGPUs||[],contextStats:f,contextWorkspaceMap:n};return console.log("[DEBUG] Final result:",w),console.log("[DEBUG] All contexts found:",s),console.log("[DEBUG] Context workspace map:",n),w}catch(e){throw console.error("[DEBUG] Failed to fetch workspace infrastructure:",e),console.error("[DEBUG] Error stack:",e.stack),e}}async function c(e){try{var t,o,r,a,s,n;if(!e||0===e.length)return{allGPUs:[],perContextGPUs:[],perNodeGPUs:[]};let c={},i={},u={},d=await Promise.all(e.map(e=>l(e))),g={};for(let t=0;t<e.length;t++)g[e[t]]=d[t];for(let r of e){let e=g[r]||{};if(e&&Object.keys(e).length>0){let a={};for(let s in e){let n=e[s];if(!n){console.warn("No node data for node ".concat(s," in context ").concat(r));continue}let c=n.accelerator_type,l=(null===(t=n.total)||void 0===t?void 0:t.accelerator_count)||0,i=(null===(o=n.free)||void 0===o?void 0:o.accelerators_available)||0;l>0&&(a[c]||(a[c]={gpu_name:c,gpu_requestable_qty_per_node:0,gpu_total:0,gpu_free:0,context:r}),a[c].gpu_total+=l,a[c].gpu_free+=i,a[c].gpu_requestable_qty_per_node=l)}for(let e in i[r]=Object.values(a),a)e in c?(c[e].gpu_total+=a[e].gpu_total,c[e].gpu_free+=a[e].gpu_free):c[e]={gpu_total:a[e].gpu_total,gpu_free:a[e].gpu_free,gpu_name:e}}else i[r]=[]}for(let t of e){let e=g[t];if(e&&Object.keys(e).length>0)for(let o in e){let l=e[o];if(!l){console.warn("No node data for node ".concat(o," in context ").concat(t));continue}let d=l.accelerator_type||"-",g=null!==(s=null===(r=l.total)||void 0===r?void 0:r.accelerator_count)&&void 0!==s?s:0,f=null!==(n=null===(a=l.free)||void 0===a?void 0:a.accelerators_available)&&void 0!==n?n:0;u["".concat(t,"/").concat(o)]={node_name:l.name||o,gpu_name:d,gpu_total:g,gpu_free:f,ip_address:l.ip_address||null,context:t},"-"===d||!i[t]||i[t].some(e=>e.gpu_name===d)||(d in c||(c[d]={gpu_total:0,gpu_free:0,gpu_name:d}),i[t].find(e=>e.gpu_name===d)||i[t].push({gpu_name:d,gpu_requestable_qty_per_node:"-",gpu_total:0,gpu_free:0,context:t}))}}return{allGPUs:Object.values(c).sort((e,t)=>e.gpu_name.localeCompare(t.gpu_name)),perContextGPUs:Object.values(i).flat().sort((e,t)=>e.context.localeCompare(t.context)||e.gpu_name.localeCompare(t.gpu_name)),perNodeGPUs:Object.values(u).sort((e,t)=>e.context.localeCompare(t.context)||e.node_name.localeCompare(t.node_name)||e.gpu_name.localeCompare(t.gpu_name))}}catch(e){throw console.error("[infra.jsx] Error in getKubernetesGPUsFromContexts:",e),e}}async function l(e){try{let t=await a.x.post("/kubernetes_node_info",{context:e});if(!t.ok){let e="Failed to get kubernetes node info with status ".concat(t.status);throw Error(e)}let o=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("x-request-id");if(!o)throw Error("No request ID received from server for kubernetes node info");let r=await a.x.get("/api/get?request_id=".concat(o));if(500===r.status)try{let t=await r.json();if(t.detail&&t.detail.error)try{let o=JSON.parse(t.detail.error),r="Context ".concat(e," unavailable: ").concat(o.message);throw Error(r)}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}if(!r.ok){let e="Failed to get kubernetes node info result with status ".concat(r.status);throw Error(e)}let s=await r.json();return(s.return_value?JSON.parse(s.return_value):{}).node_info_dict||{}}catch(t){throw console.warn("[infra.jsx] Context ".concat(e," unavailable or timed out:"),t.message),t}}async function i(e){try{let t={};return e.forEach(e=>{let o=null;if("Kubernetes"===e.cloud)(o=e.region)&&(o="kubernetes/".concat(o));else if("SSH"===e.cloud&&(o=e.region)){let e=o.startsWith("ssh-")?o.substring(4):o;o="ssh/".concat(e)}o&&(t[o]||(t[o]={clusters:0,jobs:0}),t[o].jobs+=1)}),t}catch(e){throw console.error("=== Error in getContextJobs ===",e),e}}async function u(e){try{let t={};return e.forEach(e=>{let o=null;if("Kubernetes"===e.cloud)(o=e.region)&&(o="kubernetes/".concat(o));else if("SSH"===e.cloud&&(o=e.region)){let e=o.startsWith("ssh-")?o.substring(4):o;o="ssh/".concat(e)}o&&(t[o]||(t[o]={clusters:0,jobs:0}),t[o].clusters+=1)}),t}catch(e){throw console.error("=== Error in getContextClusters ===",e),e}}},29326:function(e,t,o){o.d(t,{IS:function(){return d},It:function(){return s},MV:function(){return c},Ri:function(){return n},_x:function(){return i},ez:function(){return u},hY:function(){return l},mF:function(){return f},wJ:function(){return g}});var r=o(93225),a=o(15821);async function s(){try{let e=await fetch("".concat(r.f4,"/ssh_node_pools"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return await e.json()}catch(e){return console.error("Error fetching SSH Node Pools:",e),{}}}async function n(e){try{let t=await fetch("".concat(r.f4,"/ssh_node_pools"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error updating SSH Node Pools:",e),e}}async function c(e){try{let t=await fetch("".concat(r.f4,"/ssh_node_pools/").concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error deleting SSH Node Pool:",e),e}}async function l(e,t){try{let o=new FormData;o.append("key_name",e),o.append("key_file",t);let a=await fetch("".concat(r.f4,"/ssh_node_pools/keys"),{method:"POST",body:o});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));return await a.json()}catch(e){throw console.error("Error uploading SSH key:",e),e}}async function i(e){try{let t=await fetch("".concat(r.f4,"/ssh_node_pools/").concat(e,"/deploy"),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error deploying SSH Node Pool:",e),e}}async function u(e){try{let t=await fetch("".concat(r.f4,"/ssh_node_pools/").concat(e,"/down"),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error tearing down SSH Node Pool:",e),e}}async function d(e){try{let t=await fetch("".concat(r.f4,"/ssh_node_pools/").concat(e,"/status"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error fetching SSH Node Pool status:",e),e}}async function g(e){let t,{requestId:o,signal:s,onNewLog:n}=e,c=Date.now(),l=new Promise(e=>{let o=()=>{let r=Date.now()-c;r>=3e5?e({timeout:!0}):t=setTimeout(o,3e5-r)};t=setTimeout(o,3e5)}),i=(async()=>{try{let e=await fetch("".concat(r.f4,"/api/stream?request_id=").concat(o,"&format=plain&tail=").concat(1e3,"&follow=true"),{method:"GET",headers:{"Content-Type":"application/json"},...s?{signal:s}:{}});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let a=e.body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;c=Date.now();let o=new TextDecoder().decode(t);n(o)}}finally{a.cancel(),t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),u=await Promise.race([i,l]);if(t&&clearTimeout(t),u.timeout){(0,a.C)("SSH deployment log stream timed out after ".concat(300,"s of inactivity"),"warning");return}}async function f(e){let t,{requestId:o,signal:s,onNewLog:n,operationType:c="operation"}=e,l=Date.now(),i=new Promise(e=>{let o=()=>{let r=Date.now()-l;r>=3e5?e({timeout:!0}):t=setTimeout(o,3e5-r)};t=setTimeout(o,3e5)}),u=(async()=>{try{let e=await fetch("".concat(r.f4,"/api/stream?request_id=").concat(o,"&format=plain&tail=").concat(1e3,"&follow=true"),{method:"GET",headers:{"Content-Type":"application/json"},...s?{signal:s}:{}});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let a=e.body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;l=Date.now();let o=new TextDecoder().decode(t);n(o)}}finally{a.cancel(),t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),d=await Promise.race([u,i]);if(t&&clearTimeout(t),d.timeout){(0,a.C)("SSH ".concat(c," log stream timed out after ").concat(300,"s of inactivity"),"warning");return}}},53081:function(e,t,o){o.d(t,{R:function(){return a}});var r=o(47145);async function a(){try{let e=await r.x.get("/users");if(!e.ok)throw Error("Failed to fetch users with status ".concat(e.status));return(await e.json()).map(e=>({userId:e.id,username:e.name,role:e.role,created_at:e.created_at}))||[]}catch(e){throw console.error("Failed to fetch users:",e),e}}},19238:function(e,t,o){o.d(t,{C:function(){return a},w:function(){return s}});var r=o(47145);async function a(){try{return(await r.x.fetch("/volumes",{},"GET")).map(e=>{var t,o,r;let a=e.cloud||"";return e.region&&(a+="/".concat(e.region)),e.zone&&(a+="/".concat(e.zone)),{name:e.name,launched_at:e.launched_at,user_hash:e.user_hash,user_name:e.user_name||"-",workspace:e.workspace||"-",last_attached_at:e.last_attached_at,status:e.status,type:e.type,cloud:e.cloud,region:e.region,zone:e.zone,infra:a,size:"".concat(e.size,"Gi"),config:e.config,storage_class:(null===(t=e.config)||void 0===t?void 0:t.storage_class_name)||"-",access_mode:(null===(o=e.config)||void 0===o?void 0:o.access_mode)||"-",namespace:(null===(r=e.config)||void 0===r?void 0:r.namespace)||"-",name_on_cloud:e.name_on_cloud,usedby_pods:e.usedby_pods,usedby_clusters:e.usedby_clusters}})||[]}catch(e){throw console.error("Failed to fetch volumes:",e),e}}async function s(e){let t="";try{let o=await r.x.post("/volumes/delete",{names:[e]});if(!o.ok)return console.error("Initial API request to delete volume failed with status ".concat(o.status)),{success:!1,msg:"Failed to delete volume with status ".concat(o.status)};let a=o.headers.get("X-SkyPilot-Request-ID")||o.headers.get("X-Request-ID");if(!a)return console.error("No request ID received from server for deleting volume"),{success:!1,msg:"No request ID received from server for deleting volume"};let s=await r.x.get("/api/get?request_id=".concat(a));if(!s.ok)return t="Failed to delete volume with status ".concat(s.status),console.error(t),{success:!1,msg:t};return{success:!0}}catch(e){return console.error(t="Failed to delete volume: ".concat(e)),{success:!1,msg:t}}}},36856:function(e,t,o){var r=o(6378),a=o(23266),s=o(68969),n=o(17324),c=o(53081),l=o(19238),i=o(32045),u=o(29326);let d={base:{getClusters:{fn:a.getClusters,args:[]},getManagedJobs:{fn:s.aT,args:[{allUsers:!0}]},getWorkspaces:{fn:n.getWorkspaces,args:[]},getUsers:{fn:c.R,args:[]},getCloudInfrastructure:{fn:i.ef,args:[!1]},getSSHNodePools:{fn:u.It,args:[]},getVolumes:{fn:l.C,args:[]}},dynamic:{getEnabledClouds:{fn:n.getEnabledClouds,requiresWorkspaces:!0}},pages:{clusters:["getClusters","getWorkspaces"],jobs:["getManagedJobs","getClusters","getWorkspaces","getUsers"],infra:["getClusters","getManagedJobs","getCloudInfrastructure","getSSHNodePools"],workspaces:["getWorkspaces","getClusters","getManagedJobs","getEnabledClouds"],users:["getUsers","getClusters","getManagedJobs"],volumes:["getVolumes"]}};class g{async preloadForPage(e,t){let{backgroundPreload:o=!0,force:r=!1}=t||{};if(!d.pages[e]){console.warn("Unknown page: ".concat(e));return}console.log("[CachePreloader] Preloading cache for page: ".concat(e));try{await this._loadPageData(e,r),o&&this._backgroundPreloadOtherPages(e)}catch(t){console.error("[CachePreloader] Error preloading for page ".concat(e,":"),t)}}async _loadPageData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=d.pages[e],a=[];for(let e of o)if(d.base[e]){let{fn:o,args:s}=d.base[e];t&&r.default.invalidate(o,s),a.push(r.default.get(o,s).then(e=>(this._markAsPreloaded(o,s),e)))}else"getEnabledClouds"===e&&a.push(this._loadEnabledCloudsForAllWorkspaces(t));await Promise.allSettled(a),console.log("[CachePreloader] Loaded data for page: ".concat(e))}async _loadEnabledCloudsForAllWorkspaces(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e&&r.default.invalidate(n.getWorkspaces);let t=await r.default.get(n.getWorkspaces),o=Object.keys(t||{}).map(t=>(e&&r.default.invalidate(n.getEnabledClouds,[t]),r.default.get(n.getEnabledClouds,[t])));await Promise.allSettled(o)}catch(e){console.error("[CachePreloader] Error loading enabled clouds:",e)}}_backgroundPreloadOtherPages(e){if(this.isPreloading)return;this.isPreloading=!0;let t=new Set(d.pages[e]),o=new Set;Object.keys(d.pages).filter(t=>t!==e).forEach(e=>{d.pages[e].forEach(e=>{t.has(e)||o.add(e)})}),console.log("[CachePreloader] Background preloading ".concat(o.size," unique functions: ").concat(Array.from(o).join(", "))),Promise.allSettled(Array.from(o).map(async e=>{try{if(d.base[e]){let{fn:t,args:o}=d.base[e];await r.default.get(t,o),this._markAsPreloaded(t,o)}else"getEnabledClouds"===e&&await this._loadEnabledCloudsForAllWorkspaces(!1);console.log("[CachePreloader] Background loaded function: ".concat(e))}catch(t){console.error("[CachePreloader] Background load failed for function ".concat(e,":"),t)}})).then(()=>{this.isPreloading=!1,console.log("[CachePreloader] Background preloading complete")})}async preloadBaseFunctions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];console.log("[CachePreloader] Preloading all base functions");let t=Object.entries(d.base).map(t=>{let[o,{fn:a,args:s}]=t;return e&&r.default.invalidate(a,s),r.default.get(a,s).catch(e=>{console.error("[CachePreloader] Failed to preload ".concat(o,":"),e)})});await Promise.allSettled(t),console.log("[CachePreloader] Base functions preloaded")}getCacheStats(){return{...r.default.getStats(),isPreloading:this.isPreloading}}wasRecentlyPreloaded(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=this._generateKey(e,t),r=this.recentlyPreloaded.get(o);if(!r)return!1;let a=Date.now()-r<this.PRELOAD_GRACE_PERIOD;return a||this.recentlyPreloaded.delete(o),a}_markAsPreloaded(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=this._generateKey(e,t);this.recentlyPreloaded.set(o,Date.now())}_generateKey(e,t){let o=e.toString(),r=this._simpleHash(o),a=t.length>0?JSON.stringify(t):"";return"".concat(r,"_").concat(a)}_simpleHash(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o);return t>>>0}clearCache(){r.default.clear(),this.isPreloading=!1,this.preloadPromises.clear(),this.recentlyPreloaded.clear(),console.log("[CachePreloader] Cache cleared")}constructor(){this.isPreloading=!1,this.preloadPromises=new Map,this.recentlyPreloaded=new Map,this.PRELOAD_GRACE_PERIOD=5e3}}let f=new g;r.default.setPreloader(f),t.ZP=f}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6989],{88950:function(e,n,t){t.d(n,{Bw:function(){return p},Ph:function(){return d},Ql:function(){return x},i4:function(){return f},ki:function(){return u}});var r=t(85893),a=t(67294),s=t(2067),l=t(45895),o=t(7242),i=t(70282),c=t(32350);let d=s.fC;s.ZA;let u=s.B4,f=a.forwardRef((e,n)=>{let{className:t,children:a,...o}=e;return(0,r.jsxs)(s.xz,{ref:n,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...o,children:[a,(0,r.jsx)(s.JO,{asChild:!0,children:(0,r.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});f.displayName=s.xz.displayName;let m=a.forwardRef((e,n)=>{let{className:t,...a}=e;return(0,r.jsx)(s.u_,{ref:n,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(o.Z,{className:"h-4 w-4"})})});m.displayName=s.u_.displayName;let h=a.forwardRef((e,n)=>{let{className:t,...a}=e;return(0,r.jsx)(s.$G,{ref:n,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(l.Z,{className:"h-4 w-4"})})});h.displayName=s.$G.displayName;let p=a.forwardRef((e,n)=>{let{className:t,children:a,position:l="popper",...o}=e;return(0,r.jsx)(s.h_,{children:(0,r.jsxs)(s.VY,{ref:n,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:l,...o,children:[(0,r.jsx)(m,{}),(0,r.jsx)(s.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),(0,r.jsx)(h,{})]})})});p.displayName=s.VY.displayName,a.forwardRef((e,n)=>{let{className:t,...a}=e;return(0,r.jsx)(s.__,{ref:n,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...a})}).displayName=s.__.displayName;let x=a.forwardRef((e,n)=>{let{className:t,children:a,...l}=e;return(0,r.jsxs)(s.ck,{ref:n,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.wU,{children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(s.eT,{children:a})]})});x.displayName=s.ck.displayName,a.forwardRef((e,n)=>{let{className:t,...a}=e;return(0,r.jsx)(s.Z0,{ref:n,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",t),...a})}).displayName=s.Z0.displayName},36989:function(e,n,t){t.d(n,{$B:function(){return g},Kl:function(){return v},LU:function(){return p},Md:function(){return h},WH:function(){return m},Zg:function(){return b},Zn:function(){return x},os:function(){return _},sY:function(){return j},x9:function(){return N},xn:function(){return y},yc:function(){return u}});var r=t(85893),a=t(67294),s=t(53302),l=t(11886),o=t(88950),i=t(51214),c=t(41664),d=t.n(c);let u=i.nb.REFRESH_INTERVAL,f={placement:"bottom",color:"default"},m=e=>{let{children:n,...t}=e,a=t.content;return t.content=void 0,(0,r.jsx)(s.e,{...f,...t,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:a}),children:n})},h=e=>{let{children:n,...t}=e,a=t.content;return t.content=void 0,(0,r.jsx)(s.e,{...f,...t,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:a}),children:n})};function p(e){if(!e&&0!==e)return"-";let n=e=Math.floor(e),t="",r=0;for(let e of[{value:31536e3,label:"y"},{value:2592e3,label:"mo"},{value:86400,label:"d"},{value:3600,label:"h"},{value:60,label:"m"},{value:1,label:"s"}])if(n>=e.value&&r<2){let a=Math.floor(n/e.value);t+="".concat(a).concat(e.label," "),n%=e.value,r++}return t.trim()||"0s"}function x(e){return e.replace(/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKH]/g,"")}function g(e){let{logs:n,controller:t=!1}=e,[s,l]=(0,a.useState)("all"),[i,c]=(0,a.useState)(n),[d,u]=(0,a.useState)([]);return(0,a.useEffect)(()=>{u(function(e){let n;let t=/\((head|worker\d+),/g,r=new Set;for(;null!==(n=t.exec(e));)r.add(n[1]);return Array.from(r).sort((e,n)=>"head"===e?-1:"head"===n?1:e.localeCompare(n,void 0,{numeric:!0,sensitivity:"base"}))}(n))},[n]),(0,a.useEffect)(()=>{"all"===s?c(n):c(n.split("\n").filter(e=>e.includes("(".concat(s,","))).join("\n"))},[s,n]),(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'}),!t&&(0,r.jsx)("div",{style:{marginBottom:"1rem"},children:(0,r.jsxs)(o.Ph,{onValueChange:e=>l(e),value:s,children:[(0,r.jsx)(o.i4,{"aria-label":"Node",className:"focus:ring-0 focus:ring-offset-0",children:(0,r.jsx)(o.ki,{placeholder:"Select Node"})}),(0,r.jsxs)(o.Bw,{children:[(0,r.jsx)(o.Ql,{value:"all",children:"All Nodes"}),d.map(e=>(0,r.jsx)(o.Ql,{value:e,children:e},e))]})]})}),(0,r.jsx)("div",{className:"logs-container",dangerouslySetInnerHTML:{__html:i?x(i).split("\n").filter(e=>""!==e.trim()&&!e.match(/<rich_.*?\[bold cyan\]/)&&!e.match(/<rich_.*>.*<\/rich_.*>/)&&!e.match(/├──/)&&!e.match(/└──/)).map(e=>'<span class="log-line"><span class="message">'.concat(e,"</span></span>")).join("\n"):""}})]})}function b(e){let n,{date:t}=e;if(!t)return"N/A";let a=new Date,s=t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0"),o=t.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"});return n=function(e){if(!e||"string"!=typeof e)return e;if("just now"===e)return"now";if("less than a minute ago"===e.toLowerCase())return"Less than 1m ago";let n=e.match(/^about\s+(\d+)\s+(\w+)\s+ago$/i);if(n){let e=n[1],t=n[2],r={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(r[t])return"".concat(e).concat(r[t]," ago")}let t=e.match(/^a[n]?\s+(\w+)\s+ago$/i);if(t){let e=t[1],n={second:"s",minute:"m",hour:"h",day:"d",month:"mo",year:"yr"};if(n[e])return"1".concat(n[e]," ago")}let r=e.match(/^(\d+)\s+(\w+)\s+ago$/i);if(r){let e=r[1],n=r[2],t={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(t[n])return"".concat(e).concat(t[n]," ago")}return e}((0,l.B)(t,a,{addSuffix:!0})),(0,r.jsx)(m,{content:s+" "+o,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{className:"border-b border-dotted border-gray-400 cursor-help",children:n})})}function y(e){return e?e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")+" "+e.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"}):"N/A"}let j=e=>e&&e.jobCounts?e.jobCounts:{},w=e=>{if(!e||0===e.length)return{};let n=e.filter(e=>"READY"===e.status),t={};n.forEach(e=>{try{let n=e.cloud&&""!==e.cloud.trim()&&"undefined"!==e.cloud,r=e.region&&"undefined"!==e.region&&null!==e.region&&""!==e.region.trim();if(!n&&!r)return;let a=n?e.cloud:"Unknown",s=r?e.region:null;t[a]||(t[a]={count:0,regions:new Set}),t[a].count+=1,s&&t[a].regions.add(s)}catch(e){t.Unknown||(t.Unknown={count:0,regions:new Set}),t.Unknown.count+=1}});let r={};return Object.entries(t).forEach(e=>{let[n,t]=e,a=t.regions.size,s=n.toLowerCase().includes("kubernetes")||n.toLowerCase().includes("k8s")?"context":"region",l=1===a?"1 ".concat(s):"".concat(a," ").concat(s,"s");r[a>0?"".concat(n," (").concat(l,")"):n]=t.count}),r},N=e=>{let{jobCounts:n,getStatusStyle:t}=e;return n&&0!==Object.keys(n).length?(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(n).map(e=>{let[n,a]=e,s=t(n);return(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full flex items-center space-x-2 text-xs font-medium ".concat(s),children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{className:"text-xs bg-white/50 px-1.5 py-0.5 rounded",children:a})]},n)})}):(0,r.jsx)("span",{className:"text-gray-1000",children:"No active jobs"})},v=e=>{let{replicaInfo:n}=e,t=w(n);if(0===Object.keys(t).length)return(0,r.jsx)("span",{className:"text-gray-500 text-sm",children:"-"});let a=i.MO.NAME_TRUNCATE_LENGTH,s=e=>{let n=e.indexOf("(");if(-1===n)return e;let t=e.substring(0,n).trim(),r=e.substring(n+1,e.length-1);if(r.length<=a)return e;let s="".concat(r.substring(0,Math.floor((a-3)/2)),"...").concat(r.substring(r.length-Math.ceil((a-3)/2)));return"".concat(t," (").concat(s,")")};return(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t).map(e=>{let[n,t]=e,a=s(n),l=a!==n;return(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full flex items-center space-x-2 text-xs font-medium bg-blue-50 text-blue-700",children:[l?(0,r.jsx)(h,{content:n,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:a})}):(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{className:"text-xs bg-white/50 px-1.5 py-0.5 rounded",children:t})]},n)})})},_=(e,n,t)=>{if(!e)return"-";if(t.find(t=>t.name===e&&t.hash===n)&&n)return(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(h,{content:"This pool is running",placement:"top",children:(0,r.jsx)("div",{className:"w-2 h-2 bg-green-700 rounded-full"})}),(0,r.jsx)(d(),{href:"/jobs/pools/".concat(e),className:"text-gray-700 hover:text-blue-600 hover:underline",children:e})]});let a=n?n.substring(0,4):"";return(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(h,{content:"This pool is terminated",placement:"top",children:(0,r.jsx)("div",{className:"w-2 h-2 bg-gray-800"})}),(0,r.jsxs)("span",{children:[e," (",a,")"]})]})}},51214:function(e,n,t){t.d(n,{MO:function(){return s},ej:function(){return r},nb:function(){return a}});let r={DEFAULT_TTL:12e4},a={REFRESH_INTERVAL:3e4,GPU_REFRESH_INTERVAL:3e4},s={NAME_TRUNCATE_LENGTH:20}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6990,2350],{30803:function(e,r,t){t.d(r,{z:function(){return i}});var o=t(85893),a=t(67294),n=t(88426),s=t(12003),c=t(32350);let l=(0,s.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,r)=>{let{className:t,variant:a,size:s,asChild:i=!1,...u}=e,d=i?n.g7:"button";return(0,o.jsx)(d,{className:(0,c.cn)(l({variant:a,size:s,className:t})),ref:r,...u})});i.displayName="Button"},37673:function(e,r,t){t.d(r,{Ol:function(){return i},Zb:function(){return l},aY:function(){return f},ll:function(){return u}});var o=t(85893),a=t(67294),n=t(45697),s=t.n(n),c=t(32350);let l=a.forwardRef((e,r)=>{let{className:t,children:a,...n}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...n,children:a})});l.displayName="Card",l.propTypes={className:s().string,children:s().node};let i=a.forwardRef((e,r)=>{let{className:t,children:a,...n}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",t),...n,children:a})});i.displayName="CardHeader",i.propTypes={className:s().string,children:s().node};let u=a.forwardRef((e,r)=>{let{className:t,children:a,...n}=e;return(0,o.jsx)("h3",{ref:r,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",t),...n,children:a})});u.displayName="CardTitle",u.propTypes={className:s().string,children:s().node};let d=a.forwardRef((e,r)=>{let{className:t,children:a,...n}=e;return(0,o.jsx)("p",{ref:r,className:(0,c.cn)("text-sm text-muted-foreground",t),...n,children:a})});d.displayName="CardDescription",d.propTypes={className:s().string,children:s().node};let f=a.forwardRef((e,r)=>{let{className:t,children:a,...n}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("p-6 pt-0",t),...n,children:a})});f.displayName="CardContent",f.propTypes={className:s().string,children:s().node};let p=a.forwardRef((e,r)=>{let{className:t,children:a,...n}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("flex items-center p-6 pt-0",t),...n,children:a})});p.displayName="CardFooter",p.propTypes={className:s().string,children:s().node}},47145:function(e,r,t){t.d(r,{x:function(){return a}});var o=t(93225);let a={fetch:async function(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST";try{let a=window.location.origin,n="".concat(a).concat(o.f4).concat(e),s=await fetch(n,{method:t,headers:"POST"===t?{"Content-Type":"application/json"}:{},body:"POST"===t?JSON.stringify(r):void 0});if(!s.ok){let r="Initial API request ".concat(e," failed with status ").concat(s.status);throw Error(r)}let c=s.headers.get("X-Skypilot-Request-ID")||s.headers.get("X-Request-ID");if(!c){let r="No request ID received from server for ".concat(e);throw Error(r)}let l=await fetch("".concat(a).concat(o.f4,"/api/get?request_id=").concat(c));if(!l.ok){let r="API request to get ".concat(e," result failed with status ").concat(l.status);throw Error(r)}let i=await l.json();return i.return_value?JSON.parse(i.return_value):[]}catch(t){let r="Error in apiClient.fetch for ".concat(e,": ").concat(t);throw console.error(r),Error(r)}},post:async(e,r)=>{let t=window.location.origin,a="".concat(t).concat(o.f4).concat(e);return await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},stream:async(e,r,t)=>{let o=await a.post(e,r);if(!o.ok){let r="API request ".concat(e," failed with status ").concat(o.status);throw console.error(r),Error(r)}let n=o.body.getReader();try{for(;;){let{done:e,value:r}=await n.read();if(e)break;let o=new TextDecoder().decode(r);t(o)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let r=window.location.origin,t="".concat(r).concat(o.f4).concat(e);return await fetch(t)}}},17324:function(e,r,t){t.d(r,{MB:function(){return l},eA:function(){return c},getEnabledClouds:function(){return n},getWorkspaces:function(){return a},iE:function(){return u},rF:function(){return d},zl:function(){return i}});var o=t(47145);async function a(){try{let e=await o.x.get("/workspaces");if(!e.ok)throw Error("Error scheduling getWorkspaces: ".concat(e.statusText," (status ").concat(e.status,")"));let r=e.headers.get("X-Skypilot-Request-ID");if(!r){console.warn("X-Skypilot-Request-ID header not found in /workspaces response. Attempting to find request_id in response body as a fallback.");try{let t=await e.json();if(t&&t.request_id)r=t.request_id,console.log("Found request_id in /workspaces response body (fallback):",r);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /workspaces.")}catch(r){let e=r.message||"Error processing fallback for request_id from /workspaces response body.";throw console.error("Error in /workspaces request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!r)throw Error("Failed to obtain X-Skypilot-Request-ID from /workspaces response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching workspace data with request_id: ".concat(r));let t=await o.x.get("/api/get?request_id=".concat(r));if(!t.ok){let e="Error fetching workspace data for request ID ".concat(r,": ").concat(t.statusText," (status ").concat(t.status,")");try{let o=await t.json();if(o&&o.detail){let t=o.detail;try{let e=JSON.parse(t);e&&e.error?t=e.error:e&&e.result&&e.result.error&&(t=e.result.error)}catch(e){}e="Error fetching workspace data for request ID ".concat(r,": ").concat(t)}}catch(e){}throw Error(e)}let a=await t.json();if(console.log("[Connector Debug] Full resultData from /api/get:",a),"FAILED"===a.status){let e="Unknown error during task execution";if(a.error)"string"==typeof a.error?e=a.error:"object"==typeof a.error&&(e=a.error.message||a.error.detail||JSON.stringify(a.error));else if(a.result&&a.result.error)"string"==typeof a.result.error?e=a.result.error:"object"==typeof a.result.error&&(e=a.result.error.message||a.result.error.detail||JSON.stringify(a.result.error));else if(a.return_value)try{let r=JSON.parse(a.return_value);r.error&&(e="string"==typeof r.error?r.error:r.error.message||r.error.detail||JSON.stringify(r.error))}catch(r){(a.return_value.includes("Error")||a.return_value.includes("Cannot"))&&(e=a.return_value)}throw Error(e)}let n={};if("SUCCEEDED"===a.status&&a.return_value)try{n=JSON.parse(a.return_value),console.log("Successfully parsed workspace data from return_value:",n)}catch(e){throw console.error("Failed to parse workspace data from return_value:",e,"Raw return_value:",a.return_value),Error("Failed to parse workspace data for request ID ".concat(r,": ").concat(e.message))}else a.result&&(console.warn("Using resultData.result as fallback for status ".concat(a.status)),n=a.result);return console.log("Effectively fetched workspace data (to be returned):",n),n||{}}catch(e){throw console.error("Failed to fetch workspaces (in getWorkspaces function):",e.message,e.stack),e}}async function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let t="/enabled_clouds",a=new URLSearchParams;e&&a.append("workspace",e),r&&a.append("expand","true"),a.toString()&&(t+="?".concat(a.toString()));let n=await o.x.get(t);if(!n.ok)throw Error("Error scheduling getEnabledClouds: ".concat(n.statusText," (status ").concat(n.status,")"));let s=n.headers.get("X-Skypilot-Request-ID");if(!s){console.warn("X-Skypilot-Request-ID header not found in /enabled_clouds response. Attempting to find request_id in response body as a fallback.");try{let e=await n.json();if(e&&e.request_id)s=e.request_id,console.log("Found request_id in /enabled_clouds response body (fallback):",s);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /enabled_clouds.")}catch(r){let e=r.message||"Error processing fallback for request_id from /enabled_clouds response body.";throw console.error("Error in /enabled_clouds request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!s)throw Error("Failed to obtain X-Skypilot-Request-ID from /enabled_clouds response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching enabled_clouds data with request_id: ".concat(s));let c=await o.x.get("/api/get?request_id=".concat(s));if(!c.ok){let e="Error fetching enabled_clouds data for request ID ".concat(s,": ").concat(c.statusText," (status ").concat(c.status,")");try{let r=await c.json();if(r&&r.detail){let t=r.detail;try{let e=JSON.parse(t);e&&e.error?t=e.error:e&&e.result&&e.result.error&&(t=e.result.error)}catch(e){}e="Error fetching enabled_clouds data for request ID ".concat(s,": ").concat(t)}}catch(e){}throw Error(e)}let l=await c.json();if(console.log("[Connector Debug] Full resultData from /api/get for enabled_clouds:",l),"FAILED"===l.status){let e=l.error||l.result&&l.result.error||"Unknown error during task execution for enabled_clouds";throw Error("Fetching enabled_clouds data failed for request ID ".concat(s,": ").concat(e))}let i=[];if("SUCCEEDED"===l.status&&l.return_value)try{i=JSON.parse(l.return_value),console.log("Successfully parsed enabled_clouds data for workspace ".concat(e,":"),i)}catch(e){throw console.error("Failed to parse enabled_clouds data from return_value:",e,"Raw return_value:",l.return_value),Error("Failed to parse enabled_clouds data for request ID ".concat(s,": ").concat(e.message))}else l.result&&(console.warn("Using resultData.result as fallback for enabled_clouds status ".concat(l.status)),i=l.result);return Array.isArray(i)?i:[]}catch(e){throw console.error("Failed to fetch enabled_clouds (in getEnabledClouds function):",e.message,e.stack),e}}async function s(e,r){console.log("Polling for ".concat(r," task completion with request_id: ").concat(e));let t=await o.x.get("/api/get?request_id=".concat(e));if(!t.ok){let o="Error fetching ".concat(r," data for request ID ").concat(e,": ").concat(t.statusText," (status ").concat(t.status,")");try{let e=await t.json();if(console.error("[Error Debug] ".concat(r," HTTP error response:"),JSON.stringify(e,null,2)),e&&e.detail){if("object"==typeof e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t&&t.message)o="".concat(r," failed: ").concat(t.message);else if(t&&"object"==typeof t){let e=t.type||JSON.stringify(t);o="".concat(r," failed: ").concat(e)}}catch(t){o="".concat(r," failed: ").concat(e.detail.error)}else if("string"==typeof e.detail)o="".concat(r," failed: ").concat(e.detail);else{let t=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[o,a]of Object.entries(e)){let e=t(a,r?"".concat(r,".").concat(o):o);if(e)return e}return null},a=t(e.detail);a&&(o="".concat(r," failed: ").concat(a))}}}catch(e){console.error("[Error Debug] Failed to parse error response:",e)}throw Error(o)}let a=await t.json();if(console.log("[Connector Debug] ".concat(r," resultData:"),a),"FAILED"===a.status){console.error("[Error Debug] ".concat(r," failed. Full resultData:"),JSON.stringify(a,null,2)),console.error("[Error Debug] resultData.error:",a.error),console.error("[Error Debug] resultData.result:",a.result),console.error("[Error Debug] resultData.return_value:",a.return_value);let e="Unknown error during ".concat(r," task execution");if(a.error)"string"==typeof a.error?e=a.error:"object"==typeof a.error&&(e=a.error.message||a.error.detail||JSON.stringify(a.error));else if(a.result&&a.result.error)"string"==typeof a.result.error?e=a.result.error:"object"==typeof a.result.error&&(e=a.result.error.message||a.result.error.detail||JSON.stringify(a.result.error));else if(a.return_value)try{let r=JSON.parse(a.return_value);r.error&&(e="string"==typeof r.error?r.error:r.error.message||r.error.detail||JSON.stringify(r.error))}catch(r){a.return_value&&(a.return_value.includes("Error")||a.return_value.includes("Cannot"))&&(e=a.return_value)}if(e==="Unknown error during ".concat(r," task execution")){let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[o,a]of Object.entries(e)){let e=r(a,t?"".concat(t,".").concat(o):o);if(e)return e}return null},t=r(a);t&&(e=t)}throw Error(e)}let n={};if("SUCCEEDED"===a.status&&a.return_value)try{n=JSON.parse(a.return_value),console.log("Successfully parsed ".concat(r," data:"),n)}catch(t){throw console.error("Failed to parse ".concat(r," data from return_value:"),t,"Raw return_value:",a.return_value),Error("Failed to parse ".concat(r," data for request ID ").concat(e,": ").concat(t.message))}else a.result&&(console.warn("Using resultData.result as fallback for ".concat(r," status ").concat(a.status)),n=a.result);return n}async function c(e,r){try{console.log("Updating workspace ".concat(e," with config:"),r);let t=await o.x.post("/workspaces/update",{workspace_name:e,config:r});if(!t.ok)throw Error("Error scheduling updateWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let a=t.headers.get("X-Skypilot-Request-ID");if(!a)throw Error("Failed to obtain request ID for updateWorkspace");return await s(a,"updateWorkspace")}catch(e){throw console.error("Failed to update workspace:",e),e}}let l=async(e,r)=>{try{let t=await o.x.post("/workspaces/create",{workspace_name:e,config:r});if(!t.ok)throw await t.text(),Error("Error scheduling createWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let a=t.headers.get("X-Skypilot-Request-ID");if(!a)throw Error("Failed to obtain request ID for createWorkspace");return await s(a,"createWorkspace")}catch(e){throw console.error("Failed to create workspace:",e),e}};async function i(e){try{console.log("Deleting workspace ".concat(e));let r=await o.x.post("/workspaces/delete",{workspace_name:e});if(!r.ok)throw Error("Error scheduling deleteWorkspace: ".concat(r.statusText," (status ").concat(r.status,")"));let t=r.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("Failed to obtain request ID for deleteWorkspace");console.log("[Delete Debug] Got request ID for deleteWorkspace: ".concat(t));try{let e=await s(t,"deleteWorkspace");return console.log("[Delete Debug] deleteWorkspace completed successfully:",e),e}catch(e){throw console.error("[Delete Debug] deleteWorkspace failed with error:",e),console.error("[Delete Debug] Error message:",e.message),e}}catch(e){throw console.error("Failed to delete workspace:",e),e}}async function u(){try{console.log("Getting entire SkyPilot configuration");let e=await o.x.get("/workspaces/config");if(!e.ok)throw Error("Error scheduling getConfig: ".concat(e.statusText," (status ").concat(e.status,")"));let r=e.headers.get("X-Skypilot-Request-ID");if(!r)throw Error("Failed to obtain request ID for getConfig");return await s(r,"getConfig")}catch(e){throw console.error("Failed to get config:",e),e}}async function d(e){try{console.log("Updating entire SkyPilot configuration with config:",e);let r=await o.x.post("/workspaces/config",{config:e});if(!r.ok)throw Error("Error scheduling updateConfig: ".concat(r.statusText," (status ").concat(r.status,")"));let t=r.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("Failed to obtain request ID for updateConfig");return await s(t,"updateConfig")}catch(e){throw console.error("Failed to update config:",e),e}}},32350:function(e,r,t){t.d(r,{cn:function(){return n}});var o=t(90512),a=t(98388);function n(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,a.m6)((0,o.W)(r))}}}]);
@@ -0,0 +1,30 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7359,2369],{27325:function(e,t,n){n.d(t,{Z:function(){return r}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let r=(0,n(60998).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},16826:function(e,t,n){n.d(t,{Z:function(){return r}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let r=(0,n(60998).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},6521:function(e,t,n){n.d(t,{Z:function(){return r}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */let r=(0,n(60998).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"}]])},23293:function(e,t,n){n.d(t,{Z:function(){return r}});/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */let r=(0,n(60998).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"}]])},13626:function(e,t,n){n.d(t,{Z:function(){return r}});/**
22
+ * @license lucide-react v0.407.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */let r=(0,n(60998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},6327:function(e,t,n){n.d(t,{x8:function(){return eu},VY:function(){return eo},dk:function(){return ea},aV:function(){return er},h_:function(){return en},fC:function(){return ee},Dx:function(){return ei},xz:function(){return et}});var r=n(67294),o=n(36206),i=n(28771),a=n(25360),u=n(91276),l=n(77342),s=n(46063),c=n(95420),d=n(42651),f=n(9981),p=e=>{let t,n;let{present:o,children:a}=e,u=function(e){var t,n;let[o,i]=r.useState(),a=r.useRef(null),u=r.useRef(e),l=r.useRef("none"),[s,c]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>n[e][t]??e,t));return r.useEffect(()=>{let e=m(a.current);l.current="mounted"===s?e:"none"},[s]),(0,f.b)(()=>{let t=a.current,n=u.current;if(n!==e){let r=l.current,o=m(t);e?c("MOUNT"):"none"===o||t?.display==="none"?c("UNMOUNT"):n&&r!==o?c("ANIMATION_OUT"):c("UNMOUNT"),u.current=e}},[e,c]),(0,f.b)(()=>{if(o){let e;let t=o.ownerDocument.defaultView??window,n=n=>{let r=m(a.current).includes(n.animationName);if(n.target===o&&r&&(c("ANIMATION_END"),!u.current)){let n=o.style.animationFillMode;o.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=n)})}},r=e=>{e.target===o&&(l.current=m(a.current))};return o.addEventListener("animationstart",r),o.addEventListener("animationcancel",n),o.addEventListener("animationend",n),()=>{t.clearTimeout(e),o.removeEventListener("animationstart",r),o.removeEventListener("animationcancel",n),o.removeEventListener("animationend",n)}}c("ANIMATION_END")},[o,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(o),l="function"==typeof a?a({present:u.isPresent}):r.Children.only(a),s=(0,i.e)(u.ref,(t=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.ref:(t=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.props.ref:l.props.ref||l.ref);return"function"==typeof a||u.isPresent?r.cloneElement(l,{ref:s}):null};function m(e){return e?.animationName||"none"}p.displayName="Presence";var g=n(75320),y=n(27552),h=n(6223),v=n(23541),N=n(88426),M=n(85893),D="Dialog",[x,R]=(0,a.b)(D),[w,O]=x(D),b=e=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=r.useRef(null),d=r.useRef(null),[f,p]=(0,l.T)({prop:o,defaultProp:i??!1,onChange:a,caller:D});return(0,M.jsx)(w,{scope:t,triggerRef:c,contentRef:d,contentId:(0,u.M)(),titleId:(0,u.M)(),descriptionId:(0,u.M)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:s,children:n})};b.displayName=D;var j="DialogTrigger",k=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=O(j,n),u=(0,i.e)(t,a.triggerRef);return(0,M.jsx)(g.WV.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":K(a.open),...r,ref:u,onClick:(0,o.M)(e.onClick,a.onOpenToggle)})});k.displayName=j;var I="DialogPortal",[C,E]=x(I,{forceMount:void 0}),_=e=>{let{__scopeDialog:t,forceMount:n,children:o,container:i}=e,a=O(I,t);return(0,M.jsx)(C,{scope:t,forceMount:n,children:r.Children.map(o,e=>(0,M.jsx)(p,{present:n||a.open,children:(0,M.jsx)(d.h,{asChild:!0,container:i,children:e})}))})};_.displayName=I;var T="DialogOverlay",F=r.forwardRef((e,t)=>{let n=E(T,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=O(T,e.__scopeDialog);return i.modal?(0,M.jsx)(p,{present:r||i.open,children:(0,M.jsx)(P,{...o,ref:t})}):null});F.displayName=T;var A=(0,N.Z8)("DialogOverlay.RemoveScroll"),P=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=O(T,n);return(0,M.jsx)(h.Z,{as:A,allowPinchZoom:!0,shards:[o.contentRef],children:(0,M.jsx)(g.WV.div,{"data-state":K(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),W="DialogContent",Z=r.forwardRef((e,t)=>{let n=E(W,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=O(W,e.__scopeDialog);return(0,M.jsx)(p,{present:r||i.open,children:i.modal?(0,M.jsx)(U,{...o,ref:t}):(0,M.jsx)(V,{...o,ref:t})})});Z.displayName=W;var U=r.forwardRef((e,t)=>{let n=O(W,e.__scopeDialog),a=r.useRef(null),u=(0,i.e)(t,n.contentRef,a);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.Ry)(e)},[]),(0,M.jsx)(L,{...e,ref:u,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.M)(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.M)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,o.M)(e.onFocusOutside,e=>e.preventDefault())})}),V=r.forwardRef((e,t)=>{let n=O(W,e.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return(0,M.jsx)(L,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||n.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"!==t.detail.originalEvent.type||(i.current=!0));let r=t.target;n.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:u,...l}=e,d=O(W,n),f=r.useRef(null),p=(0,i.e)(t,f);return(0,y.EW)(),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(c.M,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:u,children:(0,M.jsx)(s.XB,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":K(d.open),...l,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(J,{titleId:d.titleId}),(0,M.jsx)(Q,{contentRef:f,descriptionId:d.descriptionId})]})]})}),S="DialogTitle",q=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=O(S,n);return(0,M.jsx)(g.WV.h2,{id:o.titleId,...r,ref:t})});q.displayName=S;var $="DialogDescription",H=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=O($,n);return(0,M.jsx)(g.WV.p,{id:o.descriptionId,...r,ref:t})});H.displayName=$;var B="DialogClose",z=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=O(B,n);return(0,M.jsx)(g.WV.button,{type:"button",...r,ref:t,onClick:(0,o.M)(e.onClick,()=>i.onOpenChange(!1))})});function K(e){return e?"open":"closed"}z.displayName=B;var X="DialogTitleWarning",[Y,G]=(0,a.k)(X,{contentName:W,titleName:S,docsSlug:"dialog"}),J=({titleId:e})=>{let t=G(X),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
27
+
28
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
29
+
30
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return r.useEffect(()=>{e&&!document.getElementById(e)&&console.error(n)},[n,e]),null},Q=({contentRef:e,descriptionId:t})=>{let n=G("DialogDescriptionWarning"),o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`;return r.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&!document.getElementById(t)&&console.warn(o)},[o,e,t]),null},ee=b,et=k,en=_,er=F,eo=Z,ei=q,ea=H,eu=z}}]);
@@ -0,0 +1,41 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7411],{19185:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let r=(0,i(60998).Z)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},88507:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let r=(0,i(60998).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},26409:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */let r=(0,i(60998).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},40355:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */let r=(0,i(60998).Z)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},33067:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
22
+ * @license lucide-react v0.407.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */let r=(0,i(60998).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},6021:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
27
+ * @license lucide-react v0.407.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */let r=(0,i(60998).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},28586:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
32
+ * @license lucide-react v0.407.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */let r=(0,i(60998).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},43767:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});/**
37
+ * @license lucide-react v0.407.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */let r=(0,i(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},26821:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return b}});let r=i(10260),n=i(77697),o=i(85893),a=n._(i(67294)),l=r._(i(73935)),s=r._(i(37219)),u=i(21128),d=i(76252),c=i(29146);i(42723);let f=i(54494),p=r._(i(95176)),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/dashboard/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function h(e,t,i,r,n,o,a){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&n(!0),null==i?void 0:i.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,n=!1;i.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>n,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{n=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function m(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}let y=(0,a.forwardRef)((e,t)=>{let{src:i,srcSet:r,sizes:n,height:l,width:s,decoding:u,className:d,style:c,fetchPriority:f,placeholder:p,loading:g,unoptimized:y,fill:v,onLoadRef:b,onLoadingCompleteRef:w,setBlurComplete:S,setShowAltText:k,sizesInput:x,onLoad:z,onError:_,...j}=e;return(0,o.jsx)("img",{...j,...m(f),loading:g,width:s,height:l,decoding:u,"data-nimg":v?"fill":"1",className:d,style:c,sizes:n,srcSet:r,src:i,ref:(0,a.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(_&&(e.src=e.src),e.complete&&h(e,p,b,w,S,y,x))},[i,p,b,w,S,_,y,x,t]),onLoad:e=>{h(e.currentTarget,p,b,w,S,y,x)},onError:e=>{k(!0),"empty"!==p&&S(!0),_&&_(e)}})});function v(e){let{isAppRouter:t,imgAttributes:i}=e,r={as:"image",imageSrcSet:i.srcSet,imageSizes:i.sizes,crossOrigin:i.crossOrigin,referrerPolicy:i.referrerPolicy,...m(i.fetchPriority)};return t&&l.default.preload?(l.default.preload(i.src,r),null):(0,o.jsx)(s.default,{children:(0,o.jsx)("link",{rel:"preload",href:i.srcSet?void 0:i.src,...r},"__nimg-"+i.src+i.srcSet+i.sizes)})}let b=(0,a.forwardRef)((e,t)=>{let i=(0,a.useContext)(f.RouterContext),r=(0,a.useContext)(c.ImageConfigContext),n=(0,a.useMemo)(()=>{let e=g||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),i=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:i}},[r]),{onLoad:l,onLoadingComplete:s}=e,h=(0,a.useRef)(l);(0,a.useEffect)(()=>{h.current=l},[l]);let m=(0,a.useRef)(s);(0,a.useEffect)(()=>{m.current=s},[s]);let[b,w]=(0,a.useState)(!1),[S,k]=(0,a.useState)(!1),{props:x,meta:z}=(0,u.getImgProps)(e,{defaultLoader:p.default,imgConf:n,blurComplete:b,showAltText:S});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y,{...x,unoptimized:z.unoptimized,placeholder:z.placeholder,fill:z.fill,onLoadRef:h,onLoadingCompleteRef:m,setBlurComplete:w,setShowAltText:k,sizesInput:e.sizes,ref:t}),z.priority?(0,o.jsx)(v,{isAppRouter:!i,imgAttributes:x}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21128:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return l}}),i(42723);let r=i(32685),n=i(76252);function o(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function l(e,t){var i;let l,s,u,{src:d,sizes:c,unoptimized:f=!1,priority:p=!1,loading:g,className:h,quality:m,width:y,height:v,fill:b=!1,style:w,overrideSrc:S,onLoad:k,onLoadingComplete:x,placeholder:z="empty",blurDataURL:_,fetchPriority:j,layout:C,objectFit:M,objectPosition:P,lazyBoundary:E,lazyRoot:O,...R}=e,{imgConf:I,showAltText:Z,blurComplete:A,defaultLoader:L}=t,N=I||n.imageConfigDefault;if("allSizes"in N)l=N;else{let e=[...N.deviceSizes,...N.imageSizes].sort((e,t)=>e-t),t=N.deviceSizes.sort((e,t)=>e-t);l={...N,allSizes:e,deviceSizes:t}}if(void 0===L)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let D=R.loader||L;delete R.loader,delete R.srcSet;let B="__next_img_default"in D;if(B){if("custom"===l.loader)throw Error('Image with src "'+d+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=D;D=t=>{let{config:i,...r}=t;return e(r)}}if(C){"fill"===C&&(b=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];e&&(w={...w,...e});let t={responsive:"100vw",fill:"100vw"}[C];t&&!c&&(c=t)}let F="",G=a(y),q=a(v);if("object"==typeof(i=d)&&(o(i)||void 0!==i.src)){let e=o(d)?d.default:d;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(s=e.blurWidth,u=e.blurHeight,_=_||e.blurDataURL,F=e.src,!b){if(G||q){if(G&&!q){let t=G/e.width;q=Math.round(e.height*t)}else if(!G&&q){let t=q/e.height;G=Math.round(e.width*t)}}else G=e.width,q=e.height}}let H=!p&&("lazy"===g||void 0===g);(!(d="string"==typeof d?d:F)||d.startsWith("data:")||d.startsWith("blob:"))&&(f=!0,H=!1),l.unoptimized&&(f=!0),B&&d.endsWith(".svg")&&!l.dangerouslyAllowSVG&&(f=!0),p&&(j="high");let V=a(m),U=Object.assign(b?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:M,objectPosition:P}:{},Z?{}:{color:"transparent"},w),W=A||"empty"===z?null:"blur"===z?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:G,heightInt:q,blurWidth:s,blurHeight:u,blurDataURL:_||"",objectFit:U.objectFit})+'")':'url("'+z+'")',T=W?{backgroundSize:U.objectFit||"cover",backgroundPosition:U.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:W}:{},J=function(e){let{config:t,src:i,unoptimized:r,width:n,quality:o,sizes:a,loader:l}=e;if(r)return{src:i,srcSet:void 0,sizes:void 0};let{widths:s,kind:u}=function(e,t,i){let{deviceSizes:r,allSizes:n}=e;if(i){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(i);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:n.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:n,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>n.find(t=>t>=e)||n[n.length-1]))],kind:"x"}}(t,n,a),d=s.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:s.map((e,r)=>l({config:t,src:i,quality:o,width:e})+" "+("w"===u?e:r+1)+u).join(", "),src:l({config:t,src:i,quality:o,width:s[d]})}}({config:l,src:d,unoptimized:f,width:G,quality:V,sizes:c,loader:D});return{props:{...R,loading:H?"lazy":g,fetchPriority:j,width:G,height:q,decoding:"async",className:h,style:{...U,...T},sizes:J.sizes,srcSet:J.srcSet,src:S||J.src},meta:{unoptimized:f,priority:p,placeholder:z,fill:b}}}},32685:function(e,t){"use strict";function i(e){let{widthInt:t,heightInt:i,blurWidth:r,blurHeight:n,blurDataURL:o,objectFit:a}=e,l=r?40*r:t,s=n?40*n:i,u=l&&s?"viewBox='0 0 "+l+" "+s+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+u+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+o+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return i}})},7e4:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{default:function(){return s},getImageProps:function(){return l}});let r=i(10260),n=i(21128),o=i(26821),a=r._(i(95176));function l(e){let{props:t}=(0,n.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/dashboard/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,i]of Object.entries(t))void 0===i&&delete t[e];return{props:t}}let s=o.Image},95176:function(e,t){"use strict";function i(e){let{config:t,src:i,width:r,quality:n}=e;return t.path+"?url="+encodeURIComponent(i)+"&w="+r+"&q="+(n||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),i.__next_img_default=!0;let r=i},25675:function(e,t,i){e.exports=i(7e4)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7615],{47615:function(e,s,t){t.r(s),t.d(s,{ClusterJobs:function(){return O},ManagedJobs:function(){return P},ManagedJobsTable:function(){return U},Status2Actions:function(){return J},filterJobsByName:function(){return M},filterJobsByPool:function(){return A},filterJobsByUser:function(){return I},filterJobsByWorkspace:function(){return F},statusGroups:function(){return R}});var r=t(85893),a=t(67294),n=t(11163),l=t(41664),i=t.n(l),c=t(55739),o=t(30803),d=t(37673),u=t(68764),h=t(36989),x=t(51214),m=t(68969),p=t(6378);class j{_generateFilterKey(e){let{allUsers:s=!0,nameMatch:t,userMatch:r,workspaceMatch:a,poolMatch:n,statuses:l}=e;return["allUsers:".concat(s),t?"name:".concat(t):"",r?"user:".concat(r):"",a?"workspace:".concat(a):"",n?"pool:".concat(n):"",l&&l.length>0?"statuses:".concat(l.sort().join(",")):""].filter(Boolean).join("|")||"default"}_getCacheStatus(e){let s=this.fullDataCache.get(e),t=Date.now();if(!s)return{isCached:!1,isFresh:!1,age:0,maxAge:12e4,hasData:!1};let r=t-s.timestamp;return{isCached:!0,isFresh:r<12e4,age:r,maxAge:12e4,hasData:s.jobs&&Array.isArray(s.jobs),data:s}}async getPaginatedJobs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{page:s=1,limit:t=10,...r}=e,a=this._generateFilterKey(r);try{let e=this._getCacheStatus(a);if(e.isCached&&e.hasData){let n=e.data;if(!n.jobs||Array.isArray(n.jobs)&&0===n.jobs.length){if(!this.prefetching.has(a)){let e=this._loadFullDataset(r,a).catch(()=>{}).finally(()=>this.prefetching.delete(a));this.prefetching.set(a,e)}}else{let l=(s-1)*t,i=n.jobs.slice(l,l+t);if(!this.prefetching.has(a)&&(!e.isFresh||e.age>e.maxAge/2)){let e=this._loadFullDataset(r,a).catch(()=>{}).finally(()=>this.prefetching.delete(a));this.prefetching.set(a,e)}return{jobs:i,total:n.total,totalNoFilter:n.totalNoFilter||n.total,controllerStopped:n.controllerStopped,statusCounts:n.statusCounts||{},fromCache:!0,cacheStatus:e.isFresh?"local_cache_hit":"local_cache_stale_hit"}}}let n=await p.default.get(m.getManagedJobs,[{...r,page:s,limit:t}]),l=(null==n?void 0:n.jobs)||[],i="number"==typeof(null==n?void 0:n.total)?n.total:l.length,c=!!(null==n?void 0:n.controllerStopped);if(!this.prefetching.has(a)){let e=this._loadFullDataset(r,a).catch(e=>{console.warn("Background prefetch of full jobs failed:",e)}).finally(()=>{this.prefetching.delete(a)});this.prefetching.set(a,e)}return{jobs:l,total:i,totalNoFilter:(null==n?void 0:n.totalNoFilter)||i,controllerStopped:c,statusCounts:(null==n?void 0:n.statusCounts)||{},fromCache:!1,cacheStatus:"server_page_fetch"}}catch(e){throw console.error("Error in getPaginatedJobs:",e),e}}async _loadFullDataset(e,s){let t=await p.default.get(m.getManagedJobs,[e]);if(t&&t.__skipCache||t.controllerStopped||!t.jobs)return t;let r={jobs:t.jobs,total:t.jobs.length,totalNoFilter:t.totalNoFilter||t.jobs.length,controllerStopped:!1,statusCounts:t.statusCounts||{},timestamp:Date.now()};return this.fullDataCache.set(s,r),r}isDataLoading(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e);return this.isLoading.has(s)||this.prefetching.has(s)}isDataCached(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e),t=this._getCacheStatus(s);return t.isCached&&t.isFresh&&t.hasData}getCacheStatus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e);return this._getCacheStatus(s)}invalidateCache(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){let s=this._generateFilterKey(e);this.fullDataCache.delete(s),this.isLoading.delete(s),this.prefetching.delete(s)}else this.fullDataCache.clear(),this.isLoading.clear(),this.prefetching.clear();p.default.invalidateFunction(m.getManagedJobs)}getCacheStats(){let e={cachedFilters:Array.from(this.fullDataCache.keys()),loadingFilters:Array.from(this.isLoading.keys()),prefetchingFilters:Array.from(this.prefetching.keys()),cacheSize:this.fullDataCache.size,loadingCount:this.isLoading.size,prefetchingCount:this.prefetching.size};for(let[s,t]of(e.detailedStatus={},this.fullDataCache.entries())){let r=this._getCacheStatus(s);e.detailedStatus[s]={age:r.age,isFresh:r.isFresh,hasData:r.hasData,jobCount:t.jobs?t.jobs.length:0}}return e}constructor(){this.fullDataCache=new Map,this.isLoading=new Map,this.prefetching=new Map}}let f=new j;var g=t(23266),b=t(17324),v=t(13626),w=t(23293),y=t(6521),N=t(16826),k=t(92128),C=t(94545),S=t(99307),L=t(20546),_=t(23001),E=t(10546);let R={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},D=[{label:"Name",value:"name"},{label:"User",value:"user"},{label:"Workspace",value:"workspace"},{label:"Pool",value:"pool"}];function M(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.name||"").toLowerCase().includes(t))}function F(e,s){return s&&"ALL_WORKSPACES"!==s?e.filter(e=>(e.workspace||"default").toLowerCase()===s.toLowerCase()):e}function I(e,s){return s&&"ALL_USERS"!==s?e.filter(e=>(e.user_hash||e.user)===s):e}function A(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.pool||"").toLowerCase().includes(t))}let z=e=>{if(!e)return"-";let s=e instanceof Date?e:new Date(1e3*e);return(0,r.jsx)(h.Zg,{date:s})};function P(){let e=(0,n.useRouter)(),[s,t]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!0),[o,d]=(0,a.useState)(!0),u=a.useRef(null),x=a.useRef(null),[j,g]=(0,a.useState)([]),[v,w]=(0,a.useState)([]),[y,N]=(0,a.useState)({name:[],user:[],workspace:[],pool:[]}),k=a.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t(!0),!e&&o&&c(!0);try{let[e]=await Promise.all([p.default.get(m.vs,[{}])]);g(e.pools||[])}catch(e){console.error("Error fetching data:",e)}finally{t(!1),!e&&o&&(c(!1),d(!1))}},[o]);(0,a.useEffect)(()=>{k()},[k]);let C=s=>{(0,E.eG)(e,s)},S=a.useCallback(()=>{let s=new Map;s.set("",""),s.set("status","Status"),s.set("name","Name"),s.set("user","User"),s.set("workspace","Workspace"),s.set("pool","Pool"),w((0,E.Fu)(e,s))},[e,w]);return(0,a.useEffect)(()=>{e.isReady&&S()},[e.isReady,e.query.tab,S]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,r.jsx)("div",{className:"text-base",children:(0,r.jsx)(i(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"})}),(0,r.jsx)("div",{className:"w-full sm:w-auto",children:(0,r.jsx)(E.ML,{propertyList:D,valueList:y,setFilters:w,updateURLParams:C,placeholder:"Filter jobs"})})]}),(0,r.jsx)(E.x$,{filters:v,setFilters:w,updateURLParams:C}),(0,r.jsx)(U,{refreshInterval:h.yc,setLoading:t,refreshDataRef:u,filters:v,onRefresh:()=>{f.invalidateCache(),p.default.invalidate(m.vs,[{}]),p.default.invalidate(b.getWorkspaces),u.current&&u.current(),x.current&&x.current()},poolsData:j,poolsLoading:l,setValueList:N}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(Z,{refreshInterval:h.yc,setLoading:t,refreshDataRef:x})})]})}function U(e){let{refreshInterval:s,setLoading:t,refreshDataRef:n,filters:l,onRefresh:j,poolsData:b,poolsLoading:y,setValueList:N}=e,[E,D]=(0,a.useState)([]),[M,F]=(0,a.useState)(0),[I,A]=(0,a.useState)(0),[P,U]=(0,a.useState)({key:null,direction:"ascending"}),[O,Z]=(0,a.useState)(!1),[B,G]=(0,a.useState)(!0),[H,K]=(0,a.useState)(1),[q,V]=(0,a.useState)(10),[Y,$]=(0,a.useState)(null),Q=(0,a.useRef)(null),[X,ee]=(0,a.useState)([]),[es,et]=(0,a.useState)({}),[er,ea]=(0,a.useState)({}),[en,el]=(0,a.useState)(!1),[ei,ec]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(!1),[eu,eh]=(0,a.useState)("all"),[ex,em]=(0,a.useState)(!0),[ep,ej]=(0,a.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),ef=(0,_.X)(),eg=(0,a.useRef)(0),eb=a.useMemo(()=>{if(!E||0===E.length)return!1;let e=new Set(E.map(e=>e.workspace||"default"));return e.size>1||1===e.size&&!e.has("default")},[E]),ev=a.useMemo(()=>b&&b.length>0,[b]),ew=async()=>{ej({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller?",onConfirm:async()=>{try{ed(!0),Z(!0),await (0,m.Ce)("restartcontroller"),await ey()}catch(e){console.error("Error restarting controller:",e)}finally{ed(!1),Z(!1)}}})},ey=a.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=!1!==e.includeStatus,r=eg.current+1;eg.current=r,Z(!0),t(!0);try{let e;let t=e=>{let s=(l||[]).find(s=>(s.property||"").toLowerCase()===e);return s&&s.value?String(s.value):void 0};X.length>0?e=X:ex?"active"===eu?e=R.active:"finished"===eu&&(e=R.finished):e=[];let a={allUsers:!0,nameMatch:t("name"),userMatch:t("user"),workspaceMatch:t("workspace"),poolMatch:t("pool"),statuses:e,page:H,limit:q},n=null;if(f.isDataCached(a),f.isDataLoading(a),s)try{n=await p.default.get(g.getClusters)}catch(e){console.error("Error fetching clusters:",e)}let{jobs:i=[],total:c=0,totalNoFilter:o=0,controllerStopped:d=!1,cacheStatus:u="unknown",statusCounts:h={}}=await f.getPaginatedJobs(a)||{},x=!1,m=!1;if(s&&n){let e=null==n?void 0:n.find(e=>(0,C.Ym)(e.cluster)),s=e?e.status:"NOT_FOUND";"STOPPED"==s&&d&&(x=!0),"LAUNCHING"==s&&(m=!0)}r===eg.current&&(D(i),F(c||0),A(o||0),el(!!x),ec(!!m),ea(h),G(!1))}catch(e){console.error("Error fetching data:",e),r===eg.current&&(D([]),el(!1),G(!1))}finally{r===eg.current&&(Z(!1),t(!1))}},[t,l,H,q,X,ex,eu]);a.useEffect(()=>{n&&(n.current=ey)},[n,ey]);let eN=a.useRef(ey);a.useEffect(()=>{eN.current=ey},[ey]);let ek=a.useRef(!0);a.useEffect(()=>{ey({includeStatus:!0}),ek.current=!1},[ey]),a.useEffect(()=>{ek.current||ey({includeStatus:!1})},[H,ey]),a.useEffect(()=>{ek.current||ey({includeStatus:!0})},[l,q,ey]),a.useEffect(()=>{ek.current||ey({includeStatus:!0})},[eu,X,ex,ey]),(0,a.useEffect)(()=>{let e=setInterval(()=>{eN.current&&"visible"===window.document.visibilityState&&eN.current({includeStatus:!0})},s);return()=>{clearInterval(e)}},[s]),(0,a.useEffect)(()=>{K(1)},[eu]),(0,a.useEffect)(()=>{K(1)},[l,q]),(0,a.useEffect)(()=>{ee([]),em(!0)},[eu]),(0,a.useEffect)(()=>{if(!E||0===E.length||!N)return;let e=new Set,s=new Set,t=new Set,r=new Set;E.forEach(a=>{a.name&&e.add(a.name),a.user&&s.add(a.user),a.workspace&&t.add(a.workspace),a.pool&&r.add(a.pool)}),N({name:Array.from(e).sort(),user:Array.from(s).sort(),workspace:Array.from(t).sort(),pool:Array.from(r).sort()})},[E,N]);let eC=e=>{let s="ascending";P.key===e&&"ascending"===P.direction&&(s="descending"),U({key:e,direction:s})},eS=e=>P.key===e?"ascending"===P.direction?" ↑":" ↓":"";a.useMemo(()=>{let e=E||[];return{active:e.filter(e=>R.active.includes(e.status)).length,finished:e.filter(e=>R.finished.includes(e.status)).length}},[E]);let eL=e=>X.length>0?X.includes(e):"all"===eu||R[eu].includes(e),e_=a.useMemo(()=>E,[E]),eE=a.useMemo(()=>P.key?[...e_].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):e_,[e_,P]),eR=(H-1)*q,eD=M>0?Math.ceil(M/q):0,eM=M>0?Math.min(eR+eE.length,M):0,eF=e=>{if(X.includes(e)){let s=X.filter(s=>s!==e);0===s.length?(em(!0),ee([])):(ee(s),em(!1))}else ee([...X,e]),em(!1);K(1)};return(0,a.useEffect)(()=>{et(er)},[er]),(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 justify-between text-sm mb-1",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center",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:[!O&&0===I&&!B&&(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(es).map(e=>{let[s,t]=e;return(0,r.jsxs)("button",{onClick:()=>eF(s),className:"px-3 py-0.5 rounded-full flex items-center space-x-2 ".concat(eL(s)||X.includes(s)?(0,S.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(eL(s)||X.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),I>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:()=>{a.startTransition(()=>{eh("all"),ee([]),em(!0),K(1)})},className:"text-sm font-medium ".concat("all"===eu&&ex?"text-purple-700 underline":"text-gray-600 hover:text-purple-700 hover:underline"),children:"show all jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{a.startTransition(()=>{eh("active"),ee([]),em(!0),K(1)})},className:"text-sm font-medium ".concat("active"===eu&&ex?"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:()=>{a.startTransition(()=>{eh("finished"),ee([]),em(!0),K(1)})},className:"text-sm font-medium ".concat("finished"===eu&&ex?"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.jsxs)("div",{className:"flex items-center gap-2",children:[O&&(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,r.jsxs)("button",{onClick:()=>{j&&j()},disabled:O,className:"text-sky-blue hover:text-sky-blue-bright flex items-center text-sm",children:[(0,r.jsx)(v.Z,{className:"h-4 w-4 mr-1.5"}),(0,r.jsx)("span",{children:"Refresh"})]})]})]})}),ef&&en&&0===eE.length&&!O&&!B&&(0,r.jsx)("div",{className:"mb-4 p-4 bg-gray-50 rounded-lg border",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-3",children:[(0,r.jsxs)("p",{className:"text-gray-700 text-center text-sm",children:["Job controller stopped.",(0,r.jsx)("br",{}),"Restart to check status."]}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:ew,className:"text-sky-blue hover:text-sky-blue-bright",disabled:O||eo,children:eo?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Restart"]})})]})}),(0,r.jsx)(d.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(u.iA,{className:"min-w-full",children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("id"),children:["ID",eS("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("name"),children:["Name",eS("name")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("user"),children:["User",eS("user")]}),eb&&(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("workspace"),children:["Workspace",eS("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("submitted_at"),children:["Submitted",eS("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("job_duration"),children:["Duration",eS("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("status"),children:["Status",eS("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("infra"),children:["Infra",eS("infra")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("cluster"),children:["Resources",eS("cluster")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("recoveries"),children:["Recoveries",eS("recoveries")]}),ev&&(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>eC("pool"),children:["Worker Pool",eS("pool")]}),(0,r.jsx)(u.ss,{children:"Details"}),(0,r.jsx)(u.ss,{children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:O&&B?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:11+(eb?1:0)+(ev?1:0),className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):eE.length>0?(0,r.jsx)(r.Fragment,{children:eE.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(L.H,{username:e.user,userHash:e.user_hash})}),eb&&(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:z(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(S.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.infra&&"-"!==e.infra?(0,r.jsx)(h.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(i(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud||e.infra.split("(")[0].trim()}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+(()=>{let s=x.MO.NAME_TRUNCATE_LENGTH,t=e.infra.substring(e.infra.indexOf("(")),r=t.substring(1,t.length-1);if(r.length<=s)return t;let a="".concat(r.substring(0,Math.floor((s-3)/2)),"...").concat(r.substring(r.length-Math.ceil((s-3)/2)));return"(".concat(a,")")})()})]})}):(0,r.jsx)("span",{children:e.infra||"-"})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(h.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(u.pj,{children:e.recoveries}),ev&&(0,r.jsx)(u.pj,{children:(0,r.jsx)("div",{className:y?"blur-sm transition-all duration-300":"",children:y?"-":(0,h.os)(e.pool,e.pool_hash,b)})}),(0,r.jsx)(u.pj,{children:e.details?(0,r.jsx)(T,{text:e.details,rowId:e.id,expandedRowId:Y,setExpandedRowId:$}):"-"}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(J,{jobParent:"/jobs",jobId:e.id,managed:!0,workspace:e.workspace})})]}),Y===e.id&&(0,r.jsx)(W,{text:e.details,colSpan:11+(eb?1:0)+(ev?1:0),innerRef:Q})]},e.task_job_id))}):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:11+(eb?1:0)+(ev?1:0),className:"text-center py-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[ei&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. It will be ready shortly."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!en&&!ei&&(0,r.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),!ef&&en&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-3 px-4",children:[(0,r.jsx)("p",{className:"text-gray-700 text-center text-sm sm:text-base max-w-md",children:"The managed job controller has been stopped. Restart to check the latest job status."}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:ew,className:"text-sky-blue hover:text-sky-blue-bright",disabled:O||eo,children:eo?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})})}),(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:q,onChange:e=>{V(parseInt(e.target.value,10)),K(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsx)("div",{children:M>0?"".concat(eR+1," – ").concat(eM," of ").concat(M):"0 – 0 of 0"}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{K(e=>Math.max(e-1,1))},disabled:1===H||!eE||0===eE.length,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:()=>{eD>0&&H<eD&&K(e=>e+1)},disabled:0===eD||H>=eD||!eE||0===eE.length,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)(k.cV,{isOpen:ep.isOpen,onClose:()=>ej({...ep,isOpen:!1}),onConfirm:ep.onConfirm,title:ep.title,message:ep.message,confirmClassName:"bg-blue-600 hover:bg-blue-700 text-white"})]})}function J(e){let{withLabel:s=!1,jobParent:t,jobId:a,managed:l,workspace:i="default"}=e,c=(0,n.useRouter)(),o=(e,s)=>{e.preventDefault(),e.stopPropagation(),c.push({pathname:"".concat(t,"/").concat(a),query:{tab:s}})},d=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.preventDefault(),e.stopPropagation(),l)(0,m.jh)({jobId:parseInt(a),controller:s});else{let e=t.match(/\/clusters\/(.+)/);if(e){let s=e[1];(0,g.GH)({clusterName:s,jobIds:[a],workspace:i})}}};return(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(h.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>o(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(y.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),(0,r.jsx)(h.WH,{content:"Download Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>d(e,!1),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(N.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Download"})]})},"downloadlogs")]})}function O(e){let{clusterName:s,clusterJobData:t,loading:n,refreshClusterJobsOnly:l,userFilter:x=null,nameFilter:m=null,workspace:p="default"}=e,[j,f]=(0,a.useState)(null),[g,b]=(0,a.useState)({key:null,direction:"ascending"}),[w,y]=(0,a.useState)(1),[N,k]=(0,a.useState)(10),C=(0,a.useRef)(null),[_,E]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=e=>{j&&C.current&&!C.current.contains(e.target)&&f(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[j]);let R=a.useMemo(()=>{let e=t||[];return x&&"ALL_USERS"!==x&&(e=I(e,x)),m&&(e=M(e,m)),e},[t,x,m]);(0,a.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(_)&&E(t)},[t,_]);let D=a.useMemo(()=>g.key?[...R].sort((e,s)=>e[g.key]<s[g.key]?"ascending"===g.direction?-1:1:e[g.key]>s[g.key]?"ascending"===g.direction?1:-1:0):R,[R,g]),F=e=>{let s="ascending";g.key===e&&"ascending"===g.direction&&(s="descending"),b({key:e,direction:s})},A=e=>g.key===e?"ascending"===g.direction?" ↑":" ↓":"",P=Math.ceil(D.length/N),U=(w-1)*N,O=U+N,Z=D.slice(U,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"}),(0,r.jsx)("div",{className:"flex items-center",children:l&&(0,r.jsxs)("button",{onClick:l,disabled:n,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center text-sm ml-2",children:[(0,r.jsx)(v.Z,{className:"w-4 h-4 mr-1"}),"Refresh Jobs"]})})]}),(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("id"),children:["ID",A("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("job"),children:["Name",A("job")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("user"),children:["User",A("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("submitted_at"),children:["Submitted",A("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("job_duration"),children:["Duration",A("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("status"),children:["Status",A("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>F("resources"),children:["Resources",A("resources")]}),(0,r.jsx)(u.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:n?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:8,className:"text-center py-12 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading cluster jobs..."})]})})}):Z.length>0?Z.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(u.SC,{className:j===e.id?"selected-row":"",children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,r.jsx)(T,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:j,setExpandedRowId:f})})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(L.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(u.pj,{children:z(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(S.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.resources}),(0,r.jsx)(u.pj,{className:"flex content-center items-center",children:(0,r.jsx)(J,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1,workspace:p})})]}),j===e.id&&(0,r.jsx)(W,{text:e.job||"Unnamed job",colSpan:8,innerRef:C})]},e.id)):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),D&&D.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:N,onChange:e=>{k(parseInt(e.target.value,10)),y(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:[U+1," – ",Math.min(O,D.length)," of"," ",D.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{y(e=>Math.max(e-1,1))},disabled:1===w,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{y(e=>Math.min(e+1,P))},disabled:w===P||0===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-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function W(e){let{text:s,colSpan:t,innerRef:a}=e;return(0,r.jsx)(u.SC,{className:"expanded-details",children:(0,r.jsx)(u.pj,{colSpan:t,children:(0,r.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:a,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 T(e){let{text:s,rowId:t,expandedRowId:n,setExpandedRowId:l}=e,i=s||"",c=i.length>50,o=n===t,d=c?"".concat(i.substring(0,50)):i,u=(0,a.useRef)(null);return(0,r.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,r.jsx)("span",{className:"truncate",children:d}),c&&(0,r.jsx)("button",{ref:u,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(o?null:t)},className:"text-blue-600 hover:text-blue-800 font-medium ml-1 flex-shrink-0","data-button-type":"show-more-less",children:o?"... show less":"... show more"})]})}function Z(e){let{refreshInterval:s,setLoading:t,refreshDataRef:n}=e,[l,o]=(0,a.useState)([]),[x,j]=(0,a.useState)({key:null,direction:"ascending"}),[f,g]=(0,a.useState)(!1),[b,v]=(0,a.useState)(!0),[w,y]=(0,a.useState)(1),[N,k]=(0,a.useState)(10),C=a.useCallback(async()=>{g(!0),t(!0);try{let{pools:e=[]}=await p.default.get(m.vs,[{}])||{};o(e),v(!1)}catch(e){console.error("Error fetching pools data:",e),o([]),v(!1)}finally{g(!1),t(!1)}},[t]);a.useEffect(()=>{n&&(n.current=C)},[n,C]),(0,a.useEffect)(()=>{o([]);let e=!0;C();let t=setInterval(()=>{e&&"visible"===window.document.visibilityState&&C()},s);return()=>{e=!1,clearInterval(t)}},[s,C]);let L=e=>{let s="ascending";x.key===e&&"ascending"===x.direction&&(s="descending"),j({key:e,direction:s})},_=e=>x.key===e?"ascending"===x.direction?" ↑":" ↓":"",E=a.useMemo(()=>x.key?[...l].sort((e,s)=>e[x.key]<s[x.key]?"ascending"===x.direction?-1:1:e[x.key]>s[x.key]?"ascending"===x.direction?1:-1:0):l,[l,x]),R=Math.ceil(E.length/N),D=(w-1)*N,M=D+N,F=E.slice(D,M),I=e=>{if(!e||!e.replica_info||0===e.replica_info.length)return"0 (target: 0)";let s=e.replica_info.filter(e=>"READY"===e.status).length,t=e.target_num_replicas||0;return"".concat(s," (target: ").concat(t,")")},A=e=>{let{jobCounts:s}=e;return(0,r.jsx)(h.x9,{jobCounts:s,getStatusStyle:S.Cl})},z=e=>{let{replicaInfo:s}=e;return(0,r.jsx)(h.Kl,{replicaInfo:s})};return(0,r.jsxs)(d.Zb,{children:[(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(u.iA,{className:"min-w-full table-fixed",children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-32",onClick:()=>L("name"),children:["Pool",_("name")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-40",onClick:()=>L("job_counts"),children:["Jobs",_("job_counts")]}),(0,r.jsx)(u.ss,{className:"whitespace-nowrap w-20",children:"Workers"}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-36",onClick:()=>L("requested_resources_str"),children:["Worker Details",_("requested_resources_str")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap w-40",onClick:()=>L("requested_resources_str"),children:["Worker Resources",_("requested_resources_str")]})]})}),(0,r.jsx)(u.RM,{children:f&&b?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):F.length>0?F.map(e=>(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/pools/".concat(e.name),className:"text-blue-600 hover:text-blue-800",children:e.name})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(A,{jobCounts:e.jobCounts})}),(0,r.jsx)(u.pj,{children:I(e)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(z,{replicaInfo:e.replica_info})}),(0,r.jsx)(u.pj,{children:e.requested_resources_str||"-"})]},e.name)):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:"No pools found"})})})]})}),F.length>0&&R>1&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-200",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("span",{className:"text-sm text-gray-700",children:"Rows per page:"}),(0,r.jsxs)("select",{value:N,onChange:e=>{k(parseInt(e.target.value,10)),y(1)},className:"border border-gray-300 rounded px-2 py-1 text-sm",children:[(0,r.jsx)("option",{value:5,children:"5"}),(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:25,children:"25"}),(0,r.jsx)("option",{value:50,children:"50"})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsxs)("span",{className:"text-sm text-gray-700",children:[D+1,"-",Math.min(M,E.length)," of"," ",E.length]}),(0,r.jsx)("button",{onClick:()=>{y(e=>Math.max(e-1,1))},disabled:1===w,className:"px-2 py-1 text-sm border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Previous"}),(0,r.jsx)("button",{onClick:()=>{y(e=>Math.min(e+1,R))},disabled:w===R,className:"px-2 py-1 text-sm border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Next"})]})]})]})}},10546:function(e,s,t){t.d(s,{Fu:function(){return o},ML:function(){return d},cm:function(){return i},eG:function(){return c},x$:function(){return u}});var r=t(85893),a=t(67294),n=t(88950);let l=(e,s)=>{var t;let{property:r,operator:a,value:n}=s;if(!n)return!0;if(!r){let s=n.toLowerCase();return Object.values(e).some(e=>null==e?void 0:e.toString().toLowerCase().includes(s))}let l=null===(t=e[r.toLowerCase()])||void 0===t?void 0:t.toString().toLowerCase(),i=n.toString().toLowerCase();switch(a){case"=":return l===i;case":":return null==l?void 0:l.includes(i);default:return!0}},i=(e,s)=>0===s.length?e:e.filter(e=>{let t=null;for(let r=0;r<s.length;r++){let a=l(e,s[r]);t=null===t?a:t&&a}return t}),c=(e,s)=>{let t={...e.query},r=[],a=[],n=[];s.map((e,s)=>{var t;r.push(null!==(t=e.property.toLowerCase())&&void 0!==t?t:""),a.push(e.operator),n.push(e.value)}),t.property=r,t.operator=a,t.value=n,e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},o=(e,s)=>{let t={...e.query},r=t.property,a=t.operator,n=t.value;if(void 0===r)return[];let l=[],i=Array.isArray(r)?r.length:1;if(1===i)l.push({property:s.get(r),operator:a,value:n});else for(let e=0;e<i;e++)l.push({property:s.get(r[e]),operator:a[e],value:n[e]});return l},d=e=>{var s,t;let{propertyList:l=[],valueList:i,setFilters:c,updateURLParams:o,placeholder:d="Filter items"}=e,u=(0,a.useRef)(null),h=(0,a.useRef)(null),[x,m]=(0,a.useState)(!1),[p,j]=(0,a.useState)(""),[f,g]=(0,a.useState)((null===(s=l[0])||void 0===s?void 0:s.value)||"status"),[b,v]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&u.current&&!u.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,a.useEffect)(()=>{let e=[];i&&"object"==typeof i&&(e=i[f]||[]),""!==p.trim()&&(e=e.filter(e=>e&&e.toString().toLowerCase().includes(p.toLowerCase()))),v(e)},[f,i,p]);let w=e=>{let s=l.find(s=>s.value===e);return s?s.label:e},y=e=>{c(s=>{let t=[...s,{property:w(f),operator:":",value:e}];return o(t),t}),m(!1),j(""),u.current.focus()};return(0,r.jsxs)("div",{className:"flex flex-row border border-gray-300 rounded-md overflow-visible bg-white",children:[(0,r.jsx)("div",{className:"border-r border-gray-300 flex-shrink-0",children:(0,r.jsxs)(n.Ph,{onValueChange:g,value:f,children:[(0,r.jsx)(n.i4,{"aria-label":"Filter Property",className:"focus:ring-0 focus:ring-offset-0 border-none rounded-l-md rounded-r-none w-20 sm:w-24 md:w-32 h-8 text-xs sm:text-sm bg-white",children:(0,r.jsx)(n.ki,{placeholder:(null===(t=l[0])||void 0===t?void 0:t.label)||"Status"})}),(0,r.jsx)(n.Bw,{children:l.map((e,s)=>(0,r.jsx)(n.Ql,{value:e.value,children:e.label},"property-item-".concat(s)))})]})}),(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",ref:u,placeholder:d,value:p,onChange:e=>{j(e.target.value),x||m(!0)},onFocus:()=>{m(!0)},onKeyDown:e=>{"Enter"===e.key&&""!==p.trim()?(c(e=>{let s=[...e,{property:w(f),operator:":",value:p}];return o(s),s}),j(""),m(!1)):"Escape"===e.key&&(m(!1),u.current.blur())},className:"h-8 w-full px-3 pr-8 text-sm border-none rounded-l-none rounded-r-md focus:ring-0 focus:outline-none",autoComplete:"off"}),p&&(0,r.jsx)("button",{onClick:()=>{j(""),m(!1)},className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",tabIndex:-1,children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),x&&b.length>0&&(0,r.jsx)("div",{ref:h,className:"absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-y-auto",style:{zIndex:9999},children:b.map((e,s)=>(0,r.jsx)("div",{className:"px-3 py-2 cursor-pointer hover:bg-gray-50 text-sm ".concat(s!==b.length-1?"border-b border-gray-100":""),onClick:()=>y(e),children:(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e})},"".concat(e,"-").concat(s)))})]})]})},u=e=>{let{filters:s=[],setFilters:t,updateURLParams:a}=e,n=e=>{t(s=>{let t=s.filter((s,t)=>t!==e);return a(t),t})};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center gap-4 py-2 px-2",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-content gap-2",children:[s.map((e,s)=>(0,r.jsx)(h,{filter:e,onRemove:()=>n(s)},"filteritem-".concat(s))),s.length>0&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("button",{onClick:()=>{a([]),t([])},className:"rounded-full px-4 py-1 text-sm text-gray-700 bg-gray-200 hover:bg-gray-300",children:"Clear filters"})})]})})})},h=e=>{let{filter:s,onRemove:t}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"flex items-center text-blue-600 bg-blue-100 px-1 py-1 rounded-full text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2",children:[(0,r.jsx)("span",{children:"".concat(s.property," ")}),(0,r.jsx)("span",{children:"".concat(s.operator," ")}),(0,r.jsx)("span",{children:" ".concat(s.value)})]}),(0,r.jsx)("button",{onClick:()=>t(),className:"p-0.5 ml-1 transform text-gray-400 hover:text-gray-600 bg-blue-500 hover:bg-blue-600 rounded-full flex flex-col items-center",title:"Clear filter",children:(0,r.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"white",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:5,d:"M6 18L18 6M6 6l12 12"})})})]})})}}}]);
@@ -0,0 +1,16 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8640],{88507:function(e,n,t){t.d(n,{Z:function(){return r}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let r=(0,t(60998).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},28586:function(e,n,t){t.d(n,{Z:function(){return r}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let r=(0,t(60998).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},43767:function(e,n,t){t.d(n,{Z:function(){return r}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */let r=(0,t(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},23001:function(e,n,t){t.d(n,{X:function(){return l}});var r=t(67294);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[n,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let n=()=>{t(window.innerWidth<e)};return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[e]),n}},12003:function(e,n,t){t.d(n,{j:function(){return i}});var r=t(90512);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,u=r.W,i=(e,n)=>t=>{var r;if((null==n?void 0:n.variants)==null)return u(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:i,defaultVariants:a}=n,d=Object.keys(i).map(e=>{let n=null==t?void 0:t[e],r=null==a?void 0:a[e];if(null===n)return null;let u=l(n)||l(r);return i[e][u]}),s=t&&Object.entries(t).reduce((e,n)=>{let[t,r]=n;return void 0===r||(e[t]=r),e},{});return u(e,d,null==n?void 0:null===(r=n.compoundVariants)||void 0===r?void 0:r.reduce((e,n)=>{let{class:t,className:r,...l}=n;return Object.entries(l).every(e=>{let[n,t]=e;return Array.isArray(t)?t.includes({...a,...s}[n]):({...a,...s})[n]===t})?[...e,t,r]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8969],{68969:function(e,t,o){o.d(t,{Ce:function(){return g},NJ:function(){return f},UA:function(){return h},aT:function(){return d},getManagedJobs:function(){return l},jh:function(){return p},vs:function(){return u}});var r=o(67294),a=o(15821),n=o(93225),s=o(6378),c=o(47145);let i=["job_id","_job_id","job_name","user_name","user_hash","workspace","submitted_at","job_duration","status","resources","cloud","region","accelerators","cluster_resources","cluster_resources_full","recovery_count","pool","pool_hash","details","failure_reason"];async function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t;let{allUsers:o=!0,skipFinished:r=!1,allFields:a=!1,nameMatch:s,userMatch:l,workspaceMatch:d,poolMatch:u,page:h,limit:f,statuses:g,fields:p,jobIDs:b}=e,_={all_users:o,verbose:!0,skip_finished:r};void 0!==s&&(_.name_match=s),void 0!==l&&(_.user_match=l),void 0!==d&&(_.workspace_match=d),void 0!==u&&(_.pool_match=u),void 0!==h&&(_.page=h),void 0!==f&&(_.limit=f),void 0!==g&&g.length>0&&(_.statuses=g),void 0!==b&&b.length>0&&(_.job_ids=b),a||(p&&p.length>0?_.fields=p:_.fields=i);let m=await c.x.post("/jobs/queue/v2",_);if(!m.ok){let e="Failed to get managed jobs with status ".concat(m.status);throw Error(e)}let w=m.headers.get("X-Skypilot-Request-ID");if(!w)throw Error("No request ID received from server for managed jobs");let y=await c.x.get("/api/get?request_id=".concat(w));if(500===y.status)try{let e=await y.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{jobs:[],total:0,controllerStopped:!0}}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}if(!y.ok){let e="API request to get managed jobs result failed with status ".concat(y.status);throw Error(e)}let j=await y.json(),v=j.return_value?JSON.parse(j.return_value):[],k=Array.isArray(v)?v:(null==v?void 0:v.jobs)||[],S=Array.isArray(v)?k.length:null!==(t=null==v?void 0:v.total)&&void 0!==t?t:k.length,C=(null==v?void 0:v.total_no_filter)||S,E=(null==v?void 0:v.status_counts)||{};return{jobs:k.map(e=>{var t;let o=0;e.end_at&&e.submitted_at?o=e.end_at-e.submitted_at:e.submitted_at&&(o=Date.now()/1e3-e.submitted_at);let r=[];e.submitted_at&&r.push({type:"PENDING",timestamp:e.submitted_at}),e.start_at&&r.push({type:"RUNNING",timestamp:e.start_at}),e.end_at&&r.push({type:e.status,timestamp:e.end_at});let a="",n="",s="",c="",i="";try{if(a=e.cloud||"",s=e.cluster_resources,n=e.region||"",a&&(c=a,n&&(c+=" (".concat(n,")"))),i=c,e.accelerators){let t=Object.entries(e.accelerators).map(e=>{let[t,o]=e;return"".concat(o,"x").concat(t)}).join(", ");t&&(i+=" (".concat(t,")"))}}catch(t){s=e.cluster_resources}return{id:e.job_id,task_job_id:e._job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:o,workspace:e.workspace,status:e.status,requested_resources:e.resources,resources_str:s,resources_str_full:e.cluster_resources_full||s,cloud:a,region:e.region,infra:c,full_infra:i,recoveries:e.recovery_count,details:e.details||e.failure_reason,user:e.user_name,user_hash:e.user_hash,submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,events:r,dag_yaml:e.user_yaml,entrypoint:e.entrypoint,git_commit:(null===(t=e.metadata)||void 0===t?void 0:t.git_commit)||"-",pool:e.pool,pool_hash:e.pool_hash,current_cluster_name:e.current_cluster_name,job_id_on_pool_cluster:e.job_id_on_pool_cluster,accelerators:e.accelerators}}),total:S,totalNoFilter:C,controllerStopped:!1,statusCounts:E}}catch(e){throw console.error("Error fetching managed job data:",e),e}}async function d(e){let{allUsers:t=!0,nameMatch:o,userMatch:r,workspaceMatch:a,poolMatch:n,page:s=1,limit:c=10,jobIDs:i,fields:d,allFields:u=!1,useClientPagination:h=!0}=e||{};try{if(!h)return await l(e);let f=await l({allUsers:t,nameMatch:o,userMatch:r,workspaceMatch:a,poolMatch:n,jobIDs:i,fields:d,allFields:u});if(f.controllerStopped||!f.jobs)return f;let g=f.jobs,p=g.length,b=(s-1)*c;return{jobs:g.slice(b,b+c),total:p,controllerStopped:!1}}catch(e){throw console.error("Error fetching managed job data with client pagination:",e),e}}async function u(){try{let e=await c.x.post("/jobs/pool_status",{pool_names:null});if(!e.ok){let t="Initial API request to get pool status failed with status ".concat(e.status);throw Error(t)}let t=e.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("No request ID received from server for getting pool status");let o=await c.x.get("/api/get?request_id=".concat(t));if(500===o.status)try{let e=await o.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{pools:[],controllerStopped:!0}}catch(e){console.error("Failed to parse error JSON:",e)}}catch(e){console.error("Failed to parse response JSON:",e)}if(!o.ok){let e="API request to get pool status result failed with status ".concat(o.status);throw Error(e)}let r=await o.json(),a=r.return_value?JSON.parse(r.return_value):[],i={jobs:[]};try{let e=await s.default.get(l,[{allUsers:!0,skipFinished:!0,fields:["pool","status"]}]);e.controllerStopped||(i=e)}catch(e){console.warn("Failed to fetch jobs for pool job counts:",e)}let d={},u=["SUCCEEDED","FAILED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER","CANCELLED"];return i.jobs&&Array.isArray(i.jobs)&&i.jobs.forEach(e=>{let t=e.pool,o=e.status;t&&!u.includes(o)&&(d[t]||(d[t]={}),d[t][o]=(d[t][o]||0)+1)}),{pools:a.map(e=>({...e,jobCounts:d[e.name]||{}})),controllerStopped:!1}}catch(e){throw console.error("Error fetching pools:",e),e}}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[o,a]=(0,r.useState)(null),[n,c]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async function(){if(e)try{var t;c(!0);let o=await s.default.get(l,[{allUsers:!0,allFields:!0,jobIDs:[e]}]),r=null==o?void 0:null===(t=o.jobs)||void 0===t?void 0:t.find(t=>String(t.id)===String(e));r?a({jobs:[r],controllerStopped:o.controllerStopped||!1}):a({jobs:[],controllerStopped:o.controllerStopped||!1})}catch(e){console.error("Error fetching single managed job data:",e),a({jobs:[],controllerStopped:!1})}finally{c(!1)}})()},[e,t]),{jobData:o,loading:n}}async function f(e){let t,{jobId:o,controller:r=!1,signal:s,onNewLog:c}=e,i=Date.now(),l=new Promise(e=>{let o=()=>{let r=Date.now()-i;r>=3e4?e({timeout:!0}):t=setTimeout(o,3e4-r)};t=setTimeout(o,3e4)}),d=window.location.origin,u="".concat(d).concat(n.f4),h=(async()=>{try{let e=(await fetch("".concat(u,"/jobs/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({controller:r,follow:!1,job_id:o,tail:1e4}),...s?{signal:s}:{}})).body.getReader();try{for(;;){let{done:t,value:o}=await e.read();if(t)break;i=Date.now();let r=new TextDecoder().decode(o);c(r)}}finally{if(!s||!s.aborted)try{e.cancel()}catch(e){"AbortError"!==e.name&&console.warn("Error canceling reader:",e)}t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),f=await Promise.race([h,l]);if(t&&clearTimeout(t),f.timeout){(0,a.C)("Log request for job ".concat(o," timed out after ").concat(30,"s of inactivity"),"warning");return}}async function g(e,t,o){let r="",s="",c="",i={};if("restartcontroller"===e)r="Restarting",s="restarted",c="jobs/queue/v2",i={all_users:!0,refresh:!0,skip_finished:!0,fields:["status"]},t="controller";else throw Error("Invalid action: ".concat(e));(0,a.C)("".concat(r," job ").concat(t,"..."),"info");let l=window.location.origin,d="".concat(l).concat(n.f4);try{try{let e=await fetch("".concat(d,"/").concat(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!e.ok){console.error("Initial API request ".concat(c," failed with status ").concat(e.status)),(0,a.C)("".concat(r," job ").concat(t," failed with status ").concat(e.status,"."),"error");return}let l=e.headers.get("X-Skypilot-Request-ID");if(!l){console.error("No request ID received from server for ".concat(c)),(0,a.C)("".concat(r," job ").concat(t," failed with no request ID."),"error");return}let u=await fetch("".concat(d,"/api/get?request_id=").concat(l));if(200===u.status)(0,a.C)("Job ".concat(t," ").concat(s," successfully."),"success");else if(500===u.status)try{let e=await u.json();if(e.detail&&e.detail.error)try{let s=JSON.parse(e.detail.error);s.type&&s.type===n.Bo?(0,a.C)("".concat(r," job ").concat(t," is not supported!"),"error",1e4):s.type&&s.type===n.mF?(0,a.C)("Cluster ".concat(o," does not exist."),"error"):s.type&&s.type===n.iW?(0,a.C)("Cluster ".concat(o," is not up."),"error"):(0,a.C)("".concat(r," job ").concat(t," failed: ").concat(s.type),"error")}catch(o){(0,a.C)("".concat(r," job ").concat(t," failed: ").concat(e.detail.error),"error")}else(0,a.C)("".concat(r," job ").concat(t," failed with no details."),"error")}catch(e){(0,a.C)("".concat(r," job ").concat(t," failed with parse error."),"error")}else(0,a.C)("".concat(r," job ").concat(t," failed with status ").concat(u.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,a.C)("Network error ".concat(r," job ").concat(t,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,a.C)("Critical error ".concat(r," job ").concat(t,": ").concat(e.message),"error")}}async function p(e){let{jobId:t=null,name:o=null,controller:r=!1}=e;try{let e=await c.x.fetch("/jobs/download_logs",{job_id:t,name:o,controller:r,refresh:!1}),s=Object.values(e||{});if(!s.length){(0,a.C)("No logs found to download.","warning");return}let i=window.location.origin,l="".concat(i).concat(n.f4,"/download"),d=await fetch("".concat(l,"?relative=items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder_paths:s})});if(!d.ok){let e=await d.text();throw Error("Download failed: ".concat(d.status," ").concat(e))}let u=await d.blob(),h=window.URL.createObjectURL(u),f=document.createElement("a"),g=new Date().toISOString().replace(/[:.]/g,"-"),p=t?"job-".concat(t):o?"job-".concat(o):"job";f.href=h,f.download="managed-".concat(p,"-").concat(r?"controller-logs":"logs","-").concat(g,".zip"),document.body.appendChild(f),f.click(),f.remove(),window.URL.revokeObjectURL(h)}catch(e){console.error("Error downloading managed job logs:",e),(0,a.C)("Error downloading managed job logs: ".concat(e.message),"error")}}},15821:function(e,t,o){o.d(t,{C:function(){return r}});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=document.getElementById("toast-container");r||((r=document.createElement("div")).id="toast-container",r.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(r));let a=document.createElement("div");switch(a.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":a.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":a.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":a.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:a.className+=" bg-blue-100 border-blue-500 text-blue-800"}return a.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),r.appendChild(a),a.querySelector("button").addEventListener("click",()=>{r.removeChild(a)}),setTimeout(()=>{r.contains(a)&&r.removeChild(a)},o),a}},6378:function(e,t,o){o.r(t),o.d(t,{DashboardCache:function(){return n},dashboardCache:function(){return s}});let r=o(51214).ej.DEFAULT_TTL;function a(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o);return t>>>0}class n{setPreloader(e){this.preloader=e}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.ttl||r,n=!1!==o.refreshOnAccess,s=this._generateKey(e,t),c=e.name||"anonymous",i=this.cache.get(s),l=Date.now();if(i&&l-i.lastUpdated<a){let o=Math.round((l-i.lastUpdated)/1e3);if(this._debug("Cache HIT for ".concat(c," (age: ").concat(o,"s, TTL: ").concat(Math.round(a/1e3),"s)")),n&&(this.cache.set(s,{data:i.data,lastUpdated:l}),this._debug("Cache TTL refreshed for ".concat(c))),!this.backgroundJobs.has(s)){var d;(null===(d=this.preloader)||void 0===d?void 0:d.wasRecentlyPreloaded(e,t))?this._debug("Skipping background refresh for ".concat(c," - recently preloaded")):this._refreshInBackground(e,t,s)}return i.data}if(this.pendingRequests.has(s))return this._debug("Request deduplication: Waiting for pending request for ".concat(c)),this.pendingRequests.get(s);let u=(async()=>{try{let o=await e(...t);if(o&&o.__skipCache){if(this._debug("Skip caching for ".concat(c," due to __skipCache flag on result")),i)return i.data;return o}return this.cache.set(s,{data:o,lastUpdated:Date.now()}),o}catch(e){if(i)return console.warn("Failed to fetch fresh data for ".concat(s,"/").concat(c,", returning stale data:"),e),i.data;throw e}finally{this.pendingRequests.delete(s)}})();return this.pendingRequests.set(s,u),u}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=this._generateKey(e,t);this.cache.delete(o),this.backgroundJobs.delete(o),this.pendingRequests.delete(o)}invalidateFunction(e){let t=a(e.toString()),o=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&o.push(e);o.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e),this.pendingRequests.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear(),this.pendingRequests.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,pendingRequests:this.pendingRequests.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[o,r]of this.cache.entries()){let a=e-r.lastUpdated;t.push({key:o,age:Math.round(a/1e3),lastUpdated:new Date(r.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(o),hasPendingRequest:this.pendingRequests.has(o)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,pendingRequests:this.pendingRequests.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,o=Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];this.debugMode&&console.log("[DashboardCache] ".concat(e),...o)}_refreshInBackground(e,t,o){this.backgroundJobs.set(o,!0),e(...t).then(e=>{e&&e.__skipCache||this.cache.set(o,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(o,":"),e)}).finally(()=>{this.backgroundJobs.delete(o)})}_generateKey(e,t){let o=a(e.toString()),r=t.length>0?JSON.stringify(t):"";return"".concat(o,"_").concat(r)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.pendingRequests=new Map,this.debugMode=!1,this.preloader=null}}let s=new n;t.default=s}}]);
@@ -0,0 +1,6 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9025],{99333:function(e,n,r){r.d(n,{Z:function(){return t}});/**
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 t=(0,r(60998).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},54042:function(e,n,r){r.r(n),r.d(n,{Config:function(){return p}});var t=r(85893),l=r(67294),s=r(11163),a=r(30803),i=r(37673),o=r(17324),c=r(1812),u=r(55739),d=r(99333),m=r(1272),f=r(36989),x=r(47145);function h(){let[e,n]=(0,l.useState)(null),[r,s]=(0,l.useState)(null),a=async()=>{let e=await x.x.get("/api/health");if(!e.ok){console.error("API request /api/health failed with status ".concat(e.status));return}let r=await e.json();r.version&&n(r.version),r.commit&&s(r.commit)};return((0,l.useEffect)(()=>{a()},[]),e)?(0,t.jsx)(f.Md,{content:r?"Commit: ".concat(r):"Commit information not available",className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"text-sm text-gray-500 cursor-help border-b border-dotted border-gray-400 inline-block",children:["Version: ",e]})}):null}var v=r(17853),g=r(83454);function p(){let e=(0,s.useRouter)(),[n,r]=(0,l.useState)(""),[f,p]=(0,l.useState)(!0),[j,b]=(0,l.useState)(!1),[y,w]=(0,l.useState)(null),[N,k]=(0,l.useState)(!1),[L,A]=(0,l.useState)(!1),C=(0,l.useRef)(null);(0,l.useEffect)(()=>{E(),(async()=>{A(await (0,v.TO)())})()},[]),(0,l.useEffect)(()=>()=>{C.current&&clearTimeout(C.current)},[]);let E=async()=>{p(!0),w(null);try{let e=await (0,o.iE)();0===Object.keys(e).length?r(""):r(m.ZP.dump(e,{indent:2}))}catch(e){console.error("Error loading config:",e),w(e)}finally{p(!1)}},S=async()=>{b(!0),w(null),C.current&&(clearTimeout(C.current),C.current=null);try{let e=await x.x.get("/users/role");if(!e.ok){let n=await e.json();throw Error(n.detail||"Failed to get user role")}let r=await e.json(),t=r.role;if("admin"!=t){w(Error("".concat(r.name," is logged in as non-admin and cannot edit config"))),b(!1);return}let l=m.ZP.load(n);if(null==l&&(l={}),"object"!=typeof l||Array.isArray(l)){let e="Invalid config structure: Configuration must be a mapping (key-value pairs) in YAML format.";Array.isArray(l),e="Invalid config structure: Configuration must be a mapping (key-value pairs) in YAML format.",w(Error(e)),b(!1);return}await (0,o.rF)(l),k(!0),C.current=setTimeout(()=>{k(!1),C.current=null},5e3)}catch(e){console.error("Error saving config:",e),w(e)}finally{b(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,t.jsx)("div",{className:"text-base flex items-center",children:(0,t.jsx)("span",{className:"text-sky-blue",children:"SkyPilot API Server"})}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("div",{className:"text-sm flex items-center",children:(f||j)&&(0,t.jsxs)("div",{className:"flex items-center mr-4",children:[(0,t.jsx)(u.Z,{size:15,className:"mt-0"}),(0,t.jsx)("span",{className:"ml-2 text-gray-500",children:j?"Applying...":"Loading..."})]})}),L&&(0,t.jsxs)("button",{onClick:()=>{let e=(0,v.ki)(),n=g.env.SKYPILOT_RELEASE_NAME||"skypilot";window.open("".concat(e,"/d/skypilot-apiserver-overview/skypilot-api-server?orgId=1&from=now-1h&to=now&timezone=browser&var-app=").concat("".concat(n,"-api")),"_blank")},className:"inline-flex items-center px-3 py-2 text-sm font-medium text-white bg-sky-blue-bright border border-transparent rounded-md shadow-sm hover:bg-sky-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-blue mr-4",children:[(0,t.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"View API Server Metrics"]}),(0,t.jsx)(h,{})]})]}),(0,t.jsxs)(i.Zb,{className:"w-full",children:[(0,t.jsx)(i.Ol,{children:(0,t.jsx)(i.ll,{className:"text-base font-normal flex items-center justify-between",children:(0,t.jsx)("span",{children:"Edit SkyPilot API Server Configuration"})})}),(0,t.jsxs)(i.aY,{className:"space-y-4",children:[(0,t.jsxs)("p",{className:"text-sm text-gray-600 mb-3",children:["Refer to the"," ",(0,t.jsx)("a",{href:"https://docs.skypilot.co/en/latest/reference/config.html",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"SkyPilot Docs"})," ","for details. The configuration should be in YAML format."]}),N&&(0,t.jsx)("div",{className:"bg-green-50 border border-green-200 rounded p-4 mb-6",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-green-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}),(0,t.jsx)("div",{className:"ml-3",children:(0,t.jsx)("p",{className:"text-sm font-medium text-green-800",children:"Configuration saved successfully!"})})]}),(0,t.jsx)("div",{className:"ml-auto pl-3",children:(0,t.jsx)("div",{className:"-mx-1.5 -my-1.5",children:(0,t.jsxs)("button",{type:"button",onClick:()=>{k(!1),C.current&&(clearTimeout(C.current),C.current=null)},className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50",children:[(0,t.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,t.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})})]})}),y&&(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(c.X,{error:y,title:"Failed to apply new configuration",onDismiss:()=>w(null)})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)("textarea",{value:n,onChange:e=>r(e.target.value),className:"w-full h-96 p-3 border border-gray-300 rounded font-mono text-sm resize-vertical focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:f?"Loading configuration...":"# Enter SkyPilot configuration in YAML format\n# Example:\n# kubernetes:\n# allowed_contexts: [default, my-context]",disabled:f||j})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-3 pt-3",children:[(0,t.jsx)(a.z,{variant:"outline",onClick:()=>{e.push("/workspaces")},disabled:j,children:"Cancel"}),(0,t.jsx)(a.z,{onClick:S,disabled:f||j,className:"inline-flex items-center bg-sky-600 hover:bg-sky-700 text-white",children:j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{size:16,className:"mr-2"}),"Applying..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{className:"w-4 h-4 mr-1.5"}),"Apply"]})})]})]})]})]})}},1812:function(e,n,r){r.d(n,{X:function(){return a}});var t=r(85893),l=r(67294);let s=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let n=e.message;return n.includes("failed:")&&(n=n.split("failed:")[1].trim()),n},a=e=>{let{error:n,title:r="Error",onDismiss:a}=e,[i,o]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{n&&o(!1)},[n]),!n||i)return null;let c="string"==typeof n?n:s(n);return(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,t.jsx)("div",{className:"ml-3",children:(0,t.jsxs)("div",{className:"text-sm text-red-800",children:[(0,t.jsxs)("strong",{children:[r,":"]})," ",c]})})]}),(0,t.jsx)("button",{onClick:()=>{o(!0),a&&a()},className:"flex-shrink-0 ml-4 text-red-400 hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-red-50 rounded","aria-label":"Dismiss error",children:(0,t.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})}},17853:function(e,n,r){r.d(n,{TO:function(){return s},ki:function(){return a}});let t=null,l=null,s=async()=>null!==t?t:l||(l=(async()=>{try{let e="".concat(window.location.origin,"/grafana"),n=await fetch("".concat(e,"/api/health"),{method:"GET",credentials:"include",headers:{Accept:"application/json"},signal:AbortSignal.timeout(5e3)});return 200==n.status}catch(e){return console.debug("Grafana availability check failed:",e),t=!1,!1}finally{l=null}})()),a=()=>"".concat(window.location.origin,"/grafana")},12003:function(e,n,r){r.d(n,{j:function(){return a}});var t=r(90512);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,s=t.W,a=(e,n)=>r=>{var t;if((null==n?void 0:n.variants)==null)return s(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:a,defaultVariants:i}=n,o=Object.keys(a).map(e=>{let n=null==r?void 0:r[e],t=null==i?void 0:i[e];if(null===n)return null;let s=l(n)||l(t);return a[e][s]}),c=r&&Object.entries(r).reduce((e,n)=>{let[r,t]=n;return void 0===t||(e[r]=t),e},{});return s(e,o,null==n?void 0:null===(t=n.compoundVariants)||void 0===t?void 0:t.reduce((e,n)=>{let{class:r,className:t,...l}=n;return Object.entries(l).every(e=>{let[n,r]=e;return Array.isArray(r)?r.includes({...i,...c}[n]):({...i,...c})[n]===r})?[...e,r,t]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9353],{9353:function(e,t,r){r.r(t),r.d(t,{Layout:function(){return v}});var s=r(85893),n=r(67294),a=r(66235),l=r(23001),o=r(43767),i=r(33067),c=r(26409),d=r(94849),u=r(6556);function x(){let{startTour:e}=(0,d.r)(),{shouldShowTourPrompt:t,markTourCompleted:r}=(0,u.n)(),[a,l]=(0,n.useState)(!1),[x,m]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(m(!0),t){let e=setTimeout(()=>{l(!0)},2e3);return()=>clearTimeout(e)}},[t]);let h=()=>{l(!1),r()};return x&&t&&a?(0,s.jsx)("div",{className:"fixed top-20 right-6 z-50 max-w-sm",children:(0,s.jsxs)("div",{className:"bg-white rounded-md shadow-lg border border-gray-200 p-4 transform transition-all duration-300 ease-out",children:[(0,s.jsx)("button",{onClick:h,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full p-1 transition-all duration-150","aria-label":"Dismiss notification",children:(0,s.jsx)(o.Z,{className:"w-3 h-3"})}),(0,s.jsxs)("div",{className:"pr-6",children:[(0,s.jsxs)("div",{className:"flex items-start mb-3",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-7 h-7 bg-blue-50 rounded-full mr-3 mt-0.5",children:(0,s.jsx)(i.Z,{className:"w-3.5 h-3.5 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:"Welcome to SkyPilot!"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:"New to the dashboard? Take a quick guided tour to discover all the features."})]})]}),(0,s.jsxs)("div",{className:"flex space-x-2 ml-10",children:[(0,s.jsxs)("button",{onClick:()=>{l(!1),e()},className:"flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors duration-150",children:[(0,s.jsx)(c.Z,{className:"w-3 h-3 mr-1.5"}),"Start Tour"]}),(0,s.jsx)("button",{onClick:h,className:"px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded transition-colors duration-150",children:"Maybe Later"})]})]})]})}):null}var m=r(19185);function h(e){let{children:t,text:r}=e,[a,l]=(0,n.useState)(!1);return(0,s.jsxs)("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,a&&(0,s.jsx)("div",{className:"absolute top-0 right-0 transform -translate-y-full -translate-x-2 mb-2 px-2 py-1 bg-gray-700 text-white text-xs rounded-md shadow-lg whitespace-nowrap z-50",children:r})]})}function f(){let{startTour:e}=(0,d.r)();return(0,s.jsx)(h,{text:"Start a tour",children:(0,s.jsx)("button",{onClick:e,className:"fixed bottom-4 right-4 bg-transparent text-gray-400 p-2 rounded-full hover:text-gray-500 focus:outline-none","aria-label":"Start Tour",children:(0,s.jsx)(m.Z,{className:"h-5 w-5"})})})}let p=(0,n.createContext)(void 0);function g(e){let{children:t}=e,[r,a]=(0,n.useState)(!1),l=(0,n.useCallback)(()=>{a(!0)},[]),o=(0,n.useCallback)(()=>{a(!1)},[]);return(0,s.jsx)(p.Provider,{value:{isUpgrading:r,reportUpgrade:l,clearUpgrade:o},children:t})}function b(){let e=(0,n.useContext)(p);if(!e)throw Error("useUpgradeDetection must be used within UpgradeDetectionProvider");return e}function j(){let{isUpgrading:e}=b();return e?(0,s.jsx)("div",{className:"fixed top-[56px] left-0 right-0 z-40 bg-yellow-50 border-b border-yellow-200",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto py-3 px-4 sm:px-6 lg:px-8",children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 text-yellow-600 mr-2 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,s.jsx)("span",{className:"text-sm font-medium text-yellow-800",children:"Your SkyPilot deployment is undergoing upgrades. Refresh in a few moments."})]})})})}):null}function y(e){let{children:t,highlighted:r}=e;(0,l.X)();let{reportUpgrade:o,clearUpgrade:i,isUpgrading:c}=b();return(0,n.useEffect)(()=>{window.__upgradeInterceptorInstalled||(window.fetch=function(e,t){let r=window.fetch;return async function(s,n){let a;try{a=await r(s,n)}catch(e){throw e}try{if(function(e){let t;try{t="string"==typeof e?e:e.url}catch(e){return!1}return["/_next/static/","/_next/image",".js",".mjs",".css",".woff",".woff2",".ttf",".eot",".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].some(e=>t.includes(e))}(s))return a;if(503===a.status){let t=a.clone();try{let r=await t.json();r.detail&&(r.detail.includes("shutting down")||r.detail.includes("try again later"))&&e()}catch(e){console.debug("Non-JSON 503 response, ignoring.")}}else(a.ok||a.status>=200&&a.status<300)&&t()}catch(e){console.error("Error in upgrade detection interceptor:",e)}return a}}(o,i),window.__upgradeInterceptorInstalled=!0)},[o,i]),(0,s.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 z-50 shadow-sm",children:(0,s.jsx)(a.Du,{})}),(0,s.jsx)(j,{}),(0,s.jsx)("div",{className:"transition-all duration-200 ease-in-out min-h-screen",style:{paddingTop:c?"112px":"56px"},children:(0,s.jsx)("main",{className:"p-6",children:t})}),(0,s.jsx)(x,{}),(0,s.jsx)(f,{})]})}function v(e){return(0,s.jsx)(g,{children:(0,s.jsx)(a.Hn,{children:(0,s.jsx)(y,{...e})})})}},66235:function(e,t,r){r.d(t,{Ap:function(){return b},Du:function(){return j},Hn:function(){return g}});var s=r(85893),n=r(67294),a=r(25675),l=r.n(a),o=r(11163),i=r(41664),c=r.n(i),d=r(53850),u=r(40355),x=r(6021),m=r(93225),h=r(36989),f=r(23001);let p=(0,n.createContext)(null);function g(e){let{children:t}=e,[r,a]=(0,n.useState)(!0),[l,o]=(0,n.useState)(!1),[i,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(null),x=window.location.origin,h="".concat(x).concat(m.f4);return(0,n.useEffect)(()=>{fetch("".concat(h,"/api/health")).then(e=>e.json()).then(e=>{e.user&&e.user.name&&(c(e.user.name),(async()=>{try{let e=await fetch("".concat(h,"/users/role"));if(e.ok){let t=await e.json();t.role&&u(t.role)}}catch(e){console.log("Could not fetch user role:",e)}})())}).catch(e=>{console.error("Error fetching user data:",e)})},[h]),(0,s.jsx)(p.Provider,{value:{isSidebarOpen:r,toggleSidebar:()=>{a(e=>!e)},isMobileSidebarOpen:l,toggleMobileSidebar:()=>{o(e=>!e)},userEmail:i,userRole:d},children:t})}function b(){let e=(0,n.useContext)(p);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e}function j(){let e,t;let r=(0,o.useRouter)(),a=(0,f.X)(),{userEmail:i,userRole:p,isMobileSidebarOpen:g,toggleMobileSidebar:j}=b(),[y,v]=(0,n.useState)(!1),N=(0,n.useRef)(null),w=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&v(!1),w.current&&!w.current.contains(e.target)&&!e.target.closest(".mobile-menu-button")&&g&&j()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[N,g,j]);let k=e=>"/workspaces"===e?r.pathname.startsWith("/workspaces")||r.pathname.startsWith("/workspace"):r.pathname.startsWith(e),C=e=>{let t=k(e);return"inline-flex items-center border-b-2 ".concat(t?"border-transparent text-blue-600":"border-transparent hover:text-blue-600"," ").concat(a?"px-2 py-1":"px-1 pt-1 space-x-2")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.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,s.jsxs)("div",{className:"flex items-center justify-between h-full",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-4 mr-4 md:mr-6",children:[a&&(0,s.jsx)("button",{onClick:j,className:"mobile-menu-button p-2 rounded-md text-gray-600 hover:text-blue-600 hover:bg-gray-100 transition-colors","aria-label":"Toggle mobile menu",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:g?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})}),(0,s.jsx)(c(),{href:"/",className:"flex items-center px-1 pt-1 h-full",prefetch:!1,children:(0,s.jsx)("div",{className:"h-20 w-20 flex items-center justify-center",children:(0,s.jsx)(l(),{src:"".concat(m.GW,"/skypilot.svg"),alt:"SkyPilot Logo",width:80,height:80,priority:!0,className:"w-full h-full object-contain"})})})]}),!a&&(0,s.jsxs)("div",{className:"flex items-center space-x-2 md:space-x-4 mr-6",children:[(0,s.jsxs)(c(),{href:"/clusters",className:C("/clusters"),prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Clusters"})]}),(0,s.jsxs)(c(),{href:"/jobs",className:C("/jobs"),prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Jobs"})]}),(0,s.jsxs)(c(),{href:"/volumes",className:C("/volumes"),prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Volumes"})]}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"}),(0,s.jsxs)(c(),{href:"/infra",className:C("/infra"),prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Infra"})]}),(0,s.jsxs)(c(),{href:"/workspaces",className:C("/workspaces"),prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Workspaces"})]}),(0,s.jsxs)(c(),{href:"/users",className:C("/users"),prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Users"})]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-1 ml-auto",children:[!a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.WH,{content:"Documentation",className:"text-sm text-muted-foreground",children:(0,s.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:[(0,s.jsx)("span",{className:"mr-1",children:"Docs"}),(0,s.jsx)(d.h0,{className:"w-3.5 h-3.5"})]})}),(0,s.jsx)(h.WH,{content:"GitHub Repository",className:"text-sm text-muted-foreground",children:(0,s.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,s.jsx)(d.fy,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Join Slack",className:"text-sm text-muted-foreground",children:(0,s.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,s.jsx)(d.mU,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Leave Feedback",className:"text-sm text-muted-foreground",children:(0,s.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,s.jsx)(d.aD,{className:"w-5 h-5"})})}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6"}),(0,s.jsx)(h.WH,{content:"Configuration",className:"text-sm text-muted-foreground",children:(0,s.jsx)(c(),{href:"/config",className:"inline-flex items-center justify-center p-2 rounded-full transition-colors duration-150 cursor-pointer ".concat(k("/config")?"text-blue-600 hover:bg-gray-100":"text-gray-600 hover:bg-gray-100"),title:"Configuration",prefetch:!1,children:(0,s.jsx)(u.Z,{className:"w-5 h-5"})})})]}),i&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsx)("button",{onClick:()=>v(!y),className:"inline-flex items-center justify-center rounded-full transition-colors duration-150 cursor-pointer hover:ring-2 hover:ring-blue-200",title:"User Profile",children:(0,s.jsx)("div",{className:"".concat(a?"w-6 h-6 text-xs":"w-7 h-7 text-sm"," bg-blue-600 text-white rounded-full flex items-center justify-center font-medium hover:bg-blue-700 transition-colors"),children:i?i.includes("@")?i.split("@")[0].charAt(0).toUpperCase():i.charAt(0).toUpperCase():"?"})}),y&&(0,s.jsxs)("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-50 border border-gray-200",children:[(e=i,t=null,i&&i.includes("@")&&(e=i.split("@")[0],t=i),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"px-4 pt-2 pb-1 text-sm font-medium text-gray-900",children:e}),t&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-1 text-xs text-gray-500",children:t}),p&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-2 text-xs",children:"admin"===p?(0,s.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,s.jsx)(d.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,s.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,s.jsx)(x.Z,{className:"w-3 h-3 mr-1"}),"User"]})})]})),(0,s.jsx)("div",{className:"border-t border-gray-200 mx-1 my-1"}),(0,s.jsx)(c(),{href:"/users",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-blue-600",onClick:()=>v(!1),prefetch:!1,children:"See all users"})]})]})]})]})}),a&&(0,s.jsxs)(s.Fragment,{children:[g&&(0,s.jsx)("div",{className:"fixed top-14 left-0 right-0 bottom-0 bg-black bg-opacity-50 z-40",onClick:j}),(0,s.jsx)("div",{ref:w,className:"fixed top-14 left-0 h-[calc(100vh-56px)] w-64 bg-white border-r border-gray-200 shadow-lg z-50 transform transition-transform duration-300 ease-in-out ".concat(g?"translate-x-0":"-translate-x-full"),children:(0,s.jsx)("nav",{className:"flex-1 overflow-y-auto py-6",children:(0,s.jsxs)("div",{className:"px-4 space-y-1",children:[(0,s.jsxs)(c(),{href:"/clusters",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/clusters")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-5 h-5 mr-3"}),"Clusters"]}),(0,s.jsxs)(c(),{href:"/jobs",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/jobs")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-5 h-5 mr-3"}),"Jobs"]}),(0,s.jsxs)(c(),{href:"/volumes",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/volumes")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-5 h-5 mr-3"}),"Volumes"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)(c(),{href:"/infra",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/infra")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-5 h-5 mr-3"}),"Infra"]}),(0,s.jsxs)(c(),{href:"/workspaces",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/workspaces")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-5 h-5 mr-3"}),"Workspaces"]}),(0,s.jsxs)(c(),{href:"/users",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/users")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-5 h-5 mr-3"}),"Users"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:j,children:[(0,s.jsx)(d.h0,{className:"w-5 h-5 mr-3"}),"Documentation"]}),(0,s.jsxs)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:j,children:[(0,s.jsx)(d.fy,{className:"w-5 h-5 mr-3"}),"GitHub"]}),(0,s.jsxs)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:j,children:[(0,s.jsx)(d.mU,{className:"w-5 h-5 mr-3"}),"Slack"]}),(0,s.jsxs)(c(),{href:"/config",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/config")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(u.Z,{className:"w-5 h-5 mr-3"}),"Configuration"]})]})})})]})]})}},23001:function(e,t,r){r.d(t,{X:function(){return n}});var s=r(67294);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=()=>{r(window.innerWidth<e)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]),t}}}]);