skypilot-nightly 1.0.0.dev20250624__py3-none-any.whl → 1.0.0.dev20250625__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 +2 -2
- sky/backends/backend_utils.py +26 -11
- sky/backends/cloud_vm_ray_backend.py +16 -5
- sky/client/cli/command.py +222 -4
- sky/client/sdk.py +110 -82
- sky/clouds/aws.py +10 -7
- sky/clouds/azure.py +10 -7
- sky/clouds/cloud.py +2 -0
- sky/clouds/cudo.py +2 -0
- sky/clouds/do.py +10 -7
- sky/clouds/fluidstack.py +2 -0
- sky/clouds/gcp.py +10 -7
- sky/clouds/hyperbolic.py +10 -7
- sky/clouds/ibm.py +2 -0
- sky/clouds/kubernetes.py +26 -9
- sky/clouds/lambda_cloud.py +10 -7
- sky/clouds/nebius.py +10 -7
- sky/clouds/oci.py +10 -7
- sky/clouds/paperspace.py +10 -7
- sky/clouds/runpod.py +10 -7
- sky/clouds/scp.py +10 -7
- sky/clouds/vast.py +10 -7
- sky/clouds/vsphere.py +2 -0
- sky/core.py +1 -0
- sky/dag.py +14 -0
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/ZWdSYkqVe3WjnFR8ocqoG/_buildManifest.js +1 -0
- sky/dashboard/out/_next/static/chunks/230-d6e363362017ff3a.js +1 -0
- sky/dashboard/out/_next/static/chunks/310.2671028c20e892c7.js +16 -0
- sky/dashboard/out/_next/static/chunks/{37-4650f214e2119168.js → 37-1f1e94f5a561202a.js} +2 -2
- sky/dashboard/out/_next/static/chunks/42.bc85e5b1a4debf22.js +6 -0
- sky/dashboard/out/_next/static/chunks/470-92dd1614396389be.js +1 -0
- sky/dashboard/out/_next/static/chunks/544.110e53813fb98e2e.js +1 -0
- sky/dashboard/out/_next/static/chunks/645.961f08e39b8ce447.js +1 -0
- sky/dashboard/out/_next/static/chunks/66-66ae330df2d3c1c7.js +1 -0
- sky/dashboard/out/_next/static/chunks/682.00e56a220dd26fe1.js +6 -0
- sky/dashboard/out/_next/static/chunks/697.6460bf72e760addd.js +20 -0
- sky/dashboard/out/_next/static/chunks/{856-bfddc18e16f3873c.js → 856-cdf66268ec878d0c.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/{_app-ce31493da9747ef4.js → _app-0ef7418d1a3822f3.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-aff040d7bc5d0086.js +6 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-32ce4f49f2261f55.js +6 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters-4aa031d1f42723d8.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/config-3102d02a188f04b3.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/infra/[context]-6f1e02e31eecb5ce.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/infra-fd5dc8a91bd9169a.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-e4b23128db0774cd.js +16 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs-26da173e20af16e4.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/users-ce29e7420385563d.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/volumes-476b670ef33d1ecd.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/workspace/new-09ae0f6f972aa871.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/workspaces/{[name]-ecc5a7003776cfa7.js → [name]-0b4c662a25e4747a.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/workspaces-862b120406461b10.js +1 -0
- sky/dashboard/out/_next/static/chunks/webpack-6133dc1e928bd0b5.js +1 -0
- sky/dashboard/out/_next/static/css/b23cb0257bf96c51.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.html +1 -1
- sky/dashboard/out/users.html +1 -1
- sky/dashboard/out/volumes.html +1 -0
- 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/storage_utils.py +2 -4
- sky/exceptions.py +15 -0
- sky/execution.py +5 -0
- sky/global_user_state.py +129 -0
- sky/jobs/client/sdk.py +13 -11
- sky/jobs/server/core.py +4 -0
- sky/models.py +16 -0
- sky/provision/__init__.py +26 -0
- sky/provision/kubernetes/__init__.py +3 -0
- sky/provision/kubernetes/instance.py +38 -77
- sky/provision/kubernetes/utils.py +52 -2
- sky/provision/kubernetes/volume.py +147 -0
- sky/resources.py +20 -76
- sky/serve/client/sdk.py +13 -13
- sky/serve/server/core.py +5 -1
- sky/server/common.py +40 -5
- sky/server/constants.py +5 -1
- sky/server/metrics.py +105 -0
- sky/server/requests/executor.py +30 -14
- sky/server/requests/payloads.py +16 -0
- sky/server/requests/requests.py +35 -1
- sky/server/rest.py +152 -0
- sky/server/server.py +66 -16
- sky/server/state.py +20 -0
- sky/server/stream_utils.py +8 -3
- sky/server/uvicorn.py +153 -13
- sky/setup_files/dependencies.py +2 -0
- sky/skylet/constants.py +14 -3
- sky/task.py +141 -18
- sky/templates/kubernetes-ray.yml.j2 +30 -1
- sky/users/permission.py +2 -0
- sky/utils/context.py +3 -1
- sky/utils/resources_utils.py +66 -0
- sky/utils/rich_utils.py +6 -0
- sky/utils/schemas.py +146 -3
- sky/utils/status_lib.py +10 -0
- sky/utils/validator.py +11 -1
- sky/volumes/__init__.py +0 -0
- sky/volumes/client/__init__.py +0 -0
- sky/volumes/client/sdk.py +64 -0
- sky/volumes/server/__init__.py +0 -0
- sky/volumes/server/core.py +199 -0
- sky/volumes/server/server.py +85 -0
- sky/volumes/utils.py +158 -0
- sky/volumes/volume.py +198 -0
- {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/METADATA +2 -1
- {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/RECORD +123 -108
- sky/dashboard/out/_next/static/chunks/350.9e123a4551f68b0d.js +0 -1
- sky/dashboard/out/_next/static/chunks/42.2273cc2415291ceb.js +0 -6
- sky/dashboard/out/_next/static/chunks/470-1494c899266cf5c9.js +0 -1
- sky/dashboard/out/_next/static/chunks/641.c8e452bc5070a630.js +0 -1
- sky/dashboard/out/_next/static/chunks/682.4dd5dc116f740b5f.js +0 -6
- sky/dashboard/out/_next/static/chunks/760-a89d354797ce7af5.js +0 -1
- sky/dashboard/out/_next/static/chunks/901-b424d293275e1fd7.js +0 -1
- sky/dashboard/out/_next/static/chunks/984.ae8c08791d274ca0.js +0 -50
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-4e065c812a52460b.js +0 -6
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-520ec1ab65e2f2a4.js +0 -6
- sky/dashboard/out/_next/static/chunks/pages/clusters-7e9736af1c6345a6.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/config-e4f473661889e7cd.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/infra/[context]-00fd23b9577492ca.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/infra-8a4bf7370d4d9bb7.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-171c27f4ca94861c.js +0 -16
- sky/dashboard/out/_next/static/chunks/pages/jobs-55e5bcb16d563231.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/users-c9f4d785cdaa52d8.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/workspace/new-31aa8bdcb7592635.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/workspaces-f00cba35691483b1.js +0 -1
- sky/dashboard/out/_next/static/chunks/webpack-c85998e6a5722f21.js +0 -1
- sky/dashboard/out/_next/static/css/6ab927686b492a4a.css +0 -3
- sky/dashboard/out/_next/static/zsALxITkbP8J8NVwSDwMo/_buildManifest.js +0 -1
- /sky/dashboard/out/_next/static/{zsALxITkbP8J8NVwSDwMo → ZWdSYkqVe3WjnFR8ocqoG}/_ssgManifest.js +0 -0
- /sky/dashboard/out/_next/static/chunks/{843-bde186946d353355.js → 843-07d25a7e64462fd8.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{938-ce7991c156584b06.js → 938-068520cc11738deb.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{973-56412c7976b4655b.js → 973-5b5019ba333e8d62.js} +0 -0
- {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250624.dist-info → skypilot_nightly-1.0.0.dev20250625.dist-info}/top_level.txt +0 -0
sky/clouds/gcp.py
CHANGED
@@ -29,6 +29,7 @@ from sky.utils import ux_utils
|
|
29
29
|
if typing.TYPE_CHECKING:
|
30
30
|
from sky import resources
|
31
31
|
from sky.utils import status_lib
|
32
|
+
from sky.volumes import volume as volume_lib
|
32
33
|
|
33
34
|
logger = sky_logging.init_logger(__name__)
|
34
35
|
|
@@ -465,13 +466,15 @@ class GCP(clouds.Cloud):
|
|
465
466
|
assert False, 'Low disk tier should always be supported on GCP.'
|
466
467
|
|
467
468
|
def make_deploy_resources_variables(
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
469
|
+
self,
|
470
|
+
resources: 'resources.Resources',
|
471
|
+
cluster_name: resources_utils.ClusterName,
|
472
|
+
region: 'clouds.Region',
|
473
|
+
zones: Optional[List['clouds.Zone']],
|
474
|
+
num_nodes: int,
|
475
|
+
dryrun: bool = False,
|
476
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
477
|
+
) -> Dict[str, Optional[str]]:
|
475
478
|
assert zones is not None, (region, zones)
|
476
479
|
|
477
480
|
region_name = region.name
|
sky/clouds/hyperbolic.py
CHANGED
@@ -13,6 +13,7 @@ from sky.utils.resources_utils import DiskTier
|
|
13
13
|
|
14
14
|
if typing.TYPE_CHECKING:
|
15
15
|
from sky import resources as resources_lib
|
16
|
+
from sky.volumes import volume as volume_lib
|
16
17
|
|
17
18
|
|
18
19
|
@registry.CLOUD_REGISTRY.register
|
@@ -244,13 +245,15 @@ class Hyperbolic(clouds.Cloud):
|
|
244
245
|
return 0.0
|
245
246
|
|
246
247
|
def make_deploy_resources_variables(
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
248
|
+
self,
|
249
|
+
resources: 'resources_lib.Resources',
|
250
|
+
cluster_name: resources_utils.ClusterName,
|
251
|
+
region: 'clouds.Region',
|
252
|
+
zones: Optional[List['clouds.Zone']],
|
253
|
+
num_nodes: int,
|
254
|
+
dryrun: bool = False,
|
255
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
256
|
+
) -> Dict[str, Any]:
|
254
257
|
"""Returns a dict of variables for the deployment template."""
|
255
258
|
del dryrun, region, cluster_name # unused
|
256
259
|
assert zones is None, ('Hyperbolic does not support zones', zones)
|
sky/clouds/ibm.py
CHANGED
@@ -18,6 +18,7 @@ from sky.utils import ux_utils
|
|
18
18
|
if typing.TYPE_CHECKING:
|
19
19
|
# renaming to avoid shadowing variables
|
20
20
|
from sky import resources as resources_lib
|
21
|
+
from sky.volumes import volume as volume_lib
|
21
22
|
|
22
23
|
logger = sky_logging.init_logger(__name__)
|
23
24
|
|
@@ -175,6 +176,7 @@ class IBM(clouds.Cloud):
|
|
175
176
|
zones: Optional[List['clouds.Zone']],
|
176
177
|
num_nodes: int,
|
177
178
|
dryrun: bool = False,
|
179
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
178
180
|
) -> Dict[str, Any]:
|
179
181
|
"""Converts planned sky.Resources to cloud-specific resource variables.
|
180
182
|
|
sky/clouds/kubernetes.py
CHANGED
@@ -25,6 +25,7 @@ from sky.utils import common_utils
|
|
25
25
|
from sky.utils import registry
|
26
26
|
from sky.utils import resources_utils
|
27
27
|
from sky.utils import schemas
|
28
|
+
from sky.volumes import volume as volume_lib
|
28
29
|
|
29
30
|
if typing.TYPE_CHECKING:
|
30
31
|
# Renaming to avoid shadowing variables.
|
@@ -394,7 +395,9 @@ class Kubernetes(clouds.Cloud):
|
|
394
395
|
return 0
|
395
396
|
|
396
397
|
@staticmethod
|
397
|
-
def _calculate_provision_timeout(
|
398
|
+
def _calculate_provision_timeout(
|
399
|
+
num_nodes: int,
|
400
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']]) -> int:
|
398
401
|
"""Calculate provision timeout based on number of nodes.
|
399
402
|
|
400
403
|
The timeout scales linearly with the number of nodes to account for
|
@@ -409,19 +412,33 @@ class Kubernetes(clouds.Cloud):
|
|
409
412
|
base_timeout = 10 # Base timeout for single node
|
410
413
|
per_node_timeout = 0.2 # Additional seconds per node
|
411
414
|
max_timeout = 60 # Cap at 1 minute
|
415
|
+
if volume_mounts is not None:
|
416
|
+
for volume_mount in volume_mounts:
|
417
|
+
if (volume_mount.volume_config.type ==
|
418
|
+
volume_lib.VolumeType.PVC.value):
|
419
|
+
if (volume_mount.volume_config.config.get(
|
420
|
+
'access_mode', '') ==
|
421
|
+
volume_lib.VolumeAccessMode.READ_WRITE_MANY.value):
|
422
|
+
# GKE may take several minutes to provision a PV
|
423
|
+
# supporting READ_WRITE_MANY with filestore.
|
424
|
+
base_timeout = 180
|
425
|
+
max_timeout = 240
|
426
|
+
break
|
412
427
|
|
413
428
|
return int(
|
414
429
|
min(base_timeout + (per_node_timeout * (num_nodes - 1)),
|
415
430
|
max_timeout))
|
416
431
|
|
417
432
|
def make_deploy_resources_variables(
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
433
|
+
self,
|
434
|
+
resources: 'resources_lib.Resources',
|
435
|
+
cluster_name: 'resources_utils.ClusterName',
|
436
|
+
region: Optional['clouds.Region'],
|
437
|
+
zones: Optional[List['clouds.Zone']],
|
438
|
+
num_nodes: int,
|
439
|
+
dryrun: bool = False,
|
440
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
441
|
+
) -> Dict[str, Optional[str]]:
|
425
442
|
del cluster_name, zones, dryrun # Unused.
|
426
443
|
if region is None:
|
427
444
|
context = kubernetes_utils.get_current_kube_config_context_name()
|
@@ -562,7 +579,7 @@ class Kubernetes(clouds.Cloud):
|
|
562
579
|
# We use a linear scaling formula to determine the timeout based on the
|
563
580
|
# number of nodes.
|
564
581
|
|
565
|
-
timeout = self._calculate_provision_timeout(num_nodes)
|
582
|
+
timeout = self._calculate_provision_timeout(num_nodes, volume_mounts)
|
566
583
|
timeout = skypilot_config.get_nested(
|
567
584
|
('kubernetes', 'provision_timeout'),
|
568
585
|
timeout,
|
sky/clouds/lambda_cloud.py
CHANGED
@@ -15,6 +15,7 @@ if typing.TYPE_CHECKING:
|
|
15
15
|
|
16
16
|
# Renaming to avoid shadowing variables.
|
17
17
|
from sky import resources as resources_lib
|
18
|
+
from sky.volumes import volume as volume_lib
|
18
19
|
else:
|
19
20
|
requests = adaptors_common.LazyImport('requests')
|
20
21
|
|
@@ -159,13 +160,15 @@ class Lambda(clouds.Cloud):
|
|
159
160
|
return None
|
160
161
|
|
161
162
|
def make_deploy_resources_variables(
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
163
|
+
self,
|
164
|
+
resources: 'resources_lib.Resources',
|
165
|
+
cluster_name: 'resources_utils.ClusterName',
|
166
|
+
region: 'clouds.Region',
|
167
|
+
zones: Optional[List['clouds.Zone']],
|
168
|
+
num_nodes: int,
|
169
|
+
dryrun: bool = False,
|
170
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
171
|
+
) -> Dict[str, Any]:
|
169
172
|
del cluster_name, dryrun # Unused.
|
170
173
|
assert zones is None, 'Lambda does not support zones.'
|
171
174
|
resources = resources.assert_launchable()
|
sky/clouds/nebius.py
CHANGED
@@ -16,6 +16,7 @@ from sky.utils import resources_utils
|
|
16
16
|
|
17
17
|
if typing.TYPE_CHECKING:
|
18
18
|
from sky import resources as resources_lib
|
19
|
+
from sky.volumes import volume as volume_lib
|
19
20
|
|
20
21
|
_INDENT_PREFIX = ' '
|
21
22
|
|
@@ -196,13 +197,15 @@ class Nebius(clouds.Cloud):
|
|
196
197
|
return None
|
197
198
|
|
198
199
|
def make_deploy_resources_variables(
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
200
|
+
self,
|
201
|
+
resources: 'resources_lib.Resources',
|
202
|
+
cluster_name: resources_utils.ClusterName,
|
203
|
+
region: 'clouds.Region',
|
204
|
+
zones: Optional[List['clouds.Zone']],
|
205
|
+
num_nodes: int,
|
206
|
+
dryrun: bool = False,
|
207
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
208
|
+
) -> Dict[str, Any]:
|
206
209
|
del dryrun, cluster_name
|
207
210
|
assert zones is None, ('Nebius does not support zones', zones)
|
208
211
|
|
sky/clouds/oci.py
CHANGED
@@ -40,6 +40,7 @@ from sky.utils import ux_utils
|
|
40
40
|
if typing.TYPE_CHECKING:
|
41
41
|
# Renaming to avoid shadowing variables.
|
42
42
|
from sky import resources as resources_lib
|
43
|
+
from sky.volumes import volume as volume_lib
|
43
44
|
|
44
45
|
logger = logging.getLogger(__name__)
|
45
46
|
|
@@ -207,13 +208,15 @@ class OCI(clouds.Cloud):
|
|
207
208
|
return None
|
208
209
|
|
209
210
|
def make_deploy_resources_variables(
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
211
|
+
self,
|
212
|
+
resources: 'resources_lib.Resources',
|
213
|
+
cluster_name: resources_utils.ClusterName,
|
214
|
+
region: Optional['clouds.Region'],
|
215
|
+
zones: Optional[List['clouds.Zone']],
|
216
|
+
num_nodes: int,
|
217
|
+
dryrun: bool = False,
|
218
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
219
|
+
) -> Dict[str, Any]:
|
217
220
|
del cluster_name, dryrun # Unused.
|
218
221
|
assert region is not None, resources
|
219
222
|
|
sky/clouds/paperspace.py
CHANGED
@@ -14,6 +14,7 @@ if typing.TYPE_CHECKING:
|
|
14
14
|
import requests
|
15
15
|
|
16
16
|
from sky import resources as resources_lib
|
17
|
+
from sky.volumes import volume as volume_lib
|
17
18
|
else:
|
18
19
|
requests = adaptors_common.LazyImport('requests')
|
19
20
|
|
@@ -179,13 +180,15 @@ class Paperspace(clouds.Cloud):
|
|
179
180
|
return None
|
180
181
|
|
181
182
|
def make_deploy_resources_variables(
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
183
|
+
self,
|
184
|
+
resources: 'resources_lib.Resources',
|
185
|
+
cluster_name: resources_utils.ClusterName,
|
186
|
+
region: 'clouds.Region',
|
187
|
+
zones: Optional[List['clouds.Zone']],
|
188
|
+
num_nodes: int,
|
189
|
+
dryrun: bool = False,
|
190
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
191
|
+
) -> Dict[str, Optional[str]]:
|
189
192
|
del zones, dryrun, cluster_name
|
190
193
|
|
191
194
|
resources = resources.assert_launchable()
|
sky/clouds/runpod.py
CHANGED
@@ -10,6 +10,7 @@ from sky.utils import resources_utils
|
|
10
10
|
|
11
11
|
if typing.TYPE_CHECKING:
|
12
12
|
from sky import resources as resources_lib
|
13
|
+
from sky.volumes import volume as volume_lib
|
13
14
|
|
14
15
|
_CREDENTIAL_FILES = [
|
15
16
|
'config.toml',
|
@@ -160,13 +161,15 @@ class RunPod(clouds.Cloud):
|
|
160
161
|
return None
|
161
162
|
|
162
163
|
def make_deploy_resources_variables(
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
164
|
+
self,
|
165
|
+
resources: 'resources_lib.Resources',
|
166
|
+
cluster_name: resources_utils.ClusterName,
|
167
|
+
region: 'clouds.Region',
|
168
|
+
zones: Optional[List['clouds.Zone']],
|
169
|
+
num_nodes: int,
|
170
|
+
dryrun: bool = False,
|
171
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
172
|
+
) -> Dict[str, Optional[Union[str, bool]]]:
|
170
173
|
del dryrun, cluster_name # unused
|
171
174
|
assert zones is not None, (region, zones)
|
172
175
|
|
sky/clouds/scp.py
CHANGED
@@ -19,6 +19,7 @@ from sky.utils import status_lib
|
|
19
19
|
if typing.TYPE_CHECKING:
|
20
20
|
# Renaming to avoid shadowing variables.
|
21
21
|
from sky import resources as resources_lib
|
22
|
+
from sky.volumes import volume as volume_lib
|
22
23
|
|
23
24
|
_CREDENTIAL_FILES = [
|
24
25
|
'scp_credential',
|
@@ -183,13 +184,15 @@ class SCP(clouds.Cloud):
|
|
183
184
|
return None
|
184
185
|
|
185
186
|
def make_deploy_resources_variables(
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
187
|
+
self,
|
188
|
+
resources: 'resources_lib.Resources',
|
189
|
+
cluster_name: 'resources_utils.ClusterName',
|
190
|
+
region: 'clouds.Region',
|
191
|
+
zones: Optional[List['clouds.Zone']],
|
192
|
+
num_nodes: int,
|
193
|
+
dryrun: bool = False,
|
194
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
195
|
+
) -> Dict[str, Optional[str]]:
|
193
196
|
del cluster_name, dryrun # Unused.
|
194
197
|
assert zones is None, 'SCP does not support zones.'
|
195
198
|
|
sky/clouds/vast.py
CHANGED
@@ -10,6 +10,7 @@ from sky.utils import resources_utils
|
|
10
10
|
|
11
11
|
if typing.TYPE_CHECKING:
|
12
12
|
from sky import resources as resources_lib
|
13
|
+
from sky.volumes import volume as volume_lib
|
13
14
|
|
14
15
|
|
15
16
|
@registry.CLOUD_REGISTRY.register
|
@@ -155,13 +156,15 @@ class Vast(clouds.Cloud):
|
|
155
156
|
return None
|
156
157
|
|
157
158
|
def make_deploy_resources_variables(
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
159
|
+
self,
|
160
|
+
resources: 'resources_lib.Resources',
|
161
|
+
cluster_name: resources_utils.ClusterName,
|
162
|
+
region: 'clouds.Region',
|
163
|
+
zones: Optional[List['clouds.Zone']],
|
164
|
+
num_nodes: int,
|
165
|
+
dryrun: bool = False,
|
166
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
167
|
+
) -> Dict[str, Optional[str]]:
|
165
168
|
del zones, dryrun, cluster_name, num_nodes # unused
|
166
169
|
|
167
170
|
resources = resources.assert_launchable()
|
sky/clouds/vsphere.py
CHANGED
@@ -18,6 +18,7 @@ if typing.TYPE_CHECKING:
|
|
18
18
|
|
19
19
|
# Renaming to avoid shadowing variables.
|
20
20
|
from sky import resources as resources_lib
|
21
|
+
from sky.volumes import volume as volume_lib
|
21
22
|
else:
|
22
23
|
requests = adaptors_common.LazyImport('requests')
|
23
24
|
|
@@ -184,6 +185,7 @@ class Vsphere(clouds.Cloud):
|
|
184
185
|
zones: Optional[List['clouds.Zone']],
|
185
186
|
num_nodes: int,
|
186
187
|
dryrun: bool = False,
|
188
|
+
volume_mounts: Optional[List['volume_lib.VolumeMount']] = None,
|
187
189
|
) -> Dict[str, Optional[str]]:
|
188
190
|
# TODO get image id here.
|
189
191
|
del cluster_name, dryrun # unused
|
sky/core.py
CHANGED
@@ -76,6 +76,7 @@ def optimize(
|
|
76
76
|
for a task.
|
77
77
|
exceptions.NoCloudAccessError: if no public clouds are enabled.
|
78
78
|
"""
|
79
|
+
dag.resolve_and_validate_volumes()
|
79
80
|
# TODO: We apply the admin policy only on the first DAG optimization which
|
80
81
|
# is shown on `sky launch`. The optimizer is also invoked during failover,
|
81
82
|
# but we do not apply the admin policy there. We should apply the admin
|
sky/dag.py
CHANGED
@@ -83,6 +83,20 @@ class Dag:
|
|
83
83
|
task.validate(skip_file_mounts=skip_file_mounts,
|
84
84
|
skip_workdir=skip_workdir)
|
85
85
|
|
86
|
+
def resolve_and_validate_volumes(self) -> None:
|
87
|
+
for task in self.tasks:
|
88
|
+
task.resolve_and_validate_volumes()
|
89
|
+
|
90
|
+
def pre_mount_volumes(self) -> None:
|
91
|
+
vol_map = {}
|
92
|
+
# Deduplicate volume mounts.
|
93
|
+
for task in self.tasks:
|
94
|
+
if task.volume_mounts is not None:
|
95
|
+
for volume_mount in task.volume_mounts:
|
96
|
+
vol_map[volume_mount.volume_name] = volume_mount
|
97
|
+
for volume_mount in vol_map.values():
|
98
|
+
volume_mount.pre_mount()
|
99
|
+
|
86
100
|
|
87
101
|
class _DagContext(threading.local):
|
88
102
|
"""A thread-local stack of Dags."""
|
sky/dashboard/out/404.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/b23cb0257bf96c51.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/b23cb0257bf96c51.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/dashboard/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/dashboard/_next/static/chunks/webpack-6133dc1e928bd0b5.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-87d061ee6ed71b28.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-e0e2335212e72357.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-0ef7418d1a3822f3.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-1be831200e60c5c0.js" defer=""></script><script src="/dashboard/_next/static/ZWdSYkqVe3WjnFR8ocqoG/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/ZWdSYkqVe3WjnFR8ocqoG/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"ZWdSYkqVe3WjnFR8ocqoG","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,e,a,t,u,n,r,i,j,f,k,b,d){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-6b0d9e5031b70c58.js"],"/_error":["static/chunks/pages/_error-1be831200e60c5c0.js"],"/clusters":["static/chunks/pages/clusters-4aa031d1f42723d8.js"],"/clusters/[cluster]":[s,c,e,a,t,r,j,u,n,f,i,k,b,d,"static/chunks/37-1f1e94f5a561202a.js","static/chunks/pages/clusters/[cluster]-32ce4f49f2261f55.js"],"/clusters/[cluster]/[job]":[s,c,e,a,t,u,n,"static/chunks/pages/clusters/[cluster]/[job]-aff040d7bc5d0086.js"],"/config":["static/chunks/pages/config-3102d02a188f04b3.js"],"/infra":["static/chunks/pages/infra-fd5dc8a91bd9169a.js"],"/infra/[context]":["static/chunks/pages/infra/[context]-6f1e02e31eecb5ce.js"],"/jobs":["static/chunks/pages/jobs-26da173e20af16e4.js"],"/jobs/[job]":[s,c,e,a,t,r,u,n,i,"static/chunks/pages/jobs/[job]-e4b23128db0774cd.js"],"/users":["static/chunks/pages/users-ce29e7420385563d.js"],"/volumes":["static/chunks/pages/volumes-476b670ef33d1ecd.js"],"/workspace/new":["static/chunks/pages/workspace/new-09ae0f6f972aa871.js"],"/workspaces":["static/chunks/pages/workspaces-862b120406461b10.js"],"/workspaces/[name]":[s,c,e,a,t,r,j,u,n,f,i,k,b,d,"static/chunks/843-07d25a7e64462fd8.js","static/chunks/pages/workspaces/[name]-0b4c662a25e4747a.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/config","/infra","/infra/[context]","/jobs","/jobs/[job]","/users","/volumes","/workspace/new","/workspaces","/workspaces/[name]"]}}("static/chunks/616-d6128fa9e7cae6e6.js","static/chunks/230-d6e363362017ff3a.js","static/chunks/799-3625946b2ec2eb30.js","static/chunks/664-047bc03493fda379.js","static/chunks/804-4c9fc53aa74bc191.js","static/chunks/989-db34c16ad7ea6155.js","static/chunks/470-92dd1614396389be.js","static/chunks/798-c0525dc3f21e488d.js","static/chunks/969-d3a0b53f728d280a.js","static/chunks/947-6620842ef80ae879.js","static/chunks/66-66ae330df2d3c1c7.js","static/chunks/856-cdf66268ec878d0c.js","static/chunks/973-5b5019ba333e8d62.js","static/chunks/938-068520cc11738deb.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[230],{8771:function(e,r,o){o.d(r,{F:function(){return l},e:function(){return i}});var t=o(7294);function n(e,r){if("function"==typeof e)return e(r);null!=e&&(e.current=r)}function l(...e){return r=>{let o=!1,t=e.map(e=>{let t=n(e,r);return o||"function"!=typeof t||(o=!0),t});if(o)return()=>{for(let r=0;r<t.length;r++){let o=t[r];"function"==typeof o?o():n(e[r],null)}}}}function i(...e){return t.useCallback(l(...e),e)}},5320:function(e,r,o){o.d(r,{WV:function(){return s},jH:function(){return a}});var t=o(7294),n=o(3935),l=o(8426),i=o(5893),s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let o=(0,l.Z8)(`Primitive.${r}`),n=t.forwardRef((e,t)=>{let{asChild:n,...l}=e,s=n?o:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(s,{...l,ref:t})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{});function a(e,r){e&&n.flushSync(()=>e.dispatchEvent(r))}},8426:function(e,r,o){o.d(r,{Z8:function(){return i},g7:function(){return s}});var t=o(7294),n=o(8771),l=o(5893);function i(e){let r=function(e){let r=t.forwardRef((e,r)=>{let{children:o,...l}=e;if(t.isValidElement(o)){let e,i;let s=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?o.ref:(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?o.props.ref:o.props.ref||o.ref,a=function(e,r){let o={...r};for(let t in r){let n=e[t],l=r[t];/^on[A-Z]/.test(t)?n&&l?o[t]=(...e)=>{let r=l(...e);return n(...e),r}:n&&(o[t]=n):"style"===t?o[t]={...n,...l}:"className"===t&&(o[t]=[n,l].filter(Boolean).join(" "))}return{...e,...o}}(l,o.props);return o.type!==t.Fragment&&(a.ref=r?(0,n.F)(r,s):s),t.cloneElement(o,a)}return t.Children.count(o)>1?t.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}(e),o=t.forwardRef((e,o)=>{let{children:n,...i}=e,s=t.Children.toArray(n),a=s.find(d);if(a){let e=a.props.children,n=s.map(r=>r!==a?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,l.jsx)(r,{...i,ref:o,children:t.isValidElement(e)?t.cloneElement(e,void 0,n):null})}return(0,l.jsx)(r,{...i,ref:o,children:n})});return o.displayName=`${e}.Slot`,o}var s=i("Slot"),a=Symbol("radix.slottable");function d(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a}},512:function(e,r,o){function t(){for(var e,r,o=0,t="",n=arguments.length;o<n;o++)(e=arguments[o])&&(r=function e(r){var o,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r){if(Array.isArray(r)){var l=r.length;for(o=0;o<l;o++)r[o]&&(t=e(r[o]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t)}return n}(e))&&(t&&(t+=" "),t+=r);return t}o.d(r,{W:function(){return t}}),r.Z=t},8388:function(e,r,o){o.d(r,{m6:function(){return L}});let t=e=>{let r=s(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:t}=e;return{getClassGroupId:e=>{let o=e.split("-");return""===o[0]&&1!==o.length&&o.shift(),n(o,r)||i(e)},getConflictingClassGroupIds:(e,r)=>{let n=o[e]||[];return r&&t[e]?[...n,...t[e]]:n}}},n=(e,r)=>{if(0===e.length)return r.classGroupId;let o=e[0],t=r.nextPart.get(o),l=t?n(e.slice(1),t):void 0;if(l)return l;if(0===r.validators.length)return;let i=e.join("-");return r.validators.find(({validator:e})=>e(i))?.classGroupId},l=/^\[(.+)\]$/,i=e=>{if(l.test(e)){let r=l.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},s=e=>{let{theme:r,prefix:o}=e,t={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),o).forEach(([e,o])=>{a(o,t,e,r)}),t},a=(e,r,o,t)=>{e.forEach(e=>{if("string"==typeof e){(""===e?r:d(r,e)).classGroupId=o;return}if("function"==typeof e){if(c(e)){a(e(t),r,o,t);return}r.validators.push({validator:e,classGroupId:o});return}Object.entries(e).forEach(([e,n])=>{a(n,d(r,e),o,t)})})},d=(e,r)=>{let o=e;return r.split("-").forEach(e=>{o.nextPart.has(e)||o.nextPart.set(e,{nextPart:new Map,validators:[]}),o=o.nextPart.get(e)}),o},c=e=>e.isThemeGetter,p=(e,r)=>r?e.map(([e,o])=>[e,o.map(e=>"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,o])=>[r+e,o])):e)]):e,u=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,o=new Map,t=new Map,n=(n,l)=>{o.set(n,l),++r>e&&(r=0,t=o,o=new Map)};return{get(e){let r=o.get(e);return void 0!==r?r:void 0!==(r=t.get(e))?(n(e,r),r):void 0},set(e,r){o.has(e)?o.set(e,r):n(e,r)}}},b=e=>{let{separator:r,experimentalParseClassName:o}=e,t=1===r.length,n=r[0],l=r.length,i=e=>{let o;let i=[],s=0,a=0;for(let d=0;d<e.length;d++){let c=e[d];if(0===s){if(c===n&&(t||e.slice(d,d+l)===r)){i.push(e.slice(a,d)),a=d+l;continue}if("/"===c){o=d;continue}}"["===c?s++:"]"===c&&s--}let d=0===i.length?e:e.substring(a),c=d.startsWith("!"),p=c?d.substring(1):d;return{modifiers:i,hasImportantModifier:c,baseClassName:p,maybePostfixModifierPosition:o&&o>a?o-a:void 0}};return o?e=>o({className:e,parseClassName:i}):i},f=e=>{if(e.length<=1)return e;let r=[],o=[];return e.forEach(e=>{"["===e[0]?(r.push(...o.sort(),e),o=[]):o.push(e)}),r.push(...o.sort()),r},m=e=>({cache:u(e.cacheSize),parseClassName:b(e),...t(e)}),g=/\s+/,h=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:n}=r,l=[],i=e.trim().split(g),s="";for(let e=i.length-1;e>=0;e-=1){let r=i[e],{modifiers:a,hasImportantModifier:d,baseClassName:c,maybePostfixModifierPosition:p}=o(r),u=!!p,b=t(u?c.substring(0,p):c);if(!b){if(!u||!(b=t(c))){s=r+(s.length>0?" "+s:s);continue}u=!1}let m=f(a).join(":"),g=d?m+"!":m,h=g+b;if(l.includes(h))continue;l.push(h);let y=n(b,u);for(let e=0;e<y.length;++e){let r=y[e];l.push(g+r)}s=r+(s.length>0?" "+s:s)}return s};function y(){let e,r,o=0,t="";for(;o<arguments.length;)(e=arguments[o++])&&(r=x(e))&&(t&&(t+=" "),t+=r);return t}let x=e=>{let r;if("string"==typeof e)return e;let o="";for(let t=0;t<e.length;t++)e[t]&&(r=x(e[t]))&&(o&&(o+=" "),o+=r);return o},v=e=>{let r=r=>r[e]||[];return r.isThemeGetter=!0,r},w=/^\[(?:([a-z-]+):)?(.+)\]$/i,k=/^\d+\/\d+$/,z=new Set(["px","full","screen"]),j=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,S=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,E=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>R(e)||z.has(e)||k.test(e),G=e=>T(e,"length",B),R=e=>!!e&&!Number.isNaN(Number(e)),$=e=>T(e,"number",R),W=e=>!!e&&Number.isInteger(Number(e)),_=e=>e.endsWith("%")&&R(e.slice(0,-1)),O=e=>w.test(e),I=e=>j.test(e),M=new Set(["length","size","percentage"]),V=e=>T(e,M,H),A=e=>T(e,"position",H),Z=new Set(["image","url"]),F=e=>T(e,Z,K),q=e=>T(e,"",J),D=()=>!0,T=(e,r,o)=>{let t=w.exec(e);return!!t&&(t[1]?"string"==typeof r?t[1]===r:r.has(t[1]):o(t[2]))},B=e=>C.test(e)&&!S.test(e),H=()=>!1,J=e=>E.test(e),K=e=>P.test(e),L=function(e,...r){let o,t,n;let l=function(s){return t=(o=m(r.reduce((e,r)=>r(e),e()))).cache.get,n=o.cache.set,l=i,i(s)};function i(e){let r=t(e);if(r)return r;let l=h(e,o);return n(e,l),l}return function(){return l(y.apply(null,arguments))}}(()=>{let e=v("colors"),r=v("spacing"),o=v("blur"),t=v("brightness"),n=v("borderColor"),l=v("borderRadius"),i=v("borderSpacing"),s=v("borderWidth"),a=v("contrast"),d=v("grayscale"),c=v("hueRotate"),p=v("invert"),u=v("gap"),b=v("gradientColorStops"),f=v("gradientColorStopPositions"),m=v("inset"),g=v("margin"),h=v("opacity"),y=v("padding"),x=v("saturate"),w=v("scale"),k=v("sepia"),z=v("skew"),j=v("space"),C=v("translate"),S=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",O,r],M=()=>[O,r],Z=()=>["",N,G],T=()=>["auto",R,O],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",O],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[R,O];return{cacheSize:500,separator:":",theme:{colors:[D],spacing:[N,G],blur:["none","",I,O],brightness:U(),borderColor:[e],borderRadius:["none","","full",I,O],borderSpacing:M(),borderWidth:Z(),contrast:U(),grayscale:L(),hueRotate:U(),invert:L(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[_,G],inset:P(),margin:P(),opacity:U(),padding:M(),saturate:U(),scale:U(),sepia:L(),skew:U(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[I]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),O]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",W,O]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",W,O]}],"grid-cols":[{"grid-cols":[D]}],"col-start-end":[{col:["auto",{span:["full",W,O]},O]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[D]}],"row-start-end":[{row:["auto",{span:[W,O]},O]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,r]}],"min-w":[{"min-w":[O,r,"min","max","fit"]}],"max-w":[{"max-w":[O,r,"none","full","min","max","fit","prose",{screen:[I]},I]}],h:[{h:[O,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,r,"auto","min","max","fit"]}],"font-size":[{text:["base",I,G]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$]}],"font-family":[{font:[D]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",O]}],"line-clamp":[{"line-clamp":["none",R,$]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",N,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",N,G]}],"underline-offset":[{"underline-offset":["auto",N,O]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),A]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},F]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:H()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[N,O]}],"outline-w":[{outline:[N,G]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[N,G]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",I,q]}],"shadow-color":[{shadow:[D]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",I,O]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[p]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",O]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[W,O]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",O]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[N,G,$]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})}}]);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[310],{1812:function(e,s,t){t.d(s,{X:function(){return l}});var r=t(5893),a=t(7294);let n=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},l=e=>{let{error:s,title:t="Error",onDismiss:l}=e,[i,o]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{s&&o(!1)},[s]),!s||i)return null;let c="string"==typeof s?s:n(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,":"]})," ",c]})})]}),(0,r.jsx)("button",{onClick:()=>{o(!0),l&&l()},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"})})})]})})}},803:function(e,s,t){t.d(s,{z:function(){return c}});var r=t(5893),a=t(7294),n=t(8426),l=t(2003),i=t(2350);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=a.forwardRef((e,s)=>{let{className:t,variant:a,size:l,asChild:c=!1,...d}=e,u=c?n.g7:"button";return(0,r.jsx)(u,{className:(0,i.cn)(o({variant:a,size:l,className:t})),ref:s,...d})});c.displayName="Button"},7673:function(e,s,t){t.d(s,{Ol:function(){return c},Zb:function(){return o},aY:function(){return m},eW:function(){return x},ll:function(){return d}});var r=t(5893),a=t(7294),n=t(5697),l=t.n(n),i=t(2350);let o=a.forwardRef((e,s)=>{let{className:t,children:a,...n}=e;return(0,r.jsx)("div",{ref:s,className:(0,i.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...n,children:a})});o.displayName="Card",o.propTypes={className:l().string,children:l().node};let c=a.forwardRef((e,s)=>{let{className:t,children:a,...n}=e;return(0,r.jsx)("div",{ref:s,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",t),...n,children:a})});c.displayName="CardHeader",c.propTypes={className:l().string,children:l().node};let d=a.forwardRef((e,s)=>{let{className:t,children:a,...n}=e;return(0,r.jsx)("h3",{ref:s,className:(0,i.cn)("text-2xl font-semibold leading-none tracking-tight",t),...n,children:a})});d.displayName="CardTitle",d.propTypes={className:l().string,children:l().node};let u=a.forwardRef((e,s)=>{let{className:t,children:a,...n}=e;return(0,r.jsx)("p",{ref:s,className:(0,i.cn)("text-sm text-muted-foreground",t),...n,children:a})});u.displayName="CardDescription",u.propTypes={className:l().string,children:l().node};let m=a.forwardRef((e,s)=>{let{className:t,children:a,...n}=e;return(0,r.jsx)("div",{ref:s,className:(0,i.cn)("p-6 pt-0",t),...n,children:a})});m.displayName="CardContent",m.propTypes={className:l().string,children:l().node};let x=a.forwardRef((e,s)=>{let{className:t,children:a,...n}=e;return(0,r.jsx)("div",{ref:s,className:(0,i.cn)("flex items-center p-6 pt-0",t),...n,children:a})});x.displayName="CardFooter",x.propTypes={className:l().string,children:l().node}},326:function(e,s,t){t.d(s,{$N:function(){return f},Be:function(){return h},Vq:function(){return o},cN:function(){return x},cZ:function(){return u},fK:function(){return m}});var r=t(5893),a=t(7294),n=t(6327),l=t(2350),i=t(3767);let o=n.fC;n.xz;let c=n.h_;n.x8;let d=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)(n.aV,{ref:s,className:(0,l.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a})});d.displayName=n.aV.displayName;let u=a.forwardRef((e,s)=>{let{className:t,children:a,...o}=e;return(0,r.jsxs)(c,{children:[(0,r.jsx)(d,{}),(0,r.jsxs)(n.VY,{ref:s,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...o,children:[a,(0,r.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500",children:[(0,r.jsx)(i.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=n.VY.displayName;let m=e=>{let{className:s,...t}=e;return(0,r.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",s),...t})};m.displayName="DialogHeader";let x=e=>{let{className:s,...t}=e;return(0,r.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t})};x.displayName="DialogFooter";let f=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)(n.Dx,{ref:s,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",t),...a})});f.displayName=n.Dx.displayName;let h=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)(n.dk,{ref:s,className:(0,l.cn)("text-sm text-gray-500",t),...a})});h.displayName=n.dk.displayName},8764:function(e,s,t){t.d(s,{RM:function(){return o},SC:function(){return c},iA:function(){return l},pj:function(){return u},ss:function(){return d},xD:function(){return i}});var r=t(5893),a=t(7294),n=t(2350);let l=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,n.cn)("w-full caption-bottom text-base",t),...a})})});l.displayName="Table";let i=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("thead",{ref:s,className:(0,n.cn)("[&_tr]:border-b",t),...a})});i.displayName="TableHeader";let o=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tbody",{ref:s,className:(0,n.cn)("[&_tr:last-child]:border-0",t),...a})});o.displayName="TableBody",a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tfoot",{ref:s,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a})}).displayName="TableFooter";let c=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tr",{ref:s,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a})});c.displayName="TableRow";let d=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("th",{ref:s,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",t),...a})});d.displayName="TableHead";let u=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("td",{ref:s,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a})});u.displayName="TableCell",a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("caption",{ref:s,className:(0,n.cn)("mt-4 text-base text-muted-foreground",t),...a})}).displayName="TableCaption"},8310:function(e,s,t){t.r(s),t.d(s,{Users:function(){return M}});var r=t(5893),a=t(7294),n=t(5697),l=t.n(n),i=t(8799),o=t(1664),c=t.n(o),d=t(803),u=t(8764),m=t(3081),x=t(3266),f=t(8969),h=t(6378),p=t(6856),g=t(1214),b=t(4545),y=t(998);/**
|
2
|
+
* @license lucide-react v0.407.0 - ISC
|
3
|
+
*
|
4
|
+
* This source code is licensed under the ISC license.
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
6
|
+
*/let j=(0,y.Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var v=t(3626);/**
|
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 N=(0,y.Z)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]),w=(0,y.Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),k=(0,y.Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var C=t(282),R=t(3767);/**
|
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 D=(0,y.Z)("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),E=(0,y.Z)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);var S=t(7603);t(9470);var I=t(3001),U=t(7673),F=t(7145),z=t(326),L=t(1812);let _=(e,s)=>e&&e.includes("@")?e.split("@")[0]:e||"N/A",Z=(e,s)=>e&&e.includes("@")?e:s||"-",T=g.nb.REFRESH_INTERVAL,V=e=>{let{message:s,onDismiss:t}=e;return s?(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:s})})]}),t&&(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:t,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"})})]})})})]})}):null};function M(){let[e,s]=(0,a.useState)(!1),t=(0,a.useRef)(null),n=(0,I.X)(),[l,o]=(0,a.useState)(!1),[u,p]=(0,a.useState)({username:"",password:"",role:"user"}),[g,b]=(0,a.useState)(!1),[y,C]=(0,a.useState)({open:!1,message:"",userName:""}),[R,D]=(0,a.useState)(null),[E,S]=(0,a.useState)(!1),[U,_]=(0,a.useState)(!1),[Z,M]=(0,a.useState)(!1),[P,q]=(0,a.useState)(null),[B,O]=(0,a.useState)(!1),[H,K]=(0,a.useState)(null),[Y,$]=(0,a.useState)("import"),[X,J]=(0,a.useState)(!1),[W,G]=(0,a.useState)(null),[Q,ee]=(0,a.useState)(""),[es,et]=(0,a.useState)(!1),[er,ea]=(0,a.useState)(null),[en,el]=(0,a.useState)(!1),[ei,eo]=(0,a.useState)(null),[ec,ed]=(0,a.useState)(null),[eu,em]=(0,a.useState)(!1),[ex,ef]=(0,a.useState)(null),[eh,ep]=(0,a.useState)(null),[eg,eb]=(0,a.useState)(void 0);(0,a.useEffect)(()=>{!async function(){try{let e=await F.x.get("/api/health");if(e.ok){let s=await e.json();eb(!!s.basic_auth_enabled)}else eb(!1)}catch(e){eb(!1)}}()},[]);let ey=(0,a.useCallback)(async()=>{if(R&&Date.now()-R.timestamp<3e5)return R;S(!0);try{let e=await F.x.get("/users/role");if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to get user role")}let s=await e.json(),t={role:s.role,name:s.name,id:s.id,timestamp:Date.now()};return D(t),S(!1),t}catch(e){throw S(!1),e}},[R]);(0,a.useEffect)(()=>{ey().catch(()=>{console.error("Failed to get user role")})},[ey]);let ej=async(e,s)=>{try{let t=await ey();if("admin"!==t.role)return C({open:!0,message:e,userName:t.name.toLowerCase()}),!1;return s(),!0}catch(e){return console.error("Failed to check user role:",e),C({open:!0,message:"Error: ".concat(e.message),userName:""}),!1}},ev=()=>{h.default.invalidate(m.R),h.default.invalidate(x.getClusters),h.default.invalidate(f.getManagedJobs,[{allUsers:!0}]),t.current&&t.current()},eN=async()=>{if(!u.username||!u.password){ep(Error("Username and password are required.")),o(!1);return}b(!0),ep(null),ef(null);try{let e=await F.x.post("/users/create",u);if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to create user")}ef('User "'.concat(u.username,'" created successfully!')),o(!1),p({username:"",password:"",role:"user"}),ev()}catch(e){ep(e),o(!1),p({username:"",password:"",role:"user"})}finally{b(!1)}},ew=async e=>{let s=e.target.files[0];s&&(q(s),K(null))},ek=async()=>{if(!P){alert("Please select a CSV file first.");return}O(!0);try{let e=new FileReader;e.onload=async e=>{try{let s=e.target.result,t=await F.x.post("/users/import",{csv_content:s});if(!t.ok){let e=await t.json();throw Error(e.detail||"Failed to import users")}let r=await t.json(),a="Import completed. ".concat(r.success_count," users created successfully.");r.error_count>0&&(a+="\n".concat(r.error_count," failed."),r.creation_errors.length>0&&(a+="\nErrors: ".concat(r.creation_errors.slice(0,3).join(", ")),r.creation_errors.length>3&&(a+=" and ".concat(r.creation_errors.length-3," more...")))),K({message:a}),r.success_count>0&&ev()}catch(e){alert("Error importing users: ".concat(e.message))}finally{O(!1)}},e.readAsText(P)}catch(e){alert("Error reading file: ".concat(e.message)),O(!1)}},eC=async e=>{G(e),ee(""),J(!0)},eR=async()=>{if(!Q){ea(Error("Please enter a new password."));return}et(!0),ea(null);try{let e=await F.x.post("/users/update",{user_id:W.userId,password:Q});if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to reset password")}ef('Password reset successfully for user "'.concat(W.usernameDisplay,'"!')),J(!1),G(null),ee("")}catch(e){ea(e)}finally{et(!1)}},eD=async()=>{if(ei){em(!0),ed(null);try{let e=await F.x.post("/users/delete",{user_id:ei.userId});if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to delete user")}ef('User "'.concat(ei.usernameDisplay,'" deleted successfully!')),el(!1),eo(null),ev()}catch(e){ed(e)}finally{em(!1)}}},eE=()=>{el(!1),eo(null),ed(null)},eS=()=>{J(!1),G(null),ee(""),ea(null)};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",children:(0,r.jsx)(c(),{href:"/users",className:"text-sky-blue hover:underline leading-none",children:"Users"})}),(0,r.jsxs)("div",{className:"flex items-center",children:[e&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(i.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),eg&&(null==R?void 0:R.role)==="admin"&&(0,r.jsx)("button",{onClick:async()=>{await ej("cannot create users",()=>{o(!0)})},className:"text-sky-blue hover:text-sky-blue-bright flex items-center border-sky-blue rounded px-2 py-1 mr-2",title:"Create New User",children:"+ New User"}),eg&&(null==R?void 0:R.role)==="admin"&&(0,r.jsxs)("button",{onClick:async()=>{await ej("cannot import users",()=>{M(!0)})},className:"text-sky-blue hover:text-sky-blue-bright flex items-center rounded px-2 py-1 mr-2",title:"Import/Export Users",children:[(0,r.jsx)(j,{className:"h-4 w-4 mr-1"}),"Import/Export"]}),(0,r.jsxs)("button",{onClick:ev,disabled:e,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(v.Z,{className:"h-4 w-4 mr-1.5"}),!n&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(V,{message:ex,onDismiss:()=>ef(null)}),(0,r.jsx)(L.X,{error:eh,title:"Error",onDismiss:()=>ep(null)}),(0,r.jsx)(A,{refreshInterval:T,setLoading:s,refreshDataRef:t,checkPermissionAndAct:ej,roleLoading:E,onResetPassword:eC,onDeleteUser:e=>{ej("cannot delete users",()=>{eo(e),el(!0)})},basicAuthEnabled:eg,currentUserRole:null==R?void 0:R.role,currentUserId:null==R?void 0:R.id}),(0,r.jsx)(z.Vq,{open:l,onOpenChange:o,children:(0,r.jsxs)(z.cZ,{className:"sm:max-w-md",children:[(0,r.jsx)(z.fK,{children:(0,r.jsx)(z.$N,{children:"Create User"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 py-4",children:[(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Username"}),(0,r.jsx)("input",{className:"border rounded px-3 py-2 w-full",placeholder:"Username",value:u.username,onChange:e=>p({...u,username:e.target.value})})]}),(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{className:"border rounded px-3 py-2 w-full pr-10",placeholder:"Password",type:U?"text":"password",value:u.password,onChange:e=>p({...u,password:e.target.value})}),(0,r.jsx)("button",{type:"button",className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600",onClick:()=>_(!U),children:U?(0,r.jsx)(N,{className:"h-4 w-4"}):(0,r.jsx)(w,{className:"h-4 w-4"})})]})]}),(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Role"}),(0,r.jsxs)("select",{className:"border rounded px-3 py-2 w-full",value:u.role,onChange:e=>p({...u,role:e.target.value}),children:[(0,r.jsx)("option",{value:"user",children:"User"}),(0,r.jsx)("option",{value:"admin",children:"Admin"})]})]})]}),(0,r.jsxs)(z.cN,{children:[(0,r.jsx)("button",{className:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",onClick:()=>o(!1),disabled:g,children:"Cancel"}),(0,r.jsx)("button",{className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-sky-600 text-white hover:bg-sky-700 h-10 px-4 py-2",onClick:eN,disabled:g,children:g?"Creating...":"Create"})]})]})}),(0,r.jsx)(z.Vq,{open:y.open,onOpenChange:e=>C(s=>({...s,open:e})),children:(0,r.jsxs)(z.cZ,{className:"sm:max-w-md transition-all duration-200 ease-in-out",children:[(0,r.jsxs)(z.fK,{children:[(0,r.jsx)(z.$N,{children:"Permission Denied"}),(0,r.jsx)(z.Be,{children:E?(0,r.jsxs)("div",{className:"flex items-center py-2",children:[(0,r.jsx)(i.Z,{size:16,className:"mr-2"}),(0,r.jsx)("span",{children:"Checking permissions..."})]}):(0,r.jsx)(r.Fragment,{children:y.userName?(0,r.jsxs)(r.Fragment,{children:[y.userName," is logged in as non-admin and ",y.message,"."]}):y.message})})]}),(0,r.jsx)(z.cN,{children:(0,r.jsx)(d.z,{variant:"outline",onClick:()=>C(e=>({...e,open:!1})),disabled:E,children:"OK"})})]})}),(0,r.jsx)(z.Vq,{open:Z,onOpenChange:M,children:(0,r.jsxs)(z.cZ,{className:"sm:max-w-lg",children:[(0,r.jsx)(z.fK,{children:(0,r.jsx)(z.$N,{children:"Import/Export Users"})}),(0,r.jsxs)("div",{className:"flex border-b border-gray-200 mb-4",children:[(0,r.jsx)("button",{className:"px-4 py-2 text-sm font-medium ".concat("import"===Y?"border-b-2 border-sky-500 text-sky-600":"text-gray-500 hover:text-gray-700"),onClick:()=>$("import"),children:"Import"}),(0,r.jsx)("button",{className:"px-4 py-2 text-sm font-medium ".concat("export"===Y?"border-b-2 border-sky-500 text-sky-600":"text-gray-500 hover:text-gray-700"),onClick:()=>$("export"),children:"Export"})]}),(0,r.jsx)("div",{className:"flex flex-col gap-4 py-4",children:"import"===Y?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"CSV File"}),(0,r.jsx)("input",{type:"file",accept:".csv",onChange:ew,className:"border rounded px-3 py-2 w-full"}),(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:["CSV should have columns: username, password, role",(0,r.jsx)("br",{}),"Supports both plain text passwords and exported password hashes."]})]}),H&&(0,r.jsx)("div",{className:"p-3 bg-green-50 border border-green-200 rounded text-green-700 text-sm",children:H.message})]}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Export Users to CSV"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Download all users as a CSV file with password hashes."}),(0,r.jsxs)("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded",children:[(0,r.jsx)("p",{className:"text-sm text-amber-700",children:"⚠️ This will export all users with columns: username, password (hashed), role"}),(0,r.jsx)("p",{className:"text-xs text-amber-600 mt-1",children:"Password hashes can be imported directly for system backups."})]})]})})}),(0,r.jsxs)(z.cN,{children:[(0,r.jsx)("button",{className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2",onClick:()=>M(!1),disabled:B,children:"Cancel"}),"import"===Y?(0,r.jsx)("button",{className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-sky-600 text-white hover:bg-sky-700 h-10 px-4 py-2",onClick:ek,disabled:B||!P,children:B?"Importing...":"Import"}):(0,r.jsxs)("button",{className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-sky-600 text-white hover:bg-sky-700 h-10 px-4 py-2",onClick:async()=>{try{let e=await F.x.get("/users/export");if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to export users")}let s=await e.json(),t=s.csv_content,r=new Blob([t],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(r),n=document.createElement("a");n.href=a;let l=new Date,i=e=>String(e).padStart(2,"0"),o=l.getFullYear(),c=i(l.getMonth()+1),d=i(l.getDate()),u=i(l.getHours()),m=i(l.getMinutes()),x=i(l.getSeconds());n.download="users_export_".concat(o,"-").concat(c,"-").concat(d,"-").concat(u,"-").concat(m,"-").concat(x,".csv"),n.click(),URL.revokeObjectURL(a),alert("Successfully exported ".concat(s.user_count," users to CSV file."))}catch(e){alert("Error exporting users: ".concat(e.message))}},children:[(0,r.jsx)(k,{className:"h-4 w-4 mr-1"}),"Export"]})]})]})}),(0,r.jsx)(z.Vq,{open:X,onOpenChange:eS,children:(0,r.jsxs)(z.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(z.fK,{children:[(0,r.jsx)(z.$N,{children:"Reset Password"}),(0,r.jsxs)(z.Be,{children:["Enter a new password for"," ",(null==W?void 0:W.usernameDisplay)||"this user","."]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-4 py-4",children:(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"New Password"}),(0,r.jsx)("input",{type:"password",className:"border rounded px-3 py-2 w-full",placeholder:"Enter new password",value:Q,onChange:e=>ee(e.target.value),autoFocus:!0})]})}),(0,r.jsx)(L.X,{error:er,title:"Reset Failed",onDismiss:()=>ea(null)}),(0,r.jsxs)(z.cN,{children:[(0,r.jsx)(d.z,{variant:"outline",onClick:eS,disabled:es,children:"Cancel"}),(0,r.jsx)(d.z,{variant:"default",onClick:eR,disabled:es||!Q,className:"bg-sky-600 text-white hover:bg-sky-700",children:es?"Resetting...":"Reset Password"})]})]})}),(0,r.jsx)(z.Vq,{open:en,onOpenChange:eE,children:(0,r.jsxs)(z.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(z.fK,{children:[(0,r.jsx)(z.$N,{children:"Delete User"}),(0,r.jsxs)(z.Be,{children:['Are you sure you want to delete user "',(null==ei?void 0:ei.usernameDisplay)||"this user",'"? This action cannot be undone.']})]}),(0,r.jsx)(L.X,{error:ec,title:"Deletion Failed",onDismiss:()=>ed(null)}),(0,r.jsxs)(z.cN,{children:[(0,r.jsx)(d.z,{variant:"outline",onClick:eE,disabled:eu,children:"Cancel"}),(0,r.jsx)(d.z,{variant:"destructive",onClick:eD,disabled:eu,children:eu?"Deleting...":"Delete"})]})]})})]})}function A(e){let{refreshInterval:s,setLoading:t,refreshDataRef:n,checkPermissionAndAct:l,roleLoading:o,onResetPassword:d,onDeleteUser:g,basicAuthEnabled:y,currentUserRole:j,currentUserId:v}=e,[N,w]=(0,a.useState)([]),[k,I]=(0,a.useState)(!0),[z,L]=(0,a.useState)(!1),[T,V]=(0,a.useState)({key:"username",direction:"ascending"}),[M,A]=(0,a.useState)(null),[P,q]=(0,a.useState)(""),B=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&e&&t(!0),e&&I(!0);try{let s=await h.default.get(m.R),r=(s||[]).map(e=>({...e,usernameDisplay:_(e.username,e.userId),fullEmailID:Z(e.username,e.userId),clusterCount:-1,jobCount:-1}));w(r),L(!0),t&&e&&t(!1),e&&I(!1);let[a,n]=await Promise.all([h.default.get(x.getClusters),h.default.get(f.getManagedJobs,[{allUsers:!0}])]),l=n.jobs||[],i=(s||[]).map(e=>{let s=(a||[]).filter(s=>s.user_hash===e.userId),t=(l||[]).filter(s=>s.user_hash===e.userId);return{...e,usernameDisplay:_(e.username,e.userId),fullEmailID:Z(e.username,e.userId),clusterCount:s.length,jobCount:t.length}});w(i)}catch(s){console.error("Failed to fetch or process user data:",s),w([]),L(!0),t&&e&&t(!1),e&&I(!1)}},[t]);(0,a.useEffect)(()=>{n&&(n.current=()=>B(!0))},[n,B]),(0,a.useEffect)(()=>{(async()=>{L(!1),I(!0),await p.ZP.preloadForPage("users"),B(!0)})();let e=setInterval(()=>{B(!1)},s);return()=>clearInterval(e)},[B,s]);let O=(0,a.useMemo)(()=>(0,b.R0)(N,T.key,T.direction),[N,T]),H=e=>{let s="ascending";T.key===e&&"ascending"===T.direction&&(s="descending"),V({key:e,direction:s})},K=e=>T.key===e?"ascending"===T.direction?" ↑":" ↓":"",Y=async(e,s)=>{await l("cannot edit user role",()=>{A(e),q(s)})},$=()=>{A(null),q("")},X=async e=>{if(!e||!P){console.error("User ID or role is missing."),alert("Error: User ID or role is missing.");return}I(!0);try{let s=await F.x.post("/users/update",{user_id:e,role:P});if(!s.ok){let e=await s.json();throw Error(e.detail||"Failed to update role")}h.default.invalidate(m.R),await B(!0),$()}catch(e){console.error("Failed to update user role:",e),alert("Error updating role: ".concat(e.message))}finally{I(!1)}};return k&&0===N.length&&!z?(0,r.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,r.jsx)(i.Z,{})}):z?O&&0!==O.length?(0,r.jsx)(U.Zb,{children:(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{onClick:()=>H("usernameDisplay"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/5",children:["Name",K("usernameDisplay")]}),(0,r.jsxs)(u.ss,{onClick:()=>H("fullEmailID"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/5",children:["User ID",K("fullEmailID")]}),(0,r.jsxs)(u.ss,{onClick:()=>H("role"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/5",children:["Role",K("role")]}),(0,r.jsxs)(u.ss,{onClick:()=>H("clusterCount"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/5",children:["Clusters",K("clusterCount")]}),(0,r.jsxs)(u.ss,{onClick:()=>H("jobCount"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/5",children:["Jobs",K("jobCount")]}),y&&(0,r.jsx)(u.ss,{className:"whitespace-nowrap w-1/6",children:"Actions"})]})}),(0,r.jsx)(u.RM,{children:O.map(e=>(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{className:"truncate",title:e.username,children:e.usernameDisplay}),(0,r.jsx)(u.pj,{className:"truncate",title:e.fullEmailID,children:e.fullEmailID}),(0,r.jsx)(u.pj,{className:"truncate",title:e.role,children:(0,r.jsx)("div",{className:"flex items-center gap-2",children:M===e.userId?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("select",{value:P,onChange:e=>q(e.target.value),className:"block w-auto p-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-sky-blue focus:border-sky-blue sm:text-sm",children:[(0,r.jsx)("option",{value:"admin",children:"Admin"}),(0,r.jsx)("option",{value:"user",children:"User"})]}),(0,r.jsx)("button",{onClick:()=>X(e.userId),className:"text-green-600 hover:text-green-800 p-1",title:"Save",children:(0,r.jsx)(C.Z,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:$,className:"text-gray-500 hover:text-gray-700 p-1",title:"Cancel",children:(0,r.jsx)(R.Z,{className:"h-4 w-4"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"capitalize",children:e.role}),"admin"===j&&(0,r.jsx)("button",{onClick:()=>Y(e.userId,e.role),className:"text-sky-blue hover:text-sky-blue-bright p-1",title:"Edit role",children:(0,r.jsx)(D,{className:"h-3 w-3"})})]})})}),(0,r.jsx)(u.pj,{children:-1===e.clusterCount?(0,r.jsxs)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-400 rounded text-xs font-medium flex items-center",children:[(0,r.jsx)(i.Z,{size:10,className:"mr-1"}),"Loading..."]}):(0,r.jsx)(c(),{href:"/clusters?user=".concat(encodeURIComponent(e.userId)),className:"px-2 py-0.5 rounded text-xs font-medium transition-colors duration-200 cursor-pointer inline-block ".concat(e.clusterCount>0?"bg-blue-100 text-blue-800 hover:bg-blue-200 hover:text-blue-900":"bg-gray-100 text-gray-500 hover:bg-gray-200 hover:text-gray-700"),title:"View ".concat(e.clusterCount," cluster").concat(1!==e.clusterCount?"s":""," for ").concat(e.usernameDisplay),children:e.clusterCount})}),(0,r.jsx)(u.pj,{children:-1===e.jobCount?(0,r.jsxs)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-400 rounded text-xs font-medium flex items-center",children:[(0,r.jsx)(i.Z,{size:10,className:"mr-1"}),"Loading..."]}):(0,r.jsx)(c(),{href:"/jobs?user=".concat(encodeURIComponent(e.userId)),className:"px-2 py-0.5 rounded text-xs font-medium transition-colors duration-200 cursor-pointer inline-block ".concat(e.jobCount>0?"bg-green-100 text-green-800 hover:bg-green-200 hover:text-green-900":"bg-gray-100 text-gray-500 hover:bg-gray-200 hover:text-gray-700"),title:"View ".concat(e.jobCount," job").concat(1!==e.jobCount?"s":""," for ").concat(e.usernameDisplay),children:e.jobCount})}),y&&(0,r.jsx)(u.pj,{className:"relative",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:"admin"===j||e.userId===v?async()=>{d(e)}:void 0,className:"admin"===j||e.userId===v?"text-sky-blue hover:text-sky-blue-bright p-1":"text-gray-300 cursor-not-allowed p-1",title:"admin"===j||e.userId===v?"Reset Password":"You can only reset your own password",disabled:"admin"!==j&&e.userId!==v,children:(0,r.jsx)(E,{className:"h-4 w-4"})}),"admin"===j&&(0,r.jsx)("button",{onClick:()=>g(e),className:"text-sky-blue hover:text-red-500 p-1",title:"Delete User",children:(0,r.jsx)(S.Z,{className:"h-4 w-4"})})]})})]},e.userId))})]})}):(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("p",{className:"text-lg font-semibold text-gray-500",children:"No users found."}),(0,r.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"There are currently no users to display."})]}):(0,r.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,r.jsx)(i.Z,{}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading users..."})]})}A.propTypes={refreshInterval:l().number.isRequired,setLoading:l().func.isRequired,refreshDataRef:l().shape({current:l().func}).isRequired,checkPermissionAndAct:l().func.isRequired,roleLoading:l().bool.isRequired,onResetPassword:l().func.isRequired,onDeleteUser:l().func.isRequired,basicAuthEnabled:l().bool,currentUserRole:l().string,currentUserId:l().string}},4545:function(e,s,t){function r(e){return e.startsWith("sky-jobs-controller-")}function a(e,s,t){return null===s?e:[...e].sort((e,r)=>e[s]<r[s]?"ascending"===t?-1:1:e[s]>r[s]?"ascending"===t?1:-1:0)}t.d(s,{R0:function(){return a},Ym:function(){return r}})}}]);
|