skypilot-nightly 1.0.0.dev20251210__py3-none-any.whl → 1.0.0.dev20260112__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.
- sky/__init__.py +4 -2
- sky/adaptors/slurm.py +159 -72
- sky/backends/backend_utils.py +52 -10
- sky/backends/cloud_vm_ray_backend.py +192 -32
- sky/backends/task_codegen.py +40 -2
- sky/catalog/data_fetchers/fetch_gcp.py +9 -1
- sky/catalog/data_fetchers/fetch_nebius.py +1 -1
- sky/catalog/data_fetchers/fetch_vast.py +4 -2
- sky/catalog/seeweb_catalog.py +30 -15
- sky/catalog/shadeform_catalog.py +5 -2
- sky/catalog/slurm_catalog.py +0 -7
- sky/catalog/vast_catalog.py +30 -6
- sky/check.py +11 -8
- sky/client/cli/command.py +106 -54
- sky/client/interactive_utils.py +190 -0
- sky/client/sdk.py +8 -0
- sky/client/sdk_async.py +9 -0
- sky/clouds/aws.py +60 -2
- sky/clouds/azure.py +2 -0
- sky/clouds/kubernetes.py +2 -0
- sky/clouds/runpod.py +38 -7
- sky/clouds/slurm.py +44 -12
- sky/clouds/ssh.py +1 -1
- sky/clouds/vast.py +30 -17
- sky/core.py +69 -1
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/3nu-b8raeKRNABZ2d4GAG/_buildManifest.js +1 -0
- sky/dashboard/out/_next/static/chunks/1871-0565f8975a7dcd10.js +6 -0
- sky/dashboard/out/_next/static/chunks/2109-55a1546d793574a7.js +11 -0
- sky/dashboard/out/_next/static/chunks/2521-099b07cd9e4745bf.js +26 -0
- sky/dashboard/out/_next/static/chunks/2755.a636e04a928a700e.js +31 -0
- sky/dashboard/out/_next/static/chunks/3495.05eab4862217c1a5.js +6 -0
- sky/dashboard/out/_next/static/chunks/3785.cfc5dcc9434fd98c.js +1 -0
- sky/dashboard/out/_next/static/chunks/3981.645d01bf9c8cad0c.js +21 -0
- sky/dashboard/out/_next/static/chunks/4083-0115d67c1fb57d6c.js +21 -0
- sky/dashboard/out/_next/static/chunks/{8640.5b9475a2d18c5416.js → 429.a58e9ba9742309ed.js} +2 -2
- sky/dashboard/out/_next/static/chunks/4555.8e221537181b5dc1.js +6 -0
- sky/dashboard/out/_next/static/chunks/4725.937865b81fdaaebb.js +6 -0
- sky/dashboard/out/_next/static/chunks/6082-edabd8f6092300ce.js +25 -0
- sky/dashboard/out/_next/static/chunks/6989-49cb7dca83a7a62d.js +1 -0
- sky/dashboard/out/_next/static/chunks/6990-630bd2a2257275f8.js +1 -0
- sky/dashboard/out/_next/static/chunks/7248-a99800d4db8edabd.js +1 -0
- sky/dashboard/out/_next/static/chunks/754-cfc5d4ad1b843d29.js +18 -0
- sky/dashboard/out/_next/static/chunks/8050-dd8aa107b17dce00.js +16 -0
- sky/dashboard/out/_next/static/chunks/8056-d4ae1e0cb81e7368.js +1 -0
- sky/dashboard/out/_next/static/chunks/8555.011023e296c127b3.js +6 -0
- sky/dashboard/out/_next/static/chunks/8821-93c25df904a8362b.js +1 -0
- sky/dashboard/out/_next/static/chunks/8969-0662594b69432ade.js +1 -0
- sky/dashboard/out/_next/static/chunks/9025.f15c91c97d124a5f.js +6 -0
- sky/dashboard/out/_next/static/chunks/{9353-8369df1cf105221c.js → 9353-7ad6bd01858556f1.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/_app-5a86569acad99764.js +34 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8297476714acb4ac.js +6 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-337c3ba1085f1210.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/{clusters-9e5d47818b9bdadd.js → clusters-57632ff3684a8b5c.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/infra/[context]-5fd3a453c079c2ea.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/infra-9f85c02c9c6cae9e.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-90f16972cbecf354.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/pools/[pool]-2dd42fc37aad427a.js +16 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs-ed806aeace26b972.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/users-bec34706b36f3524.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/{volumes-ef19d49c6d0e8500.js → volumes-a83ba9b38dff7ea9.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/workspaces/{[name]-96e0f298308da7e2.js → [name]-c781e9c3e52ef9fc.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/workspaces-91e0942f47310aae.js +1 -0
- sky/dashboard/out/_next/static/chunks/webpack-cfe59cf684ee13b9.js +1 -0
- sky/dashboard/out/_next/static/css/b0dbca28f027cc19.css +3 -0
- sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
- sky/dashboard/out/clusters/[cluster].html +1 -1
- sky/dashboard/out/clusters.html +1 -1
- sky/dashboard/out/config.html +1 -1
- sky/dashboard/out/index.html +1 -1
- sky/dashboard/out/infra/[context].html +1 -1
- sky/dashboard/out/infra.html +1 -1
- sky/dashboard/out/jobs/[job].html +1 -1
- sky/dashboard/out/jobs/pools/[pool].html +1 -1
- sky/dashboard/out/jobs.html +1 -1
- sky/dashboard/out/plugins/[...slug].html +1 -1
- sky/dashboard/out/users.html +1 -1
- sky/dashboard/out/volumes.html +1 -1
- sky/dashboard/out/workspace/new.html +1 -1
- sky/dashboard/out/workspaces/[name].html +1 -1
- sky/dashboard/out/workspaces.html +1 -1
- sky/data/data_utils.py +26 -12
- sky/data/mounting_utils.py +29 -4
- sky/global_user_state.py +108 -16
- sky/jobs/client/sdk.py +8 -3
- sky/jobs/controller.py +191 -31
- sky/jobs/recovery_strategy.py +109 -11
- sky/jobs/server/core.py +81 -4
- sky/jobs/server/server.py +14 -0
- sky/jobs/state.py +417 -19
- sky/jobs/utils.py +73 -80
- sky/models.py +9 -0
- sky/optimizer.py +2 -1
- sky/provision/__init__.py +11 -9
- sky/provision/kubernetes/utils.py +122 -15
- sky/provision/kubernetes/volume.py +52 -17
- sky/provision/provisioner.py +2 -1
- sky/provision/runpod/instance.py +3 -1
- sky/provision/runpod/utils.py +13 -1
- sky/provision/runpod/volume.py +25 -9
- sky/provision/slurm/instance.py +75 -29
- sky/provision/slurm/utils.py +213 -107
- sky/provision/vast/utils.py +1 -0
- sky/resources.py +135 -13
- sky/schemas/api/responses.py +4 -0
- sky/schemas/db/global_user_state/010_save_ssh_key.py +1 -1
- sky/schemas/db/spot_jobs/008_add_full_resources.py +34 -0
- sky/schemas/db/spot_jobs/009_job_events.py +32 -0
- sky/schemas/db/spot_jobs/010_job_events_timestamp_with_timezone.py +43 -0
- sky/schemas/db/spot_jobs/011_add_links.py +34 -0
- sky/schemas/generated/jobsv1_pb2.py +9 -5
- sky/schemas/generated/jobsv1_pb2.pyi +12 -0
- sky/schemas/generated/jobsv1_pb2_grpc.py +44 -0
- sky/schemas/generated/managed_jobsv1_pb2.py +32 -28
- sky/schemas/generated/managed_jobsv1_pb2.pyi +11 -2
- sky/serve/serve_utils.py +232 -40
- sky/server/common.py +17 -0
- sky/server/constants.py +1 -1
- sky/server/metrics.py +6 -3
- sky/server/plugins.py +16 -0
- sky/server/requests/payloads.py +18 -0
- sky/server/requests/request_names.py +2 -0
- sky/server/requests/requests.py +28 -10
- sky/server/requests/serializers/encoders.py +5 -0
- sky/server/requests/serializers/return_value_serializers.py +14 -4
- sky/server/server.py +434 -107
- sky/server/uvicorn.py +5 -0
- sky/setup_files/MANIFEST.in +1 -0
- sky/setup_files/dependencies.py +21 -10
- sky/sky_logging.py +2 -1
- sky/skylet/constants.py +22 -5
- sky/skylet/executor/slurm.py +4 -6
- sky/skylet/job_lib.py +89 -4
- sky/skylet/services.py +18 -3
- sky/ssh_node_pools/deploy/tunnel/cleanup-tunnel.sh +62 -0
- sky/ssh_node_pools/deploy/tunnel/ssh-tunnel.sh +379 -0
- sky/templates/kubernetes-ray.yml.j2 +4 -6
- sky/templates/slurm-ray.yml.j2 +32 -2
- sky/templates/websocket_proxy.py +18 -41
- sky/users/permission.py +61 -51
- sky/utils/auth_utils.py +42 -0
- sky/utils/cli_utils/status_utils.py +19 -5
- sky/utils/cluster_utils.py +10 -3
- sky/utils/command_runner.py +256 -94
- sky/utils/command_runner.pyi +16 -0
- sky/utils/common_utils.py +30 -29
- sky/utils/context.py +32 -0
- sky/utils/db/db_utils.py +36 -6
- sky/utils/db/migration_utils.py +41 -21
- sky/utils/infra_utils.py +5 -1
- sky/utils/instance_links.py +139 -0
- sky/utils/interactive_utils.py +49 -0
- sky/utils/kubernetes/generate_kubeconfig.sh +42 -33
- sky/utils/kubernetes/rsync_helper.sh +5 -1
- sky/utils/plugin_extensions/__init__.py +14 -0
- sky/utils/plugin_extensions/external_failure_source.py +176 -0
- sky/utils/resources_utils.py +10 -8
- sky/utils/rich_utils.py +9 -11
- sky/utils/schemas.py +63 -20
- sky/utils/status_lib.py +7 -0
- sky/utils/subprocess_utils.py +17 -0
- sky/volumes/client/sdk.py +6 -3
- sky/volumes/server/core.py +65 -27
- sky_templates/ray/start_cluster +8 -4
- {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/METADATA +53 -57
- {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/RECORD +172 -162
- sky/dashboard/out/_next/static/KYAhEFa3FTfq4JyKVgo-s/_buildManifest.js +0 -1
- sky/dashboard/out/_next/static/chunks/1141-9c810f01ff4f398a.js +0 -11
- sky/dashboard/out/_next/static/chunks/1871-7e202677c42f43fe.js +0 -6
- sky/dashboard/out/_next/static/chunks/2260-7703229c33c5ebd5.js +0 -1
- sky/dashboard/out/_next/static/chunks/2350.fab69e61bac57b23.js +0 -1
- sky/dashboard/out/_next/static/chunks/2369.fc20f0c2c8ed9fe7.js +0 -15
- sky/dashboard/out/_next/static/chunks/2755.edd818326d489a1d.js +0 -26
- sky/dashboard/out/_next/static/chunks/3294.ddda8c6c6f9f24dc.js +0 -1
- sky/dashboard/out/_next/static/chunks/3785.7e245f318f9d1121.js +0 -1
- sky/dashboard/out/_next/static/chunks/3800-b589397dc09c5b4e.js +0 -1
- sky/dashboard/out/_next/static/chunks/4725.172ede95d1b21022.js +0 -1
- sky/dashboard/out/_next/static/chunks/4937.a2baa2df5572a276.js +0 -15
- sky/dashboard/out/_next/static/chunks/6212-7bd06f60ba693125.js +0 -13
- sky/dashboard/out/_next/static/chunks/6856-da20c5fd999f319c.js +0 -1
- sky/dashboard/out/_next/static/chunks/6989-01359c57e018caa4.js +0 -1
- sky/dashboard/out/_next/static/chunks/6990-09cbf02d3cd518c3.js +0 -1
- sky/dashboard/out/_next/static/chunks/7359-c8d04e06886000b3.js +0 -30
- sky/dashboard/out/_next/static/chunks/7411-b15471acd2cba716.js +0 -41
- sky/dashboard/out/_next/static/chunks/7615-019513abc55b3b47.js +0 -1
- sky/dashboard/out/_next/static/chunks/8969-452f9d5cbdd2dc73.js +0 -1
- sky/dashboard/out/_next/static/chunks/9025.fa408f3242e9028d.js +0 -6
- sky/dashboard/out/_next/static/chunks/9360.a536cf6b1fa42355.js +0 -31
- sky/dashboard/out/_next/static/chunks/9847.3aaca6bb33455140.js +0 -30
- sky/dashboard/out/_next/static/chunks/pages/_app-68b647e26f9d2793.js +0 -34
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-33f525539665fdfd.js +0 -16
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-a7565f586ef86467.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/infra/[context]-12c559ec4d81fdbd.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/infra-d187cd0413d72475.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-895847b6cf200b04.js +0 -16
- sky/dashboard/out/_next/static/chunks/pages/jobs/pools/[pool]-8d0f4655400b4eb9.js +0 -21
- sky/dashboard/out/_next/static/chunks/pages/jobs-e5a98f17f8513a96.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/users-2f7646eb77785a2c.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/workspaces-cb4da3abe08ebf19.js +0 -1
- sky/dashboard/out/_next/static/chunks/webpack-fba3de387ff6bb08.js +0 -1
- sky/dashboard/out/_next/static/css/c5a4cfd2600fc715.css +0 -3
- /sky/dashboard/out/_next/static/{KYAhEFa3FTfq4JyKVgo-s → 3nu-b8raeKRNABZ2d4GAG}/_ssgManifest.js +0 -0
- /sky/dashboard/out/_next/static/chunks/pages/plugins/{[...slug]-4f46050ca065d8f8.js → [...slug]-449a9f5a3bb20fb3.js} +0 -0
- {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8050],{27325:function(e,s,t){t.d(s,{Z:function(){return r}});/**
|
|
2
|
+
* @license lucide-react v0.407.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/let r=(0,t(60998).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},99333:function(e,s,t){t.d(s,{Z:function(){return r}});/**
|
|
7
|
+
* @license lucide-react v0.407.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/let r=(0,t(60998).Z)("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"}]])},98418:function(e,s,t){t.d(s,{Z:function(){return r}});/**
|
|
12
|
+
* @license lucide-react v0.407.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/let r=(0,t(60998).Z)("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]])},1812:function(e,s,t){t.d(s,{X:function(){return n}});var r=t(85893),a=t(67294);let l=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let s=e.message;return s.includes("failed:")&&(s=s.split("failed:")[1].trim()),s},n=e=>{let{error:s,title:t="Error",onDismiss:n}=e,[c,i]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{s&&i(!1)},[s]),!s||c)return null;let o="string"==typeof s?s:l(s);return(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.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,r.jsx)("div",{className:"ml-3",children:(0,r.jsxs)("div",{className:"text-sm text-red-800",children:[(0,r.jsxs)("strong",{children:[t,":"]})," ",o]})})]}),(0,r.jsx)("button",{onClick:()=>{i(!0),n&&n()},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,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.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"})})})]})})}},69123:function(e,s,t){t.d(s,{g:function(){return n}});var r=t(85893),a=t(67294),l=t(32350);let n=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...a})});n.displayName="Textarea"},11141:function(e,s,t){t.r(s),t.d(s,{WorkspaceEditor:function(){return O}});var r=t(85893),a=t(67294),l=t(11163),n=t(17324),c=t(23266),i=t(68969);t(9353);var o=t(41664),d=t.n(o),u=t(9008),x=t.n(u),m=t(37673),h=t(30803),f=t(69123),g=t(55739),p=t(70282),b=t(6021),j=t(13626),y=t(98418),N=t(99333),k=t(50326);let v=e=>{let{className:s="",variant:t="default",children:a,...l}=e;return(0,r.jsx)("div",{role:"alert",className:"".concat("relative w-full rounded-lg border p-4 flex items-start space-x-2"," ").concat({default:"bg-blue-50 border-blue-200 text-blue-800",destructive:"bg-red-50 border-red-200 text-red-800"}[t]," ").concat(s),...l,children:a})},w=e=>{let{className:s="",children:t,...a}=e;return(0,r.jsx)("div",{className:"text-sm leading-relaxed ".concat(s),...a,children:t})};var C=t(53850),L=t(1812),E=t(2109),S=t(1272),Z=t(93225),M=t(53081),W=t(6378),A=t(47145);let D=e=>{let{message:s}=e;return s?(0,r.jsxs)(v,{className:"border-green-200 bg-green-50",children:[(0,r.jsx)(p.Z,{className:"h-4 w-4 text-green-600"}),(0,r.jsx)(w,{className:"text-green-800",children:s})]}):null},P=e=>{let{workspaceName:s,config:t,enabledClouds:a=[],isLoading:l=!1}=e;if(!t)return null;let n="default"===s,c=0===Object.keys(t).length;if(n&&c)return(0,r.jsx)("div",{className:"text-sm text-gray-500 mb-3 italic p-3 bg-sky-50 rounded border border-sky-200",children:"Workspace 'default' can use all accessible infrastructure."});let i=[],o=[],d=[],u=new Set(a.map(e=>e.toLowerCase()));Object.entries(t).forEach(e=>{let[s,t]=e;if("private"===s||"allowed_users"===s)return;let a=Z.Z2[s.toLowerCase()]||s.toUpperCase(),n=null==a?void 0:a.toLowerCase(),c=u.has(n)||Array.from(u).some(e=>e.startsWith(n+"/")),x=()=>"kubernetes"===s.toLowerCase()?Array.from(u).filter(e=>e.startsWith(n+"/")).map(e=>e.split("/")[1]):[];if((null==t?void 0:t.disabled)===!0)o.push(a);else if(t&&Object.keys(t).length>0){if(!l){let e="";if("gcp"===s.toLowerCase()&&t.project_id)e=" (Project ID: ".concat(t.project_id,")");else if("aws"===s.toLowerCase()&&t.region)e=" (Region: ".concat(t.region,")");else if("kubernetes"===s.toLowerCase()){let s=x();s.length>0&&(e=" (Contexts: ".concat(s.join(", "),")"))}c?i.push((0,r.jsxs)("span",{className:"block",children:[a,e," is enabled."]},"".concat(s,"-enabled"))):d.push((0,r.jsxs)("span",{className:"block text-amber-700",children:[a,e," is configured but not currently available."]},"".concat(s,"-configured-not-enabled")))}}else if(!l){if(c){let e="";if("kubernetes"===s.toLowerCase()){let s=x();s.length>0&&(e=" (Contexts: ".concat(s.join(", "),")"))}i.push((0,r.jsxs)("span",{className:"block",children:[a,e," is enabled (using default settings)."]},"".concat(s,"-default-enabled")))}else d.push((0,r.jsxs)("span",{className:"block text-amber-700",children:[a," is configured but not currently available."]},"".concat(s,"-default-not-enabled")))}});let x=[];if(o.length>0){let e=o.join(" and ");x.push((0,r.jsxs)("span",{className:"block",children:[e," ",1===o.length?"is":"are"," explicitly disabled."]},"disabled-clouds"))}return(x.push(...i),x.push(...d),x.length>0)?(0,r.jsx)("div",{className:"text-sm text-gray-700 mb-3 p-3 bg-sky-50 rounded border border-sky-200",children:x}):!n&&c?(0,r.jsx)("div",{className:"text-sm text-gray-500 mb-3 italic p-3 bg-sky-50 rounded border border-sky-200",children:"This workspace has no specific cloud resource configurations and can use all accessible infrastructure."}):null},R=e=>{let{isPrivate:s}=e;return s?(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300",children:"Private"}):(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-300",children:"Public"})},z=e=>{let{workspaceConfig:s,allUsers:t}=e;if(!s.private)return null;let a=s.allowed_users||[],l=(t||[]).filter(e=>"admin"===e.role).map(e=>e.username),n=[...new Set([...a,...l])];return 0===n.length?(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:"Allowed Users (0)"}),(0,r.jsx)("div",{className:"text-amber-600 text-xs italic p-2 bg-amber-50 rounded border border-amber-200",children:"No users configured (workspace may be inaccessible)"})]}):(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsxs)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:["Allowed Users (",n.length,")"]}),(0,r.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto border border-gray-200 rounded",children:n.map(e=>{let s=l.includes(e);return(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs p-2 bg-gray-50 hover:bg-gray-100 border-b border-gray-100 last:border-b-0",children:[(0,r.jsx)("span",{className:"font-medium text-gray-700",children:e}),s?(0,r.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,r.jsx)(C.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,r.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,r.jsx)(b.Z,{className:"w-3 h-3 mr-1"}),"User"]})]},e)})})]})};function O(e){let{workspaceName:s,isNewWorkspace:t=!1}=e,o=(0,l.useRouter)(),[u,p]=(0,a.useState)({}),[b,v]=(0,a.useState)({}),[w,Z]=(0,a.useState)(""),[O,_]=(0,a.useState)(!0),[T,U]=(0,a.useState)(!1),[Y,J]=(0,a.useState)(!1),[V,F]=(0,a.useState)(null),[I,H]=(0,a.useState)(null),[q,B]=(0,a.useState)(null),[X,G]=(0,a.useState)([]),[K,Q]=(0,a.useState)({showDialog:!1,deleting:!1,error:null}),[$,ee]=(0,a.useState)({totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:[]}),[es,et]=(0,a.useState)(!1),er=(0,a.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];e&&_(!0),F(null);try{let e;let[t,r]=await Promise.all([(0,n.getWorkspaces)(),(0,M.R)()]),a=t[s]||{};p(a),v(a),G(r||[]),e=0===Object.keys(a).length?"".concat(s,":\n # Empty workspace configuration - uses all accessible infrastructure\n"):S.ZP.dump({[s]:a},{indent:2,lineWidth:-1,noRefs:!0,skipInvalid:!0,flowLevel:-1}),Z(e)}catch(e){console.error("Error fetching workspace config:",e),F(e)}finally{e&&_(!1)}},[s]),ea=(0,a.useCallback)(async()=>{if(!t){et(!0);try{let[e,t,r]=await Promise.all([W.kq.get(c.getClusters),W.kq.get(i.getManagedJobs,[{allUsers:!0,skipFinished:!0,workspaceMatch:s,fields:["workspace","status"]}]),W.kq.get(n.getEnabledClouds,[s,!0])]),a=e.filter(e=>(e.workspace||"default")===s),l=a.filter(e=>"RUNNING"===e.status||"LAUNCHING"===e.status),o={};e.forEach(e=>{o[e.cluster]=e.workspace||"default"});let d=t.jobs||[],u=new Set(E.statusGroups.active),x=0;d.forEach(e=>{e.workspace===s&&u.has(e.status)&&x++}),ee({totalClusterCount:a.length,runningClusterCount:l.length,managedJobsCount:x,clouds:Array.isArray(r)?r:[]})}catch(e){console.error("Failed to fetch workspace stats:",e)}finally{et(!1)}}},[s,t]);(0,a.useEffect)(()=>{t?(_(!1),Z("".concat(s,":\n # New workspace configuration\n # Leave empty to use all accessible infrastructure\n"))):(er(),ea())},[s,t,er,ea]),(0,a.useEffect)(()=>{J(JSON.stringify(u)!==JSON.stringify(b))},[u,b]);let el=e=>{Z(e),B(null);try{let t=S.ZP.load(e)||{},r=Object.keys(t);if(0===r.length)p({});else if(1===r.length){let e=r[0];if(e!==s){B('Workspace name cannot be changed. Expected "'.concat(s,'" but found "').concat(e,'".'));return}let a=t[s]||{};p(a)}else B("Configuration must contain only one workspace. Found: ".concat(r.join(", ")))}catch(e){B("Invalid YAML: ".concat(e.message))}},en=async()=>{U(!0),F(null),H(null);try{if(q)throw Error("Please fix YAML errors before saving");let e=S.ZP.load(w)||{},r=Object.keys(e);if(r.length>0&&r[0]!==s)throw Error('Workspace name cannot be changed. Expected "'.concat(s,'".'));t?(await (0,n.MB)(s,u),H("Workspace created successfully!"),setTimeout(()=>{o.push("/workspaces/".concat(s))},1500)):(await (0,n.eA)(s,u),H("Workspace updated successfully!"),v(u),ea())}catch(e){console.error("Error saving workspace:",e),F(e)}finally{U(!1)}},ec=async()=>{Q(e=>({...e,deleting:!0,error:null}));try{await (0,n.zl)(s),H("Workspace deleted successfully!"),setTimeout(()=>{o.push("/workspaces")},1500)}catch(e){console.error("Error deleting workspace:",e),Q(s=>({...s,deleting:!1,error:e}))}},ei=()=>{Q({showDialog:!1,deleting:!1,error:null})},eo=async()=>{_(!0);try{await A.x.fetch("/check",{},"POST"),await Promise.all([er(!1),ea()])}catch(e){console.error("Error during sky check refresh:",e)}finally{_(!1)}};if(!o.isReady)return(0,r.jsx)("div",{children:"Loading..."});let ed=t?"Create New Workspace | SkyPilot Dashboard":"Workspace: ".concat(s," | SkyPilot Dashboard");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x(),{children:(0,r.jsx)("title",{children:ed})}),(0,r.jsxs)(r.Fragment,{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)(d(),{href:"/workspaces",className:"text-sky-blue hover:underline",children:"Workspaces"}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsx)(d(),{href:t?"/workspace/new":"/workspaces/".concat(s),className:"text-sky-blue hover:underline",children:t?"New Workspace":s}),Y&&(0,r.jsx)("span",{className:"ml-3 px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded",children:"Unsaved changes"})]}),(0,r.jsxs)("div",{className:"text-sm flex items-center",children:[(O||T||es)&&(0,r.jsxs)("div",{className:"flex items-center mr-4",children:[(0,r.jsx)(g.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:T?"Saving...":"Loading..."})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[!t&&(0,r.jsxs)("button",{onClick:eo,disabled:O||T||es,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,r.jsx)(j.Z,{className:"w-4 h-4 mr-1.5"}),"Refresh"]}),!t&&"default"!==s&&(0,r.jsxs)("button",{onClick:()=>Q({...K,showDialog:!0}),disabled:K.deleting||T,className:"text-red-600 hover:text-red-700 font-medium inline-flex items-center",children:[(0,r.jsx)(y.Z,{className:"w-4 h-4 mr-1.5"}),"Delete"]})]})]})]}),O?(0,r.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,r.jsx)(g.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{className:"text-gray-500",children:"Loading workspace configuration..."})]}):(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(L.X,{error:V,title:"Error",onDismiss:()=>F(null)}),(0,r.jsx)(D,{message:I}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[!t&&(0,r.jsx)("div",{className:"lg:col-span-1",children:(0,r.jsxs)(m.Zb,{className:"h-full",children:[(0,r.jsx)(m.Ol,{children:(0,r.jsx)(m.ll,{className:"text-base font-normal",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"Workspace:"})," ",s]}),(0,r.jsx)(R,{isPrivate:!0===b.private})]})})}),(0,r.jsxs)(m.aY,{className:"text-sm pb-2 flex-1",children:[(0,r.jsxs)("div",{className:"py-2 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,r.jsx)(C.QT,{className:"w-4 h-4 mr-2 text-gray-500"}),(0,r.jsx)("span",{children:"Clusters (Running / Total)"})]}),(0,r.jsx)("span",{className:"font-normal text-gray-800",children:es?"...":"".concat($.runningClusterCount," / ").concat($.totalClusterCount)})]}),(0,r.jsxs)("div",{className:"py-2 flex items-center justify-between border-t border-gray-100",children:[(0,r.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,r.jsx)(C.Vp,{className:"w-4 h-4 mr-2 text-gray-500"}),(0,r.jsx)("span",{children:"Managed Jobs"})]}),(0,r.jsx)("span",{className:"font-normal text-gray-800",children:es?"...":$.managedJobsCount})]})]}),(0,r.jsxs)("div",{className:"px-6 pb-6 text-sm pt-3",children:[(0,r.jsx)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:"Enabled Infra"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:es?(0,r.jsx)("span",{className:"text-gray-500",children:"Loading..."}):$.clouds.length>0?$.clouds.map(e=>(0,r.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,r.jsx)(C.Ye,{className:"w-3.5 h-3.5 mr-1.5 text-green-500"}),(0,r.jsx)("span",{children:e})]},e)):(0,r.jsx)("span",{className:"text-gray-500 italic",children:"No enabled infrastructure"})}),(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)(P,{workspaceName:s,config:b,enabledClouds:$.clouds,isLoading:es})}),(0,r.jsx)(z,{workspaceConfig:b,allUsers:X})]})]})}),(0,r.jsx)("div",{className:t?"lg:col-span-3":"lg:col-span-2",children:(0,r.jsxs)(m.Zb,{className:"h-full flex flex-col",children:[(0,r.jsx)(m.Ol,{children:(0,r.jsx)(m.ll,{className:"text-base font-normal",children:t?"New Workspace YAML":"Edit Workspace YAML"})}),(0,r.jsx)(m.aY,{className:"flex-1 flex flex-col",children:(0,r.jsxs)("div",{className:"space-y-4 flex-1 flex flex-col",children:[q&&(0,r.jsx)(L.X,{error:q,onDismiss:()=>B(null)}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,r.jsxs)("p",{className:"text-sm text-gray-600 mb-3",children:["Configure infra-specific settings for this workspace. Leave empty to use all accessible infrastructure. Refer to"," ",(0,r.jsx)("a",{href:"https://docs.skypilot.co/en/latest/admin/workspaces.html#configuration",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600",children:"SkyPilot Docs"})," ","for more details."]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Example configuration:"}),(0,r.jsx)("div",{className:"p-3 bg-gray-50 border rounded-lg",children:(0,r.jsx)("pre",{className:"text-xs font-mono text-gray-600 whitespace-pre-wrap",children:"".concat(s||"my-workspace",":\n private: true\n allowed_users:\n - user1@mydomain.com\n - user2@mydomain.com\n gcp:\n project_id: xxx\n disabled: false\n kubernetes:\n allowed_contexts:\n - context-1")})})]}),(0,r.jsx)(f.g,{value:w,onChange:e=>el(e.target.value),className:"font-mono text-sm flex-1 resize-none",style:{minHeight:"350px"},spellCheck:!1,placeholder:"# Enter workspace configuration in YAML format"}),(0,r.jsx)("div",{className:"flex justify-end space-x-3 pt-3 border-gray-200",children:(0,r.jsxs)(h.z,{onClick:en,disabled:T||q||O,className:"inline-flex items-center bg-sky-600 hover:bg-sky-700 text-white",children:[(0,r.jsx)(N.Z,{className:"w-4 h-4 mr-1.5"}),T?"Applying...":"Apply"]})})]})]})})]})})]})]}),(0,r.jsx)(k.Vq,{open:K.showDialog,onOpenChange:ei,children:(0,r.jsxs)(k.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(k.fK,{className:"",children:[(0,r.jsx)(k.$N,{children:"Delete Workspace"}),(0,r.jsxs)(k.Be,{children:['Are you sure you want to delete workspace "',s,'"? This action cannot be undone.']})]}),K.error&&(0,r.jsx)(L.X,{error:K.error,title:"Deletion Failed",onDismiss:()=>Q(e=>({...e,error:null}))}),(0,r.jsxs)(k.cN,{className:"",children:[(0,r.jsx)(h.z,{variant:"outline",onClick:ei,disabled:K.deleting,children:"Cancel"}),(0,r.jsx)(h.z,{variant:"destructive",onClick:ec,disabled:K.deleting,children:K.deleting?"Deleting...":"Delete"})]})]})})]})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8056],{50326:function(e,t,r){r.d(t,{$N:function(){return h},Be:function(){return p},Vq:function(){return c},cN:function(){return g},cZ:function(){return d},fK:function(){return f}});var o=r(85893),a=r(67294),s=r(6327),n=r(32350),l=r(43767);let c=s.fC;s.xz;let u=s.h_;s.x8;let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,o.jsx)(s.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a})});i.displayName=s.aV.displayName;let d=a.forwardRef((e,t)=>{let{className:r,children:a,...c}=e;return(0,o.jsxs)(u,{children:[(0,o.jsx)(i,{}),(0,o.jsxs)(s.VY,{ref:t,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...c,children:[a,(0,o.jsxs)(s.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500",children:[(0,o.jsx)(l.Z,{className:"h-4 w-4"}),(0,o.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});d.displayName=s.VY.displayName;let f=e=>{let{className:t,...r}=e;return(0,o.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};f.displayName="DialogHeader";let g=e=>{let{className:t,...r}=e;return(0,o.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};g.displayName="DialogFooter";let h=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,o.jsx)(s.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",r),...a})});h.displayName=s.Dx.displayName;let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,o.jsx)(s.dk,{ref:t,className:(0,n.cn)("text-sm text-gray-500",r),...a})});p.displayName=s.dk.displayName},23266:function(e,t,r){r.d(t,{GH:function(){return f},QL:function(){return h},Sl:function(){return d},getClusters:function(){return u},uR:function(){return i}});var o=r(67294),a=r(15821),s=r(47145),n=r(93225),l=r(6378);let c={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function u(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await s.x.fetch("/status",{cluster_names:e,all_users:!0,include_credentials:!1,include_handle:!1,summary_response:null==e})).map(e=>{let t="";t=e.zone?e.zone:e.region,"SSH"===e.cloud&&(null==t?void 0:t.startsWith("ssh-"))&&(t=t.substring(4));let r=t;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),o=r+(t-3)%2;return 0===r?e.substring(0,o)+"...":e.substring(0,o)+"..."+e.substring(e.length-r)}(t,25)),{status:c[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cluster_hash:e.cluster_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,last_event:e.last_event,to_down:e.to_down,cluster_name_on_cloud:e.cluster_name_on_cloud,labels:e.labels||{},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){throw console.error("Error fetching clusters:",e),e}}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;try{let r={days:t,dashboard_summary_response:!0};e&&(r.cluster_hashes=[e]);let o=await s.x.fetch("/cost_report",r);console.log("Raw cluster history data:",o);let a=o.map(e=>{let t="Unknown";e.cloud?t=e.cloud:e.resources&&e.resources.cloud&&(t=e.resources.cloud);let r=e.user_name||"-";return{status:e.status?c[e.status]:"TERMINATED",cluster:e.name,user:r,user_hash:e.user_hash,cluster_hash:e.cluster_hash,cloud:t,region:"",infra:t,full_infra:t,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:e.launched_at?new Date(1e3*e.launched_at):null,num_nodes:e.num_nodes||1,duration:e.duration,total_cost:e.total_cost,workspace:e.workspace||"default",autostop:-1,last_event:e.last_event,to_down:!1,cluster_name_on_cloud:null,usage_intervals:e.usage_intervals,command:e.last_creation_command||"",task_yaml:e.last_creation_yaml||"{}",events:[{time:e.launched_at?new Date(1e3*e.launched_at):new Date,event:"Cluster created."}]}});return console.log("Processed cluster history data:",a),a}catch(e){throw console.error("Error fetching cluster history:",e),e}}async function d(e){let{clusterName:t,jobId:r,onNewLog:o,workspace:n,signal:l}=e;try{await s.x.stream("/logs",{follow:!1,cluster_name:t,job_id:r,tail:5e3,override_skypilot_config:{active_workspace:n||"default"}},o,{signal:l})}catch(e){if((null==e?void 0:e.name)==="AbortError")return;console.error("Error in streamClusterJobLogs:",e),(0,a.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function f(e){let{clusterName:t,jobIds:r=null,workspace:o}=e;try{let e=await s.x.fetch("/download_logs",{cluster_name:t,job_ids:r?r.map(String):null,override_skypilot_config:{active_workspace:o||"default"}}),l=Object.values(e||{});if(!l.length){(0,a.C)("No logs found to download.","warning");return}let c=window.location.origin,u="".concat(c).concat(n.f4,"/download"),i=await fetch("".concat(u,"?relative=items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder_paths:l})});if(!i.ok){let e=await i.text();throw Error("Download failed: ".concat(i.status," ").concat(e))}let d=await i.blob(),f=window.URL.createObjectURL(d),g=document.createElement("a"),h=new Date().toISOString().replace(/[:.]/g,"-"),p=r&&1===r.length?"job-".concat(r[0]):"jobs";g.href=f,g.download="".concat(t,"-").concat(p,"-logs-").concat(h,".zip"),document.body.appendChild(g),g.click(),g.remove(),window.URL.revokeObjectURL(f)}catch(e){console.error("Error downloading logs:",e),(0,a.C)("Error downloading logs: ".concat(e.message),"error")}}async function g(e){let{clusterName:t,workspace:r}=e;try{return(await s.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:r}})).map(e=>{var o;let a=e.end_at?e.end_at:Date.now()/1e3,s=0,n=0;return e.submitted_at&&(s=a-e.submitted_at),e.start_at&&(n=a-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:s,job_duration:n,infra:"",logs:"",workspace:r||"default",git_commit:(null===(o=e.metadata)||void 0===o?void 0:o.git_commit)||"-"}})}catch(e){throw console.error("Error fetching cluster jobs:",e),e}}function h(e){let{cluster:t,job:r=null}=e,[a,s]=(0,o.useState)(null),[n,c]=(0,o.useState)(null),[i,d]=(0,o.useState)(!0),[f,h]=(0,o.useState)(!0),p=(0,o.useCallback)(async()=>{if(t)try{d(!0);let e=await l.ZP.get(u,[{clusterNames:[t]}]);if(e.length>0)return s(e[0]),e[0];return console.error("No cluster data found for cluster:",t),null}catch(e){console.error("Error fetching cluster data:",e)}finally{d(!1)}return null},[t]),m=(0,o.useCallback)(async e=>{if(t)try{h(!0);let r=await l.ZP.get(g,[{clusterName:t,workspace:e||"default"}]);c(r)}catch(e){console.error("Error fetching cluster job data:",e)}finally{h(!1)}},[t]),_=(0,o.useCallback)(async()=>{l.ZP.invalidate(u,[{clusterNames:[t]}]);let e=await p();e&&(l.ZP.invalidate(g,[{clusterName:t,workspace:e.workspace||"default"}]),await m(e.workspace))},[p,m,t]),w=(0,o.useCallback)(async()=>{a&&(l.ZP.invalidate(g,[{clusterName:t,workspace:a.workspace||"default"}]),await m(a.workspace))},[m,a,t]);return(0,o.useEffect)(()=>{(async()=>{let e=await p();e&&m(e.workspace)})()},[t,r,p,m]),{clusterData:a,clusterJobData:n,loading:i,clusterDetailsLoading:i,clusterJobsLoading:f,refreshData:_,refreshClusterJobsOnly:w}}},32045:function(e,t,r){r.d(t,{F5:function(){return g},R8:function(){return f},Ve:function(){return m},Xg:function(){return u},ef:function(){return c}});var o=r(93225),a=r(47145),s=r(94545),n=r(6378),l=r(30017);async function c(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let{getClusters:e}=await Promise.resolve().then(r.bind(r,23266)),{getManagedJobs:t}=await Promise.resolve().then(r.bind(r,68969)),{getWorkspaces:a,getEnabledClouds:s}=await Promise.resolve().then(r.bind(r,17324));try{let[r,l,c]=await Promise.all([n.ZP.get(t,[{allUsers:!0,skipFinished:!0}]).catch(e=>(console.error("Error fetching managed jobs:",e),{jobs:[]})),n.ZP.get(e).catch(e=>(console.error("Error fetching clusters:",e),[])),n.ZP.get(a).catch(e=>(console.error("Error fetching workspaces:",e),{}))]),u=(null==r?void 0:r.jobs)||[],i=[],d=Object.keys(c||{});if(0===d.length)console.warn("No accessible workspaces found"),i=[];else{let e=new Set;await Promise.all(d.map(async t=>{try{let r=await n.ZP.get(s,[t,!1]);Array.isArray(r)&&r.forEach(t=>{t&&e.add(t.toLowerCase())})}catch(e){console.error("Error fetching enabled clouds for workspace ".concat(t,":"),e)}})),i=Array.from(e),console.log("Aggregated enabled clouds across all workspaces:",i)}let f={};o.$m.forEach(e=>{let t=i.includes(e.toLowerCase());f[e]={name:e,clusters:0,jobs:0,enabled:t}}),(l||[]).forEach(e=>{if(e.cloud){let t=e.cloud;f[t]&&(f[t].clusters+=1,f[t].enabled=!0)}}),u.forEach(e=>{if(e.cloud){let t=e.cloud;f[t]&&(f[t].jobs+=1,f[t].enabled=!0)}});let g=o.$m.length,h=Object.values(f).filter(e=>e.enabled).length;return{clouds:Object.values(f).filter(e=>e.enabled).sort((e,t)=>e.name.localeCompare(t.name)),totalClouds:g,enabledClouds:h}}catch(e){throw console.error("Error fetching cloud infrastructure:",e),e}}async function u(){try{console.log("[DEBUG] Starting workspace-aware infrastructure fetch");let{getWorkspaces:e}=await Promise.resolve().then(r.bind(r,17324));console.log("[DEBUG] About to call getWorkspaces() via cache");let t=await n.ZP.get(e);if(console.log("[DEBUG] Workspaces data received:",t),console.log("[DEBUG] Number of accessible workspaces:",Object.keys(t||{}).length),console.log("[DEBUG] Workspace names:",Object.keys(t||{})),!t||0===Object.keys(t).length)return console.log("[DEBUG] No accessible workspaces found - returning empty result"),{workspaces:{},allContextNames:[],allGPUs:[],perContextGPUs:[],perNodeGPUs:[],allSlurmGPUs:[],perClusterSlurmGPUs:[],perNodeSlurmGPUs:[],contextStats:{},contextWorkspaceMap:{},contextErrors:{}};let{getEnabledClouds:o}=await Promise.resolve().then(r.bind(r,17324)),a={},s=[],l={};await Promise.allSettled(Object.entries(t).map(async e=>{let[t,r]=e;console.log("Fetching infrastructure for workspace: ".concat(t));try{console.log("[DEBUG] Fetching enabled clouds for workspace: ".concat(t," via cache"));let e=await n.ZP.get(o,[t,!0]);console.log("[DEBUG] Expanded clouds for ".concat(t,":"),e),a[t]={config:r,clouds:e,contexts:[]},console.log("[DEBUG] Processing expandedClouds for ".concat(t,":"),e),e&&Array.isArray(e)?e.forEach(e=>{if(console.log("[DEBUG] Processing infraItem: ".concat(e)),e.toLowerCase().startsWith("kubernetes/")){let r=e.replace(/^kubernetes\//i,"");console.log("[DEBUG] Extracted kubernetes context: ".concat(r)),s.push(r),l[r]||(l[r]=[]),l[r].includes(t)||l[r].push(t),a[t].contexts.push(r)}else if(e.toLowerCase().startsWith("ssh/")){let r=e.replace(/^ssh\//i,""),o="ssh-".concat(r);console.log("[DEBUG] Extracted SSH context: ".concat(o)),s.push(o),l[o]||(l[o]=[]),l[o].includes(t)||l[o].push(t),a[t].contexts.push(o)}}):console.log("[DEBUG] No expanded clouds or not an array for ".concat(t))}catch(e){throw console.error("Failed to fetch infrastructure for workspace ".concat(t,":"),e),e}}));let{getClusters:c}=await Promise.resolve().then(r.bind(r,23266)),u=[];try{u=await n.ZP.get(c)}catch(e){console.error("Error fetching clusters:",e)}let d=u||[],f={};try{f=await g(d)}catch(e){console.error("Error fetching context clusters:",e)}let h=[...new Set(s)].filter(e=>e&&"string"==typeof e),p={allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextErrors:{}};try{p=await i(h)}catch(e){console.error("Error fetching Kubernetes GPUs:",e)}let m={workspaces:a,allContextNames:[...new Set(s)].sort(),allGPUs:p.allGPUs||[],perContextGPUs:p.perContextGPUs||[],perNodeGPUs:p.perNodeGPUs||[],contextStats:f,contextWorkspaceMap:l,contextErrors:p.contextErrors||{}};return console.log("[DEBUG] Final result:",m),console.log("[DEBUG] All contexts found:",s),console.log("[DEBUG] Context workspace map:",l),m}catch(e){throw console.error("[DEBUG] Failed to fetch workspace infrastructure:",e),console.error("[DEBUG] Error stack:",e.stack),e}}async function i(e){try{var t,r,o,a,s,n,l,c,u,i,f;if(!e||0===e.length)return{allGPUs:[],perContextGPUs:[],perNodeGPUs:[],contextErrors:{}};let g={},h={},p={},m={},_=await Promise.allSettled(e.map(e=>d(e))),w={};for(let r=0;r<e.length;r++){let o=_[r];if("fulfilled"===o.status)w[e[r]]=o.value,console.log("[CONTEXT_DEBUG] Context node info result:",e[r],o.value);else{let a=(null===(t=o.reason)||void 0===t?void 0:t.message)||"string"==typeof o.reason&&o.reason||"Context may be unavailable or timed out";console.warn("Failed to get node info for context ".concat(e[r],":"),a),w[e[r]]={},m[e[r]]=a}}for(let t of e){let e=w[t]||{};if(e&&Object.keys(e).length>0){let a={};for(let s in e){let n=e[s];if(!n){console.warn("No node data for node ".concat(s," in context ").concat(t));continue}let l=n.accelerator_type||"-",c=(null===(r=n.total)||void 0===r?void 0:r.accelerator_count)||0,u=(null===(o=n.free)||void 0===o?void 0:o.accelerators_available)||0,i=!1!==n.is_ready;c>0&&(a[l]||(a[l]={gpu_name:l,gpu_requestable_qty_per_node:0,gpu_total:0,gpu_free:0,gpu_not_ready:0,context:t}),a[l].gpu_total+=c,a[l].gpu_free+=u,!1===i&&(a[l].gpu_not_ready+=c),a[l].gpu_requestable_qty_per_node=c)}for(let e in h[t]=Object.values(a),a)e in g?(g[e].gpu_total+=a[e].gpu_total,g[e].gpu_free+=a[e].gpu_free,g[e].gpu_not_ready+=a[e].gpu_not_ready):g[e]={gpu_total:a[e].gpu_total,gpu_free:a[e].gpu_free,gpu_not_ready:a[e].gpu_not_ready,gpu_name:e}}else h[t]=[]}for(let t of e){let e=w[t];if(e&&Object.keys(e).length>0)for(let r in e){let o=e[r];if(!o){console.warn("No node data for node ".concat(r," in context ").concat(t));continue}let d=o.accelerator_type||"-",m=null!==(n=null===(a=o.total)||void 0===a?void 0:a.accelerator_count)&&void 0!==n?n:0,_=null!==(l=null===(s=o.free)||void 0===s?void 0:s.accelerators_available)&&void 0!==l?l:0,w=!1!==o.is_ready,y=null!==(c=o.cpu_count)&&void 0!==c?c:null,P=null!==(u=o.memory_gb)&&void 0!==u?u:null,b=null!==(i=o.cpu_free)&&void 0!==i?i:null,E=null!==(f=o.memory_free_gb)&&void 0!==f?f:null;p["".concat(t,"/").concat(r)]={node_name:o.name||r,gpu_name:d,gpu_total:m,gpu_free:_,ip_address:o.ip_address||null,context:t,cpu_count:y,memory_gb:P,cpu_free:b,memory_free_gb:E,is_ready:w},"-"===d||!h[t]||h[t].some(e=>e.gpu_name===d)||(d in g||(g[d]={gpu_total:0,gpu_free:0,gpu_not_ready:0,gpu_name:d}),h[t].find(e=>e.gpu_name===d)||h[t].push({gpu_name:d,gpu_not_ready:0,gpu_requestable_qty_per_node:"-",gpu_total:0,gpu_free:0,context:t}))}}return console.log("[CONTEXT_DEBUG] All GPUs summary:",g),console.log("[CONTEXT_DEBUG] Per context GPUs data:",h),console.log("[CONTEXT_DEBUG] Per node GPUs data:",p),console.log("[CONTEXT_DEBUG] Context errors:",m),{allGPUs:Object.values(g).sort((e,t)=>(e.gpu_name||"").localeCompare(t.gpu_name||"")),perContextGPUs:Object.values(h).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||"")),contextErrors:m}}catch(e){throw console.error("[infra.jsx] Error in getKubernetesGPUsFromContexts:",e),e}}async function d(e){try{let t=await a.x.post("/kubernetes_node_info",{context:e});if(!t.ok){let r="Failed to get kubernetes node info for context ".concat(e," with status ").concat(t.status,", error: ").concat(t.statusText);throw Error(r)}let r=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("x-request-id");if(!r)throw Error("No request ID received from server for kubernetes node info");let o=await a.x.get("/api/get?request_id=".concat(r));if(!o.ok){let t=await (0,s.oN)(o),r="Failed to get kubernetes node info result for context ".concat(e," with status ").concat(o.status,", error: ").concat(t);throw Error(r)}let n=await o.json();return(n.return_value?JSON.parse(n.return_value):{}).node_info_dict||{}}catch(t){throw console.warn("[infra.jsx] Context ".concat(e," unavailable or timed out:"),t.message),t}}async function f(e){try{let t={};return e.forEach(e=>{let r=(0,l.y)(e.cloud,e.region);r&&(t[r]||(t[r]={clusters:0,jobs:0}),t[r].jobs+=1)}),t}catch(e){throw console.error("=== Error in getContextJobs ===",e),e}}async function g(e){try{let t={};return e.forEach(e=>{let r=(0,l.y)(e.cloud,e.region);r&&(t[r]||(t[r]={clusters:0,jobs:0}),t[r].clusters+=1)}),t}catch(e){throw console.error("=== Error in getContextClusters ===",e),e}}async function h(){try{let e=await a.x.post("/slurm_gpu_availability",{});if(!e.ok){let t="Failed to get slurm cluster GPUs with status ".concat(e.status);throw Error(t)}let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)throw Error("No request ID received from server for slurm cluster GPUs");let r=await a.x.get("/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);console.error("Error fetching Slurm cluster GPUs:",t.message)}catch(e){console.error("Error parsing JSON for Slurm error:",e)}}catch(e){console.error("Error parsing JSON for Slurm 500 response:",e)}return[]}if(!r.ok){let e="Failed to get slurm cluster GPUs result with status ".concat(r.status);throw Error(e)}let o=await r.json();return o.return_value?JSON.parse(o.return_value):[]}catch(e){return console.error("Error fetching Slurm cluster GPUs:",e),[]}}async function p(){try{let e=await a.x.post("/slurm_node_info",{});if(!e.ok){let t="Failed to get slurm node info with status ".concat(e.status);throw Error(t)}let t=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("x-request-id");if(!t)throw Error("No request ID received from server for slurm node info");let r=await a.x.get("/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);console.error("Error fetching Slurm per node GPUs:",t.message)}catch(e){console.error("Error parsing JSON for Slurm node error:",e)}}catch(e){console.error("Error parsing JSON for Slurm node 500 response:",e)}return[]}if(!r.ok){let e="Failed to get slurm node info result with status ".concat(r.status);throw Error(e)}let o=await r.json();return o.return_value?JSON.parse(o.return_value):[]}catch(e){return console.error("Error fetching Slurm per node GPUs:",e),[]}}async function m(){return await _()}async function _(){try{let[e,t]=await Promise.all([h(),p()]),r={},o={},a={};for(let t of e){let e=t[0];for(let a of t[1]){let t=a[0],s=a[1].join(", "),n=a[2],l=a[3];t in r?(r[t].gpu_total+=n,r[t].gpu_free+=l):r[t]={gpu_total:n,gpu_free:l,gpu_name:t},o["".concat(e,"#").concat(t)]={gpu_name:t,gpu_requestable_qty_per_node:s,gpu_total:n,gpu_free:l,cluster:e}}}for(let e of t){let t=e.slurm_cluster_name||"default";a["".concat(t,"/").concat(e.node_name,"/").concat(e.gpu_type||"-")]={node_name:e.node_name,gpu_name:e.gpu_type||"-",gpu_total:e.total_gpus||0,gpu_free:e.free_gpus||0,cluster:t,partition:e.partition||"default"}}return{allSlurmGPUs:Object.values(r).sort((e,t)=>e.gpu_name.localeCompare(t.gpu_name)),perClusterSlurmGPUs:Object.values(o).sort((e,t)=>e.cluster.localeCompare(t.cluster)||e.gpu_name.localeCompare(t.gpu_name)),perNodeSlurmGPUs:Object.values(a).sort((e,t)=>(e.cluster||"").localeCompare(t.cluster||"")||(e.node_name||"").localeCompare(t.node_name||"")||(e.gpu_name||"").localeCompare(t.gpu_name||""))}}catch(e){return console.error("Error fetching Slurm GPUs:",e),{allSlurmGPUs:[],perClusterSlurmGPUs:[],perNodeSlurmGPUs:[]}}}},29326:function(e,t,r){r.d(t,{IS:function(){return d},It:function(){return s},MV:function(){return l},Ri:function(){return n},_x:function(){return u},ez:function(){return i},hY:function(){return c},mF:function(){return g},wJ:function(){return f}});var o=r(93225),a=r(15821);async function s(){try{let e=await fetch("".concat(o.f4,"/ssh_node_pools"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return await e.json()}catch(e){return console.error("Error fetching SSH Node Pools:",e),{}}}async function n(e){try{let t=await fetch("".concat(o.f4,"/ssh_node_pools"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error updating SSH Node Pools:",e),e}}async function l(e){try{let t=await fetch("".concat(o.f4,"/ssh_node_pools/").concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error deleting SSH Node Pool:",e),e}}async function c(e,t){try{let r=new FormData;r.append("key_name",e),r.append("key_file",t);let a=await fetch("".concat(o.f4,"/ssh_node_pools/keys"),{method:"POST",body:r});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));return await a.json()}catch(e){throw console.error("Error uploading SSH key:",e),e}}async function u(e){try{let t=await fetch("".concat(o.f4,"/ssh_node_pools/").concat(e,"/deploy"),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error deploying SSH Node Pool:",e),e}}async function i(e){try{let t=await fetch("".concat(o.f4,"/ssh_node_pools/").concat(e,"/down"),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error tearing down SSH Node Pool:",e),e}}async function d(e){try{let t=await fetch("".concat(o.f4,"/ssh_node_pools/").concat(e,"/status"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return await t.json()}catch(e){throw console.error("Error fetching SSH Node Pool status:",e),e}}async function f(e){let t,{requestId:r,signal:s,onNewLog:n}=e,l=Date.now(),c=new Promise(e=>{let r=()=>{let o=Date.now()-l;o>=3e5?e({timeout:!0}):t=setTimeout(r,3e5-o)};t=setTimeout(r,3e5)}),u=(async()=>{try{let e=await fetch("".concat(o.f4,"/api/stream?request_id=").concat(r,"&format=plain&tail=").concat(1e3,"&follow=true"),{method:"GET",headers:{"Content-Type":"application/json"},...s?{signal:s}:{}});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let a=e.body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;l=Date.now();let r=new TextDecoder().decode(t);n(r)}}finally{a.cancel(),t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),i=await Promise.race([u,c]);if(t&&clearTimeout(t),i.timeout){(0,a.C)("SSH deployment log stream timed out after ".concat(300,"s of inactivity"),"warning");return}}async function g(e){let t,{requestId:r,signal:s,onNewLog:n,operationType:l="operation"}=e,c=Date.now(),u=new Promise(e=>{let r=()=>{let o=Date.now()-c;o>=3e5?e({timeout:!0}):t=setTimeout(r,3e5-o)};t=setTimeout(r,3e5)}),i=(async()=>{try{let e=await fetch("".concat(o.f4,"/api/stream?request_id=").concat(r,"&format=plain&tail=").concat(1e3,"&follow=true"),{method:"GET",headers:{"Content-Type":"application/json"},...s?{signal:s}:{}});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let a=e.body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;c=Date.now();let r=new TextDecoder().decode(t);n(r)}}finally{a.cancel(),t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),d=await Promise.race([i,u]);if(t&&clearTimeout(t),d.timeout){(0,a.C)("SSH ".concat(l," log stream timed out after ").concat(300,"s of inactivity"),"warning");return}}},53081:function(e,t,r){r.d(t,{R:function(){return s},i:function(){return a}});var o=r(47145);async function a(){try{let e=await o.x.get("/users/service-account-tokens");if(!e.ok)throw Error("Failed to fetch service account tokens with status ".concat(e.status));return await e.json()||[]}catch(e){throw console.error("Failed to fetch service account tokens:",e),e}}async function s(){try{let e=await o.x.get("/users");if(!e.ok)throw Error("Failed to fetch users with status ".concat(e.status));return(await e.json()).map(e=>({userId:e.id,username:e.name,role:e.role,created_at:e.created_at}))||[]}catch(e){throw console.error("Failed to fetch users:",e),e}}},19238:function(e,t,r){r.d(t,{C:function(){return s},w:function(){return n}});var o=r(47145),a=r(94545);async function s(){try{return(await o.x.fetch("/volumes",{},"GET")).map(e=>{var t,r,o;let a=e.cloud||"";return e.region&&(a+="/".concat(e.region)),e.zone&&(a+="/".concat(e.zone)),{name:e.name,launched_at:e.launched_at,user_hash:e.user_hash,user_name:e.user_name||"-",workspace:e.workspace||"-",last_attached_at:e.last_attached_at,status:e.status,type:e.type,cloud:e.cloud,region:e.region,zone:e.zone,infra:a,size:"".concat(e.size,"Gi"),config:e.config,storage_class:(null===(t=e.config)||void 0===t?void 0:t.storage_class_name)||"-",access_mode:(null===(r=e.config)||void 0===r?void 0:r.access_mode)||"-",namespace:(null===(o=e.config)||void 0===o?void 0:o.namespace)||"-",name_on_cloud:e.name_on_cloud,usedby_pods:e.usedby_pods,usedby_clusters:e.usedby_clusters}})||[]}catch(e){throw console.error("Failed to fetch volumes:",e),e}}async function n(e){let t="";try{let r=await o.x.post("/volumes/delete",{names:[e]});if(!r.ok)return console.error("Initial API request to delete volume failed with status ".concat(r.status)),{success:!1,msg:"Failed to delete volume with status ".concat(r.status)};let s=r.headers.get("X-SkyPilot-Request-ID")||r.headers.get("X-Request-ID");if(!s)return console.error("No request ID received from server for deleting volume"),{success:!1,msg:"No request ID received from server for deleting volume"};let n=await o.x.get("/api/get?request_id=".concat(s));if(!n.ok){let e=await (0,a.oN)(n);return t="Failed to delete volume with status ".concat(n.status,", error: ").concat(e),console.error(t),{success:!1,msg:t}}return{success:!0}}catch(e){return console.error(t="Failed to delete volume: ".concat(e)),{success:!1,msg:t}}}},23001:function(e,t,r){r.d(t,{X:function(){return a}});var o=r(67294);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,r]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let t=()=>{r(window.innerWidth<e)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]),t}},36856:function(e,t,r){var o=r(6378),a=r(23266),s=r(68969),n=r(17324),l=r(53081),c=r(19238),u=r(32045),i=r(29326);let d={base:{getClusters:{fn:a.getClusters,args:[]},getManagedJobs:{fn:s.aT,args:[{allUsers:!0}]},getManagedJobsForOtherPages:{fn:s.getManagedJobs,args:[{allUsers:!0,skipFinished:!0}]},getWorkspaces:{fn:n.getWorkspaces,args:[]},getUsers:{fn:l.R,args:[]},getCloudInfrastructure:{fn:u.ef,args:[!1]},getSSHNodePools:{fn:i.It,args:[]},getVolumes:{fn:c.C,args:[]}},dynamic:{getEnabledClouds:{fn:n.getEnabledClouds,requiresWorkspaces:!0}},pages:{clusters:["getClusters","getWorkspaces"],jobs:["getManagedJobs","getClusters","getWorkspaces","getUsers"],infra:["getClusters","getManagedJobsForOtherPages","getCloudInfrastructure","getSSHNodePools"],workspaces:["getWorkspaces","getClusters","getManagedJobsForOtherPages","getEnabledClouds"],users:["getUsers","getClusters","getManagedJobsForOtherPages"],volumes:["getVolumes"]}};class f{async preloadForPage(e,t){let{backgroundPreload:r=!0,force:o=!1}=t||{};if(!d.pages[e]){console.warn("Unknown page: ".concat(e));return}console.log("[CachePreloader] Preloading cache for page: ".concat(e));try{await this._loadPageData(e,o),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=d.pages[e],a=[];for(let e of r)if(d.base[e]){let{fn:r,args:s}=d.base[e];t&&o.ZP.invalidate(r,s),a.push(o.ZP.get(r,s).then(e=>(this._markAsPreloaded(r,s),e)))}else"getEnabledClouds"===e&&a.push(this._loadEnabledCloudsForAllWorkspaces(t));await Promise.allSettled(a),console.log("[CachePreloader] Loaded data for page: ".concat(e))}async _loadEnabledCloudsForAllWorkspaces(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e&&o.ZP.invalidate(n.getWorkspaces);let t=await o.ZP.get(n.getWorkspaces),r=Object.keys(t||{}).map(t=>(e&&o.ZP.invalidate(n.getEnabledClouds,[t]),o.ZP.get(n.getEnabledClouds,[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=new Set(d.pages[e]),r=new Set;Object.keys(d.pages).filter(t=>t!==e).forEach(e=>{d.pages[e].forEach(e=>{t.has(e)||r.add(e)})}),console.log("[CachePreloader] Background preloading ".concat(r.size," unique functions: ").concat(Array.from(r).join(", "))),Promise.allSettled(Array.from(r).map(async e=>{try{if(d.base[e]){let{fn:t,args:r}=d.base[e];await o.ZP.get(t,r),this._markAsPreloaded(t,r)}else"getEnabledClouds"===e&&await this._loadEnabledCloudsForAllWorkspaces(!1);console.log("[CachePreloader] Background loaded function: ".concat(e))}catch(t){console.error("[CachePreloader] Background load failed for function ".concat(e,":"),t)}})).then(()=>{this.isPreloading=!1,console.log("[CachePreloader] Background preloading complete")})}async preloadBaseFunctions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];console.log("[CachePreloader] Preloading all base functions");let t=Object.entries(d.base).map(t=>{let[r,{fn:a,args:s}]=t;return e&&o.ZP.invalidate(a,s),o.ZP.get(a,s).catch(e=>{console.error("[CachePreloader] Failed to preload ".concat(r,":"),e)})});await Promise.allSettled(t),console.log("[CachePreloader] Base functions preloaded")}getCacheStats(){return{...o.ZP.getStats(),isPreloading:this.isPreloading}}wasRecentlyPreloaded(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this._generateKey(e,t),o=this.recentlyPreloaded.get(r);if(!o)return!1;let a=Date.now()-o<this.PRELOAD_GRACE_PERIOD;return a||this.recentlyPreloaded.delete(r),a}_markAsPreloaded(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this._generateKey(e,t);this.recentlyPreloaded.set(r,Date.now())}_generateKey(e,t){let r=e.toString(),o=this._simpleHash(r),a=t.length>0?JSON.stringify(t):"";return"".concat(o,"_").concat(a)}_simpleHash(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r);return t>>>0}clearCache(){o.ZP.clear(),this.isPreloading=!1,this.preloadPromises.clear(),this.recentlyPreloaded.clear(),console.log("[CachePreloader] Cache cleared")}constructor(){this.isPreloading=!1,this.preloadPromises=new Map,this.recentlyPreloaded=new Map,this.PRELOAD_GRACE_PERIOD=5e3}}let g=new f;o.ZP.setPreloader(g),t.ZP=g},30017:function(e,t,r){function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{isSSH:r,isSlurm:o,cloud:a}=t,s=null;s=r||"SSH"===a?"ssh":o||(null==a?void 0:a.toLowerCase())==="slurm"?"slurm":"Kubernetes"===a?"kubernetes":e.startsWith("ssh-")?"ssh":"kubernetes";let n=e;return"ssh"===s&&(n=e.replace(/^ssh-/,"")),"".concat(s,"/").concat(n)}function a(e,t){return e&&t?o(t,{cloud:e}):null}r.d(t,{G:function(){return o},y:function(){return a}})}}]);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8555],{27325:function(e,l,n){n.d(l,{Z:function(){return r}});/**
|
|
2
|
+
* @license lucide-react v0.407.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/let r=(0,n(60998).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},12003:function(e,l,n){n.d(l,{j:function(){return i}});var r=n(90512);let t=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,u=r.W,i=(e,l)=>n=>{var r;if((null==l?void 0:l.variants)==null)return u(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:i,defaultVariants:c}=l,s=Object.keys(i).map(e=>{let l=null==n?void 0:n[e],r=null==c?void 0:c[e];if(null===l)return null;let u=t(l)||t(r);return i[e][u]}),a=n&&Object.entries(n).reduce((e,l)=>{let[n,r]=l;return void 0===r||(e[n]=r),e},{});return u(e,s,null==l?void 0:null===(r=l.compoundVariants)||void 0===r?void 0:r.reduce((e,l)=>{let{class:n,className:r,...t}=l;return Object.entries(t).every(e=>{let[l,n]=e;return Array.isArray(n)?n.includes({...c,...a}[l]):({...c,...a})[l]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8821],{65168:function(e,t,n){n.d(t,{ZP:function(){return eq}});var r=n(87462),o=n(63366),i=n(67294),l=n(90512),a=n(94780);function s(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function u(...e){return i.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{s(e,t)})},e)}var c=function(e){return"string"==typeof e},d=function(e,t=[]){if(void 0===e)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n},p=function(e){if(void 0===e)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t},f=function(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:o,externalForwardedProps:i,className:a}=e;if(!t){let e=(0,l.Z)(null==n?void 0:n.className,a,null==i?void 0:i.className,null==o?void 0:o.className),t=(0,r.Z)({},null==n?void 0:n.style,null==i?void 0:i.style,null==o?void 0:o.style),s=(0,r.Z)({},n,i,o);return e.length>0&&(s.className=e),Object.keys(t).length>0&&(s.style=t),{props:s,internalRef:void 0}}let s=d((0,r.Z)({},i,o)),u=p(o),c=p(i),f=t(s),v=(0,l.Z)(null==f?void 0:f.className,null==n?void 0:n.className,a,null==i?void 0:i.className,null==o?void 0:o.className),h=(0,r.Z)({},null==f?void 0:f.style,null==n?void 0:n.style,null==i?void 0:i.style,null==o?void 0:o.style),m=(0,r.Z)({},f,n,c,u);return v.length>0&&(m.className=v),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:f.ref}};let v=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];var h=function(e){var t,n;let{elementType:i,externalSlotProps:l,ownerState:a,skipResolvingSlotProps:s=!1}=e,d=(0,o.Z)(e,v),p=s?{}:"function"==typeof l?l(a,void 0):l,{props:h,internalRef:m}=f((0,r.Z)({},d,{externalSlotProps:p})),E=u(m,null==p?void 0:p.ref,null==(t=e.additionalProps)?void 0:t.ref);return n=(0,r.Z)({},h,{ref:E}),void 0===i||c(i)?n:(0,r.Z)({},n,{ownerState:(0,r.Z)({},n.ownerState,a)})},m=n(30957),E=n(81079),x=function(e,t=166){let n;function r(...o){clearTimeout(n),n=setTimeout(()=>{e.apply(this,o)},t)}return r.clear=()=>{clearTimeout(n)},r};function y(e){return e&&e.ownerDocument||document}function g(e){return y(e).defaultView||window}let b={},R=[];class k{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new k}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function P(e){if(parseInt(i.version,10)>=19){var t;return(null==e||null==(t=e.props)?void 0:t.ref)||null}return(null==e?void 0:e.ref)||null}function Z(e,t){return(Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var T=n(73935),N={disabled:!1},S=i.createContext(null),w="unmounted",C="exited",O="entering",I="entered",M="exiting",j=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=C,r.appearStatus=O):o=I:o=t.unmountOnExit||t.mountOnEnter?w:C,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Z(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===w?{status:C}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==O&&n!==I&&(t=O):(n===O||n===I)&&(t=M)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===O){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:T.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===C&&this.setState({status:w})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[T.findDOMNode(this),r],i=o[0],l=o[1],a=this.getTimeouts(),s=r?a.appear:a.enter;if(!e&&!n||N.disabled){this.safeSetState({status:I},function(){t.props.onEntered(i)});return}this.props.onEnter(i,l),this.safeSetState({status:O},function(){t.props.onEntering(i,l),t.onTransitionEnd(s,function(){t.safeSetState({status:I},function(){t.props.onEntered(i,l)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:T.findDOMNode(this);if(!t||N.disabled){this.safeSetState({status:C},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:M},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:C},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:T.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],l=o[1];this.props.addEndListener(i,l)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===w)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,o.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(S.Provider,{value:null},"function"==typeof n?n(e,r):i.cloneElement(i.Children.only(n),r))},t}(i.Component);function A(){}j.contextType=S,j.propTypes={},j.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:A,onEntering:A,onEntered:A,onExit:A,onExiting:A,onExited:A},j.UNMOUNTED=w,j.EXITED=C,j.ENTERING=O,j.ENTERED=I,j.EXITING=M;var D=n(17172),L=n(87685),F=function(e=null){let t=i.useContext(L.T);return t&&0!==Object.keys(t).length?t:e};let z=(0,D.Z)();var B=n(2418),H=n(22453);function U(){let e=function(e=z){return F(e)}(B.Z);return e[H.Z]||e}let W=e=>e.scrollTop;function _(e,t){var n,r;let{timeout:o,easing:i,style:l={}}=e;return{duration:null!=(n=l.transitionDuration)?n:"number"==typeof o?o:o[t.mode]||0,easing:null!=(r=l.transitionTimingFunction)?r:"object"==typeof i?i[t.mode]:i,delay:l.transitionDelay}}var q=n(85893);let K=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function V(e){return"scale(".concat(e,", ").concat(e**2,")")}let Y={entering:{opacity:1,transform:V(1)},entered:{opacity:1,transform:"none"}},X="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),G=i.forwardRef(function(e,t){let{addEndListener:n,appear:l=!0,children:a,easing:s,in:c,onEnter:d,onEntered:p,onEntering:f,onExit:v,onExited:h,onExiting:m,style:E,timeout:x="auto",TransitionComponent:y=j}=e,g=(0,o.Z)(e,K),Z=function(){var e;let t=function(e,t){let n=i.useRef(b);return n.current===b&&(n.current=e(void 0)),n}(k.create).current;return e=t.disposeEffect,i.useEffect(e,R),t}(),T=i.useRef(),N=U(),S=i.useRef(null),w=u(S,P(a),t),C=e=>t=>{if(e){let n=S.current;void 0===t?e(n):e(n,t)}},O=C(f),I=C((e,t)=>{let n;W(e);let{duration:r,delay:o,easing:i}=_({style:E,timeout:x,easing:s},{mode:"enter"});"auto"===x?(n=N.transitions.getAutoHeightDuration(e.clientHeight),T.current=n):n=r,e.style.transition=[N.transitions.create("opacity",{duration:n,delay:o}),N.transitions.create("transform",{duration:X?n:.666*n,delay:o,easing:i})].join(","),d&&d(e,t)}),M=C(p),A=C(m),D=C(e=>{let t;let{duration:n,delay:r,easing:o}=_({style:E,timeout:x,easing:s},{mode:"exit"});"auto"===x?(t=N.transitions.getAutoHeightDuration(e.clientHeight),T.current=t):t=n,e.style.transition=[N.transitions.create("opacity",{duration:t,delay:r}),N.transitions.create("transform",{duration:X?t:.666*t,delay:X?r:r||.333*t,easing:o})].join(","),e.style.opacity=0,e.style.transform=V(.75),v&&v(e)}),L=C(h);return(0,q.jsx)(y,(0,r.Z)({appear:l,in:c,nodeRef:S,onEnter:I,onEntered:M,onEntering:O,onExit:D,onExited:L,onExiting:A,addEndListener:e=>{"auto"===x&&Z.start(T.current||0,e),n&&n(S.current,e)},timeout:"auto"===x?null:x},g,{children:(e,t)=>i.cloneElement(a,(0,r.Z)({style:(0,r.Z)({opacity:0,transform:V(.75),visibility:"exited"!==e||c?void 0:"hidden"},Y[e],E,a.props.style),ref:w},t))}))});function $(e){let t=[],n=[];return Array.from(e.querySelectorAll('input,select,textarea,a[href],button,[tabindex],audio[controls],video[controls],[contenteditable]:not([contenteditable="false"])')).forEach((e,r)=>{let o=function(e){let t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1===o||e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!1;let t=t=>e.ownerDocument.querySelector('input[type="radio"]'.concat(t)),n=t('[name="'.concat(e.name,'"]:checked'));return n||(n=t('[name="'.concat(e.name,'"]'))),n!==e}(e)||(0===o?t.push(e):n.push({documentOrder:r,tabIndex:o,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function J(){return!0}G.muiSupportAuto=!0;var Q=function(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:l=$,isEnabled:a=J,open:s}=e,c=i.useRef(!1),d=i.useRef(null),p=i.useRef(null),f=i.useRef(null),v=i.useRef(null),h=i.useRef(!1),m=i.useRef(null),E=u(P(t),m),x=i.useRef(null);i.useEffect(()=>{s&&m.current&&(h.current=!n)},[n,s]),i.useEffect(()=>{if(!s||!m.current)return;let e=y(m.current);return!m.current.contains(e.activeElement)&&(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),h.current&&m.current.focus()),()=>{o||(f.current&&f.current.focus&&(c.current=!0,f.current.focus()),f.current=null)}},[s]),i.useEffect(()=>{if(!s||!m.current)return;let e=y(m.current),t=t=>{x.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(c.current=!0,p.current&&p.current.focus())},n=()=>{let t=m.current;if(null===t)return;if(!e.hasFocus()||!a()||c.current){c.current=!1;return}if(t.contains(e.activeElement)||r&&e.activeElement!==d.current&&e.activeElement!==p.current)return;if(e.activeElement!==v.current)v.current=null;else if(null!==v.current)return;if(!h.current)return;let n=[];if((e.activeElement===d.current||e.activeElement===p.current)&&(n=l(m.current)),n.length>0){var o,i;let e=!!((null==(o=x.current)?void 0:o.shiftKey)&&(null==(i=x.current)?void 0:i.key)==="Tab"),t=n[0],r=n[n.length-1];"string"!=typeof t&&"string"!=typeof r&&(e?r.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);let o=setInterval(()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()},50);return()=>{clearInterval(o),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}},[n,r,o,a,s,l]);let g=e=>{null===f.current&&(f.current=e.relatedTarget),h.current=!0};return(0,q.jsxs)(i.Fragment,{children:[(0,q.jsx)("div",{tabIndex:s?0:-1,onFocus:g,ref:d,"data-testid":"sentinelStart"}),i.cloneElement(t,{ref:E,onFocus:e=>{null===f.current&&(f.current=e.relatedTarget),h.current=!0,v.current=e.target;let n=t.props.onFocus;n&&n(e)}}),(0,q.jsx)("div",{tabIndex:s?0:-1,onFocus:g,ref:p,"data-testid":"sentinelEnd"})]})};let ee="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,et=i.forwardRef(function(e,t){let{children:n,container:r,disablePortal:o=!1}=e,[l,a]=i.useState(null),c=u(i.isValidElement(n)?P(n):null,t);return(ee(()=>{!o&&a(("function"==typeof r?r():r)||document.body)},[r,o]),ee(()=>{if(l&&!o)return s(t,l),()=>{s(t,null)}},[t,l,o]),o)?i.isValidElement(n)?i.cloneElement(n,{ref:c}):(0,q.jsx)(i.Fragment,{children:n}):(0,q.jsx)(i.Fragment,{children:l?T.createPortal(n,l):l})}),en=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],er={entering:{opacity:1},entered:{opacity:1}},eo=i.forwardRef(function(e,t){let n=U(),l={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:c,easing:d,in:p,onEnter:f,onEntered:v,onEntering:h,onExit:m,onExited:E,onExiting:x,style:y,timeout:g=l,TransitionComponent:b=j}=e,R=(0,o.Z)(e,en),k=i.useRef(null),Z=u(k,P(c),t),T=e=>t=>{if(e){let n=k.current;void 0===t?e(n):e(n,t)}},N=T(h),S=T((e,t)=>{W(e);let r=_({style:y,timeout:g,easing:d},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),f&&f(e,t)}),w=T(v),C=T(x),O=T(e=>{let t=_({style:y,timeout:g,easing:d},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),m&&m(e)}),I=T(E);return(0,q.jsx)(b,(0,r.Z)({appear:s,in:p,nodeRef:k,onEnter:S,onEntered:w,onEntering:N,onExit:O,onExited:I,onExiting:C,addEndListener:e=>{a&&a(k.current,e)},timeout:g},R,{children:(e,t)=>i.cloneElement(c,(0,r.Z)({style:(0,r.Z)({opacity:0,visibility:"exited"!==e||p?void 0:"hidden"},er[e],y,c.props.style),ref:Z},t))}))});var ei=n(1588),el=n(27621);function ea(e){return(0,el.ZP)("MuiBackdrop",e)}(0,ei.Z)("MuiBackdrop",["root","invisible"]);let es=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],eu=e=>{let{classes:t,invisible:n}=e;return(0,a.Z)({root:["root",n&&"invisible"]},ea,t)},ec=(0,m.ZP)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(e=>{let{ownerState:t}=e;return(0,r.Z)({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})}),ed=i.forwardRef(function(e,t){var n,i,a;let s=(0,E.i)({props:e,name:"MuiBackdrop"}),{children:u,className:c,component:d="div",components:p={},componentsProps:f={},invisible:v=!1,open:h,slotProps:m={},slots:x={},TransitionComponent:y=eo,transitionDuration:g}=s,b=(0,o.Z)(s,es),R=(0,r.Z)({},s,{component:d,invisible:v}),k=eu(R),P=null!=(n=m.root)?n:f.root;return(0,q.jsx)(y,(0,r.Z)({in:h,timeout:g},b,{children:(0,q.jsx)(ec,(0,r.Z)({"aria-hidden":!0},P,{as:null!=(i=null!=(a=x.root)?a:p.Root)?i:d,className:(0,l.Z)(k.root,c,null==P?void 0:P.className),ownerState:(0,r.Z)({},R,null==P?void 0:P.ownerState),classes:k,ref:t,children:u}))}))});var ep=function(e){let t=i.useRef(e);return ee(()=>{t.current=e}),i.useRef((...e)=>(0,t.current)(...e)).current};function ef(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function ev(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function eh(e){return parseInt(g(e).getComputedStyle(e).paddingRight,10)||0}function em(e,t,n,r,o){let i=[t,n,...r];[].forEach.call(e.children,e=>{let t=-1===i.indexOf(e),n=!function(e){let t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&ev(e,o)})}function eE(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}class ex{add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&ev(e.modalRef,!1);let r=function(e){let t=[];return[].forEach.call(e.children,e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}(t);em(t,e.mount,e.modalRef,r,!0);let o=eE(this.containers,e=>e.container===t);return -1!==o?this.containers[o].modals.push(e):this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n}mount(e,t){let n=eE(this.containers,t=>-1!==t.modals.indexOf(e)),r=this.containers[n];r.restore||(r.restore=function(e,t){let n=[],r=e.container;if(!t.disableScrollLock){let e;if(function(e){let t=y(e);return t.body===e?g(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){let e=function(e){let t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(y(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight="".concat(eh(r)+e,"px");let t=y(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight="".concat(eh(t)+e,"px")})}if(r.parentNode instanceof DocumentFragment)e=y(r).body;else{let t=r.parentElement,n=g(r);e=(null==t?void 0:t.nodeName)==="HTML"&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(e=>{let{value:t,el:n,property:r}=e;t?n.style.setProperty(r,t):n.style.removeProperty(r)})}}(r,t))}remove(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.modals.indexOf(e);if(-1===n)return n;let r=eE(this.containers,t=>-1!==t.modals.indexOf(e)),o=this.containers[r];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(n,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&ev(e.modalRef,t),em(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=o.modals[o.modals.length-1];e.modalRef&&ev(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}}let ey=new ex;var eg=function(e){let{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,manager:l=ey,closeAfterTransition:a=!1,onTransitionEnter:s,onTransitionExited:c,children:p,onClose:f,open:v,rootRef:h}=e,m=i.useRef({}),E=i.useRef(null),x=i.useRef(null),g=u(x,h),[b,R]=i.useState(!v),k=!!p&&p.props.hasOwnProperty("in"),P=!0;("false"===e["aria-hidden"]||!1===e["aria-hidden"])&&(P=!1);let Z=()=>y(E.current),T=()=>(m.current.modalRef=x.current,m.current.mount=E.current,m.current),N=()=>{l.mount(T(),{disableScrollLock:o}),x.current&&(x.current.scrollTop=0)},S=ep(()=>{let e=("function"==typeof t?t():t)||Z().body;l.add(T(),e),x.current&&N()}),w=i.useCallback(()=>l.isTopModal(T()),[l]),C=ep(e=>{E.current=e,e&&(v&&w()?N():x.current&&ev(x.current,P))}),O=i.useCallback(()=>{l.remove(T(),P)},[P,l]);i.useEffect(()=>()=>{O()},[O]),i.useEffect(()=>{v?S():k&&a||O()},[v,O,k,a,S]);let I=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&w()&&!n&&(t.stopPropagation(),f&&f(t,"escapeKeyDown"))},M=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&f&&f(t,"backdropClick")};return{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=d(e);delete n.onTransitionEnter,delete n.onTransitionExited;let o=(0,r.Z)({},n,t);return(0,r.Z)({role:"presentation"},o,{onKeyDown:I(o),ref:g})},getBackdropProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.Z)({"aria-hidden":!0},e,{onClick:M(e),open:v})},getTransitionProps:()=>({onEnter:ef(()=>{R(!1),s&&s()},null==p?void 0:p.props.onEnter),onExited:ef(()=>{R(!0),c&&c(),a&&O()},null==p?void 0:p.props.onExited)}),rootRef:g,portalRef:C,isTopModal:w,exited:b,hasTransition:k}};function eb(e){return(0,el.ZP)("MuiModal",e)}(0,ei.Z)("MuiModal",["root","hidden","backdrop"]);let eR=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],ek=e=>{let{open:t,exited:n,classes:r}=e;return(0,a.Z)({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},eb,r)},eP=(0,m.ZP)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(e=>{let{theme:t,ownerState:n}=e;return(0,r.Z)({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!n.open&&n.exited&&{visibility:"hidden"})}),eZ=(0,m.ZP)(ed,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),eT=i.forwardRef(function(e,t){var n,a,s,u,c,d;let p=(0,E.i)({name:"MuiModal",props:e}),{BackdropComponent:f=eZ,BackdropProps:v,className:m,closeAfterTransition:x=!1,children:y,container:g,component:b,components:R={},componentsProps:k={},disableAutoFocus:P=!1,disableEnforceFocus:Z=!1,disableEscapeKeyDown:T=!1,disablePortal:N=!1,disableRestoreFocus:S=!1,disableScrollLock:w=!1,hideBackdrop:C=!1,keepMounted:O=!1,onBackdropClick:I,open:M,slotProps:j,slots:A}=p,D=(0,o.Z)(p,eR),L=(0,r.Z)({},p,{closeAfterTransition:x,disableAutoFocus:P,disableEnforceFocus:Z,disableEscapeKeyDown:T,disablePortal:N,disableRestoreFocus:S,disableScrollLock:w,hideBackdrop:C,keepMounted:O}),{getRootProps:F,getBackdropProps:z,getTransitionProps:B,portalRef:H,isTopModal:U,exited:W,hasTransition:_}=eg((0,r.Z)({},L,{rootRef:t})),K=(0,r.Z)({},L,{exited:W}),V=ek(K),Y={};if(void 0===y.props.tabIndex&&(Y.tabIndex="-1"),_){let{onEnter:e,onExited:t}=B();Y.onEnter=e,Y.onExited=t}let X=null!=(n=null!=(a=null==A?void 0:A.root)?a:R.Root)?n:eP,G=null!=(s=null!=(u=null==A?void 0:A.backdrop)?u:R.Backdrop)?s:f,$=null!=(c=null==j?void 0:j.root)?c:k.root,J=null!=(d=null==j?void 0:j.backdrop)?d:k.backdrop,ee=h({elementType:X,externalSlotProps:$,externalForwardedProps:D,getSlotProps:F,additionalProps:{ref:t,as:b},ownerState:K,className:(0,l.Z)(m,null==$?void 0:$.className,null==V?void 0:V.root,!K.open&&K.exited&&(null==V?void 0:V.hidden))}),en=h({elementType:G,externalSlotProps:J,additionalProps:v,getSlotProps:e=>z((0,r.Z)({},e,{onClick:t=>{I&&I(t),null!=e&&e.onClick&&e.onClick(t)}})),className:(0,l.Z)(null==J?void 0:J.className,null==v?void 0:v.className,null==V?void 0:V.backdrop),ownerState:K});return O||M||_&&!W?(0,q.jsx)(et,{ref:H,container:g,disablePortal:N,children:(0,q.jsxs)(X,(0,r.Z)({},ee,{children:[!C&&f?(0,q.jsx)(G,(0,r.Z)({},en)):null,(0,q.jsx)(Q,{disableEnforceFocus:Z,disableAutoFocus:P,disableRestoreFocus:S,isEnabled:U,open:M,children:i.cloneElement(y,Y)})]}))}):null});var eN=n(2101),eS=e=>((e<1?5.11916*e**2:4.5*Math.log(e+1)+2)/100).toFixed(2);function ew(e){return(0,el.ZP)("MuiPaper",e)}(0,ei.Z)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);let eC=["className","component","elevation","square","variant"],eO=e=>{let{square:t,elevation:n,variant:r,classes:o}=e;return(0,a.Z)({root:["root",r,!t&&"rounded","elevation"===r&&"elevation".concat(n)]},ew,o)},eI=(0,m.ZP)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t["elevation".concat(n.elevation)]]}})(e=>{var t;let{theme:n,ownerState:o}=e;return(0,r.Z)({backgroundColor:(n.vars||n).palette.background.paper,color:(n.vars||n).palette.text.primary,transition:n.transitions.create("box-shadow")},!o.square&&{borderRadius:n.shape.borderRadius},"outlined"===o.variant&&{border:"1px solid ".concat((n.vars||n).palette.divider)},"elevation"===o.variant&&(0,r.Z)({boxShadow:(n.vars||n).shadows[o.elevation]},!n.vars&&"dark"===n.palette.mode&&{backgroundImage:"linear-gradient(".concat((0,eN.Fq)("#fff",eS(o.elevation)),", ").concat((0,eN.Fq)("#fff",eS(o.elevation)),")")},n.vars&&{backgroundImage:null==(t=n.vars.overlays)?void 0:t[o.elevation]}))}),eM=i.forwardRef(function(e,t){let n=(0,E.i)({props:e,name:"MuiPaper"}),{className:i,component:a="div",elevation:s=1,square:u=!1,variant:c="elevation"}=n,d=(0,o.Z)(n,eC),p=(0,r.Z)({},n,{component:a,elevation:s,square:u,variant:c}),f=eO(p);return(0,q.jsx)(eI,(0,r.Z)({as:a,ownerState:p,className:(0,l.Z)(f.root,i),ref:t},d))});function ej(e){return(0,el.ZP)("MuiPopover",e)}(0,ei.Z)("MuiPopover",["root","paper"]);let eA=["onEntering"],eD=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],eL=["slotProps"];function eF(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function ez(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function eB(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?"".concat(e,"px"):e).join(" ")}function eH(e){return"function"==typeof e?e():e}let eU=e=>{let{classes:t}=e;return(0,a.Z)({root:["root"],paper:["paper"]},ej,t)},eW=(0,m.ZP)(eT,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),e_=(0,m.ZP)(eM,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0});var eq=i.forwardRef(function(e,t){var n,a,s;let d=(0,E.i)({props:e,name:"MuiPopover"}),{action:p,anchorEl:f,anchorOrigin:v={vertical:"top",horizontal:"left"},anchorPosition:m,anchorReference:b="anchorEl",children:R,className:k,container:P,elevation:Z=8,marginThreshold:T=16,open:N,PaperProps:S={},slots:w,slotProps:C,transformOrigin:O={vertical:"top",horizontal:"left"},TransitionComponent:I=G,transitionDuration:M="auto",TransitionProps:{onEntering:j}={},disableScrollLock:A=!1}=d,D=(0,o.Z)(d.TransitionProps,eA),L=(0,o.Z)(d,eD),F=null!=(n=null==C?void 0:C.paper)?n:S,z=i.useRef(),B=u(z,F.ref),H=(0,r.Z)({},d,{anchorOrigin:v,anchorReference:b,elevation:Z,marginThreshold:T,externalPaperSlotProps:F,transformOrigin:O,TransitionComponent:I,transitionDuration:M,TransitionProps:D}),U=eU(H),W=i.useCallback(()=>{if("anchorPosition"===b)return m;let e=eH(f),t=(e&&1===e.nodeType?e:y(z.current).body).getBoundingClientRect();return{top:t.top+eF(t,v.vertical),left:t.left+ez(t,v.horizontal)}},[f,v.horizontal,v.vertical,m,b]),_=i.useCallback(e=>({vertical:eF(e,O.vertical),horizontal:ez(e,O.horizontal)}),[O.horizontal,O.vertical]),K=i.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=_(t);if("none"===b)return{top:null,left:null,transformOrigin:eB(n)};let r=W(),o=r.top-n.vertical,i=r.left-n.horizontal,l=o+t.height,a=i+t.width,s=g(eH(f)),u=s.innerHeight-T,c=s.innerWidth-T;if(null!==T&&o<T){let e=o-T;o-=e,n.vertical+=e}else if(null!==T&&l>u){let e=l-u;o-=e,n.vertical+=e}if(null!==T&&i<T){let e=i-T;i-=e,n.horizontal+=e}else if(a>c){let e=a-c;i-=e,n.horizontal+=e}return{top:"".concat(Math.round(o),"px"),left:"".concat(Math.round(i),"px"),transformOrigin:eB(n)}},[f,b,W,_,T]),[V,Y]=i.useState(N),X=i.useCallback(()=>{let e=z.current;if(!e)return;let t=K(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,Y(!0)},[K]);i.useEffect(()=>(A&&window.addEventListener("scroll",X),()=>window.removeEventListener("scroll",X)),[f,A,X]),i.useEffect(()=>{N&&X()}),i.useImperativeHandle(p,()=>N?{updatePosition:()=>{X()}}:null,[N,X]),i.useEffect(()=>{if(!N)return;let e=x(()=>{X()}),t=g(f);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[f,N,X]);let $=M;"auto"!==M||I.muiSupportAuto||($=void 0);let J=P||(f?y(eH(f)).body:void 0),Q=null!=(a=null==w?void 0:w.root)?a:eW,ee=null!=(s=null==w?void 0:w.paper)?s:e_,et=h({elementType:ee,externalSlotProps:(0,r.Z)({},F,{style:V?F.style:(0,r.Z)({},F.style,{opacity:0})}),additionalProps:{elevation:Z,ref:B},ownerState:H,className:(0,l.Z)(U.paper,null==F?void 0:F.className)}),en=h({elementType:Q,externalSlotProps:(null==C?void 0:C.root)||{},externalForwardedProps:L,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:J,open:N},ownerState:H,className:(0,l.Z)(U.root,k)}),{slotProps:er}=en,eo=(0,o.Z)(en,eL);return(0,q.jsx)(Q,(0,r.Z)({},eo,!c(Q)&&{slotProps:er,disableScrollLock:A},{children:(0,q.jsx)(I,(0,r.Z)({appear:!0,in:N,onEntering:(e,t)=>{j&&j(e,t),X()},onExited:()=>{Y(!1)},timeout:$},D,{children:(0,q.jsx)(ee,(0,r.Z)({},et,{children:R}))}))}))})},12003:function(e,t,n){n.d(t,{j:function(){return l}});var r=n(90512);let o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=r.W,l=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return i(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:l,defaultVariants:a}=t,s=Object.keys(l).map(e=>{let t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;let i=o(t)||o(r);return l[e][i]}),u=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return i(e,s,null==t?void 0:null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...u}[t]):({...a,...u})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8969],{68969:function(e,t,r){r.d(t,{Ce:function(){return m},NJ:function(){return p},UA:function(){return f},aT:function(){return u},getManagedJobs:function(){return i},jh:function(){return b},vs:function(){return d}});var o=r(67294),a=r(15821),n=r(93225),s=r(6378),l=r(47145);let c=["job_id","_job_id","job_name","user_name","user_hash","workspace","submitted_at","job_duration","status","resources","cloud","region","accelerators","cluster_resources","cluster_resources_full","recovery_count","pool","pool_hash","details","failure_reason","links"];async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t;let{allUsers:r=!0,skipFinished:o=!1,allFields:a=!1,nameMatch:s,userMatch:i,workspaceMatch:u,poolMatch:d,page:f,limit:p,statuses:m,fields:b,jobIDs:h}=e,_={all_users:r,verbose:!0,skip_finished:o};void 0!==s&&(_.name_match=s),void 0!==i&&(_.user_match=i),void 0!==u&&(_.workspace_match=u),void 0!==d&&(_.pool_match=d),void 0!==f&&(_.page=f),void 0!==p&&(_.limit=p),void 0!==m&&m.length>0&&(_.statuses=m),void 0!==h&&h.length>0&&(_.job_ids=h),a||(b&&b.length>0?_.fields=b:_.fields=c);let g=await l.x.post("/jobs/queue/v2",_);if(!g.ok){let e="Failed to get managed jobs with status ".concat(g.status);throw Error(e)}let w=g.headers.get("X-Skypilot-Request-ID");if(!w)throw Error("No request ID received from server for managed jobs");let y=await l.x.get("/api/get?request_id=".concat(w)),j=y.statusText;if(500===y.status)try{let e=await y.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{jobs:[],total:0,controllerStopped:!0};j=t.message||String(e.detail.error)}catch(t){console.error("Error parsing JSON from data.detail.error:",t),j=String(e.detail.error)}}catch(e){console.error("Error parsing response JSON:",e),j=String(e)}if(!y.ok){let e="API request to get managed jobs result failed with status ".concat(y.status,", error: ").concat(j);throw Error(e)}let v=await y.json(),E=v.return_value?JSON.parse(v.return_value):[],S=Array.isArray(E)?E:(null==E?void 0:E.jobs)||[],C=Array.isArray(E)?S.length:null!==(t=null==E?void 0:E.total)&&void 0!==t?t:S.length,k=(null==E?void 0:E.total_no_filter)||C,x=(null==E?void 0:E.status_counts)||{};return{jobs:S.map(e=>{var t;let r=0;e.end_at&&e.submitted_at?r=e.end_at-e.submitted_at:e.submitted_at&&(r=Date.now()/1e3-e.submitted_at);let o=[];e.submitted_at&&o.push({type:"PENDING",timestamp:e.submitted_at}),e.start_at&&o.push({type:"RUNNING",timestamp:e.start_at}),e.end_at&&o.push({type:e.status,timestamp:e.end_at});let a="",n="",s="",l="",c="";try{if(a=e.cloud||"",s=e.cluster_resources,n=e.region||"","-"===n&&(n=""),a&&(l=a,n&&(l+=" (".concat(n,")"))),c=l,e.accelerators){let t=Object.entries(e.accelerators).map(e=>{let[t,r]=e;return"".concat(r,"x").concat(t)}).join(", ");t&&(c+=" (".concat(t,")"))}}catch(t){s=e.cluster_resources}return{id:e.job_id,task_job_id:e._job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:r,workspace:e.workspace,status:e.status,requested_resources:e.resources,resources_str:s,resources_str_full:e.cluster_resources_full||s,cloud:a,region:e.region,infra:l,full_infra:c,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:o,dag_yaml:e.user_yaml,entrypoint:e.entrypoint,git_commit:(null===(t=e.metadata)||void 0===t?void 0:t.git_commit)||"-",links:e.links||{},pool:e.pool,pool_hash:e.pool_hash,current_cluster_name:e.current_cluster_name,job_id_on_pool_cluster:e.job_id_on_pool_cluster,accelerators:e.accelerators,labels:e.labels||{}}}),total:C,totalNoFilter:k,controllerStopped:!1,statusCounts:x}}catch(e){throw console.error("Error fetching managed job data:",e),e}}async function u(e){let{allUsers:t=!0,nameMatch:r,userMatch:o,workspaceMatch:a,poolMatch:n,page:s=1,limit:l=10,jobIDs:c,fields:u,allFields:d=!1,useClientPagination:f=!0}=e||{};try{if(!f)return await i(e);let p=await i({allUsers:t,nameMatch:r,userMatch:o,workspaceMatch:a,poolMatch:n,jobIDs:c,fields:u,allFields:d});if(p.controllerStopped||!p.jobs)return p;let m=p.jobs,b=m.length,h=(s-1)*l;return{jobs:m.slice(h,h+l),total:b,controllerStopped:!1}}catch(e){throw console.error("Error fetching managed job data with client pagination:",e),e}}async function d(){try{let e=await l.x.post("/jobs/pool_status",{pool_names:null});if(!e.ok){let t="Initial API request to get pool status failed with status ".concat(e.status);throw Error(t)}let t=e.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("No request ID received from server for getting pool status");let r=await l.x.get("/api/get?request_id=".concat(t)),o=r.statusText;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{pools:[],controllerStopped:!0};o=t.message||String(e.detail.error)}catch(t){console.error("Error parsing JSON from data.detail.error:",t),o=String(e.detail.error)}}catch(e){console.error("Error parsing response JSON:",e),o=String(e)}if(!r.ok){let e="API request to get pool status result failed with status ".concat(r.status,", error: ").concat(o);throw Error(e)}let a=await r.json(),c=a.return_value?JSON.parse(a.return_value):[],u={jobs:[]};try{let e=await s.ZP.get(i,[{allUsers:!0,skipFinished:!0,fields:["pool","status"]}]);e.controllerStopped||(u=e)}catch(e){console.warn("Failed to fetch jobs for pool job counts:",e)}let d={},f=["SUCCEEDED","FAILED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER","CANCELLED"];return u.jobs&&Array.isArray(u.jobs)&&u.jobs.forEach(e=>{let t=e.pool,r=e.status;t&&!f.includes(r)&&(d[t]||(d[t]={}),d[t][r]=(d[t][r]||0)+1)}),{pools:c.map(e=>({...e,jobCounts:d[e.name]||{}})),controllerStopped:!1}}catch(e){throw console.error("Error fetching pools:",e),e}}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[r,a]=(0,o.useState)(null),[n,l]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){if(e)try{var t;l(!0);let r=await s.ZP.get(i,[{allUsers:!0,allFields:!0,jobIDs:[e]}]),o=null==r?void 0:null===(t=r.jobs)||void 0===t?void 0:t.find(t=>String(t.id)===String(e));o?a({jobs:[o],controllerStopped:r.controllerStopped||!1}):a({jobs:[],controllerStopped:r.controllerStopped||!1})}catch(e){console.error("Error fetching single managed job data:",e),a({jobs:[],controllerStopped:!1})}finally{l(!1)}})()},[e,t]),{jobData:r,loading:n}}async function p(e){let t,{jobId:r,controller:o=!1,signal:n,onNewLog:s}=e,c=Date.now(),i=new Promise(e=>{let r=()=>{let o=Date.now()-c;o>=3e4?e({timeout:!0}):t=setTimeout(r,3e4-o)};t=setTimeout(r,3e4)}),u=(async()=>{try{let e=(await l.x.fetchImmediate("/jobs/logs",{controller:o,follow:!1,job_id:r,tail:5e3},"POST",{signal:n})).body.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;c=Date.now();let o=new TextDecoder().decode(r);s(o)}}finally{if(!n||!n.aborted)try{e.cancel()}catch(e){"AbortError"!==e.name&&console.warn("Error canceling reader:",e)}t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),d=await Promise.race([u,i]);if(t&&clearTimeout(t),d.timeout){(0,a.C)("Log request for job ".concat(r," timed out after ").concat(30,"s of inactivity"),"warning");return}}async function m(e,t,r){let o="",s="",c="",i={};if("restartcontroller"===e)o="Restarting",s="restarted",c="jobs/queue/v2",i={all_users:!0,refresh:!0,skip_finished:!0,fields:["status"]},t="controller";else throw Error("Invalid action: ".concat(e));(0,a.C)("".concat(o," job ").concat(t,"..."),"info");try{try{let e=await l.x.fetchImmediate("/".concat(c),i);if(!e.ok){console.error("Initial API request ".concat(c," failed with status ").concat(e.status)),(0,a.C)("".concat(o," job ").concat(t," failed with status ").concat(e.status,"."),"error");return}let u=e.headers.get("X-Skypilot-Request-ID");if(!u){console.error("No request ID received from server for ".concat(c)),(0,a.C)("".concat(o," job ").concat(t," failed with no request ID."),"error");return}let d=await l.x.fetchImmediate("/api/get?request_id=".concat(u),void 0,"GET");if(200===d.status)(0,a.C)("Job ".concat(t," ").concat(s," successfully."),"success");else if(500===d.status)try{let e=await d.json();if(e.detail&&e.detail.error)try{let s=JSON.parse(e.detail.error);s.type&&s.type===n.Bo?(0,a.C)("".concat(o," job ").concat(t," is not supported!"),"error",1e4):s.type&&s.type===n.mF?(0,a.C)("Cluster ".concat(r," does not exist."),"error"):s.type&&s.type===n.iW?(0,a.C)("Cluster ".concat(r," is not up."),"error"):(0,a.C)("".concat(o," job ").concat(t," failed: ").concat(s.type),"error")}catch(r){(0,a.C)("".concat(o," job ").concat(t," failed: ").concat(e.detail.error),"error")}else(0,a.C)("".concat(o," job ").concat(t," failed with no details."),"error")}catch(e){(0,a.C)("".concat(o," job ").concat(t," failed with parse error."),"error")}else(0,a.C)("".concat(o," job ").concat(t," failed with status ").concat(d.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,a.C)("Network error ".concat(o," job ").concat(t,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,a.C)("Critical error ".concat(o," job ").concat(t,": ").concat(e.message),"error")}}async function b(e){let{jobId:t=null,name:r=null,controller:o=!1}=e;try{let e=await l.x.fetch("/jobs/download_logs",{job_id:t,name:r,controller:o,refresh:!1}),n=Object.values(e||{});if(!n.length){(0,a.C)("No logs found to download.","warning");return}let s=await l.x.fetchImmediate("/download?relative=items",{folder_paths:n});if(!s.ok){let e=await s.text();throw Error("Download failed: ".concat(s.status," ").concat(e))}let c=await s.blob(),i=window.URL.createObjectURL(c),u=document.createElement("a"),d=new Date().toISOString().replace(/[:.]/g,"-"),f=t?"job-".concat(t):r?"job-".concat(r):"job";u.href=i,u.download="managed-".concat(f,"-").concat(o?"controller-logs":"logs","-").concat(d,".zip"),document.body.appendChild(u),u.click(),u.remove(),window.URL.revokeObjectURL(i)}catch(e){console.error("Error downloading managed job logs:",e),(0,a.C)("Error downloading managed job logs: ".concat(e.message),"error")}}},15821:function(e,t,r){r.d(t,{C:function(){return o}});function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,o=document.getElementById("toast-container");o||((o=document.createElement("div")).id="toast-container",o.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(o));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 '),o.appendChild(a),a.querySelector("button").addEventListener("click",()=>{o.removeChild(a)}),setTimeout(()=>{o.contains(a)&&o.removeChild(a)},r),a}}}]);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9025],{99333:function(e,s,n){n.d(s,{Z:function(){return r}});/**
|
|
2
|
+
* @license lucide-react v0.407.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/let r=(0,n(60998).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},54042:function(e,s,n){n.r(s),n.d(s,{Config:function(){return p}});var r=n(85893),t=n(67294),l=n(11163),a=n(30803),i=n(37673),o=n(17324),c=n(1812),u=n(55739),d=n(99333),m=n(1272),f=n(36989),h=n(47145);function x(){let[e,s]=(0,t.useState)(null),[n,l]=(0,t.useState)(null),[a,i]=(0,t.useState)([]),o=async()=>{let[e,n]=await Promise.all([h.x.get("/api/health"),h.x.get("/api/plugins")]);if(e.ok){let n=await e.json();n.version&&s(n.version),n.commit&&l(n.commit)}else console.error("API request /api/health failed with status ".concat(e.status));if(n.ok){let e=await n.json();e.plugins&&e.plugins.length>0&&i(e.plugins)}else console.error("API request /api/plugins failed with status ".concat(n.status))};if((0,t.useEffect)(()=>{o()},[]),!e)return null;let c=[];n&&(a.length>0?c.push("Core commit: ".concat(n)):c.push("Commit: ".concat(n))),a.forEach(e=>{let s=e.name||"Unknown Plugin",n=[];e.version&&n.push("".concat(e.version)),e.commit&&n.push(e.commit),n.length>0&&c.push("".concat(s,": ").concat(n.join(" - ")))});let u=c.length>0?c.join("\n"):"Commit information not available";return(0,r.jsx)(f.Md,{content:u,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("div",{className:"text-sm text-gray-500 cursor-help border-b border-dotted border-gray-400 inline-block",children:["Version: ",e]})})}var v=n(17853),g=n(83454);function p(){let e=(0,l.useRouter)(),[s,n]=(0,t.useState)(""),[f,p]=(0,t.useState)(!0),[j,b]=(0,t.useState)(!1),[y,N]=(0,t.useState)(null),[w,k]=(0,t.useState)(!1),[L,C]=(0,t.useState)(!1),A=(0,t.useRef)(null);(0,t.useEffect)(()=>{E(),(async()=>{C(await (0,v.TO)())})()},[]),(0,t.useEffect)(()=>()=>{A.current&&clearTimeout(A.current)},[]);let E=async()=>{p(!0),N(null);try{let e=await (0,o.iE)();0===Object.keys(e).length?n(""):n(m.ZP.dump(e,{indent:2}))}catch(e){console.error("Error loading config:",e),N(e)}finally{p(!1)}},S=async()=>{b(!0),N(null),A.current&&(clearTimeout(A.current),A.current=null);try{let e=await h.x.get("/users/role");if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to get user role")}let n=await e.json(),r=n.role;if("admin"!=r){N(Error("".concat(n.name," is logged in as non-admin and cannot edit config"))),b(!1);return}let t=m.ZP.load(s);if(null==t&&(t={}),"object"!=typeof t||Array.isArray(t)){let e="Invalid config structure: Configuration must be a mapping (key-value pairs) in YAML format.";Array.isArray(t),e="Invalid config structure: Configuration must be a mapping (key-value pairs) in YAML format.",N(Error(e)),b(!1);return}await (0,o.rF)(t),k(!0),A.current=setTimeout(()=>{k(!1),A.current=null},5e3)}catch(e){console.error("Error saving config:",e),N(e)}finally{b(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsx)("div",{className:"text-base flex items-center",children:(0,r.jsx)("span",{className:"text-sky-blue",children:"SkyPilot API Server"})}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"text-sm flex items-center",children:(f||j)&&(0,r.jsxs)("div",{className:"flex items-center mr-4",children:[(0,r.jsx)(u.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:j?"Applying...":"Loading..."})]})}),L&&(0,r.jsxs)("button",{onClick:()=>{let e=(0,v.ki)(),s=g.env.SKYPILOT_RELEASE_NAME||"skypilot";window.open("".concat(e,"/d/skypilot-apiserver-overview/skypilot-api-server?orgId=1&from=now-1h&to=now&timezone=browser&var-app=").concat("".concat(s,"-api")),"_blank")},className:"inline-flex items-center px-3 py-2 text-sm font-medium text-white bg-sky-blue-bright border border-transparent rounded-md shadow-sm hover:bg-sky-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-blue mr-4",children:[(0,r.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"View API Server Metrics"]}),(0,r.jsx)(x,{})]})]}),(0,r.jsxs)(i.Zb,{className:"w-full",children:[(0,r.jsx)(i.Ol,{children:(0,r.jsx)(i.ll,{className:"text-base font-normal flex items-center justify-between",children:(0,r.jsx)("span",{children:"Edit SkyPilot API Server Configuration"})})}),(0,r.jsxs)(i.aY,{className:"space-y-4",children:[(0,r.jsxs)("p",{className:"text-sm text-gray-600 mb-3",children:["Refer to the"," ",(0,r.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."]}),w&&(0,r.jsx)("div",{className:"bg-green-50 border border-green-200 rounded p-4 mb-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-green-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.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,r.jsx)("div",{className:"ml-3",children:(0,r.jsx)("p",{className:"text-sm font-medium text-green-800",children:"Configuration saved successfully!"})})]}),(0,r.jsx)("div",{className:"ml-auto pl-3",children:(0,r.jsx)("div",{className:"-mx-1.5 -my-1.5",children:(0,r.jsxs)("button",{type:"button",onClick:()=>{k(!1),A.current&&(clearTimeout(A.current),A.current=null)},className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50",children:[(0,r.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,r.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})})]})}),y&&(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(c.X,{error:y,title:"Failed to apply new configuration",onDismiss:()=>N(null)})}),(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)("textarea",{value:s,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:f?"Loading configuration...":"# Enter SkyPilot configuration in YAML format\n# Example:\n# kubernetes:\n# allowed_contexts: [default, my-context]",disabled:f||j})}),(0,r.jsxs)("div",{className:"flex justify-end space-x-3 pt-3",children:[(0,r.jsx)(a.z,{variant:"outline",onClick:()=>{e.push("/workspaces")},disabled:j,children:"Cancel"}),(0,r.jsx)(a.z,{onClick:S,disabled:f||j,className:"inline-flex items-center bg-sky-600 hover:bg-sky-700 text-white",children:j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{size:16,className:"mr-2"}),"Applying..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{className:"w-4 h-4 mr-1.5"}),"Apply"]})})]})]})]})]})}},1812:function(e,s,n){n.d(s,{X:function(){return a}});var r=n(85893),t=n(67294);let l=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let s=e.message;return s.includes("failed:")&&(s=s.split("failed:")[1].trim()),s},a=e=>{let{error:s,title:n="Error",onDismiss:a}=e,[i,o]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{s&&o(!1)},[s]),!s||i)return null;let c="string"==typeof s?s:l(s);return(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.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,r.jsx)("div",{className:"ml-3",children:(0,r.jsxs)("div",{className:"text-sm text-red-800",children:[(0,r.jsxs)("strong",{children:[n,":"]})," ",c]})})]}),(0,r.jsx)("button",{onClick:()=>{o(!0),a&&a()},className:"flex-shrink-0 ml-4 text-red-400 hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-red-50 rounded","aria-label":"Dismiss error",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.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"})})})]})})}},12003:function(e,s,n){n.d(s,{j:function(){return a}});var r=n(90512);let t=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=r.W,a=(e,s)=>n=>{var r;if((null==s?void 0:s.variants)==null)return l(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:a,defaultVariants:i}=s,o=Object.keys(a).map(e=>{let s=null==n?void 0:n[e],r=null==i?void 0:i[e];if(null===s)return null;let l=t(s)||t(r);return a[e][l]}),c=n&&Object.entries(n).reduce((e,s)=>{let[n,r]=s;return void 0===r||(e[n]=r),e},{});return l(e,o,null==s?void 0:null===(r=s.compoundVariants)||void 0===r?void 0:r.reduce((e,s)=>{let{class:n,className:r,...t}=s;return Object.entries(t).every(e=>{let[s,n]=e;return Array.isArray(n)?n.includes({...i,...c}[s]):({...i,...c})[s]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9353],{9353:function(e,t,r){r.r(t),r.d(t,{Layout:function(){return v}});var s=r(85893),n=r(67294),a=r(66235),l=r(23001),i=r(43767),o=r(33067),c=r(26409),d=r(94849),x=r(6556);function u(){let{startTour:e}=(0,d.r)(),{shouldShowTourPrompt:t,markTourCompleted:r}=(0,x.n)(),[a,l]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(m(!0),t){let e=setTimeout(()=>{l(!0)},2e3);return()=>clearTimeout(e)}},[t]);let h=()=>{l(!1),r()};return u&&t&&a?(0,s.jsx)("div",{className:"fixed top-20 right-6 z-50 max-w-sm",children:(0,s.jsxs)("div",{className:"bg-white rounded-md shadow-lg border border-gray-200 p-4 transform transition-all duration-300 ease-out",children:[(0,s.jsx)("button",{onClick:h,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full p-1 transition-all duration-150","aria-label":"Dismiss notification",children:(0,s.jsx)(i.Z,{className:"w-3 h-3"})}),(0,s.jsxs)("div",{className:"pr-6",children:[(0,s.jsxs)("div",{className:"flex items-start mb-3",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-7 h-7 bg-blue-50 rounded-full mr-3 mt-0.5",children:(0,s.jsx)(o.Z,{className:"w-3.5 h-3.5 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:"Welcome to SkyPilot!"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:"New to the dashboard? Take a quick guided tour to discover all the features."})]})]}),(0,s.jsxs)("div",{className:"flex space-x-2 ml-10",children:[(0,s.jsxs)("button",{onClick:()=>{l(!1),e()},className:"flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors duration-150",children:[(0,s.jsx)(c.Z,{className:"w-3 h-3 mr-1.5"}),"Start Tour"]}),(0,s.jsx)("button",{onClick:h,className:"px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded transition-colors duration-150",children:"Maybe Later"})]})]})]})}):null}var m=r(19185);function h(e){let{children:t,text:r}=e,[a,l]=(0,n.useState)(!1);return(0,s.jsxs)("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,a&&(0,s.jsx)("div",{className:"absolute top-0 right-0 transform -translate-y-full -translate-x-2 mb-2 px-2 py-1 bg-gray-700 text-white text-xs rounded-md shadow-lg whitespace-nowrap z-50",children:r})]})}function f(){let{startTour:e}=(0,d.r)();return(0,s.jsx)(h,{text:"Start a tour",children:(0,s.jsx)("button",{onClick:e,className:"fixed bottom-4 right-4 bg-transparent text-gray-400 p-2 rounded-full hover:text-gray-500 focus:outline-none","aria-label":"Start Tour",children:(0,s.jsx)(m.Z,{className:"h-5 w-5"})})})}let p=(0,n.createContext)(void 0);function g(e){let{children:t}=e,[r,a]=(0,n.useState)(!1),l=(0,n.useCallback)(()=>{a(!0)},[]),i=(0,n.useCallback)(()=>{a(!1)},[]);return(0,s.jsx)(p.Provider,{value:{isUpgrading:r,reportUpgrade:l,clearUpgrade:i},children:t})}function b(){let e=(0,n.useContext)(p);if(!e)throw Error("useUpgradeDetection must be used within UpgradeDetectionProvider");return e}function j(){let{isUpgrading:e}=b();return e?(0,s.jsx)("div",{className:"fixed top-[56px] left-0 right-0 z-40 bg-yellow-50 border-b border-yellow-200",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto py-3 px-4 sm:px-6 lg:px-8",children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 text-yellow-600 mr-2 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,s.jsx)("span",{className:"text-sm font-medium text-yellow-800",children:"Your SkyPilot deployment is undergoing upgrades. Refresh in a few moments."})]})})})}):null}function y(e){let{children:t,highlighted:r}=e;(0,l.X)();let{reportUpgrade:i,clearUpgrade:o,isUpgrading:c}=b();return(0,n.useEffect)(()=>{window.__upgradeInterceptorInstalled||(window.fetch=function(e,t){let r=window.fetch;return async function(s,n){let a;try{a=await r(s,n)}catch(e){throw e}try{if(function(e){let t;try{t="string"==typeof e?e:e.url}catch(e){return!1}return["/_next/static/","/_next/image",".js",".mjs",".css",".woff",".woff2",".ttf",".eot",".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].some(e=>t.includes(e))}(s))return a;if(503===a.status){let t=a.clone();try{let r=await t.json();r.detail&&(r.detail.includes("shutting down")||r.detail.includes("try again later"))&&e()}catch(e){console.debug("Non-JSON 503 response, ignoring.")}}else(a.ok||a.status>=200&&a.status<300)&&t()}catch(e){console.error("Error in upgrade detection interceptor:",e)}return a}}(i,o),window.__upgradeInterceptorInstalled=!0)},[i,o]),(0,s.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 z-50 shadow-sm",children:(0,s.jsx)(a.Du,{})}),(0,s.jsx)(j,{}),(0,s.jsx)("div",{className:"transition-all duration-200 ease-in-out min-h-screen",style:{paddingTop:c?"112px":"56px"},children:(0,s.jsx)("main",{className:"p-6",children:t})}),(0,s.jsx)(u,{}),(0,s.jsx)(f,{})]})}function v(e){return(0,s.jsx)(g,{children:(0,s.jsx)(a.Hn,{children:(0,s.jsx)(y,{...e})})})}},66235:function(e,t,r){r.d(t,{Ap:function(){return y},Du:function(){return v},Hn:function(){return j}});var s=r(85893),n=r(67294),a=r(25675),l=r.n(a),i=r(11163),o=r(41664),c=r.n(o),d=r(53850),x=r(40355),u=r(6021),m=r(93225),h=r(36989),f=r(23001),p=r(23800);let g={key:d._m,server:d.QT,briefcase:d.Vp,chip:d.PC,book:d.E9,users:d.oy,volume:d.eU},b=(0,n.createContext)(null);function j(e){let{children:t}=e,[r,a]=(0,n.useState)(!0),[l,i]=(0,n.useState)(!1),[o,c]=(0,n.useState)(null),[d,x]=(0,n.useState)(null),u=window.location.origin,h="".concat(u).concat(m.f4);return(0,n.useEffect)(()=>{fetch("".concat(h,"/api/health")).then(e=>e.json()).then(e=>{e.user&&e.user.name&&(c(e.user.name),(async()=>{try{let e=await fetch("".concat(h,"/users/role"));if(e.ok){let t=await e.json();t.role&&x(t.role)}}catch(e){console.log("Could not fetch user role:",e)}})())}).catch(e=>{console.error("Error fetching user data:",e)})},[h]),(0,s.jsx)(b.Provider,{value:{isSidebarOpen:r,toggleSidebar:()=>{a(e=>!e)},isMobileSidebarOpen:l,toggleMobileSidebar:()=>{i(e=>!e)},userEmail:o,userRole:d},children:t})}function y(){let e=(0,n.useContext)(b);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e}function v(){let e,t;let r=(0,i.useRouter)(),a=(0,f.X)(),{userEmail:o,userRole:b,isMobileSidebarOpen:j,toggleMobileSidebar:v}=y(),[N,w]=(0,n.useState)(!1),[k,C]=(0,n.useState)(null),{ungrouped:S,groups:E}=(0,p.d7)(),_=(0,p.x1)(),W=(0,n.useRef)(null),z=(0,n.useRef)(null),L=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){W.current&&!W.current.contains(e.target)&&w(!1),z.current&&!z.current.contains(e.target)&&!e.target.closest(".mobile-menu-button")&&j&&v(),L.current&&!L.current.contains(e.target)&&C(null)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[W,j,v]);let U=e=>"/workspaces"===e?r.pathname.startsWith("/workspaces")||r.pathname.startsWith("/workspace"):r.pathname.startsWith(e),H=e=>{let t=U(e);return"inline-flex items-center border-b-2 ".concat(t?"border-transparent text-blue-600":"border-transparent hover:text-blue-600"," ").concat(a?"px-2 py-1":"px-1 pt-1 space-x-2")},M=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!t&&U(e);return"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(r?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600")},P=(e,t)=>{let r=g[e];return r?n.createElement(r,{className:t}):e},D=e=>(0,s.jsxs)(s.Fragment,{children:[e.icon&&(0,s.jsx)("span",{className:"text-base leading-none mr-1","aria-hidden":"true",children:P(e.icon,"w-4 h-4")}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,s.jsx)("span",{children:e.label}),e.badge&&(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded-full",children:e.badge})]})]}),T=e=>{if("string"!=typeof e)return e;let t=_.find(t=>t.path===e);if(!t||!t.path.startsWith("/plugins"))return e;let r=t.path.replace(/^\/+/,"").split("/").slice(1).filter(Boolean);return{pathname:"/plugins/[...slug]",query:r.length?{slug:r}:{}}},F=e=>e.external?(0,s.jsx)("a",{href:e.href,target:e.target,rel:e.rel,className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 space-x-2 text-gray-700 hover:text-blue-600",children:D(e)},e.id):(0,s.jsx)(c(),{href:T(e.href),className:H(e.href),prefetch:!1,children:D(e)},e.id),R=e=>{let t=(0,s.jsxs)(s.Fragment,{children:[e.icon&&(0,s.jsx)("span",{className:"text-base leading-none mr-2","aria-hidden":"true",children:P(e.icon,"w-5 h-5")}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.label}),e.badge&&(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded-full",children:e.badge})]})]});return e.external?(0,s.jsx)("a",{href:e.href,target:e.target,rel:e.rel,className:M(e.href,!0),onClick:v,children:t},e.id):(0,s.jsx)(c(),{href:T(e.href),className:M(e.href),onClick:v,prefetch:!1,children:t},e.id)},Z=(e,t)=>{let r=k===e;return(0,s.jsxs)("div",{className:"relative",ref:L,children:[(0,s.jsxs)("button",{onClick:()=>C(r?null:e),className:"inline-flex items-center align-middle border-b-2 px-1 pt-1 space-x-1 ".concat(r?"text-blue-600 border-blue-600":"border-transparent text-gray-700 hover:text-blue-600"),children:[(0,s.jsx)("span",{children:e}),(0,s.jsx)("svg",{className:"w-4 h-4 transition-transform ".concat(r?"rotate-180":""),fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]}),r&&(0,s.jsx)("div",{className:"absolute top-full left-0 mt-1 min-w-[8rem] bg-white rounded-md shadow-lg border border-gray-200 z-50",children:(0,s.jsx)("div",{className:"py-1",children:t.map(e=>(0,s.jsx)(c(),{href:T(e.href),className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors",onClick:()=>C(null),prefetch:!1,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.icon&&(0,s.jsx)("span",{className:"text-base leading-none",children:P(e.icon,"w-4 h-4")}),(0,s.jsx)("span",{children:e.label})]})},e.id))})})]},e)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 bg-white z-30 h-14 px-4 border-b border-gray-200 shadow-sm",children:(0,s.jsxs)("div",{className:"flex items-center justify-between h-full",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-4 mr-4 md:mr-6",children:[a&&(0,s.jsx)("button",{onClick:v,className:"mobile-menu-button p-2 rounded-md text-gray-600 hover:text-blue-600 hover:bg-gray-100 transition-colors","aria-label":"Toggle mobile menu",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:j?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})}),(0,s.jsx)(c(),{href:"/",className:"flex items-center px-1 pt-1 h-full",prefetch:!1,children:(0,s.jsx)("div",{className:"h-20 w-20 flex items-center justify-center",children:(0,s.jsx)(l(),{src:"".concat(m.GW,"/skypilot.svg"),alt:"SkyPilot Logo",width:80,height:80,priority:!0,className:"w-full h-full object-contain"})})})]}),!a&&(0,s.jsxs)("div",{className:"flex items-center space-x-2 md:space-x-4 mr-6",children:[(0,s.jsxs)(c(),{href:"/clusters",className:H("/clusters"),prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Clusters"})]}),(0,s.jsxs)(c(),{href:"/jobs",className:H("/jobs"),prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Jobs"})]}),(0,s.jsxs)(c(),{href:"/volumes",className:H("/volumes"),prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Volumes"})]}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"}),(0,s.jsxs)(c(),{href:"/infra",className:H("/infra"),prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Infra"})]}),(0,s.jsxs)(c(),{href:"/workspaces",className:H("/workspaces"),prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Workspaces"})]}),(0,s.jsxs)(c(),{href:"/users",className:H("/users"),prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Users"})]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-1 ml-auto",children:[!a&&(0,s.jsxs)(s.Fragment,{children:[S.map(e=>F(e)),Object.entries(E).map(e=>{let[t,r]=e;return Z(t,r)}),(0,s.jsx)(h.WH,{content:"Documentation",className:"text-sm text-muted-foreground",children:(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center align-middle border-b-2 border-transparent px-1 pt-1 space-x-1 text-gray-600 hover:text-blue-600 transition-colors duration-150 cursor-pointer",title:"Docs",children:[(0,s.jsx)("span",{className:"leading-none",children:"Docs"}),(0,s.jsx)(d.h0,{className:"w-3.5 h-3.5"})]})}),(0,s.jsx)(h.WH,{content:"GitHub Repository",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center align-middle p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"GitHub",children:(0,s.jsx)(d.fy,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Join Slack",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center align-middle p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Slack",children:(0,s.jsx)(d.mU,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Leave Feedback",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://github.com/skypilot-org/skypilot/issues/new",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center align-middle p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Leave Feedback",children:(0,s.jsx)(d.aD,{className:"w-5 h-5"})})}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6"}),(0,s.jsx)(h.WH,{content:"Configuration",className:"text-sm text-muted-foreground",children:(0,s.jsx)(c(),{href:"/config",className:"inline-flex items-center justify-center p-2 rounded-full transition-colors duration-150 cursor-pointer ".concat(U("/config")?"text-blue-600 hover:bg-gray-100":"text-gray-600 hover:bg-gray-100"),title:"Configuration",prefetch:!1,children:(0,s.jsx)(x.Z,{className:"w-5 h-5"})})})]}),o&&(0,s.jsxs)("div",{className:"relative",ref:W,children:[(0,s.jsx)("button",{onClick:()=>w(!N),className:"inline-flex items-center justify-center rounded-full transition-colors duration-150 cursor-pointer hover:ring-2 hover:ring-blue-200",title:"User Profile",children:(0,s.jsx)("div",{className:"".concat(a?"w-6 h-6 text-xs":"w-7 h-7 text-sm"," bg-blue-600 text-white rounded-full flex items-center justify-center font-medium hover:bg-blue-700 transition-colors"),children:o?o.includes("@")?o.split("@")[0].charAt(0).toUpperCase():o.charAt(0).toUpperCase():"?"})}),N&&(0,s.jsxs)("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-50 border border-gray-200",children:[(e=o,t=null,o&&o.includes("@")&&(e=o.split("@")[0],t=o),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"px-4 pt-2 pb-1 text-sm font-medium text-gray-900",children:e}),t&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-1 text-xs text-gray-500",children:t}),b&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-2 text-xs",children:"admin"===b?(0,s.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,s.jsx)(d.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,s.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,s.jsx)(u.Z,{className:"w-3 h-3 mr-1"}),"User"]})})]})),(0,s.jsx)("div",{className:"border-t border-gray-200 mx-1 my-1"}),(0,s.jsx)(c(),{href:"/users",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-blue-600",onClick:()=>w(!1),prefetch:!1,children:"See all users"})]})]})]}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"})]})}),a&&(0,s.jsxs)(s.Fragment,{children:[j&&(0,s.jsx)("div",{className:"fixed top-14 left-0 right-0 bottom-0 bg-black bg-opacity-50 z-40",onClick:v}),(0,s.jsx)("div",{ref:z,className:"fixed top-14 left-0 h-[calc(100vh-56px)] w-64 bg-white border-r border-gray-200 shadow-lg z-50 transform transition-transform duration-300 ease-in-out ".concat(j?"translate-x-0":"-translate-x-full"),children:(0,s.jsx)("nav",{className:"flex-1 overflow-y-auto py-6",children:(0,s.jsxs)("div",{className:"px-4 space-y-1",children:[(0,s.jsxs)(c(),{href:"/clusters",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/clusters")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-5 h-5 mr-3"}),"Clusters"]}),(0,s.jsxs)(c(),{href:"/jobs",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/jobs")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-5 h-5 mr-3"}),"Jobs"]}),(0,s.jsxs)(c(),{href:"/volumes",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/volumes")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-5 h-5 mr-3"}),"Volumes"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)(c(),{href:"/infra",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/infra")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-5 h-5 mr-3"}),"Infra"]}),(0,s.jsxs)(c(),{href:"/workspaces",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/workspaces")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-5 h-5 mr-3"}),"Workspaces"]}),(0,s.jsxs)(c(),{href:"/users",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/users")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-5 h-5 mr-3"}),"Users"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),S.map(e=>R(e)),Object.entries(E).map(e=>{let[t,r]=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:t}),r.map(e=>R(e))]},t)}),(S.length>0||Object.keys(E).length>0)&&(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:v,children:[(0,s.jsx)(d.h0,{className:"w-5 h-5 mr-3"}),"Documentation"]}),(0,s.jsxs)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:v,children:[(0,s.jsx)(d.fy,{className:"w-5 h-5 mr-3"}),"GitHub"]}),(0,s.jsxs)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:v,children:[(0,s.jsx)(d.mU,{className:"w-5 h-5 mr-3"}),"Slack"]}),(0,s.jsxs)(c(),{href:"/config",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(U("/config")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:v,prefetch:!1,children:[(0,s.jsx)(x.Z,{className:"w-5 h-5 mr-3"}),"Configuration"]})]})})})]})]})}},23001:function(e,t,r){r.d(t,{X:function(){return n}});var s=r(67294);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=()=>{r(window.innerWidth<e)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]),t}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9353],{9353:function(e,t,r){r.r(t),r.d(t,{Layout:function(){return N}});var s=r(85893),n=r(67294),a=r(66235),l=r(23001),i=r(43767),o=r(33067),c=r(26409),d=r(94849),x=r(6556);function u(){let{startTour:e}=(0,d.r)(),{shouldShowTourPrompt:t,markTourCompleted:r}=(0,x.n)(),[a,l]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(m(!0),t){let e=setTimeout(()=>{l(!0)},2e3);return()=>clearTimeout(e)}},[t]);let h=()=>{l(!1),r()};return u&&t&&a?(0,s.jsx)("div",{className:"fixed top-20 right-6 z-50 max-w-sm",children:(0,s.jsxs)("div",{className:"bg-white rounded-md shadow-lg border border-gray-200 p-4 transform transition-all duration-300 ease-out",children:[(0,s.jsx)("button",{onClick:h,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full p-1 transition-all duration-150","aria-label":"Dismiss notification",children:(0,s.jsx)(i.Z,{className:"w-3 h-3"})}),(0,s.jsxs)("div",{className:"pr-6",children:[(0,s.jsxs)("div",{className:"flex items-start mb-3",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-7 h-7 bg-blue-50 rounded-full mr-3 mt-0.5",children:(0,s.jsx)(o.Z,{className:"w-3.5 h-3.5 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:"Welcome to SkyPilot!"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:"New to the dashboard? Take a quick guided tour to discover all the features."})]})]}),(0,s.jsxs)("div",{className:"flex space-x-2 ml-10",children:[(0,s.jsxs)("button",{onClick:()=>{l(!1),e()},className:"flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors duration-150",children:[(0,s.jsx)(c.Z,{className:"w-3 h-3 mr-1.5"}),"Start Tour"]}),(0,s.jsx)("button",{onClick:h,className:"px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded transition-colors duration-150",children:"Maybe Later"})]})]})]})}):null}var m=r(19185);function h(e){let{children:t,text:r}=e,[a,l]=(0,n.useState)(!1);return(0,s.jsxs)("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,a&&(0,s.jsx)("div",{className:"absolute top-0 right-0 transform -translate-y-full -translate-x-2 mb-2 px-2 py-1 bg-gray-700 text-white text-xs rounded-md shadow-lg whitespace-nowrap z-50",children:r})]})}function p(){let{startTour:e}=(0,d.r)();return(0,s.jsx)(h,{text:"Start a tour",children:(0,s.jsx)("button",{onClick:e,className:"fixed bottom-4 right-4 bg-transparent text-gray-400 p-2 rounded-full hover:text-gray-500 focus:outline-none","aria-label":"Start Tour",children:(0,s.jsx)(m.Z,{className:"h-5 w-5"})})})}let f=(0,n.createContext)(void 0);function g(e){let{children:t}=e,[r,a]=(0,n.useState)(!1),l=(0,n.useCallback)(()=>{a(!0)},[]),i=(0,n.useCallback)(()=>{a(!1)},[]);return(0,s.jsx)(f.Provider,{value:{isUpgrading:r,reportUpgrade:l,clearUpgrade:i},children:t})}function b(){let e=(0,n.useContext)(f);if(!e)throw Error("useUpgradeDetection must be used within UpgradeDetectionProvider");return e}function j(){let{isUpgrading:e}=b();return e?(0,s.jsx)("div",{className:"fixed top-[56px] left-0 right-0 z-40 bg-yellow-50 border-b border-yellow-200",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto py-3 px-4 sm:px-6 lg:px-8",children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 text-yellow-600 mr-2 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,s.jsx)("span",{className:"text-sm font-medium text-yellow-800",children:"Your SkyPilot deployment is undergoing upgrades. Refresh in a few moments."})]})})})}):null}function y(e){let{children:t,highlighted:r}=e;(0,l.X)();let{reportUpgrade:i,clearUpgrade:o,isUpgrading:c}=b();return(0,n.useEffect)(()=>{window.__upgradeInterceptorInstalled||(window.fetch=function(e,t){let r=window.fetch;return async function(s,n){let a;try{a=await r(s,n)}catch(e){throw e}try{if(function(e){let t;try{t="string"==typeof e?e:e.url}catch(e){return!1}return["/_next/static/","/_next/image",".js",".mjs",".css",".woff",".woff2",".ttf",".eot",".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].some(e=>t.includes(e))}(s))return a;if(503===a.status){let t=a.clone();try{let r=await t.json();r.detail&&(r.detail.includes("shutting down")||r.detail.includes("try again later"))&&e()}catch(e){console.debug("Non-JSON 503 response, ignoring.")}}else(a.ok||a.status>=200&&a.status<300)&&t()}catch(e){console.error("Error in upgrade detection interceptor:",e)}return a}}(i,o),window.__upgradeInterceptorInstalled=!0)},[i,o]),(0,s.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 z-50 shadow-sm",children:(0,s.jsx)(a.Du,{})}),(0,s.jsx)(j,{}),(0,s.jsx)("div",{className:"transition-all duration-200 ease-in-out min-h-screen",style:{paddingTop:c?"112px":"56px"},children:(0,s.jsx)("main",{className:"p-6",children:t})}),(0,s.jsx)(u,{}),(0,s.jsx)(p,{})]})}function N(e){return(0,s.jsx)(g,{children:(0,s.jsx)(a.Hn,{children:(0,s.jsx)(y,{...e})})})}},66235:function(e,t,r){r.d(t,{Ap:function(){return y},Du:function(){return N},Hn:function(){return j}});var s=r(85893),n=r(67294),a=r(25675),l=r.n(a),i=r(11163),o=r(41664),c=r.n(o),d=r(53850),x=r(40355),u=r(6021),m=r(93225),h=r(36989),p=r(23001),f=r(23800);let g={key:d._m,server:d.QT,briefcase:d.Vp,chip:d.PC,book:d.E9,users:d.oy,volume:d.eU},b=(0,n.createContext)(null);function j(e){let{children:t}=e,[r,a]=(0,n.useState)(!0),[l,i]=(0,n.useState)(!1),[o,c]=(0,n.useState)(null),[d,x]=(0,n.useState)(null),u=window.location.origin,h="".concat(u).concat(m.f4);return(0,n.useEffect)(()=>{fetch("".concat(h,"/api/health")).then(e=>e.json()).then(e=>{e.user&&e.user.name&&(c(e.user.name),(async()=>{try{let e=await fetch("".concat(h,"/users/role"));if(e.ok){let t=await e.json();t.role&&x(t.role)}}catch(e){console.log("Could not fetch user role:",e)}})())}).catch(e=>{console.error("Error fetching user data:",e)})},[h]),(0,s.jsx)(b.Provider,{value:{isSidebarOpen:r,toggleSidebar:()=>{a(e=>!e)},isMobileSidebarOpen:l,toggleMobileSidebar:()=>{i(e=>!e)},userEmail:o,userRole:d},children:t})}function y(){let e=(0,n.useContext)(b);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e}function N(){let e,t;let r=(0,i.useRouter)(),a=(0,p.X)(),{userEmail:o,userRole:b,isMobileSidebarOpen:j,toggleMobileSidebar:N}=y(),[v,w]=(0,n.useState)(!1),[k,C]=(0,n.useState)(null),{ungrouped:S,groups:_}=(0,f.d7)(),E=(0,f.x1)(),W=(0,n.useRef)(null),U=(0,n.useRef)(null),z=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){W.current&&!W.current.contains(e.target)&&w(!1),U.current&&!U.current.contains(e.target)&&!e.target.closest(".mobile-menu-button")&&j&&N(),z.current&&!z.current.contains(e.target)&&C(null)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[W,j,N]);let L=e=>"/workspaces"===e?r.pathname.startsWith("/workspaces")||r.pathname.startsWith("/workspace"):r.pathname.startsWith(e),H=e=>{let t=L(e);return"inline-flex items-center border-b-2 ".concat(t?"border-transparent text-blue-600":"border-transparent hover:text-blue-600"," ").concat(a?"px-2 py-1":"px-1 pt-1 space-x-2")},M=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!t&&L(e);return"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(r?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600")},P=(e,t)=>{let r=g[e];return r?n.createElement(r,{className:t}):e},D=e=>(0,s.jsxs)(s.Fragment,{children:[e.icon&&(0,s.jsx)("span",{className:"text-base leading-none mr-1","aria-hidden":"true",children:P(e.icon,"w-4 h-4")}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,s.jsx)("span",{children:e.label}),e.badge&&(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded-full",children:e.badge})]})]}),T=e=>{if("string"!=typeof e)return e;let t=E.find(t=>t.path===e);if(!t||!t.path.startsWith("/plugins"))return e;let r=t.path.replace(/^\/+/,"").split("/").slice(1).filter(Boolean);return{pathname:"/plugins/[...slug]",query:r.length?{slug:r}:{}}},F=e=>e.external?(0,s.jsx)("a",{href:e.href,target:e.target,rel:e.rel,className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 space-x-2 text-gray-700 hover:text-blue-600",children:D(e)},e.id):(0,s.jsx)(c(),{href:T(e.href),className:H(e.href),prefetch:!1,children:D(e)},e.id),R=e=>{let t=(0,s.jsxs)(s.Fragment,{children:[e.icon&&(0,s.jsx)("span",{className:"text-base leading-none mr-2","aria-hidden":"true",children:P(e.icon,"w-5 h-5")}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.label}),e.badge&&(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded-full",children:e.badge})]})]});return e.external?(0,s.jsx)("a",{href:e.href,target:e.target,rel:e.rel,className:M(e.href,!0),onClick:N,children:t},e.id):(0,s.jsx)(c(),{href:T(e.href),className:M(e.href),onClick:N,prefetch:!1,children:t},e.id)},Z=(e,t)=>{let r=k===e;return(0,s.jsxs)("div",{className:"relative",ref:z,children:[(0,s.jsxs)("button",{onClick:()=>C(r?null:e),className:"inline-flex items-center align-middle border-b-2 px-1 pt-1 space-x-1 ".concat(r?"text-blue-600 border-blue-600":"border-transparent text-gray-700 hover:text-blue-600"),children:[(0,s.jsx)("span",{children:e}),(0,s.jsx)("svg",{className:"w-4 h-4 transition-transform ".concat(r?"rotate-180":""),fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]}),r&&(0,s.jsx)("div",{className:"absolute top-full left-0 mt-1 min-w-[8rem] bg-white rounded-md shadow-lg border border-gray-200 z-50",children:(0,s.jsx)("div",{className:"py-1",children:t.map(e=>(0,s.jsx)(c(),{href:T(e.href),className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors",onClick:()=>C(null),prefetch:!1,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.icon&&(0,s.jsx)("span",{className:"text-base leading-none",children:P(e.icon,"w-4 h-4")}),(0,s.jsx)("span",{children:e.label})]})},e.id))})})]},e)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 bg-white z-30 h-14 px-4 border-b border-gray-200 shadow-sm",children:(0,s.jsxs)("div",{className:"flex items-center justify-between h-full",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-4 mr-4 md:mr-6",children:[a&&(0,s.jsx)("button",{onClick:N,className:"mobile-menu-button p-2 rounded-md text-gray-600 hover:text-blue-600 hover:bg-gray-100 transition-colors","aria-label":"Toggle mobile menu",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:j?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})}),(0,s.jsx)(c(),{href:"/",className:"flex items-center px-1 pt-1 h-full",prefetch:!1,children:(0,s.jsx)("div",{className:"h-20 w-20 flex items-center justify-center",children:(0,s.jsx)(l(),{src:"".concat(m.GW,"/skypilot.svg"),alt:"SkyPilot Logo",width:80,height:80,priority:!0,className:"w-full h-full object-contain"})})})]}),!a&&(0,s.jsxs)("div",{className:"flex items-center space-x-2 md:space-x-4 mr-6",children:[(0,s.jsxs)(c(),{href:"/clusters",className:H("/clusters"),prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Clusters"})]}),(0,s.jsxs)(c(),{href:"/jobs",className:H("/jobs"),prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Jobs"})]}),(0,s.jsxs)(c(),{href:"/volumes",className:H("/volumes"),prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Volumes"})]}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"}),(0,s.jsxs)(c(),{href:"/infra",className:H("/infra"),prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Infra"})]}),(0,s.jsxs)(c(),{href:"/workspaces",className:H("/workspaces"),prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Workspaces"})]}),(0,s.jsxs)(c(),{href:"/users",className:H("/users"),prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Users"})]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-1 ml-auto",children:[!a&&(0,s.jsxs)(s.Fragment,{children:[S.map(e=>F(e)),Object.entries(_).map(e=>{let[t,r]=e;return Z(t,r)}),(0,s.jsx)(h.WH,{content:"Documentation",className:"text-sm text-muted-foreground",children:(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center align-middle border-b-2 border-transparent px-1 pt-1 space-x-1 text-gray-600 hover:text-blue-600 transition-colors duration-150 cursor-pointer",title:"Docs",children:[(0,s.jsx)("span",{className:"leading-none",children:"Docs"}),(0,s.jsx)(d.h0,{className:"w-3.5 h-3.5"})]})}),(0,s.jsx)(h.WH,{content:"GitHub Repository",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center align-middle p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"GitHub",children:(0,s.jsx)(d.fy,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Join Slack",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center align-middle p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Slack",children:(0,s.jsx)(d.mU,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Leave Feedback",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://github.com/skypilot-org/skypilot/issues/new",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center align-middle p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Leave Feedback",children:(0,s.jsx)(d.aD,{className:"w-5 h-5"})})}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6"}),(0,s.jsx)(h.WH,{content:"Configuration",className:"text-sm text-muted-foreground",children:(0,s.jsx)(c(),{href:"/config",className:"inline-flex items-center justify-center p-2 rounded-full transition-colors duration-150 cursor-pointer ".concat(L("/config")?"text-blue-600 hover:bg-gray-100":"text-gray-600 hover:bg-gray-100"),title:"Configuration",prefetch:!1,children:(0,s.jsx)(x.Z,{className:"w-5 h-5"})})})]}),o&&(0,s.jsxs)("div",{className:"relative",ref:W,children:[(0,s.jsx)("button",{onClick:()=>w(!v),className:"inline-flex items-center justify-center rounded-full transition-colors duration-150 cursor-pointer hover:ring-2 hover:ring-blue-200",title:"User Profile",children:(0,s.jsx)("div",{className:"".concat(a?"w-6 h-6 text-xs":"w-7 h-7 text-sm"," bg-blue-600 text-white rounded-full flex items-center justify-center font-medium hover:bg-blue-700 transition-colors"),children:o?o.includes("@")?o.split("@")[0].charAt(0).toUpperCase():o.charAt(0).toUpperCase():"?"})}),v&&(0,s.jsxs)("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-50 border border-gray-200",children:[(e=o,t=null,o&&o.includes("@")&&(e=o.split("@")[0],t=o),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"px-4 pt-2 pb-1 text-sm font-medium text-gray-900",children:e}),t&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-1 text-xs text-gray-500",children:t}),b&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-2 text-xs",children:"admin"===b?(0,s.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,s.jsx)(d.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,s.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,s.jsx)(u.Z,{className:"w-3 h-3 mr-1"}),"User"]})})]})),(0,s.jsx)("div",{className:"border-t border-gray-200 mx-1 my-1"}),(0,s.jsx)(c(),{href:"/users",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-blue-600",onClick:()=>w(!1),prefetch:!1,children:"See all users"})]})]})]})]})}),a&&(0,s.jsxs)(s.Fragment,{children:[j&&(0,s.jsx)("div",{className:"fixed top-14 left-0 right-0 bottom-0 bg-black bg-opacity-50 z-40",onClick:N}),(0,s.jsx)("div",{ref:U,className:"fixed top-14 left-0 h-[calc(100vh-56px)] w-64 bg-white border-r border-gray-200 shadow-lg z-50 transform transition-transform duration-300 ease-in-out ".concat(j?"translate-x-0":"-translate-x-full"),children:(0,s.jsx)("nav",{className:"flex-1 overflow-y-auto py-6",children:(0,s.jsxs)("div",{className:"px-4 space-y-1",children:[(0,s.jsxs)(c(),{href:"/clusters",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/clusters")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-5 h-5 mr-3"}),"Clusters"]}),(0,s.jsxs)(c(),{href:"/jobs",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/jobs")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-5 h-5 mr-3"}),"Jobs"]}),(0,s.jsxs)(c(),{href:"/volumes",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/volumes")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-5 h-5 mr-3"}),"Volumes"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)(c(),{href:"/infra",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/infra")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-5 h-5 mr-3"}),"Infra"]}),(0,s.jsxs)(c(),{href:"/workspaces",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/workspaces")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-5 h-5 mr-3"}),"Workspaces"]}),(0,s.jsxs)(c(),{href:"/users",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/users")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-5 h-5 mr-3"}),"Users"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),S.map(e=>R(e)),Object.entries(_).map(e=>{let[t,r]=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:t}),r.map(e=>R(e))]},t)}),(S.length>0||Object.keys(_).length>0)&&(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:N,children:[(0,s.jsx)(d.h0,{className:"w-5 h-5 mr-3"}),"Documentation"]}),(0,s.jsxs)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:N,children:[(0,s.jsx)(d.fy,{className:"w-5 h-5 mr-3"}),"GitHub"]}),(0,s.jsxs)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:N,children:[(0,s.jsx)(d.mU,{className:"w-5 h-5 mr-3"}),"Slack"]}),(0,s.jsxs)(c(),{href:"/config",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(L("/config")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:N,prefetch:!1,children:[(0,s.jsx)(x.Z,{className:"w-5 h-5 mr-3"}),"Configuration"]})]})})})]})]})}}}]);
|