skypilot-nightly 1.0.0.dev20250531__py3-none-any.whl → 1.0.0.dev20250603__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. sky/__init__.py +2 -2
  2. sky/client/sdk.py +3 -4
  3. sky/clouds/gcp.py +3 -6
  4. sky/dashboard/out/404.html +1 -1
  5. sky/dashboard/out/_next/static/chunks/236-fef38aa6e5639300.js +6 -0
  6. sky/dashboard/out/_next/static/chunks/37-947904ccc5687bac.js +6 -0
  7. sky/dashboard/out/_next/static/chunks/682-2be9b0f169727f2f.js +6 -0
  8. sky/dashboard/out/_next/static/chunks/856-f1b1f7f47edde2e8.js +1 -0
  9. sky/dashboard/out/_next/static/chunks/969-d7b6fb7f602bfcb3.js +1 -0
  10. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-158b70da336d8607.js +6 -0
  11. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-62c9982dc3675725.js +6 -0
  12. sky/dashboard/out/_next/static/chunks/pages/{clusters-f37ff20f0af29aae.js → clusters-5549a350f97d7ef3.js} +1 -1
  13. sky/dashboard/out/_next/static/chunks/pages/config-35383adcb0edb5e2.js +6 -0
  14. sky/dashboard/out/_next/static/chunks/pages/infra/{[context]-342bc15bb78ab2e5.js → [context]-b68ddeed712d45b5.js} +1 -1
  15. sky/dashboard/out/_next/static/chunks/pages/{infra-7b4b8e7fa9fa0827.js → infra-13b117a831702196.js} +1 -1
  16. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-a62a3c65dc9bc57c.js +11 -0
  17. sky/dashboard/out/_next/static/chunks/pages/{jobs-78a6c5ba3e24c0cf.js → jobs-a76b2700eca236f7.js} +1 -1
  18. sky/dashboard/out/_next/static/chunks/pages/{users-89f9212b81d8897e.js → users-07b523ccb19317ad.js} +1 -1
  19. sky/dashboard/out/_next/static/chunks/pages/workspace/{new-198b6e00d7d724c5.js → new-c7516f2b4c3727c0.js} +1 -1
  20. sky/dashboard/out/_next/static/chunks/pages/workspaces/{[name]-2ce792183b03c341.js → [name]-7799de9e691e35d8.js} +1 -1
  21. sky/dashboard/out/_next/static/chunks/pages/workspaces-f54921ec9eb20965.js +1 -0
  22. sky/dashboard/out/_next/static/css/63d3995d8b528eb1.css +3 -0
  23. sky/dashboard/out/_next/static/zTAFq_Iv6_yxQj3fXvJWR/_buildManifest.js +1 -0
  24. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  25. sky/dashboard/out/clusters/[cluster].html +1 -1
  26. sky/dashboard/out/clusters.html +1 -1
  27. sky/dashboard/out/config.html +1 -1
  28. sky/dashboard/out/index.html +1 -1
  29. sky/dashboard/out/infra/[context].html +1 -1
  30. sky/dashboard/out/infra.html +1 -1
  31. sky/dashboard/out/jobs/[job].html +1 -1
  32. sky/dashboard/out/jobs.html +1 -1
  33. sky/dashboard/out/users.html +1 -1
  34. sky/dashboard/out/workspace/new.html +1 -1
  35. sky/dashboard/out/workspaces/[name].html +1 -1
  36. sky/dashboard/out/workspaces.html +1 -1
  37. sky/execution.py +1 -2
  38. sky/global_user_state.py +1 -1
  39. sky/jobs/utils.py +31 -1
  40. sky/provision/gcp/constants.py +4 -0
  41. sky/resources.py +31 -0
  42. sky/server/common.py +86 -53
  43. sky/server/stream_utils.py +38 -2
  44. sky/utils/controller_utils.py +4 -14
  45. {skypilot_nightly-1.0.0.dev20250531.dist-info → skypilot_nightly-1.0.0.dev20250603.dist-info}/METADATA +1 -1
  46. {skypilot_nightly-1.0.0.dev20250531.dist-info → skypilot_nightly-1.0.0.dev20250603.dist-info}/RECORD +53 -52
  47. sky/dashboard/out/_next/static/bdeJWb62qu7L7FOq1dbXX/_buildManifest.js +0 -1
  48. sky/dashboard/out/_next/static/chunks/236-7458fda7b295f305.js +0 -6
  49. sky/dashboard/out/_next/static/chunks/37-b638675d511d58b4.js +0 -6
  50. sky/dashboard/out/_next/static/chunks/682-5c12535476a21ce3.js +0 -6
  51. sky/dashboard/out/_next/static/chunks/856-ab9627e7e8ac35e8.js +0 -1
  52. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8f270e2c9c59fa1a.js +0 -6
  53. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-25edb867a41b6b20.js +0 -6
  54. sky/dashboard/out/_next/static/chunks/pages/config-3c6a2dabf56e8cd6.js +0 -6
  55. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-c0c1dff3cd463d9e.js +0 -11
  56. sky/dashboard/out/_next/static/chunks/pages/workspaces-17d41826537196e7.js +0 -1
  57. sky/dashboard/out/_next/static/css/2b3ee34e586949a3.css +0 -3
  58. /sky/dashboard/out/_next/static/chunks/{843-786c36624d5ff61f.js → 843-a097338acb89b7d7.js} +0 -0
  59. /sky/dashboard/out/_next/static/chunks/pages/{_app-ad1edd7fe17ea796.js → _app-67925f5e6382e22f.js} +0 -0
  60. /sky/dashboard/out/_next/static/{bdeJWb62qu7L7FOq1dbXX → zTAFq_Iv6_yxQj3fXvJWR}/_ssgManifest.js +0 -0
  61. {skypilot_nightly-1.0.0.dev20250531.dist-info → skypilot_nightly-1.0.0.dev20250603.dist-info}/WHEEL +0 -0
  62. {skypilot_nightly-1.0.0.dev20250531.dist-info → skypilot_nightly-1.0.0.dev20250603.dist-info}/entry_points.txt +0 -0
  63. {skypilot_nightly-1.0.0.dev20250531.dist-info → skypilot_nightly-1.0.0.dev20250603.dist-info}/licenses/LICENSE +0 -0
  64. {skypilot_nightly-1.0.0.dev20250531.dist-info → skypilot_nightly-1.0.0.dev20250603.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- sky/__init__.py,sha256=BbTIIFb0xONzHwJUNzZRk9GIMoM-E3A-SUdgDWdNVow,6428
1
+ sky/__init__.py,sha256=_Bruj00ouVrcQmbO3mNo2FkSGtji1pR6ryCH1jyet-0,6428
2
2
  sky/admin_policy.py,sha256=hPo02f_A32gCqhUueF0QYy1fMSSKqRwYEg_9FxScN_s,3248
3
3
  sky/authentication.py,sha256=jEo4hsbKqnutG-ictNT74vXUfTV85ePKtWY8E5V6Iac,25119
4
4
  sky/check.py,sha256=Tvei7s8uywVhdjtKi1Wchp70IM62xusbS79cJIwhChU,28612
@@ -7,11 +7,11 @@ sky/cloud_stores.py,sha256=Ln5GBpel-sEs7rVx7bBrMkfLwA_bctI05Rox2uoz7Lo,26388
7
7
  sky/core.py,sha256=aR9lIsZUkIMfM8HEAx186woTgxwCwuway6r46pi3XUM,52197
8
8
  sky/dag.py,sha256=8x-VMtjvSi0lYBemCMPLYq5ONljhoABjWzMKjmmdjSo,3369
9
9
  sky/exceptions.py,sha256=MKkGTj6ixRgZ7bSoTS4LkyDTC0XlGcUzO6G4SlmTeHM,17707
10
- sky/execution.py,sha256=YSzpSxoUqLlGZ5v-2pgCt9Jkkcwz12FovOeFs3lC3q8,33109
11
- sky/global_user_state.py,sha256=cVZSWGvERRhdOFGmJSaCqFJUWga2_9w9ZtsEICRV91A,47497
10
+ sky/execution.py,sha256=m-IIZz0g0YKRg-_yMnkWaqvw6ZxVJrF91BsiSDVA8-I,33033
11
+ sky/global_user_state.py,sha256=9AjQMXLHXS8npQmgML_Raa_wmLueF6pm-9sVYpBRjXE,47496
12
12
  sky/models.py,sha256=bGMSATMkSMr_Kp6SCoiJVVeebwSdZuzjw_jrJzVWAAc,1603
13
13
  sky/optimizer.py,sha256=24hkzaM1W_VRhVkhtWXmUhJDOX55WV9kEF1hAVW_tVg,61426
14
- sky/resources.py,sha256=PbEj_zf2Zh_IE76ejb1Tnww4BdRFmFmFAKNPUgLyy7Q,94723
14
+ sky/resources.py,sha256=-PjNbcGeWA2tX-HtpiYKl03CGDnhA9jy8zBqQ0Ncwpo,96321
15
15
  sky/sky_logging.py,sha256=cMurxhFExKEFX1frcMR71Ti_s9Obg9WY30veVxsZB6o,7285
16
16
  sky/skypilot_config.py,sha256=12NGZ2_nIuQaO4cRF4C9xu98EPK3OxtRAfhn3-smTwc,28618
17
17
  sky/task.py,sha256=AEQqeJ2SHuBj36mdWjyF2OrLXwJ20Jnv-7Sw3g4m0bc,59240
@@ -46,7 +46,7 @@ sky/client/__init__.py,sha256=pz6xvVSd9X-gwqbsDL0E9QOojYqM0KAD0j-NCyCIF1k,38
46
46
  sky/client/cli.py,sha256=18DU5lplQAQvrno94-pN99scVHvPgN7CUXW0joHP0IQ,245418
47
47
  sky/client/common.py,sha256=E_5cjxd8fWRB7fU1yfIbiyQf-IyVhpD5KkB7Fl3cQEI,15215
48
48
  sky/client/oauth.py,sha256=sNJ_DMsSTcxluj5FeNQ2IafZJLImRFmCAZ79bXeABn4,2871
49
- sky/client/sdk.py,sha256=txybH3mT06QUJC4wKKyeg4Ef75Y99vJ3H9_AFlpAJhA,81296
49
+ sky/client/sdk.py,sha256=0QADM_HwM-J1Ydqyu4IGKxvO2JaNFtqEY1F0IoFcnv4,81260
50
50
  sky/clouds/__init__.py,sha256=5aPPmXGCnGN8DbOXTXh_BirESaW4wK-bao2n_3-fm6Q,1561
51
51
  sky/clouds/aws.py,sha256=BkD27knG7aaC033jFS5SO3qdG19a5yHlKTrLIeBUBck,55055
52
52
  sky/clouds/azure.py,sha256=1jxa8vxi3N8EHdeV3mzL6uc1XKrQy4_lGB9lnccswjM,32743
@@ -54,7 +54,7 @@ sky/clouds/cloud.py,sha256=PJmk4lKWvGjqdFrv-fL5fw8ZuUgEKn5fjrFPaKbAkrU,38722
54
54
  sky/clouds/cudo.py,sha256=dA4SsIpriJHXXE5eZpxJeHtmqHHhFwKVdkKP4A6VLRs,13603
55
55
  sky/clouds/do.py,sha256=1A_Eg29tiVjIZkqWo2MXRFyuCYxS8JquM50C-ib4cD4,11996
56
56
  sky/clouds/fluidstack.py,sha256=TREsai1mRpH8OxsRLVp_BiJLmVgtgcM90y0gd7RuyzE,13075
57
- sky/clouds/gcp.py,sha256=zklscRyefHzdvcsLHLnGbVV3oAleIcQaqV1Sh-9q2ko,67841
57
+ sky/clouds/gcp.py,sha256=G4dIl7RCpkppjkpAxWWVfbaet-mZsSq_MrutWxbzXmg,67719
58
58
  sky/clouds/ibm.py,sha256=9_7EGmCtYznJSvAC5reKAwTtb-ZRmhHZSrUKHF9CVBg,22352
59
59
  sky/clouds/kubernetes.py,sha256=YVXa9CY3-acxfw1O6h7zWs7xiYKO1bnngph2sYyg_yY,43325
60
60
  sky/clouds/lambda_cloud.py,sha256=evjN4lm5TAmovA7Un4JA59nqEm02XCRtVBcqeO1gGUk,13194
@@ -104,29 +104,28 @@ sky/clouds/utils/azure_utils.py,sha256=NToRBnhEyuUvb-nBnsKTxjhOBRkMcrelL8LK4w6s4
104
104
  sky/clouds/utils/gcp_utils.py,sha256=YtuS4EoAMvcRnGPgE_WLENPOPWIdvhp7dLceTw_zfas,7114
105
105
  sky/clouds/utils/oci_utils.py,sha256=0YxhgZdeIHQUI1AZ86YuswsZg5HdVCIVfSTRJsSHYI0,6396
106
106
  sky/clouds/utils/scp_utils.py,sha256=MqawUhhFHHxVnn29nOI4gJ_nF665ich4Po7bsy1afsA,15948
107
- sky/dashboard/out/404.html,sha256=X5qxwWiw1elzpQKPZb0vR8hsdVgjJkBUZT6cAFtgy5c,2296
108
- sky/dashboard/out/clusters.html,sha256=Yd0LlhQxRpNP0dTdFsY68YeslBt70cxAJjnt3Pux5W8,14802
109
- sky/dashboard/out/config.html,sha256=_L2Rtj7BKuoZgCtN_v3UGkOPEXr2REKCVaIv9tWNlPs,15092
107
+ sky/dashboard/out/404.html,sha256=7W4WH4h0IbSk0NJlQ0O1DTKh1xAFBFiDUSr-hNYWTjE,2296
108
+ sky/dashboard/out/clusters.html,sha256=_mHatOsTn4ZvMLFIM3Viw_sTYgE4N_F6mtRHsPFFPSQ,14889
109
+ sky/dashboard/out/config.html,sha256=kWEPqkuHzkZYZM8NpGXGQPHKtyXN7WsE9IXVPj5GxqI,15092
110
110
  sky/dashboard/out/favicon.ico,sha256=XilUZZglAl_1zRsg85QsbQgmQAzGPQjcUIJ-A3AzYn8,93590
111
- sky/dashboard/out/index.html,sha256=5vjOy1XsHu-vUYOJ22QcMr9PbZ_Jxv2q-9iP2gjx3io,1407
112
- sky/dashboard/out/infra.html,sha256=89FFyd7apHS9AYQmEH7HlA_pwViNNH0_FkjyeeXL_9w,19996
113
- sky/dashboard/out/jobs.html,sha256=g9Zr9QPgVDAmTCdwpc9DNzJL7LmV4Sfm52HH5v2jPY8,15810
111
+ sky/dashboard/out/index.html,sha256=7Nb-YR_ZHFTC0Is8sWBvGdph9wA5S7C5iDWlhBcujLo,1407
112
+ sky/dashboard/out/infra.html,sha256=X7DsNbTGuL4TnZNZsy-KtMkCGj5GGH-wKBYLiof9axk,15586
113
+ sky/dashboard/out/jobs.html,sha256=GIcT7nnJDiXpxxGdJK8Xc4Or4nyI1wVn5P46IUh6rz4,17785
114
114
  sky/dashboard/out/skypilot.svg,sha256=c0iRtlfLlaUm2p0rG9NFmo5FN0Qhf3pq5Xph-AeMPJw,5064
115
- sky/dashboard/out/users.html,sha256=-NChDgYVC6aX-UWbwQ6gA9xK717XPm2HgeJ_twHOC_E,13306
116
- sky/dashboard/out/workspaces.html,sha256=IJ69862CC0UpbfhpswGpQTruDSPh_GiMdemfWIeY_ps,13082
117
- sky/dashboard/out/_next/static/bdeJWb62qu7L7FOq1dbXX/_buildManifest.js,sha256=j46Nth7dHZ5vh6vrhbhvLY9vILhxrLzvuCHvPudcf3g,1948
118
- sky/dashboard/out/_next/static/bdeJWb62qu7L7FOq1dbXX/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
115
+ sky/dashboard/out/users.html,sha256=JwSgP-kXU88mxNqsOEuwJl-LP5TccakdiUsH-AsAPdE,13393
116
+ sky/dashboard/out/workspaces.html,sha256=_Ty5fobXn_z_J9fZ6XkiiWvnXq-y66NaRM8fiIu6bnI,13169
119
117
  sky/dashboard/out/_next/static/chunks/121-8f55ee3fa6301784.js,sha256=RIwzzRiPiEGM8PV-7Wesb3CkChfz9cgvLseMyKfD_MY,9292
120
- sky/dashboard/out/_next/static/chunks/236-7458fda7b295f305.js,sha256=5y-Mx9ooV5GpCbUc9KwAVvXt-SHfZ2cDtFsu6q4tEyU,23831
118
+ sky/dashboard/out/_next/static/chunks/236-fef38aa6e5639300.js,sha256=PJxI_evm_Re2hn0yBuGqNL205zedWKD1XK7XEq84pZc,24370
121
119
  sky/dashboard/out/_next/static/chunks/293-351268365226d251.js,sha256=kIKGZcJd0zyOkyYylqy_sRcpCMk2bjzq5A_6-Hrt0b8,12465
122
- sky/dashboard/out/_next/static/chunks/37-b638675d511d58b4.js,sha256=vjtwJOeOrOl3glwenJUp2phu9tN49VOWJxpRCyZj21A,10409
120
+ sky/dashboard/out/_next/static/chunks/37-947904ccc5687bac.js,sha256=xN1vjy0wvSL09KK8Ac_JfXo5aGaM8hiSEFCjRPJTUqc,10434
123
121
  sky/dashboard/out/_next/static/chunks/470-9e7a479cc8303baa.js,sha256=iP1BodDz6ywQUXbCdmP7wZhr6SDivtzCDkdo6_jiMD4,22278
124
122
  sky/dashboard/out/_next/static/chunks/614-3d29f98e0634b179.js,sha256=JllLxIGISain5yHH3XMUvyqvXYtqflIN_z2h3J7xoJk,284557
125
- sky/dashboard/out/_next/static/chunks/682-5c12535476a21ce3.js,sha256=1kq4q4y9AUePWP_P-Z3MvzVLvKmN-o-ohMRegyI1_nE,16487
123
+ sky/dashboard/out/_next/static/chunks/682-2be9b0f169727f2f.js,sha256=fNx6ANTK4A_T0L3gsBzYRm6lQy7Mwbv0g4DfXE3ZBUY,17179
126
124
  sky/dashboard/out/_next/static/chunks/798-c0525dc3f21e488d.js,sha256=qROA0j-IKFdZFhQdWglA67iuCH8pf6mQRDqD6Q4hy00,38450
127
- sky/dashboard/out/_next/static/chunks/843-786c36624d5ff61f.js,sha256=K32I4DcgHhwuliF47ZVauksEx3xL5xKz6Zc9_ez9iLw,15559
128
- sky/dashboard/out/_next/static/chunks/856-ab9627e7e8ac35e8.js,sha256=eG7_Z3uViU2kMGGvYbdzwiA444i30lhZXOBFCN3-Xjc,23539
125
+ sky/dashboard/out/_next/static/chunks/843-a097338acb89b7d7.js,sha256=K32I4DcgHhwuliF47ZVauksEx3xL5xKz6Zc9_ez9iLw,15559
126
+ sky/dashboard/out/_next/static/chunks/856-f1b1f7f47edde2e8.js,sha256=gLCsme2gnKNv75iFgUvk0JUEe1QB1ALnJihhUwzHo_0,14767
129
127
  sky/dashboard/out/_next/static/chunks/937.f97f83652028e944.js,sha256=3G2YlQgxD17Z7GeznWGDwYSKEB8W4FZFfLKEXmtBiWE,54452
128
+ sky/dashboard/out/_next/static/chunks/969-d7b6fb7f602bfcb3.js,sha256=mxIv-BfEZs-3ZIe9A_nWLo4Sh1pdeTBhg6e11Tg8pmY,9718
130
129
  sky/dashboard/out/_next/static/chunks/973-1a09cac61cfcc1e1.js,sha256=QoNq70edEqfx5pik8iQhhFhU71DxhfND_wu3mLnEnmw,13476
131
130
  sky/dashboard/out/_next/static/chunks/fd9d1056-2821b0f0cabcd8bd.js,sha256=ce2WOATL1LdzsWouKQ-1NCiBQJmcykgzqP8wCp1yqbE,172831
132
131
  sky/dashboard/out/_next/static/chunks/framework-87d061ee6ed71b28.js,sha256=dh6TKdXcSRoGP4HqHe2uwzWCZBPz16dyTWufLsxeRvM,140942
@@ -134,29 +133,31 @@ sky/dashboard/out/_next/static/chunks/main-app-241eb28595532291.js,sha256=P0_tU7
134
133
  sky/dashboard/out/_next/static/chunks/main-e0e2335212e72357.js,sha256=BxTmVbZDnMUQvQd57MEl1Ui0VZaNmwLOviY7h_xMjP0,109884
135
134
  sky/dashboard/out/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js,sha256=6QPOwdWeAVe8x-SsiDrm-Ga6u2DkqgG5SFqglrlyIgA,91381
136
135
  sky/dashboard/out/_next/static/chunks/webpack-f27c9a32aa3d9c6d.js,sha256=ZmruoC8C86_-mqwGF3AsHiR0CXx1Skr-vPg8cTjrZxA,3605
137
- sky/dashboard/out/_next/static/chunks/pages/_app-ad1edd7fe17ea796.js,sha256=lqFYBo3gcDUyNT-vVEqyoXJkFmFKu6i4wvssOQiqQhE,2097
136
+ sky/dashboard/out/_next/static/chunks/pages/_app-67925f5e6382e22f.js,sha256=lqFYBo3gcDUyNT-vVEqyoXJkFmFKu6i4wvssOQiqQhE,2097
138
137
  sky/dashboard/out/_next/static/chunks/pages/_error-1be831200e60c5c0.js,sha256=TZqrus06KKPx-CMABDMPKF7w-NQ5s2gwJAM8Huyl7qU,247
139
- sky/dashboard/out/_next/static/chunks/pages/clusters-f37ff20f0af29aae.js,sha256=qnQjkj7_GDcLsr-2PTQ02UMlr7ZAQ2pFnNiGmioAmfQ,578
140
- sky/dashboard/out/_next/static/chunks/pages/config-3c6a2dabf56e8cd6.js,sha256=Wu9ah0cxC2qtRju4VVJHRMczJOLmaN75LbIHj0OiRN0,10905
138
+ sky/dashboard/out/_next/static/chunks/pages/clusters-5549a350f97d7ef3.js,sha256=cFVTfmzDS7ME5m54x3hfl9NWGXBWAo0vYIcePCKJFsY,582
139
+ sky/dashboard/out/_next/static/chunks/pages/config-35383adcb0edb5e2.js,sha256=QCkkOIY8s1TF9Nrgjq4ebHZbEVb8mTq7hf-qwU21PRw,11190
141
140
  sky/dashboard/out/_next/static/chunks/pages/index-6b0d9e5031b70c58.js,sha256=Fp2FKnKQtORK_5O7MEQ08tlTk7ewMLuecw_EY5g4Dlg,513
142
- sky/dashboard/out/_next/static/chunks/pages/infra-7b4b8e7fa9fa0827.js,sha256=XzUoYkFoJ98z2AknTL5RxnIlWjjTTn1IoSrnNwwJYB4,561
143
- sky/dashboard/out/_next/static/chunks/pages/jobs-78a6c5ba3e24c0cf.js,sha256=pfsU_vKAJ6mf1e3peQG301Kif2xJRiramKB9nhmMjbs,563
144
- sky/dashboard/out/_next/static/chunks/pages/users-89f9212b81d8897e.js,sha256=92qnB-zELDvIeTRDJoOVjKFOYJw0tWVZmqE1-O8diLM,10872
145
- sky/dashboard/out/_next/static/chunks/pages/workspaces-17d41826537196e7.js,sha256=Rkkl4lt7R6UT38lR9DPIGupYHwTON-xw3ftqYOcrSOY,12321
146
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-25edb867a41b6b20.js,sha256=vWAa-9w4hnznFnshBs3VrSOmDm-ct027MO_tYnwBC4w,7131
147
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8f270e2c9c59fa1a.js,sha256=DVwvWDNQKm17l_bAXhSp1q3maEdO2cZ1eaYttQ9Qn8c,15559
148
- sky/dashboard/out/_next/static/chunks/pages/infra/[context]-342bc15bb78ab2e5.js,sha256=GrTozxI1XMqIXlyYgUCFaToZ7_JWaTv9pEgtksCxQA8,571
149
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-c0c1dff3cd463d9e.js,sha256=gr2HGQ8cHs9DPxNk6WuwvAYvaxankVu9UxEzVBbW7rE,26678
150
- sky/dashboard/out/_next/static/chunks/pages/workspace/new-198b6e00d7d724c5.js,sha256=dEjlIoAb-DxdPCJGnraVc8D49-6lixPI4u1G1R6z7Cg,3542
151
- sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-2ce792183b03c341.js,sha256=S1AlYNpHGN4ttwMtA3BXY5KK4TRPvbC66C984VJU3RA,569
152
- sky/dashboard/out/_next/static/css/2b3ee34e586949a3.css,sha256=Uf7ADStbwFxzINj6bQDFoiY-mnWD5RgpR1rAlvKb-oA,38056
153
- sky/dashboard/out/clusters/[cluster].html,sha256=xmUapDRi7r9x9la3AiinD77wSM3xcPwGIhIxU7p56eg,2245
154
- sky/dashboard/out/clusters/[cluster]/[job].html,sha256=b74DGF-wZ-5Ms9x2odZYxX8SKo56-TtYqPHC-X-qJc4,1653
155
- sky/dashboard/out/infra/[context].html,sha256=nOmdkTOXG9GC6P2Gcbu3ELzduOw9eV1UhbWdYmMYDIE,20020
156
- sky/dashboard/out/jobs/[job].html,sha256=-K-XLcGf00K0kbi8z9Nyu25Awd9ARolWE7tRzLfktls,1708
141
+ sky/dashboard/out/_next/static/chunks/pages/infra-13b117a831702196.js,sha256=WC8tAhkQmFWwdsAkO0PoC_Xl_OjXWQDtRSLSZfdaAoU,565
142
+ sky/dashboard/out/_next/static/chunks/pages/jobs-a76b2700eca236f7.js,sha256=6NlyXbHCM_-CkQKcgAlOWdsFBbZle7So9u3zlGxzxBo,567
143
+ sky/dashboard/out/_next/static/chunks/pages/users-07b523ccb19317ad.js,sha256=m0AsFmN9uoIuPAlRQOpFq-YiNpYuKC_Z3DaD-34MhvE,10886
144
+ sky/dashboard/out/_next/static/chunks/pages/workspaces-f54921ec9eb20965.js,sha256=a1pQFQEUSdhNFjmw0slRSCwWF0A3V1NtqBVhVmFNh0k,12397
145
+ sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-62c9982dc3675725.js,sha256=MKqd_RVIG3pSp8iMQMFtsa63r_TxGubGQnS6f6vx6TA,7312
146
+ sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-158b70da336d8607.js,sha256=wSsiDpkwR3Yfw3Xpt5HnTloDReejo6sB23OdTt7qbOc,18413
147
+ sky/dashboard/out/_next/static/chunks/pages/infra/[context]-b68ddeed712d45b5.js,sha256=uDhwqmgArds4TWKTzbxPT2iIcYjFjZTUW2RxrqvImSs,575
148
+ sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-a62a3c65dc9bc57c.js,sha256=bHT9ftXn2JjFZrWfY55Cv-IqSzrEiGr8QXFf-FySTf0,19749
149
+ sky/dashboard/out/_next/static/chunks/pages/workspace/new-c7516f2b4c3727c0.js,sha256=_iK_Lp1WWBpCA1Cnts0BXFYhU7NZAIvaDoJgQXQsk2w,3546
150
+ sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-7799de9e691e35d8.js,sha256=N09QC0O7MFg1WeOtEQsVbM41MoweogtzMRfrUi29-Vg,573
151
+ sky/dashboard/out/_next/static/css/63d3995d8b528eb1.css,sha256=lw1nBJcLVQ0hm_mdo7UT0mftzSVvK7EsFKrdkpKfZBQ,38212
152
+ sky/dashboard/out/_next/static/zTAFq_Iv6_yxQj3fXvJWR/_buildManifest.js,sha256=hceWdHi97VDLBjuMjPbz1xR7uVqUVWfMemVktOb3RgA,2010
153
+ sky/dashboard/out/_next/static/zTAFq_Iv6_yxQj3fXvJWR/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
154
+ sky/dashboard/out/clusters/[cluster].html,sha256=xSe0viDTCbm01MATtIOxsGqyKToA1sQU6z8Tg9_V-94,2332
155
+ sky/dashboard/out/clusters/[cluster]/[job].html,sha256=Tx2IgTqmos5ulHaPVh_qH9TLRDOVKChLS9llYDJUISE,1653
156
+ sky/dashboard/out/infra/[context].html,sha256=zpiA9AvG0uK85ydwWvie_HsblxAc2RSHKTRH8xusFsQ,15610
157
+ sky/dashboard/out/jobs/[job].html,sha256=vOEQzzBsOHUNIrv8SlsqqHrPoOe08xW48QHtUg9853g,1795
157
158
  sky/dashboard/out/videos/cursor-small.mp4,sha256=8tRdp1vjawOrXUar1cfjOc-nkaKmcwCPZx_LO0XlCvQ,203285
158
- sky/dashboard/out/workspace/new.html,sha256=q1s5X-ZnsTMhcMaPurqJ0EK8rUhhEY6SAyZmKDNfzdc,12807
159
- sky/dashboard/out/workspaces/[name].html,sha256=VvUiNmF9jgm1cuvOgUAC7GrWOueVMrZ7hiFgEasoS4M,2244
159
+ sky/dashboard/out/workspace/new.html,sha256=hL4y_BHrCa7KhMN-AVe04tOiSQWW_hqDhfpWSC_v-ao,12894
160
+ sky/dashboard/out/workspaces/[name].html,sha256=ltM8xl6D3rLf4ocss3ipKTf0ORNE_bIC3C1aEbWrOg0,2331
160
161
  sky/data/__init__.py,sha256=Nhaf1NURisXpZuwWANa2IuCyppIuc720FRwqSE2oEwY,184
161
162
  sky/data/data_transfer.py,sha256=N8b0CQebDuHieXjvEVwlYmK6DbQxUGG1RQJEyTbh3dU,12040
162
163
  sky/data/data_utils.py,sha256=CNYPM963qby5ddW0DZNbhiWXkqgB9MHh_jrC5DoBctM,33437
@@ -169,7 +170,7 @@ sky/jobs/controller.py,sha256=1MHXM4fmPdVuOPeqsOpNxyTFUPlJWC9JGmFytaG35aY,31211
169
170
  sky/jobs/recovery_strategy.py,sha256=a9A4W-6U3KU-pjkWiFpIdgTHC8W26-jYrmi4vzU9iOg,28818
170
171
  sky/jobs/scheduler.py,sha256=QMpApgCIh2v46bjx3cNxDJWVphn2g50kBMTdTM0uy84,13865
171
172
  sky/jobs/state.py,sha256=9DPYD6Zo83yfzjvUxFN-R53PNV0ewke76HFMlNjxY6Q,50608
172
- sky/jobs/utils.py,sha256=4y7dNI4TpR_m6LfnFiKoaxMonmjpBTFhfuE69q7CQTs,63559
173
+ sky/jobs/utils.py,sha256=nCFjAYMejE91vSS3WgX6v3K9rGnNObLXHdATMiICjrk,65110
173
174
  sky/jobs/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
174
175
  sky/jobs/client/sdk.py,sha256=UDobv7wvVeVEXJK4-E1zVUflubn1pJcylXpPsIB9MWk,10674
175
176
  sky/jobs/dashboard/dashboard.py,sha256=JKg8cCH_Y0sf3MoDTx85BghVEXWpp8ItPLshp09-_Js,7618
@@ -212,7 +213,7 @@ sky/provision/fluidstack/fluidstack_utils.py,sha256=NdhQcwhIPGT21g7lQR-t6j-1zTA_
212
213
  sky/provision/fluidstack/instance.py,sha256=zCyG8_gmMowzXpmEfv4yBYXgyslKjNXsbFXBq8eQnzc,13788
213
214
  sky/provision/gcp/__init__.py,sha256=zlgjR2JoaGD7sStGStMRu9bJ62f-8NKEIyb-bFHBlzM,528
214
215
  sky/provision/gcp/config.py,sha256=3xIX4u-Dn6Z9W4UY2sjAl6fB-4MHWnuaVq53O5QA65o,41668
215
- sky/provision/gcp/constants.py,sha256=1AefCqLbQzYo4NXcq0YqAWIw_wM9QnS-AppcHq0zPAg,15881
216
+ sky/provision/gcp/constants.py,sha256=TT9Ci3hu-0-o21B7iNfQX8qRThrQOkbADmnXz7Hv6AA,16136
216
217
  sky/provision/gcp/instance.py,sha256=fHtOh-Qo1rk_oL7wZML2s6tKUyQxQu2nuIsb_E0x_rQ,25118
217
218
  sky/provision/gcp/instance_utils.py,sha256=RM5KOAk56TU8q1LNRoo9yl4VwQ3DDq7FAfTxpgdZVTc,72094
218
219
  sky/provision/gcp/mig_utils.py,sha256=oFpcFZoapHMILSE4iIm8V5bxP1RhbMHRF7cciqq8qAk,7883
@@ -287,11 +288,11 @@ sky/serve/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
287
288
  sky/serve/server/core.py,sha256=QRXTDSXAvLZNUCJcVuwWIOCHP96lpiQgxhJNlDWfcQw,41246
288
289
  sky/serve/server/server.py,sha256=A9K37a0nQgZeN3eKWv62Oh2C5TSAReTZ9pHmztqlI-c,4396
289
290
  sky/server/__init__.py,sha256=MPPBqFzXz6Jv5QSk6td_IcvnfXfNErDZVcizu4MLRow,27
290
- sky/server/common.py,sha256=9s6-31tLRaNA81YT1YAcCdDHEu-IkcjglVPYTfl5-QY,31094
291
+ sky/server/common.py,sha256=dbWDUT2rAJGEhJD5Otc7NkG8T-JCAFi58iCa-d3oP5I,32057
291
292
  sky/server/config.py,sha256=XWf5Kw4am6vMO5wcyWevbQAFH-dmKb7AMEgDzD083-M,8538
292
293
  sky/server/constants.py,sha256=s2dHx-CZLWDdqN5JR0mK_I6Ygdpmknd92rZrIHXzUv4,1193
293
294
  sky/server/server.py,sha256=EqUi7yyz9XnDXIuFhXSYcIHSiss9vdyRzs4iH0BEHTw,54628
294
- sky/server/stream_utils.py,sha256=yyfKLcaB3RDC8BfhLLiOQW-nQE05ojUsQ26K0teSea0,6878
295
+ sky/server/stream_utils.py,sha256=W8TIUHHDK_LufQvLohPQQWofyZwXhZ-NgGYJf7Osdx0,8293
295
296
  sky/server/uvicorn.py,sha256=4bTlvqQiykYDEIfV6Ta9KXWKZUtSfIrhDeT1F9yQuvs,3323
296
297
  sky/server/html/log.html,sha256=TSGZktua9Ysl_ysg3w60rjxAxhH61AJnsYDHdtqrjmI,6929
297
298
  sky/server/html/token_page.html,sha256=eUndS5u1foL9vaWGPRTLMt7lCzD1g0wYJ2v_EeeFzlc,7046
@@ -382,7 +383,7 @@ sky/utils/config_utils.py,sha256=v8yZcr8OvEfXmBDYcdOj3U-AH1XERY76zGJMNdqzvqc,103
382
383
  sky/utils/context.py,sha256=yxNlkVV9_7_0bnXJkXXe8h9t_LbFbYzPAnWIx8aTLJI,9327
383
384
  sky/utils/context_utils.py,sha256=cby-QPmnGObjIE4K7eZ_dkWZdUo7YJUmnJr5oKf_v54,6712
384
385
  sky/utils/control_master_utils.py,sha256=iD4M0onjYOdZ2RuxjwMBl4KhafHXJzuHjvqlBUnu-VE,1450
385
- sky/utils/controller_utils.py,sha256=65cA--9V32HTcNS-gaXZRcLswafS7DlMZ9qSbdTLkF8,53396
386
+ sky/utils/controller_utils.py,sha256=xBHh6M2OpxFCtybBYBZjZhESwLpLT-Xo1UEn2CzM-G8,52907
386
387
  sky/utils/dag_utils.py,sha256=FjxMaAT6ia4ndVg-ogXgiekLGD1GiPCAdK_c-cjIeuY,7607
387
388
  sky/utils/db_utils.py,sha256=MlJN4dVUEcMkLMn5rYi1F-WnD9ap2oOoF9lDiqlL0h4,5243
388
389
  sky/utils/env_options.py,sha256=aaD6GoYK0LaZIqjOEZ-R7eccQuiRriW3EuLWtOI5En8,1578
@@ -423,9 +424,9 @@ sky/utils/kubernetes/ssh_jump_lifecycle_manager.py,sha256=Kq1MDygF2IxFmu9FXpCxqu
423
424
  sky/workspaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
424
425
  sky/workspaces/core.py,sha256=YtmfIwq26MBQqI9eKdgiVpCq-5b-c8SHURJzjYsK-0k,16813
425
426
  sky/workspaces/server.py,sha256=A3jt9RSzRXTYWpmVQNW0b4-QrgfLq3eiHcRA0tutZhw,2893
426
- skypilot_nightly-1.0.0.dev20250531.dist-info/licenses/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
427
- skypilot_nightly-1.0.0.dev20250531.dist-info/METADATA,sha256=82adzGeoUyZjWPcQoyGVGQSQY8kGBHWec_d8EbUAB2U,18378
428
- skypilot_nightly-1.0.0.dev20250531.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
429
- skypilot_nightly-1.0.0.dev20250531.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
430
- skypilot_nightly-1.0.0.dev20250531.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
431
- skypilot_nightly-1.0.0.dev20250531.dist-info/RECORD,,
427
+ skypilot_nightly-1.0.0.dev20250603.dist-info/licenses/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
428
+ skypilot_nightly-1.0.0.dev20250603.dist-info/METADATA,sha256=afO1Y317gtE1T6_zI8RzmTCPzS2n2VlpiA-MH6y14_o,18378
429
+ skypilot_nightly-1.0.0.dev20250603.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
430
+ skypilot_nightly-1.0.0.dev20250603.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
431
+ skypilot_nightly-1.0.0.dev20250603.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
432
+ skypilot_nightly-1.0.0.dev20250603.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,c,e,a,t,r,n,u,f,i,b){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-6b0d9e5031b70c58.js"],"/_error":["static/chunks/pages/_error-1be831200e60c5c0.js"],"/clusters":[s,t,r,c,e,a,n,f,"static/chunks/pages/clusters-f37ff20f0af29aae.js"],"/clusters/[cluster]":[s,t,r,c,e,a,n,u,f,"static/chunks/pages/clusters/[cluster]-25edb867a41b6b20.js"],"/clusters/[cluster]/[job]":[s,c,"static/chunks/pages/clusters/[cluster]/[job]-8f270e2c9c59fa1a.js"],"/config":[s,t,c,e,"static/chunks/pages/config-3c6a2dabf56e8cd6.js"],"/infra":[s,c,e,a,i,"static/chunks/pages/infra-7b4b8e7fa9fa0827.js"],"/infra/[context]":[s,c,e,a,i,"static/chunks/pages/infra/[context]-342bc15bb78ab2e5.js"],"/jobs":[s,r,c,e,a,n,u,"static/chunks/pages/jobs-78a6c5ba3e24c0cf.js"],"/jobs/[job]":[s,t,c,"static/chunks/pages/jobs/[job]-c0c1dff3cd463d9e.js"],"/users":[s,c,e,a,"static/chunks/pages/users-89f9212b81d8897e.js"],"/workspace/new":[s,t,r,c,e,a,n,u,b,"static/chunks/pages/workspace/new-198b6e00d7d724c5.js"],"/workspaces":[s,t,r,c,e,a,n,u,"static/chunks/pages/workspaces-17d41826537196e7.js"],"/workspaces/[name]":[s,t,r,c,e,a,n,u,b,"static/chunks/pages/workspaces/[name]-2ce792183b03c341.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/config","/infra","/infra/[context]","/jobs","/jobs/[job]","/users","/workspace/new","/workspaces","/workspaces/[name]"]}}("static/chunks/614-3d29f98e0634b179.js","static/chunks/470-9e7a479cc8303baa.js","static/chunks/293-351268365226d251.js","static/chunks/856-ab9627e7e8ac35e8.js","static/chunks/798-c0525dc3f21e488d.js","static/chunks/121-8f55ee3fa6301784.js","static/chunks/973-1a09cac61cfcc1e1.js","static/chunks/236-7458fda7b295f305.js","static/chunks/37-b638675d511d58b4.js","static/chunks/682-5c12535476a21ce3.js","static/chunks/843-786c36624d5ff61f.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -1,6 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[236],{8236:function(e,s,t){t.d(s,{L4:function(){return D},Nk:function(){return I},x2:function(){return R}});var n=t(5893),r=t(7294),a=t(1163),l=t(1664),i=t.n(l),c=t(8799),o=t(803),d=t(7673),h=t(8764),x=t(6989),u=t(8969),m=t(3266),p=t(7324),j=t(9470),f=t(3626),g=t(998);/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let w=(0,g.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"}]]),N=(0,g.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"}]]),b=(0,g.Z)("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var y=t(9284),v=t(4545),k=t(9307),C=t(3001),S=t(8950),E=t(6378),L=t(6856);let R={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},M="__ALL_WORKSPACES__",_=e=>{if(!e)return"-";let s=(0,x.GV)(e);if(r.isValidElement(s)&&s.props&&s.props.children&&(s=r.isValidElement(s.props.children)&&s.props.children.props&&s.props.children.props.children?s.props.children.props.children:s.props.children),"string"!=typeof s)return s;if("just now"===s)return"now";let t=s.match(/^About\s+(\d+)\s+(\w+)\s+ago$/);if(t){let e=t[1],s=t[2],n={second:"sec",seconds:"secs",minute:"min",minutes:"mins",hour:"hr",hours:"hrs",day:"d",days:"d",month:"mo",months:"mos",year:"yr",years:"yrs"};if(n[s])return"~ ".concat(e," ").concat(n[s]," ago")}let n=s.match(/^a[n]?\s+(\w+)\s+ago$/);if(n){let e=n[1],s={second:"sec",minute:"min",hour:"hr",day:"d",month:"mo",year:"yr"};if(s[e])return"1 ".concat(s[e]," ago")}let a=s.match(/^(\d+)\s+(\w+)\s+ago$/);if(a){let e=a[1],s=a[2],t={seconds:"secs",minutes:"mins",hours:"hrs",days:"d",months:"mo",years:"yr"};if(t[s])return"".concat(e," ").concat(t[s]," ago")}return s};function I(){let e=(0,a.useRouter)(),[s,t]=(0,r.useState)(!1),l=r.useRef(null),[o,d]=(0,r.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),h=(0,C.X)(),[g,w]=(0,r.useState)(M),[N,b]=(0,r.useState)([]);return(0,r.useEffect)(()=>{e.isReady&&e.query.workspace&&w(Array.isArray(e.query.workspace)?e.query.workspace[0]:e.query.workspace)},[e.isReady,e.query.workspace]),(0,r.useEffect)(()=>{(async()=>{try{await L.ZP.preloadForPage("jobs");let e=await E.ZP.get(p.fX),s=Object.keys(e),t=(await E.ZP.get(u.getManagedJobs)).jobs||[],n=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],r=new Set(s);n.forEach(e=>r.add(e)),b(Array.from(r).sort())}catch(e){console.error("Error fetching data for workspace filter:",e),b(["default"])}})()},[]),(0,n.jsxs)(j.A,{highlighted:"jobs",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,n.jsxs)("div",{className:"text-base flex items-center",children:[(0,n.jsx)(i(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"}),(0,n.jsxs)(S.Ph,{value:g,onValueChange:w,children:[(0,n.jsx)(S.i4,{className:"h-8 w-48 ml-4 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,n.jsx)(S.ki,{placeholder:"Filter by workspace...",children:g===M?"All Workspaces":g})}),(0,n.jsxs)(S.Bw,{children:[(0,n.jsx)(S.Ql,{value:M,children:"All Workspaces"}),N.map(e=>(0,n.jsx)(S.Ql,{value:e,children:e},e))]})]})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,n.jsxs)("div",{className:"flex items-center mr-2",children:[(0,n.jsx)(c.Z,{size:15,className:"mt-0"}),(0,n.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,n.jsxs)("button",{onClick:()=>{E.ZP.invalidate(u.getManagedJobs),E.ZP.invalidate(m.getClusters),E.ZP.invalidate(p.fX),l.current&&l.current()},disabled:s,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",title:"Refresh",children:[(0,n.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!h&&(0,n.jsx)("span",{children:"Refresh"})]})]})]}),(0,n.jsx)(O,{refreshInterval:x.yc,setLoading:t,refreshDataRef:l,workspaceFilter:g}),(0,n.jsx)(y.cV,{isOpen:o.isOpen,onClose:()=>d({...o,isOpen:!1}),onConfirm:o.onConfirm,title:o.title,message:o.message})]})}function O(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a,workspaceFilter:l}=e,[p,j]=(0,r.useState)([]),[f,g]=(0,r.useState)({key:null,direction:"ascending"}),[N,b]=(0,r.useState)(!1),[C,S]=(0,r.useState)(!0),[L,I]=(0,r.useState)(1),[O,D]=(0,r.useState)(10),[z,F]=(0,r.useState)(null),W=(0,r.useRef)(null),[U,q]=(0,r.useState)([]),[T,V]=(0,r.useState)({}),[B,J]=(0,r.useState)(!1),[G,H]=(0,r.useState)(!1),[X,$]=(0,r.useState)(!1),[K,Q]=(0,r.useState)("active"),[Y,ee]=(0,r.useState)(!0),[es,et]=(0,r.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),en=async()=>{et({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller? This will temporarily interrupt job management.",onConfirm:async()=>{try{$(!0),b(!0),await (0,u.Ce)("restartcontroller"),await er()}catch(e){console.error("Error restarting controller:",e)}finally{$(!1),b(!1)}}})},er=r.useCallback(async()=>{b(!0),t(!0);try{let[e,s]=await Promise.all([E.ZP.get(u.getManagedJobs),E.ZP.get(m.getClusters)]),{jobs:t,controllerStopped:n}=e,r=s.find(e=>(0,v.Ym)(e.cluster)),a=r?r.status:"NOT_FOUND",l=!1;"STOPPED"==a&&n&&(l=!0),"LAUNCHING"==a?H(!0):H(!1),j(t),J(l)}catch(e){console.error("Error fetching data:",e),j([])}finally{b(!1),t(!1),S(!1)}},[t]);r.useEffect(()=>{a&&(a.current=er)},[a,er]),(0,r.useEffect)(()=>{j([]);let e=!0;er();let t=setInterval(()=>{e&&er()},s);return()=>{e=!1,clearInterval(t)}},[s,er]),(0,r.useEffect)(()=>{I(1)},[K,p.length]),(0,r.useEffect)(()=>{q([]),ee(!0)},[K]);let ea=e=>{let s="ascending";f.key===e&&"ascending"===f.direction&&(s="descending"),g({key:e,direction:s})},el=e=>f.key===e?"ascending"===f.direction?" ↑":" ↓":"";r.useMemo(()=>({active:p.filter(e=>R.active.includes(e.status)).length,finished:p.filter(e=>R.finished.includes(e.status)).length}),[p]);let ei=e=>U.length>0?U.includes(e):R[K].includes(e),ec=r.useMemo(()=>{let e=l&&l!==M?p.filter(e=>(e.workspace||"default").toLowerCase()===l.toLowerCase()):p;return U.length>0?e.filter(e=>U.includes(e.status)):Y?e.filter(e=>R[K].includes(e.status)):[]},[p,K,U,Y,l]),eo=r.useMemo(()=>f.key?[...ec].sort((e,s)=>e[f.key]<s[f.key]?"ascending"===f.direction?-1:1:e[f.key]>s[f.key]?"ascending"===f.direction?1:-1:0):ec,[ec,f]),ed=Math.ceil(eo.length/O),eh=(L-1)*O,ex=eh+O,eu=eo.slice(eh,ex),em=e=>{if(U.includes(e)){let s=U.filter(s=>s!==e);0===s.length?(ee(!0),q([])):(q(s),ee(!1))}else q([...U,e]),ee(!1)};return(0,r.useEffect)(()=>{V(p.reduce((e,s)=>(e[s.status]=(e[s.status]||0)+1,e),{}))},[p]),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("div",{className:"flex flex-col space-y-1 mb-1",children:(0,n.jsxs)("div",{className:"flex flex-wrap items-center text-sm mb-1",children:[(0,n.jsx)("span",{className:"mr-2 text-sm font-medium",children:"Statuses:"}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[!N&&0===p.length&&!C&&(0,n.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(T).map(e=>{let[s,t]=e;return(0,n.jsxs)("button",{onClick:()=>em(s),className:"px-3 py-1 rounded-full flex items-center space-x-2 ".concat(ei(s)||U.includes(s)?(0,k.Cl)(s):"bg-gray-50 text-gray-600 hover:bg-gray-100"),children:[(0,n.jsx)("span",{children:s}),(0,n.jsx)("span",{className:"text-xs ".concat(ei(s)||U.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),p.length>0&&(0,n.jsxs)("div",{className:"flex items-center ml-2 gap-2",children:[(0,n.jsx)("span",{className:"text-gray-500",children:"("}),(0,n.jsx)("button",{onClick:()=>{Q("active"),q([]),ee(!0)},className:"text-sm font-medium ".concat("active"===K&&Y?"text-green-700 underline":"text-gray-600 hover:text-green-700 hover:underline"),children:"show all active jobs"}),(0,n.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,n.jsx)("button",{onClick:()=>{Q("finished"),q([]),ee(!0)},className:"text-sm font-medium ".concat("finished"===K&&Y?"text-blue-700 underline":"text-gray-600 hover:text-blue-700 hover:underline"),children:"show all finished jobs"}),(0,n.jsx)("span",{className:"text-gray-500",children:")"})]})]})]})}),(0,n.jsx)(d.Zb,{children:(0,n.jsxs)(h.iA,{children:[(0,n.jsx)(h.xD,{children:(0,n.jsxs)(h.SC,{children:[(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("id"),children:["ID",el("id")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("name"),children:["Name",el("name")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("user"),children:["User",el("user")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("workspace"),children:["Workspace",el("workspace")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("submitted_at"),children:["Submitted",el("submitted_at")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("job_duration"),children:["Duration",el("job_duration")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("status"),children:["Status",el("status")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("priority"),children:["Priority",el("priority")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("resources_str"),children:["Requested",el("resources_str")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("infra"),children:["Infra",el("infra")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("cluster"),children:["Resources",el("cluster")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ea("recoveries"),children:["Recoveries",el("recoveries")]}),(0,n.jsx)(h.ss,{children:"Details"}),(0,n.jsx)(h.ss,{children:"Logs"})]})}),(0,n.jsx)(h.RM,{children:N&&C?(0,n.jsx)(h.SC,{children:(0,n.jsx)(h.pj,{colSpan:13,className:"text-center py-6 text-gray-500",children:(0,n.jsxs)("div",{className:"flex justify-center items-center",children:[(0,n.jsx)(c.Z,{size:20,className:"mr-2"}),(0,n.jsx)("span",{children:"Loading..."})]})})}):eu.length>0?(0,n.jsx)(n.Fragment,{children:eu.map(e=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsxs)(h.SC,{children:[(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,n.jsx)(h.pj,{children:e.user}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,n.jsx)(h.pj,{children:_(e.submitted_at)}),(0,n.jsx)(h.pj,{children:(0,x.LU)(e.job_duration)}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(k.OE,{status:e.status})}),(0,n.jsx)(h.pj,{children:e.priority}),(0,n.jsx)(h.pj,{children:e.requested_resources}),(0,n.jsx)(h.pj,{children:e.infra&&"-"!==e.infra?(0,n.jsx)(x.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,n.jsxs)("span",{children:[(0,n.jsx)(i(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud||e.infra.split("(")[0].trim()}),e.infra.includes("(")&&(0,n.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})}):(0,n.jsx)("span",{children:e.infra||"-"})}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(x.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,n.jsx)("span",{children:e.resources_str})})}),(0,n.jsx)(h.pj,{children:e.recoveries}),(0,n.jsx)(h.pj,{children:e.details?(0,n.jsx)(Z,{text:e.details,rowId:e.id,expandedRowId:z,setExpandedRowId:F}):"-"}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(P,{jobParent:"/jobs",jobId:e.id,managed:!0})})]}),z===e.id&&(0,n.jsx)(A,{text:e.details,colSpan:13,innerRef:W})]},e.id))}):(0,n.jsx)(h.SC,{children:(0,n.jsx)(h.pj,{colSpan:13,className:"text-center py-6",children:(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[G&&(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,n.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. Please wait for it to be ready."}),(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(c.Z,{size:12,className:"mr-2"}),(0,n.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!B&&!G&&(0,n.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),B&&(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,n.jsx)("p",{className:"text-gray-700",children:"The managed job controller has been stopped. Please restart it to check the latest job status."}),(0,n.jsx)(o.z,{variant:"outline",size:"sm",onClick:en,className:"text-sky-blue hover:text-sky-blue-bright",disabled:N||X,children:X?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})}),eo.length>0&&(0,n.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,n.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,n.jsxs)("div",{className:"relative inline-block",children:[(0,n.jsxs)("select",{value:O,onChange:e=>{D(parseInt(e.target.value,10)),I(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,n.jsx)("option",{value:10,children:"10"}),(0,n.jsx)("option",{value:30,children:"30"}),(0,n.jsx)("option",{value:50,children:"50"}),(0,n.jsx)("option",{value:100,children:"100"}),(0,n.jsx)("option",{value:200,children:"200"})]}),(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,n.jsxs)("div",{children:[eh+1," – ",Math.min(ex,eo.length)," of"," ",eo.length]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{I(e=>Math.max(e-1,1))},disabled:1===L,className:"text-gray-500 h-8 w-8 p-0",children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,n.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,n.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{I(e=>Math.min(e+1,ed))},disabled:L===ed||0===ed,className:"text-gray-500 h-8 w-8 p-0",children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,n.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})}),(0,n.jsx)(y.cV,{isOpen:es.isOpen,onClose:()=>et({...es,isOpen:!1}),onConfirm:es.onConfirm,title:es.title,message:es.message})]})}function P(e){let{withLabel:s=!1,jobParent:t,jobId:r,managed:l}=e,i=(0,a.useRouter)(),c=(e,s)=>{e.preventDefault(),e.stopPropagation(),i.push({pathname:"".concat(t,"/").concat(r),query:{tab:s}})};return(0,n.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,n.jsx)(x.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,n.jsxs)("button",{onClick:e=>c(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,n.jsx)(N,{className:"w-4 h-4"}),s&&(0,n.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),l&&(0,n.jsx)(x.WH,{content:"View Controller Logs",className:"capitalize text-sm text-muted-foreground",children:(0,n.jsxs)("button",{onClick:e=>c(e,"controllerlogs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,n.jsx)(b,{className:"w-4 h-4"}),s&&(0,n.jsx)("span",{className:"ml-2",children:"Controller Logs"})]})},"controllerlogs")]})}function D(e){let{clusterName:s,clusterJobData:t,loading:a}=e,[l,u]=(0,r.useState)(null),[m,p]=(0,r.useState)({key:null,direction:"ascending"}),[j,f]=(0,r.useState)(1),[g,w]=(0,r.useState)(10),N=(0,r.useRef)(null),[b,y]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=e=>{l&&N.current&&!N.current.contains(e.target)&&u(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l]);let v=r.useMemo(()=>t||[],[t]);(0,r.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(b)&&y(t)},[t,b]);let C=r.useMemo(()=>m.key?[...v].sort((e,s)=>e[m.key]<s[m.key]?"ascending"===m.direction?-1:1:e[m.key]>s[m.key]?"ascending"===m.direction?1:-1:0):v,[v,m]),S=e=>{let s="ascending";m.key===e&&"ascending"===m.direction&&(s="descending"),p({key:e,direction:s})},E=e=>m.key===e?"ascending"===m.direction?" ↑":" ↓":"",L=Math.ceil(C.length/g),R=(j-1)*g,M=R+g,I=C.slice(R,M);return(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)(d.Zb,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Cluster Jobs"}),a&&(0,n.jsxs)("div",{className:"flex items-center mr-2",children:[(0,n.jsx)(c.Z,{size:15,className:"mt-0"}),(0,n.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]})]}),(0,n.jsxs)(h.iA,{children:[(0,n.jsx)(h.xD,{children:(0,n.jsxs)(h.SC,{children:[(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("id"),children:["ID",E("id")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("job"),children:["Name",E("job")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("user"),children:["User",E("user")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("workspace"),children:["Workspace",E("workspace")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("submitted_at"),children:["Submitted",E("submitted_at")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("job_duration"),children:["Duration",E("job_duration")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("status"),children:["Status",E("status")]}),(0,n.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>S("resources"),children:["Resources",E("resources")]}),(0,n.jsx)(h.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,n.jsx)(h.RM,{children:I.length>0?I.map(e=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsxs)(h.SC,{className:l===e.id?"selected-row":"",children:[(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,n.jsx)(Z,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:l,setExpandedRowId:u})})}),(0,n.jsx)(h.pj,{children:e.user}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(i(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,n.jsx)(h.pj,{children:_(e.submitted_at)}),(0,n.jsx)(h.pj,{children:(0,x.LU)(e.job_duration)}),(0,n.jsx)(h.pj,{children:(0,n.jsx)(k.OE,{status:e.status})}),(0,n.jsx)(h.pj,{children:e.resources}),(0,n.jsx)(h.pj,{className:"flex content-center items-center",children:(0,n.jsx)(P,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1})})]}),l===e.id&&(0,n.jsx)(A,{text:e.job||"Unnamed job",colSpan:9,innerRef:N})]},e.id)):(0,n.jsx)(h.SC,{children:(0,n.jsx)(h.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),C.length>0&&(0,n.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,n.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,n.jsxs)("div",{className:"relative inline-block",children:[(0,n.jsxs)("select",{value:g,onChange:e=>{w(parseInt(e.target.value,10)),f(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,n.jsx)("option",{value:5,children:"5"}),(0,n.jsx)("option",{value:10,children:"10"}),(0,n.jsx)("option",{value:20,children:"20"}),(0,n.jsx)("option",{value:50,children:"50"})]}),(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,n.jsxs)("div",{children:[R+1," – ",Math.min(M,C.length)," of"," ",C.length]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{f(e=>Math.max(e-1,1))},disabled:1===j,className:"text-gray-500 h-8 w-8 p-0",children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,n.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,n.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{f(e=>Math.min(e+1,L))},disabled:j===L||0===L,className:"text-gray-500 h-8 w-8 p-0",children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,n.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function A(e){let{text:s,colSpan:t,innerRef:r}=e;return(0,n.jsx)(h.SC,{className:"expanded-details",children:(0,n.jsx)(h.pj,{colSpan:t,children:(0,n.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:r,children:(0,n.jsx)("div",{className:"flex justify-between items-start",children:(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Full Details"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-gray-700",style:{whiteSpace:"pre-wrap"},children:s})]})})})})})}function Z(e){let{text:s,rowId:t,expandedRowId:a,setExpandedRowId:l}=e,i=s.length>50,c=a===t,o=i?"".concat(s.substring(0,50)):s,d=(0,r.useRef)(null);return(0,n.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,n.jsx)("span",{className:"truncate",children:o}),i&&(0,n.jsx)("button",{ref:d,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(c?null:t)},className:"text-blue-600 hover:text-blue-800 font-medium ml-1 flex-shrink-0","data-button-type":"show-more-less",children:c?"... show less":"... show more"})]})}}}]);
@@ -1,6 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37],{9037:function(e,s,t){t.d(s,{Cc:function(){return L},GV:function(){return V}});var r=t(5893),n=t(7294),l=t(1163),a=t(8799),c=t(6989),i=t(1664),o=t.n(i),d=t(803),h=t(7673),u=t(8764),x=t(3266),p=t(7324),j=t(4545),m=t(3626),f=t(998);/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let w=(0,f.Z)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),k=(0,f.Z)("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var g=t(9470),y=t(9284),N=t(9307),v=t(3001),C=t(8950),b=t(6378),S=t(6856);t(1272);let _="__ALL_WORKSPACES__",M=(e,s)=>{let t="",r="";return e>=0&&(t=e+"m",r=" "),s&&(t+="".concat(r,"(down)")),""===t&&(t="-"),t};function L(){let e=(0,l.useRouter)(),[s,t]=(0,n.useState)(!1),i=n.useRef(null),[d,h]=(0,n.useState)(!1),[u,j]=(0,n.useState)(!1),[f,w]=(0,n.useState)(null),[k,N]=(0,n.useState)(_),[M,L]=(0,n.useState)([]),R=(0,v.X)();return(0,n.useEffect)(()=>{e.isReady&&e.query.workspace&&N(Array.isArray(e.query.workspace)?e.query.workspace[0]:e.query.workspace)},[e.isReady,e.query.workspace]),(0,n.useEffect)(()=>{(async()=>{try{await S.ZP.preloadForPage("clusters");let e=await b.ZP.get(p.fX),s=Object.keys(e),t=await b.ZP.get(x.getClusters),r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],n=new Set(s);r.includes("default")&&n.has("default"),r.forEach(e=>n.add(e)),L(Array.from(n).sort())}catch(e){console.error("Error fetching data for workspace filter:",e),L(["default"])}})()},[]),(0,r.jsxs)(g.A,{highlighted:"clusters",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(o(),{href:"/clusters",className:"text-sky-blue hover:underline leading-none",children:"Sky Clusters"}),(0,r.jsxs)(C.Ph,{value:k,onValueChange:N,children:[(0,r.jsx)(C.i4,{className:"h-8 w-48 ml-4 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(C.ki,{placeholder:"Filter by workspace...",children:k===_?"All Workspaces":k})}),(0,r.jsxs)(C.Bw,{children:[(0,r.jsx)(C.Ql,{value:_,children:"All Workspaces"}),M.map(e=>(0,r.jsx)(C.Ql,{value:e,children:e},e))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[s&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(a.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsxs)("button",{onClick:()=>{b.ZP.invalidate(x.getClusters),b.ZP.invalidate(p.fX),i.current&&i.current()},disabled:s,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(m.Z,{className:"h-4 w-4 mr-1.5"}),!R&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(O,{refreshInterval:c.yc,setLoading:t,refreshDataRef:i,workspaceFilter:k,onOpenSSHModal:e=>{w(e),h(!0)},onOpenVSCodeModal:e=>{w(e),j(!0)}}),(0,r.jsx)(y.Oh,{isOpen:d,onClose:()=>h(!1),cluster:f}),(0,r.jsx)(y._R,{isOpen:u,onClose:()=>j(!1),cluster:f})]})}function O(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l,workspaceFilter:i,onOpenSSHModal:p,onOpenVSCodeModal:m}=e,[f,w]=(0,n.useState)([]),[k,g]=(0,n.useState)({key:null,direction:"ascending"}),[y,v]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!0),[L,O]=(0,n.useState)(1),[R,Z]=(0,n.useState)(10),A=n.useCallback(async()=>{t(!0),v(!0),w(await b.ZP.get(x.getClusters)),t(!1),v(!1),S(!1)},[t]),E=n.useMemo(()=>{let e=f;return i&&i!==_&&(e=f.filter(e=>(e.workspace||"default").toLowerCase()===i.toLowerCase())),(0,j.R0)(e,k.key,k.direction)},[f,k,i]);n.useEffect(()=>{l&&(l.current=A)},[l,A]),(0,n.useEffect)(()=>{w([]);let e=!0;A();let t=setInterval(()=>{e&&A()},s);return()=>{e=!1,clearInterval(t)}},[s,A]),(0,n.useEffect)(()=>{O(1)},[f.length]);let W=e=>{let s="ascending";k.key===e&&"ascending"===k.direction&&(s="descending"),g({key:e,direction:s})},q=e=>k.key===e?"ascending"===k.direction?" ↑":" ↓":"",P=Math.ceil(E.length/R),z=(L-1)*R,I=z+R,H=E.slice(z,I);return(0,r.jsxs)("div",{children:[(0,r.jsx)(h.Zb,{children:(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("status"),children:["Status",q("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("cluster"),children:["Cluster",q("cluster")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("user"),children:["User",q("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("workspace"),children:["Workspace",q("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("infra"),children:["Infra",q("infra")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("resources_str"),children:["Resources",q("resources_str")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("time"),children:["Started",q("time")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>W("autostop"),children:["Autostop",q("autostop")]}),(0,r.jsx)(u.ss,{children:"Actions"})]})}),(0,r.jsx)(u.RM,{children:y&&C?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):H.length>0?H.map((e,s)=>(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(N.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(o(),{href:"/clusters/".concat(e.cluster),className:"text-blue-600",children:e.cluster})}),(0,r.jsx)(u.pj,{children:e.user}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(o(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(c.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(o(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(c.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(u.pj,{children:(0,c.GV)(e.time)}),(0,r.jsx)(u.pj,{children:M(e.autostop,e.to_down)}),(0,r.jsx)(u.pj,{className:"text-left",children:(0,r.jsx)(V,{cluster:e.cluster,status:e.status,onOpenSSHModal:p,onOpenVSCodeModal:m})})]},s)):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:"No active clusters"})})})]})}),f.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:R,onChange:e=>{Z(parseInt(e.target.value,10)),O(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[z+1," – ",Math.min(I,f.length)," of"," ",f.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(d.z,{variant:"ghost",size:"icon",onClick:()=>{O(e=>Math.max(e-1,1))},disabled:1===L,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)(d.z,{variant:"ghost",size:"icon",onClick:()=>{O(e=>Math.min(e+1,P))},disabled:L===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"})})})]})]})})]})}let R=(e,s)=>{s&&s(e)},Z=(e,s)=>{s?s(e):window.open("ssh://".concat(e))},A=e=>"RUNNING"===e?["connect","VSCode"]:[],E={connect:(0,r.jsx)(w,{className:"w-4 h-4 text-gray-500 inline-block"}),VSCode:(0,r.jsx)(k,{className:"w-4 h-4 text-gray-500 inline-block"})};function V(e){let{withLabel:s=!1,cluster:t,status:n,onOpenSSHModal:l,onOpenVSCodeModal:a}=e,i=A(n),o=(0,v.X)(),d=e=>{switch(e){case"connect":Z(t,l);break;case"VSCode":R(t,a);break;default:return}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center space-x-4",children:Object.entries(E).map(e=>{let t,n,[l,a]=e;switch(l){case"connect":t="Connect",n="Connect with SSH";break;case"VSCode":t="VSCode",n="Open in VS Code"}return(s||(t=""),i.includes(l))?(0,r.jsx)(c.WH,{content:n,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:()=>d(l),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[a,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},l):(0,r.jsx)(c.WH,{content:n,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("span",{className:"opacity-30 flex items-center cursor-not-allowed text-sm",title:l,children:[a,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},l)})})})}}}]);
@@ -1,6 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[682],{3626:function(e,s,t){t.d(s,{Z:function(){return a}});/**
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 a=(0,t(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},8682:function(e,s,t){t.d(s,{fx:function(){return v}});var a=t(5893),l=t(7294),r=t(8799),n=t(9470),d=t(3626),c=t(3001),i=t(2045),o=t(3266),x=t(8969),m=t(6378),h=t(6856),u=t(1214),g=t(1163),f=t(1664),p=t.n(f),j=t(6989);let N=u.nb.REFRESH_INTERVAL,b=u.MO.NAME_TRUNCATE_LENGTH;function y(e){let{title:s,isLoading:t,isDataLoaded:l,contexts:n,gpus:d,groupedPerContextGPUs:c,groupedPerNodeGPUs:i,handleContextClick:o,contextStats:x={},isSSH:m=!1}=e;return t&&!l?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:s}),(0,a.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,a.jsx)(r.Z,{size:24,className:"mr-3"}),(0,a.jsxs)("span",{className:"text-gray-500",children:["Loading ",s,"..."]})]})]})}):l&&0===n.length?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:s}),(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:["No ",s," found or ",s," is not configured."]})]})}):l&&n.length>0?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:s}),(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-800 rounded-full text-xs font-medium",children:[n.length," ",1===n.length?m?"pool":"context":m?"pools":"contexts"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:m?"Node Pool":"Context"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Clusters"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Jobs"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Nodes"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:"GPU Types"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"#GPUs"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200 ".concat(n.length>5?"max-h-[250px] overflow-y-auto block":""),children:n.map(e=>{let s=c[e]||[],t=i[e]||[],l=s.reduce((e,s)=>e+(s.gpu_total||0),0),r=x[m?"ssh/".concat(e.replace(/^ssh-/,"")):"kubernetes/".concat(e)]||{clusters:0,jobs:0},n=Object.keys(s.reduce((e,s)=>(e[s.gpu_name]=(e[s.gpu_name]||0)+(s.gpu_total||0),e),{})).join(", "),d=m?e.replace(/^ssh-/,""):e;return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3",children:(0,a.jsx)(j.Md,{content:d,className:"text-sm text-muted-foreground",children:(0,a.jsx)("span",{className:"text-blue-600 hover:underline cursor-pointer",onClick:()=>o(e),children:d.length>b?"".concat(d.substring(0,Math.floor((b-3)/2)),"...").concat(d.substring(d.length-Math.ceil((b-3)/2))):d})})}),(0,a.jsx)("td",{className:"p-3",children:r.clusters>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded text-xs font-medium",children:r.clusters}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:r.jobs>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs font-medium",children:r.jobs}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:t.length}),(0,a.jsx)("td",{className:"p-3",children:n||"-"}),(0,a.jsx)("td",{className:"p-3",children:l})]},e)})})]})})}),d.length>0&&(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsxs)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4 whitespace-nowrap",children:["GPU",(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded-full text-xs font-medium whitespace-nowrap",children:[d.reduce((e,s)=>e+s.gpu_free,0)," ","of"," ",d.reduce((e,s)=>e+s.gpu_total,0)," ","free"]})]}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:"Requestable"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/2",children:(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsx)("span",{children:"Utilization"})})})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200 ".concat(d.length>5?"max-h-[250px] overflow-y-auto block":""),children:d.map(e=>{let s=e.gpu_total-e.gpu_free,t=e.gpu_total>0?e.gpu_free/e.gpu_total*100:0,l=e.gpu_total>0?s/e.gpu_total*100:0,r=c?Object.values(c).flat().filter(s=>s.gpu_name===e.gpu_name&&(m?s.context.startsWith("ssh-"):!s.context.startsWith("ssh-"))).map(e=>e.gpu_requestable_qty_per_node).filter((e,s,t)=>t.indexOf(e)===s).join(", "):"-";return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"p-3 font-medium w-24 whitespace-nowrap",children:e.gpu_name}),(0,a.jsxs)("td",{className:"p-3 text-xs text-gray-600",children:[r||"-"," / node"]}),(0,a.jsx)("td",{className:"p-3 w-2/3",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"flex-1 bg-gray-100 rounded-md h-5 flex overflow-hidden shadow-sm min-w-[100px] w-full",children:[l>0&&(0,a.jsx)("div",{style:{width:"".concat(l,"%")},className:"bg-yellow-500 h-full flex items-center justify-center text-white text-xs font-medium",children:l>15&&"".concat(s," used")}),t>0&&(0,a.jsx)("div",{style:{width:"".concat(t,"%")},className:"bg-green-700 h-full flex items-center justify-center text-white text-xs font-medium",children:t>15&&"".concat(e.gpu_free," free")})]})})})]},e.gpu_name)})})]})})})]})]})}):null}function w(e){let{contextName:s,gpusInContext:t,nodesInContext:l}=e;return s.startsWith("ssh-"),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm h-full",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Available GPUs"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6",children:t.map(e=>{let s=e.gpu_total-e.gpu_free,t=e.gpu_total>0?e.gpu_free/e.gpu_total*100:0,l=e.gpu_total>0?s/e.gpu_total*100:0;return(0,a.jsxs)("div",{className:"p-3 bg-gray-50 rounded-md border border-gray-200 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1.5 flex-wrap",children:[(0,a.jsxs)("div",{className:"font-medium text-gray-800 text-sm",children:[e.gpu_name,(0,a.jsxs)("span",{className:"text-xs text-gray-500 ml-2",children:["(Requestable: ",e.gpu_requestable_qty_per_node," / node)"]})]}),(0,a.jsxs)("span",{className:"text-xs font-medium",children:[e.gpu_free," free / ",e.gpu_total," total"]})]}),(0,a.jsxs)("div",{className:"w-full bg-gray-100 rounded-md h-4 flex overflow-hidden shadow-sm",children:[l>0&&(0,a.jsx)("div",{style:{width:"".concat(l,"%")},className:"bg-yellow-500 h-full flex items-center justify-center text-white text-xs",children:l>15&&"".concat(s," used")}),t>0&&(0,a.jsx)("div",{style:{width:"".concat(t,"%")},className:"bg-green-700 h-full flex items-center justify-center text-white text-xs",children:t>15&&"".concat(e.gpu_free," free")})]})]},e.gpu_name)})}),l.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Nodes"}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-100",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"Node"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"GPU"}),(0,a.jsx)("th",{className:"p-3 text-right font-medium text-gray-600",children:"Availability"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:l.map((e,s)=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.node_name}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.gpu_name}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-right text-gray-700",children:"".concat(e.gpu_free," of ").concat(e.gpu_total," free")})]},"".concat(e.node_name,"-").concat(s)))})]})})]})]})})})}function v(){let[e,s]=(0,l.useState)(!0),[t,u]=(0,l.useState)(!0),[f,j]=(0,l.useState)(!0),b=l.useRef(null),v=(0,c.X)(),[_,C]=(0,l.useState)(!1),[S,P]=(0,l.useState)(!1),k=(0,g.useRouter)(),[L,U]=(0,l.useState)([]),[E,I]=(0,l.useState)([]),[M,R]=(0,l.useState)([]),[G,Z]=(0,l.useState)([]),[q,W]=(0,l.useState)([]),[A,z]=(0,l.useState)(0),[H,F]=(0,l.useState)(0),[T,O]=(0,l.useState)({}),[D,J]=(0,l.useState)(null),K=l.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{showLoadingIndicators:!0};e.showLoadingIndicators&&(s(!0),u(!0));try{let{gpuData:e,cloudData:s}=await m.ZP.get(i.l4),{allContextNames:t,allGPUs:a,perContextGPUs:l,perNodeGPUs:r,contextStats:n}=e;U(t||[]),I(a||[]),R(l||[]),Z(r||[]),O(n||{}),C(!0),W((null==s?void 0:s.clouds)||[]),z((null==s?void 0:s.totalClouds)||0),F((null==s?void 0:s.enabledClouds)||0),P(!0)}catch(e){console.error("Error in fetchData:",e)}finally{s(!1),u(!1),f&&e.showLoadingIndicators&&j(!1)}},[f]);(0,l.useEffect)(()=>{b.current=K},[K]),(0,l.useEffect)(()=>{(async()=>{await h.ZP.preloadForPage("infra"),K({showLoadingIndicators:!0})})()},[K]),(0,l.useEffect)(()=>{let e=!0,s=setInterval(()=>{e&&b.current&&b.current({showLoadingIndicators:!1})},N);return()=>{e=!1,clearInterval(s)}},[]),E.length,E.reduce((e,s)=>e+s.gpu_total,0),E.reduce((e,s)=>e+s.gpu_free,0);let V=l.useMemo(()=>M?M.reduce((e,s)=>{let{context:t}=s;return e[t]||(e[t]=[]),e[t].push(s),e},{}):{},[M]),X=l.useMemo(()=>L.filter(e=>e.startsWith("ssh-")),[L]),B=l.useMemo(()=>L.filter(e=>!e.startsWith("ssh-")),[L]),Q=l.useMemo(()=>{if(!M)return[];let e=new Set;return M.forEach(s=>{s.context.startsWith("ssh-")&&e.add(s.gpu_name)}),E.filter(s=>e.has(s.gpu_name))},[E,M]),Y=l.useMemo(()=>{if(!M)return[];let e=new Set;return M.forEach(s=>{s.context.startsWith("ssh-")||e.add(s.gpu_name)}),E.filter(s=>e.has(s.gpu_name))},[E,M]),$=l.useMemo(()=>G?G.reduce((e,s)=>{let{context:t}=s;return e[t]||(e[t]=[]),e[t].push(s),e},{}):{},[G]);(0,l.useEffect)(()=>{k.isReady&&k.query.context&&J(decodeURIComponent(Array.isArray(k.query.context)?k.query.context[0]:k.query.context))},[k.isReady,k.query.context]);let ee=e=>{J(e),k.push("/infra/".concat(encodeURIComponent(e)))},es=e||t;return(0,a.jsxs)(n.A,{highlighted:"infra",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(p(),{href:"/infra",className:"text-sky-blue hover:underline ".concat(D?"":"cursor-default"),children:"Infrastructure"}),D&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),D.startsWith("ssh-")?(0,a.jsx)(p(),{href:"/infra",className:"text-sky-blue hover:underline cursor-pointer",children:"SSH Node Pool"}):(0,a.jsx)(p(),{href:"/infra",className:"text-sky-blue hover:underline cursor-pointer",children:"Kubernetes"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)("span",{className:"text-sky-blue",children:D.startsWith("ssh-")?D.replace(/^ssh-/,""):D})]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[es&&(0,a.jsxs)("div",{className:"flex items-center mr-2",children:[(0,a.jsx)(r.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,a.jsxs)("button",{onClick:()=>{m.ZP.invalidate(o.getClusters),m.ZP.invalidate(x.getManagedJobs),m.ZP.invalidate(i.l4),b.current&&b.current({showLoadingIndicators:!0})},disabled:es,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 mr-1.5"}),!v&&"Refresh"]})]})]}),D?e&&!_?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading Context..."})]}):(s=>{let t=V[s]||[],l=$[s]||[];return e&&!_?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading Context..."})]}):(0,a.jsx)(w,{contextName:s,gpusInContext:t,nodesInContext:l})})(D):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{title:"SSH Node Pool",isLoading:e,isDataLoaded:_,contexts:X,gpus:Q,groupedPerContextGPUs:V,groupedPerNodeGPUs:$,handleContextClick:ee,contextStats:T,isSSH:!0}),(0,a.jsx)(y,{title:"Kubernetes",isLoading:e,isDataLoaded:_,contexts:B,gpus:Y,groupedPerContextGPUs:V,groupedPerNodeGPUs:$,handleContextClick:ee,contextStats:T,isSSH:!1}),t&&!S?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Cloud"}),(0,a.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,a.jsx)(r.Z,{size:24,className:"mr-3"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading Cloud..."})]})]})}):(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Cloud"}),(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-800 rounded-full text-xs font-medium",children:[H," of ",A," enabled"]})]}),0===q.length?(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"No enabled clouds available."}):(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-32",children:"Cloud"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-24",children:"Clusters"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-24",children:"Jobs"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:q.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3 font-medium text-gray-700",children:e.name}),(0,a.jsx)("td",{className:"p-3",children:e.clusters>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded text-xs font-medium",children:e.clusters}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:e.jobs>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs font-medium",children:e.jobs}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})})]},e.name))})]})})]})})]})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[856],{3266:function(e,t,r){r.d(t,{QL:function(){return u},Sl:function(){return l},getClusters:function(){return c}});var a=r(7294),o=r(5821),n=r(3225);let s={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function c(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=await fetch("".concat(n.f4,"/status"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_names:e,all_users:!0})}),r=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("X-Request-ID"),a=await fetch("".concat(n.f4,"/api/get?request_id=").concat(r)),o=await a.json();return(o.return_value?JSON.parse(o.return_value):[]).map(e=>{let t="",r=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let r=Math.floor((t-3)/2),a=r+(t-3)%2;return 0===r?e.substring(0,a)+"...":e.substring(0,a)+"..."+e.substring(e.length-r)}(t,25)),{status:s[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cloud:e.cloud,region:e.region,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:r?"".concat(e.cloud," (").concat(r,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,autostop:e.autostop,to_down:e.to_down,jobs:[],command:e.last_creation_command||e.last_use,task_yaml:e.last_creation_yaml||"{}",events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function l(e){let{clusterName:t,jobId:r,onNewLog:a,workspace:s}=e;try{let e=(await fetch("".concat(n.f4,"/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({follow:!1,cluster_name:t,job_id:r,override_skypilot_config:{active_workspace:s||"default"}})})).body.getReader();for(;;){let{done:t,value:r}=await e.read();if(t)break;let o=new TextDecoder().decode(r);a(o)}}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,o.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function i(e){let{clusterName:t,workspace:r}=e;try{let e=await fetch("".concat(n.f4,"/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:r}})}),a=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),o=await fetch("".concat(n.f4,"/api/get?request_id=").concat(a)),s=await o.json();return JSON.parse(s.return_value).map(e=>{let r=e.end_at?e.end_at:Date.now()/1e3,a=0,o=0;return e.submitted_at&&(a=r-e.submitted_at),e.start_at&&(o=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:a,job_duration:o,infra:"",logs:""}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function u(e){let{cluster:t,job:r=null}=e,[o,n]=(0,a.useState)(null),[s,l]=(0,a.useState)(null),[u,d]=(0,a.useState)(!0),[g,h]=(0,a.useState)(!0),f=(0,a.useCallback)(async()=>{if(t)try{d(!0);let e=await c({clusterNames:[t]});return n(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{d(!1)}return null},[t]),p=(0,a.useCallback)(async e=>{if(t)try{h(!0);let r=await i({clusterName:t,workspace:e||"default"});l(r)}catch(e){console.error("Error fetching cluster job data:",e)}finally{h(!1)}},[t]),b=(0,a.useCallback)(async()=>{let e=await f();e&&await p(e.workspace)},[f,p]);return(0,a.useEffect)(()=>{(async()=>{let e=await f();e&&await p(e.workspace)})()},[t,r,f,p]),{clusterData:o,clusterJobData:s,loading:u||g,refreshData:b}}},2045:function(e,t,r){r.d(t,{l4:function(){return n}});var a=r(3225);async function o(e,t){try{let r=[];try{let e=await fetch("".concat(a.f4,"/enabled_clouds"),{method:"GET",headers:{"Content-Type":"application/json"}}),t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),o=await fetch("".concat(a.f4,"/api/get?request_id=").concat(t)),n=await o.json();r=n.return_value?JSON.parse(n.return_value):[],console.log("Enabled clouds:",r)}catch(e){console.error("Error fetching enabled clouds:",e),r=[]}let o={};a.$m.forEach(e=>{let t=r.includes(e.toLowerCase());o[e]={name:e,clusters:0,jobs:0,enabled:t}}),e.forEach(e=>{if(e.cloud){let t=e.cloud;o[t]&&(o[t].clusters+=1,o[t].enabled=!0)}}),t.forEach(e=>{if(e.cloud){let t=e.cloud;o[t]&&(o[t].jobs+=1,o[t].enabled=!0)}});let n=a.$m.length,s=Object.values(o).filter(e=>e.enabled).length;return{clouds:Object.values(o).filter(e=>e.enabled).sort((e,t)=>t.clusters-e.clusters||t.jobs-e.jobs),totalClouds:n,enabledClouds:s}}catch(e){return console.error("Error fetching cloud infrastructure:",e),{clouds:[],totalClouds:a.$m.length,enabledClouds:0}}}async function n(){let{getClusters:e}=await Promise.resolve().then(r.bind(r,3266)),{getManagedJobs:t}=await Promise.resolve().then(r.bind(r,8969)),[a,n]=await Promise.all([e(),t()]),c=a||[],l=(null==n?void 0:n.jobs)||[],[i,u]=await Promise.all([s(c,l),o(c,l)]);return{gpuData:i,cloudData:u}}async function s(e,t){return await d({clusters:e||[],jobs:t||[]})}async function c(){try{let e=await fetch("".concat(a.f4,"/realtime_kubernetes_gpu_availability"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:null,name_filter:null,quantity_filter:null})});if(!e.ok)return console.error("Error fetching Kubernetes context GPUs (in getKubernetesContextGPUs): ".concat(e.status," ").concat(e.statusText)),[];let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)return console.error("No request ID returned for Kubernetes GPU availability (in getKubernetesContextGPUs)"),[];let r=await fetch("".concat(a.f4,"/api/get?request_id=").concat(t)),o=await r.text();if(500===r.status){try{let e=JSON.parse(o);if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);console.error("[infra.jsx] getKubernetesContextGPUs: Server error detail:",t.message)}catch(t){console.error("[infra.jsx] getKubernetesContextGPUs: Error parsing server error JSON:",t,"Original error text:",e.detail.error)}}catch(e){console.error("[infra.jsx] getKubernetesContextGPUs: Error parsing 500 error response JSON:",e,"Raw text was:",o)}return[]}let n=JSON.parse(o);return n.return_value?JSON.parse(n.return_value):[]}catch(e){return console.error("[infra.jsx] Outer error in getKubernetesContextGPUs:",e),[]}}async function l(){try{let e=await fetch("".concat(a.f4,"/all_contexts"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return console.error("Error fetching all contexts: ".concat(e.status," ").concat(e.statusText)),[];let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)return console.error("No request ID returned for /all_contexts"),[];let r=await fetch("".concat(a.f4,"/api/get?request_id=").concat(t)),o=await r.json();return o.return_value?JSON.parse(o.return_value):[]}catch(e){return console.error("[infra.jsx] Error in getAllContexts:",e),[]}}async function i(e){try{let t=await fetch("".concat(a.f4,"/kubernetes_node_info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),r=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("x-request-id"),o=await fetch("".concat(a.f4,"/api/get?request_id=").concat(r));if(500===o.status){try{let e=await o.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);console.error("Error fetching Kubernetes per node GPUs:",t.message)}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{}}let n=await o.json();return(n.return_value?JSON.parse(n.return_value):{}).node_info_dict||{}}catch(t){return console.error("[infra.jsx] Error in getKubernetesPerNodeGPUs for context",e,":",t),{}}}async function u(e){try{let t=e.clusters,r=e.jobs,a={};return t.forEach(e=>{let t=null;if("Kubernetes"===e.cloud)(t=e.region)&&(t="kubernetes/".concat(t));else if("SSH"===e.cloud&&(t=e.region)){let e=t.startsWith("ssh-")?t.substring(4):t;t="ssh/".concat(e)}t&&(a[t]||(a[t]={clusters:0,jobs:0}),a[t].clusters+=1)}),r.forEach(e=>{let t=null;if("Kubernetes"===e.cloud)(t=e.region)&&(t="kubernetes/".concat(t));else if("SSH"===e.cloud&&(t=e.region)){let e=t.startsWith("ssh-")?t.substring(4):t;t="ssh/".concat(e)}t&&(a[t]||(a[t]={clusters:0,jobs:0}),a[t].jobs+=1)}),a}catch(e){return console.error("=== Error in getContextClustersAndJobs ===",e),{}}}async function d(e){try{let n=await l();if(!n||0===n.length)return console.log("No contexts found from /all_contexts endpoint."),{allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{}};let s=await u(e),d=await c(),g=new Map;d&&d.forEach(e=>{g.set(e[0],e[1])});let h={},f={},p={};for(let e of n){f[e]||(f[e]=[]);let n=g.get(e);if(n&&n.length>0)for(let t of n){let r=t[0],a=t[1].join(", "),o=t[2],n=t[3];r in h?(h[r].gpu_total+=o,h[r].gpu_free+=n):h[r]={gpu_total:o,gpu_free:n,gpu_name:r},f[e].push({gpu_name:r,gpu_requestable_qty_per_node:a,gpu_total:o,gpu_free:n,context:e})}let s=await i(e);if(s&&Object.keys(s).length>0)for(let n in s){var t,r,a,o;let c=s[n],l=c.accelerator_type||"-",i=null!==(a=null===(t=c.total)||void 0===t?void 0:t.accelerator_count)&&void 0!==a?a:0,u=null!==(o=null===(r=c.free)||void 0===r?void 0:r.accelerators_available)&&void 0!==o?o:0;p["".concat(e,"/").concat(n)]={node_name:c.name,gpu_name:l,gpu_total:i,gpu_free:u,context:e},"-"===l||f[e].some(e=>e.gpu_name===l)||(l in h||(h[l]={gpu_total:0,gpu_free:0,gpu_name:l}),f[e].find(e=>e.gpu_name===l)||f[e].push({gpu_name:l,gpu_requestable_qty_per_node:"-",gpu_total:0,gpu_free:0,context:e}))}0===f[e].length&&s&&Object.keys(s).length}return{allContextNames:n.sort(),allGPUs:Object.values(h).sort((e,t)=>e.gpu_name.localeCompare(t.gpu_name)),perContextGPUs:Object.values(f).flat().sort((e,t)=>e.context.localeCompare(t.context)||e.gpu_name.localeCompare(t.gpu_name)),perNodeGPUs:Object.values(p).sort((e,t)=>e.context.localeCompare(t.context)||e.node_name.localeCompare(t.node_name)||e.gpu_name.localeCompare(t.gpu_name)),contextStats:s}}catch(e){return console.error("[infra.jsx] Outer error in getKubernetesGPUs:",e),{allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextStats:{}}}}r(3266),r(8969)},8969:function(e,t,r){r.d(t,{Ce:function(){return i},NJ:function(){return l},Pr:function(){return c},getManagedJobs:function(){return s}});var a=r(7294),o=r(5821),n=r(3225);async function s(){let{allUsers:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=(await fetch("".concat(n.f4,"/jobs/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({all_users:e})})).headers.get("X-Skypilot-Request-ID"),r=await fetch("".concat(n.f4,"/api/get?request_id=").concat(t));if(500===r.status){try{let e=await r.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{jobs:[],controllerStopped:!0}}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{jobs:[],controllerStopped:!1}}let a=await r.json();return{jobs:(a.return_value?JSON.parse(a.return_value):[]).map(e=>{let t=[];e.submitted_at&&t.push({time:new Date(1e3*e.submitted_at),event:"Job submitted."}),e.start_at&&t.push({time:new Date(1e3*e.start_at),event:"Job started."}),e.end_at&&("CANCELLING"==e.status||"CANCELLED"==e.status?t.push({time:new Date(1e3*e.end_at),event:"Job cancelled."}):t.push({time:new Date(1e3*e.end_at),event:"Job completed."})),e.last_recovered_at&&e.last_recovered_at!=e.start_at&&t.push({time:new Date(1e3*e.last_recovered_at),event:"Job recovered."});let r=(e.end_at?e.end_at:Date.now()/1e3)-e.submitted_at,a=e.cloud,o=e.cluster_resources;if(!a){if(e.cluster_resources&&"-"!==e.cluster_resources)try{a=e.cluster_resources.split("(")[0].split("x").pop().trim(),o=e.cluster_resources.replace("".concat(a,"("),"(").replace("x ","x")}catch(e){a="Unknown"}else a="Unknown"}let n="",s=n=e.zone?e.zone:e.region;n&&n.length>15&&(n=n.substring(0,15)+"...");let c=a+" ("+n+")";"-"===n&&(c=a);let l=a+" ("+s+")";return"-"===s&&(l=a),{id:e.job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:r,workspace:e.workspace,status:e.status,priority:e.priority,requested_resources:e.resources,resources_str:o,resources_str_full:e.cluster_resources_full||o,cloud:a,region:e.region,infra:c,full_infra:l,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:t,dag_yaml:e.dag_yaml,entrypoint:e.entrypoint}}),controllerStopped:!1}}catch(e){return console.error("Error fetching managed job data:",e),{jobs:[],controllerStopped:!1}}}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,r]=(0,a.useState)(null),[o,n]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(async function(){try{n(!0);let e=await s({allUsers:!0});r(e)}catch(e){console.error("Error fetching managed job data:",e)}finally{n(!1)}})()},[e]),{jobData:t,loading:o}}async function l(e){let t,{jobId:r,controller:a=!1,signal:s,onNewLog:c}=e,l=Date.now(),i=new Promise(e=>{let r=()=>{let a=Date.now()-l;a>=3e4?e({timeout:!0}):t=setTimeout(r,3e4-a)};t=setTimeout(r,3e4)}),u=(async()=>{try{let e=(await fetch("".concat(n.f4,"/jobs/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({controller:a,follow:!1,job_id:r,tail:1e3}),...s?{signal:s}:{}})).body.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;l=Date.now();let a=new TextDecoder().decode(r);c(a)}}finally{e.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,o.C)("Log request for job ".concat(r," timed out after ").concat(30,"s of inactivity"),"warning");return}}async function i(e,t,r){let a="",s="",c="",l={};if("restartcontroller"===e)a="Restarting",s="restarted",c="jobs/queue",l={all_users:!0,refresh:!0},t="controller";else throw Error("Invalid action: ".concat(e));(0,o.C)("".concat(a," job ").concat(t,"..."),"info");try{try{let e=(await fetch("".concat(n.f4,"/").concat(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).headers.get("X-Skypilot-Request-ID"),i=await fetch("".concat(n.f4,"/api/get?request_id=").concat(e));if(200===i.status)(0,o.C)("Job ".concat(t," ").concat(s," successfully."),"success");else if(500===i.status)try{let e=await i.json();if(e.detail&&e.detail.error)try{let s=JSON.parse(e.detail.error);s.type&&s.type===n.Bo?(0,o.C)("".concat(a," job ").concat(t," is not supported!"),"error",1e4):s.type&&s.type===n.mF?(0,o.C)("Cluster ".concat(r," does not exist."),"error"):s.type&&s.type===n.iW?(0,o.C)("Cluster ".concat(r," is not up."),"error"):(0,o.C)("".concat(a," job ").concat(t," failed: ").concat(s.type),"error")}catch(r){(0,o.C)("".concat(a," job ").concat(t," failed: ").concat(e.detail.error),"error")}else(0,o.C)("".concat(a," job ").concat(t," failed with no details."),"error")}catch(e){(0,o.C)("".concat(a," job ").concat(t," failed with parse error."),"error")}else(0,o.C)("".concat(a," job ").concat(t," failed with status ").concat(i.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,o.C)("Network error ".concat(a," job ").concat(t,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,o.C)("Critical error ".concat(a," job ").concat(t,": ").concat(e.message),"error")}}},5821:function(e,t,r){r.d(t,{C:function(){return a}});function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,a=document.getElementById("toast-container");a||((a=document.createElement("div")).id="toast-container",a.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(a));let o=document.createElement("div");switch(o.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":o.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":o.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":o.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:o.className+=" bg-blue-100 border-blue-500 text-blue-800"}return o.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 '),a.appendChild(o),o.querySelector("button").addEventListener("click",()=>{a.removeChild(o)}),setTimeout(()=>{a.contains(o)&&a.removeChild(o)},r),o}},3081:function(e,t,r){r.d(t,{R:function(){return l},i:function(){return i}});var a=r(3225),o=r(3266),n=r(8969);let s=e=>e&&e.includes("@")?e.split("@")[0]:e||"N/A",c=e=>e&&e.includes("@")?e:"-";async function l(){try{let e=await fetch("".concat(a.f4,"/users"));if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return(await e.json()).map(e=>({userId:e.id,username:e.name}))||[]}catch(e){return console.error("Failed to fetch users:",e),[]}}async function i(){let[e,t,r]=await Promise.all([l(),(0,o.getClusters)(),(0,n.getManagedJobs)()]),a=r.jobs||[];return(e||[]).map(e=>{let r=(t||[]).filter(t=>t.user_hash===e.userId),o=(a||[]).filter(t=>t.user_hash===e.userId);return{...e,usernameDisplay:s(e.username),fullEmail:c(e.username),clusterCount:r.length,jobCount:o.length}})}},6856:function(e,t,r){var a=r(6378),o=r(3266),n=r(8969),s=r(7324),c=r(3081),l=r(2045);let i={base:{getClusters:{fn:o.getClusters,args:[]},getManagedJobs:{fn:n.getManagedJobs,args:[]},getWorkspaces:{fn:s.fX,args:[]},getUsers:{fn:c.R,args:[]},getUsersWithCounts:{fn:c.i,args:[]},getInfraData:{fn:l.l4,args:[]}},dynamic:{getEnabledClouds:{fn:s.yz,requiresWorkspaces:!0}},pages:{clusters:["getClusters","getWorkspaces"],jobs:["getManagedJobs","getClusters","getWorkspaces"],infra:["getInfraData"],workspaces:["getWorkspaces","getClusters","getManagedJobs","getEnabledClouds"],users:["getUsersWithCounts"]}};class u{async preloadForPage(e,t){let{backgroundPreload:r=!0,force:a=!1}=t||{};if(!i.pages[e]){console.warn("Unknown page: ".concat(e));return}console.log("[CachePreloader] Preloading cache for page: ".concat(e));try{await this._loadPageData(e,a),r&&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],r=i.pages[e],o=[];for(let e of r)if(i.base[e]){let{fn:r,args:n}=i.base[e];t&&a.ZP.invalidate(r,n),o.push(a.ZP.get(r,n))}else"getEnabledClouds"===e&&o.push(this._loadEnabledCloudsForAllWorkspaces(t));await Promise.allSettled(o),console.log("[CachePreloader] Loaded data for page: ".concat(e))}async _loadEnabledCloudsForAllWorkspaces(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e&&a.ZP.invalidate(s.fX);let t=await a.ZP.get(s.fX),r=Object.keys(t||{}).map(t=>(e&&a.ZP.invalidate(s.yz,[t]),a.ZP.get(s.yz,[t])));await Promise.allSettled(r)}catch(e){console.error("[CachePreloader] Error loading enabled clouds:",e)}}_backgroundPreloadOtherPages(e){if(this.isPreloading)return;this.isPreloading=!0;let t=Object.keys(i.pages).filter(t=>t!==e);console.log("[CachePreloader] Background preloading pages: ".concat(t.join(", "))),Promise.allSettled(t.map(async e=>{try{await this._loadPageData(e,!1),console.log("[CachePreloader] Background loaded: ".concat(e))}catch(t){console.error("[CachePreloader] Background load failed for ".concat(e,":"),t)}})).then(()=>{this.isPreloading=!1,console.log("[CachePreloader] Background preloading complete")})}async preloadBaseFunctions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];console.log("[CachePreloader] Preloading all base functions");let t=Object.entries(i.base).map(t=>{let[r,{fn:o,args:n}]=t;return e&&a.ZP.invalidate(o,n),a.ZP.get(o,n).catch(e=>{console.error("[CachePreloader] Failed to preload ".concat(r,":"),e)})});await Promise.allSettled(t),console.log("[CachePreloader] Base functions preloaded")}getCacheStats(){return{...a.ZP.getStats(),isPreloading:this.isPreloading,preloadPromises:this.preloadPromises.size}}clearCache(){a.ZP.clear(),this.isPreloading=!1,this.preloadPromises.clear(),console.log("[CachePreloader] Cache cleared")}constructor(){this.isPreloading=!1,this.preloadPromises=new Map}}let d=new u;t.ZP=d},6378:function(e,t,r){let a=r(1214).ej.DEFAULT_TTL;class o{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.ttl||a,n=!1!==r.refreshOnAccess,s=this._generateKey(e,t),c=e.name||"anonymous",l=this.cache.get(s),i=Date.now();if(l&&i-l.lastUpdated<o){let r=Math.round((i-l.lastUpdated)/1e3);return this._debug("Cache HIT for ".concat(c," (age: ").concat(r,"s, TTL: ").concat(Math.round(o/1e3),"s)")),n&&(this.cache.set(s,{data:l.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(c))),this.backgroundJobs.has(s)||this._refreshInBackground(e,t,s),l.data}try{let r=await e(...t);return this.cache.set(s,{data:r,lastUpdated:i}),r}catch(e){if(l)return console.warn("Failed to fetch fresh data for ".concat(s,", returning stale data:"),e),l.data;throw e}}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this._generateKey(e,t);this.cache.delete(r),this.backgroundJobs.delete(r)}invalidateFunction(e){let t=e.name||"anonymous",r=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&r.push(e);r.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[r,a]of this.cache.entries()){let o=e-a.lastUpdated;t.push({key:r,age:Math.round(o/1e3),lastUpdated:new Date(a.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(r)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];this.debugMode&&console.log("[DashboardCache] ".concat(e),...r)}_refreshInBackground(e,t,r){this.backgroundJobs.set(r,!0),e(...t).then(e=>{this.cache.set(r,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(r,":"),e)}).finally(()=>{this.backgroundJobs.delete(r)})}_generateKey(e,t){let r=e.name||"anonymous",a=t.length>0?JSON.stringify(t):"";return"".concat(r,"_").concat(a)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.debugMode=!1}}let n=new o;t.ZP=n}}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[826],{4966:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters/[cluster]/[job]",function(){return s(190)}])},3626:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
2
- * @license lucide-react v0.407.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */let r=(0,s(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},9307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return c},OE:function(){return d}});var r=s(5893);s(7294);var a=s(8799),n=s(6989),l=s(3850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},i=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(a.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":default:return(0,r.jsx)(l.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(l.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.jsx)(l.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return(0,r.jsx)(l.J$,{className:"w-3 h-3 mr-1"})}},o=e=>{let t=c(e),s=i(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,r.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:o(t)})})}},7673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return o},Zb:function(){return i},aY:function(){return m},eW:function(){return x},ll:function(){return d}});var r=s(5893),a=s(7294),n=s(5697),l=s.n(n),c=s(2350);let i=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:a})});i.displayName="Card",i.propTypes={className:l().string,children:l().node};let o=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:a})});o.displayName="CardHeader",o.propTypes={className:l().string,children:l().node};let d=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:a})});d.displayName="CardTitle",d.propTypes={className:l().string,children:l().node};let u=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",s),...n,children:a})});u.displayName="CardDescription",u.propTypes={className:l().string,children:l().node};let m=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",s),...n,children:a})});m.displayName="CardContent",m.propTypes={className:l().string,children:l().node};let x=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",s),...n,children:a})});x.displayName="CardFooter",x.propTypes={className:l().string,children:l().node}},3266:function(e,t,s){"use strict";s.d(t,{QL:function(){return d},Sl:function(){return i},getClusters:function(){return c}});var r=s(7294),a=s(5821),n=s(3225);let l={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function c(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=await fetch("".concat(n.f4,"/status"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_names:e,all_users:!0})}),s=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("X-Request-ID"),r=await fetch("".concat(n.f4,"/api/get?request_id=").concat(s)),a=await r.json();return(a.return_value?JSON.parse(a.return_value):[]).map(e=>{let t="",s=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let s=Math.floor((t-3)/2),r=s+(t-3)%2;return 0===s?e.substring(0,r)+"...":e.substring(0,r)+"..."+e.substring(e.length-s)}(t,25)),{status:l[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cloud:e.cloud,region:e.region,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:s?"".concat(e.cloud," (").concat(s,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,autostop:e.autostop,to_down:e.to_down,jobs:[],command:e.last_creation_command||e.last_use,task_yaml:e.last_creation_yaml||"{}",events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function i(e){let{clusterName:t,jobId:s,onNewLog:r,workspace:l}=e;try{let e=(await fetch("".concat(n.f4,"/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({follow:!1,cluster_name:t,job_id:s,override_skypilot_config:{active_workspace:l||"default"}})})).body.getReader();for(;;){let{done:t,value:s}=await e.read();if(t)break;let a=new TextDecoder().decode(s);r(a)}}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,a.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function o(e){let{clusterName:t,workspace:s}=e;try{let e=await fetch("".concat(n.f4,"/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:s}})}),r=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),a=await fetch("".concat(n.f4,"/api/get?request_id=").concat(r)),l=await a.json();return JSON.parse(l.return_value).map(e=>{let s=e.end_at?e.end_at:Date.now()/1e3,r=0,a=0;return e.submitted_at&&(r=s-e.submitted_at),e.start_at&&(a=s-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:r,job_duration:a,infra:"",logs:""}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function d(e){let{cluster:t,job:s=null}=e,[a,n]=(0,r.useState)(null),[l,i]=(0,r.useState)(null),[d,u]=(0,r.useState)(!0),[m,x]=(0,r.useState)(!0),h=(0,r.useCallback)(async()=>{if(t)try{u(!0);let e=await c({clusterNames:[t]});return n(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{u(!1)}return null},[t]),f=(0,r.useCallback)(async e=>{if(t)try{x(!0);let s=await o({clusterName:t,workspace:e||"default"});i(s)}catch(e){console.error("Error fetching cluster job data:",e)}finally{x(!1)}},[t]),N=(0,r.useCallback)(async()=>{let e=await h();e&&await f(e.workspace)},[h,f]);return(0,r.useEffect)(()=>{(async()=>{let e=await h();e&&await f(e.workspace)})()},[t,s,h,f]),{clusterData:a,clusterJobData:l,loading:d||m,refreshData:N}}},5821:function(e,t,s){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=document.getElementById("toast-container");r||((r=document.createElement("div")).id="toast-container",r.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(r));let a=document.createElement("div");switch(a.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":a.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":a.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":a.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:a.className+=" bg-blue-100 border-blue-500 text-blue-800"}return a.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),r.appendChild(a),a.querySelector("button").addEventListener("click",()=>{r.removeChild(a)}),setTimeout(()=>{r.contains(a)&&r.removeChild(a)},s),a}s.d(t,{C:function(){return r}})},190:function(e,t,s){"use strict";s.r(t),s.d(t,{JobDetailPage:function(){return j}});var r=s(5893),a=s(7294),n=s(9470),l=s(7673),c=s(1664),i=s.n(c),o=s(1163),d=s(3266),u=s(6989),m=s(3626),x=s(8799),h=s(9307),f=s(3001),N=s(9008),g=s.n(N);function b(e){let{cluster:t,job:s,jobData:a,onRefresh:n,isRefreshing:l,loading:c}=e,o=(0,f.X)();return(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(i(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsx)(i(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsxs)(i(),{href:"/clusters/".concat(t,"/").concat(s),className:"text-sky-blue hover:underline",children:[s,a.job&&"-"!=a.job?" (".concat(a.job,")"):""]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[(c||l)&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(x.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"text-sm ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsx)(u.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.jsxs)("button",{onClick:n,disabled:c||l,className:"text-sm text-sky-blue hover:text-sky-blue-bright font-medium mx-2 flex items-center",children:[(0,r.jsx)(m.Z,{className:"w-4 h-4 mr-1.5"}),!o&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]})}function j(){let e=(0,o.useRouter)(),{cluster:t,job:s}=e.query,{clusterData:c,clusterJobData:f,loading:N,refreshData:j}=(0,d.QL)({cluster:t}),[p,y]=(0,a.useState)(!1),[w,v]=(0,a.useState)(!0),[E,_]=(0,a.useState)(!1),[C,k]=(0,a.useState)([]),[D,T]=(0,a.useState)(!1),R=(0,a.useMemo)(()=>["INIT","PENDING","SETTING_UP"],[]),S=(0,a.useMemo)(()=>{if(!f||!s)return!0;let e=f.find(e=>e.id==s);return e&&R.includes(e.status)},[f,s,R]);a.useEffect(()=>{!N&&w&&v(!1)},[N,w]),(0,a.useEffect)(()=>{let e=!0;return t&&s&&!S?(_(!0),(0,d.Sl)({clusterName:t,jobId:s,onNewLog:t=>{if(e){let e=(0,u.q8)(t);k(t=>[...t,e])}},workspace:null==c?void 0:c.workspace}).then(()=>{e&&_(!1)}).catch(t=>{e&&(console.error("Error streaming logs:",t),_(!1))})):_(!1),()=>{e=!1}},[t,s,D,S,c]);let I=async()=>{y(!0),T(e=>!e),k([]);try{j&&await j()}catch(e){console.error("Error refreshing data:",e)}finally{y(!1)}};if(!e.isReady)return(0,r.jsx)("div",{children:"Loading..."});let L={id:s};if(c&&f){let e=f.find(e=>e.id==s);e&&(L={...e,infra:c.infra,cluster:c.cluster,user:c.user})}let O=t&&s?"Job: ".concat(s," @ ").concat(t," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g(),{children:(0,r.jsx)("title",{children:O})}),(0,r.jsxs)(n.A,{highlighted:"clusters",children:[(0,r.jsx)(b,{cluster:t,job:s,jobData:L,onRefresh:I,isRefreshing:p,loading:N}),N&&w?(0,r.jsxs)("div",{className:"flex items-center justify-center h-64",children:[(0,r.jsx)(x.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)("div",{id:"details",children:(0,r.jsxs)(l.Zb,{children:[(0,r.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Details"})}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.id})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job Name"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.job})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(h.OE,{status:L.status})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.user})]}),L.resources&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.resources||"N/A"})]}),L.cluster&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(i(),{href:"/clusters/".concat(L.cluster),className:"text-sky-blue hover:underline",children:L.cluster})})]})]})})]})}),(0,r.jsx)("div",{id:"logs",className:"mt-6",children:(0,r.jsxs)(l.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Logs"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,r.jsx)(u.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{T(e=>!e),k([])},disabled:E,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(m.Z,{className:"w-4 h-4 ".concat(E?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:S?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job to start, please refresh after a while"})}):E?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(x.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",children:(0,r.jsx)(u.$B,{logs:C.join("")})})})]})})]})]})]})}t.default=j}},function(e){e.O(0,[614,470,888,774,179],function(){return e(e.s=4966)}),_N_E=e.O()}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[722],{8706:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters/[cluster]",function(){return t(6996)}])},6639:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});/**
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 a=(0,t(998).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},6996:function(e,s,t){"use strict";t.r(s);var a=t(5893),r=t(7294),l=t(8799),n=t(8236),i=t(1163),c=t(9470),d=t(1664),x=t.n(d),m=t(9037),o=t(9307),u=t(7673),h=t(3266),j=t(3626),f=t(5895),N=t(6639),v=t(1272),b=t(6989),y=t(9284),g=t(3001),p=t(9008),w=t.n(p);let _=(e,s)=>{let t="",a="";return e>=0&&(t=e+"m",a=" "),s&&(t+="".concat(a,"(down)")),""===t&&(t="-"),t};function k(e){let{clusterData:s,clusterJobData:t,loading:l}=e,[i,c]=(0,r.useState)(!1),d=(null==s?void 0:s.command)||(null==s?void 0:s.task_yaml);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)(u.Zb,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Details"})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(o.OE,{status:s.status})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.cluster})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.user})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Infra"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.infra?(0,a.jsx)(b.Md,{content:s.full_infra||s.infra,className:"text-sm text-muted-foreground",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(x(),{href:"/infra",className:"text-blue-600 hover:underline",children:s.cloud||s.infra.split("(")[0].trim()}),s.infra.includes("(")&&(0,a.jsx)("span",{children:" "+s.infra.substring(s.infra.indexOf("("))})]})}):"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Resources"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.resources_str_full||s.resources_str||"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Started"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.time?new Date(s.time).toLocaleString():"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Autostop"}),(0,a.jsx)("div",{className:"text-base mt-1",children:_(s.autostop,s.to_down)})]}),d&&(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Entrypoint"}),(0,a.jsxs)("div",{className:"space-y-4 mt-3",children:[s.command&&(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3",children:(0,a.jsx)("code",{className:"text-sm text-gray-800 font-mono break-all",children:s.command})})}),s.task_yaml&&"{}"!==s.task_yaml&&(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{onClick:()=>{c(!i)},className:"flex items-center text-left focus:outline-none mb-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",children:(0,a.jsxs)("div",{className:"flex items-center",children:[i?(0,a.jsx)(f.Z,{className:"w-4 h-4 mr-1"}):(0,a.jsx)(N.Z,{className:"w-4 h-4 mr-1"}),(0,a.jsx)("span",{className:"text-base",children:"Show SkyPilot YAML"})]})}),i&&(0,a.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 max-h-96 overflow-y-auto",children:(0,a.jsx)("pre",{className:"text-sm text-gray-800 font-mono whitespace-pre-wrap",children:(e=>{if(!e)return"No YAML available";try{let s=v.ZP.load(e),t=v.ZP.dump(s,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),a=[],r=-1;for(let e=0;e<t.length;e++){let s=t[e],l=s.search(/\S/);0===l&&r>=0&&e>0&&a.push(""),a.push(s),r=l}return a.join("\n").trim()}catch(s){return console.error("YAML formatting error:",s),e}})(s.task_yaml)})})]})]})]})]})})]})}),(0,a.jsx)("div",{className:"mb-8",children:t&&(0,a.jsx)(n.L4,{clusterName:s.cluster,clusterJobData:t,loading:l})})]})}s.default=function(){let e=(0,i.useRouter)(),{cluster:s}=e.query,[t,n]=(0,r.useState)(!1),[d,o]=(0,r.useState)(!0),[u,f]=(0,r.useState)(!1),[N,v]=(0,r.useState)(!1),p=(0,g.X)(),{clusterData:_,clusterJobData:S,loading:C,refreshData:L}=(0,h.QL)({cluster:s});r.useEffect(()=>{!C&&d&&o(!1)},[C,d]);let Z=async()=>{n(!0),await L(),n(!1)};if(!e.isReady)return(0,a.jsx)("div",{children:"Loading..."});let O=s?"Cluster: ".concat(s," | SkyPilot Dashboard"):"Cluster Details | SkyPilot Dashboard";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w(),{children:(0,a.jsx)("title",{children:O})}),(0,a.jsxs)(c.A,{highlighted:"clusters",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(x(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(x(),{href:"/clusters/".concat(s),className:"text-sky-blue hover:underline",children:s})]}),(0,a.jsx)("div",{className:"text-sm flex items-center",children:(0,a.jsxs)("div",{className:"text-sm flex items-center",children:[(C||t)&&(0,a.jsxs)("div",{className:"flex items-center mr-4",children:[(0,a.jsx)(l.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),_&&(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(b.WH,{content:"Refresh",className:"text-sm text-muted-foreground",children:(0,a.jsxs)("button",{onClick:Z,disabled:C||t,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,a.jsx)(j.Z,{className:"w-4 h-4 mr-1.5"}),!p&&(0,a.jsx)("span",{children:"Refresh"})]})}),(0,a.jsx)(m.GV,{withLabel:!0,cluster:_.cluster,status:_.status,onOpenSSHModal:()=>{f(!0)},onOpenVSCodeModal:()=>{v(!0)}})]})]})})]}),C&&d?(0,a.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,a.jsx)(l.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading..."})]}):_?(0,a.jsx)(k,{clusterData:_,clusterJobData:S,loading:C||t}):null,(0,a.jsx)(y.Oh,{isOpen:u,onClose:()=>f(!1),cluster:s}),(0,a.jsx)(y._R,{isOpen:N,onClose:()=>v(!1),cluster:s})]})]})}}},function(e){e.O(0,[614,798,121,470,293,856,973,236,37,888,774,179],function(){return e(e.s=8706)}),_N_E=e.O()}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[490],{4483:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/config",function(){return n(9377)}])},9333:function(e,r,n){"use strict";n.d(r,{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,n(998).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"}]])},1812:function(e,r,n){"use strict";n.d(r,{X:function(){return i}});var t=n(5893),s=n(7294);let l=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let r=e.message;return r.includes("failed:")&&(r=r.split("failed:")[1].trim()),r.charAt(0).toUpperCase()+r.slice(1)},i=e=>{let{error:r,title:n="Error",onDismiss:i}=e,[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{r&&o(!1)},[r]),!r||a)return null;let c="string"==typeof r?r:l(r);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:[n,":"]})," ",c]})})]}),(0,t.jsx)("button",{onClick:()=>{o(!0),i&&i()},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"})})})]})})}},803:function(e,r,n){"use strict";n.d(r,{z:function(){return c}});var t=n(5893),s=n(7294),l=n(8426),i=n(2003),a=n(2350);let o=(0,i.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"}}),c=s.forwardRef((e,r)=>{let{className:n,variant:s,size:i,asChild:c=!1,...d}=e,u=c?l.g7:"button";return(0,t.jsx)(u,{className:(0,a.cn)(o({variant:s,size:i,className:n})),ref:r,...d})});c.displayName="Button"},7673:function(e,r,n){"use strict";n.d(r,{Ol:function(){return c},Zb:function(){return o},aY:function(){return f},eW:function(){return m},ll:function(){return d}});var t=n(5893),s=n(7294),l=n(5697),i=n.n(l),a=n(2350);let o=s.forwardRef((e,r)=>{let{className:n,children:s,...l}=e;return(0,t.jsx)("div",{ref:r,className:(0,a.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",n),...l,children:s})});o.displayName="Card",o.propTypes={className:i().string,children:i().node};let c=s.forwardRef((e,r)=>{let{className:n,children:s,...l}=e;return(0,t.jsx)("div",{ref:r,className:(0,a.cn)("flex flex-col space-y-1.5 p-6",n),...l,children:s})});c.displayName="CardHeader",c.propTypes={className:i().string,children:i().node};let d=s.forwardRef((e,r)=>{let{className:n,children:s,...l}=e;return(0,t.jsx)("h3",{ref:r,className:(0,a.cn)("text-2xl font-semibold leading-none tracking-tight",n),...l,children:s})});d.displayName="CardTitle",d.propTypes={className:i().string,children:i().node};let u=s.forwardRef((e,r)=>{let{className:n,children:s,...l}=e;return(0,t.jsx)("p",{ref:r,className:(0,a.cn)("text-sm text-muted-foreground",n),...l,children:s})});u.displayName="CardDescription",u.propTypes={className:i().string,children:i().node};let f=s.forwardRef((e,r)=>{let{className:n,children:s,...l}=e;return(0,t.jsx)("div",{ref:r,className:(0,a.cn)("p-6 pt-0",n),...l,children:s})});f.displayName="CardContent",f.propTypes={className:i().string,children:i().node};let m=s.forwardRef((e,r)=>{let{className:n,children:s,...l}=e;return(0,t.jsx)("div",{ref:r,className:(0,a.cn)("flex items-center p-6 pt-0",n),...l,children:s})});m.displayName="CardFooter",m.propTypes={className:i().string,children:i().node}},9377:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return g}});var t=n(5893),s=n(7294),l=n(1163),i=n(9470);n(1664);var a=n(9008),o=n.n(a),c=n(803),d=n(7673),u=n(7324),f=n(1812),m=n(8799),x=n(9333),h=n(1272),p=n(3225);function v(){let[e,r]=(0,s.useState)(null);return((0,s.useEffect)(()=>{fetch("".concat(p.f4,"/api/health")).then(e=>e.json()).then(e=>{e.version&&r(e.version)}).catch(e=>{console.error("Error fetching version:",e)})},[]),e)?(0,t.jsxs)("div",{className:"text-sm text-gray-500",children:["Version: ",e]}):null}function g(){let e=(0,l.useRouter)(),[r,n]=(0,s.useState)(""),[a,p]=(0,s.useState)(!0),[g,y]=(0,s.useState)(!1),[j,b]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1);(0,s.useEffect)(()=>{k()},[]);let k=async()=>{p(!0),b(null);try{let e=await (0,u.iE)();0===Object.keys(e).length?n(""):n(h.ZP.dump(e,{indent:2}))}catch(e){console.error("Error loading config:",e),b(e)}finally{p(!1)}},C=async()=>{y(!0),b(null),w(!1);try{let e=h.ZP.load(r);if(null==e&&(e={}),"object"!=typeof e||Array.isArray(e)){let r="Invalid config structure: Configuration must be a mapping (key-value pairs) in YAML format.";Array.isArray(e),r="Invalid config structure: Configuration must be a mapping (key-value pairs) in YAML format.",b(Error(r)),y(!1);return}await (0,u.rF)(e),w(!0),setTimeout(()=>w(!1),3e3)}catch(e){console.error("Error saving config:",e),b(e)}finally{y(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o(),{children:(0,t.jsx)("title",{children:"Edit SkyPilot Configuration | SkyPilot Dashboard"})}),(0,t.jsxs)(i.A,{highlighted:"workspaces",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 Configuration"})}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("div",{className:"text-sm flex items-center",children:(a||g)&&(0,t.jsxs)("div",{className:"flex items-center mr-4",children:[(0,t.jsx)(m.Z,{size:15,className:"mt-0"}),(0,t.jsx)("span",{className:"ml-2 text-gray-500",children:g?"Applying...":"Loading..."})]})}),(0,t.jsx)(v,{})]})]}),(0,t.jsxs)(d.Zb,{className:"w-full",children:[(0,t.jsx)(d.Ol,{children:(0,t.jsx)(d.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)(d.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",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!"})})]})}),j&&(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(f.X,{error:j,title:"Failed to apply new configuration",onDismiss:()=>b(null)})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)("textarea",{value:r,onChange:e=>n(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:a?"Loading configuration...":"# Enter SkyPilot configuration in YAML format\n# Example:\n# kubernetes:\n# allowed_contexts: [default, my-context]",disabled:a||g})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-3 pt-3",children:[(0,t.jsx)(c.z,{variant:"outline",onClick:()=>{e.push("/workspaces")},disabled:g,children:"Cancel"}),(0,t.jsx)(c.z,{onClick:C,disabled:a||g,className:"inline-flex items-center bg-blue-600 hover:bg-blue-700 text-white",children:g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Z,{size:16,className:"mr-2"}),"Applying..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Z,{className:"w-4 h-4 mr-1.5"}),"Apply"]})})]})]})]})]})]})}},2003:function(e,r,n){"use strict";n.d(r,{j:function(){return i}});var t=n(512);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=t.W,i=(e,r)=>n=>{var t;if((null==r?void 0:r.variants)==null)return l(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:i,defaultVariants:a}=r,o=Object.keys(i).map(e=>{let r=null==n?void 0:n[e],t=null==a?void 0:a[e];if(null===r)return null;let l=s(r)||s(t);return i[e][l]}),c=n&&Object.entries(n).reduce((e,r)=>{let[n,t]=r;return void 0===t||(e[n]=t),e},{});return l(e,o,null==r?void 0:null===(t=r.compoundVariants)||void 0===t?void 0:t.reduce((e,r)=>{let{class:n,className:t,...s}=r;return Object.entries(s).every(e=>{let[r,n]=e;return Array.isArray(n)?n.includes({...a,...c}[r]):({...a,...c})[r]===n})?[...e,n,t]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}}},function(e){e.O(0,[614,798,470,293,888,774,179],function(){return e(e.s=4483)}),_N_E=e.O()}]);