skypilot-nightly 1.0.0.dev20251029__py3-none-any.whl → 1.0.0.dev20251101__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (68) hide show
  1. sky/__init__.py +2 -2
  2. sky/adaptors/aws.py +25 -7
  3. sky/client/cli/command.py +47 -23
  4. sky/clouds/aws.py +59 -11
  5. sky/dashboard/out/404.html +1 -1
  6. sky/dashboard/out/_next/static/chunks/2755.d6dc6d530fed0b61.js +26 -0
  7. sky/dashboard/out/_next/static/chunks/{webpack-485984ca04e021d0.js → webpack-e38d5319cd10a3a0.js} +1 -1
  8. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  9. sky/dashboard/out/clusters/[cluster].html +1 -1
  10. sky/dashboard/out/clusters.html +1 -1
  11. sky/dashboard/out/config.html +1 -1
  12. sky/dashboard/out/index.html +1 -1
  13. sky/dashboard/out/infra/[context].html +1 -1
  14. sky/dashboard/out/infra.html +1 -1
  15. sky/dashboard/out/jobs/[job].html +1 -1
  16. sky/dashboard/out/jobs/pools/[pool].html +1 -1
  17. sky/dashboard/out/jobs.html +1 -1
  18. sky/dashboard/out/users.html +1 -1
  19. sky/dashboard/out/volumes.html +1 -1
  20. sky/dashboard/out/workspace/new.html +1 -1
  21. sky/dashboard/out/workspaces/[name].html +1 -1
  22. sky/dashboard/out/workspaces.html +1 -1
  23. sky/data/mounting_utils.py +32 -2
  24. sky/jobs/constants.py +2 -0
  25. sky/jobs/controller.py +62 -67
  26. sky/jobs/file_content_utils.py +80 -0
  27. sky/jobs/log_gc.py +201 -0
  28. sky/jobs/scheduler.py +15 -2
  29. sky/jobs/server/core.py +85 -13
  30. sky/jobs/server/server.py +12 -11
  31. sky/jobs/server/utils.py +28 -10
  32. sky/jobs/state.py +216 -40
  33. sky/jobs/utils.py +60 -22
  34. sky/metrics/utils.py +18 -0
  35. sky/schemas/api/responses.py +1 -0
  36. sky/schemas/db/spot_jobs/004_job_file_contents.py +42 -0
  37. sky/schemas/db/spot_jobs/005_logs_gc.py +38 -0
  38. sky/schemas/generated/managed_jobsv1_pb2.py +39 -35
  39. sky/schemas/generated/managed_jobsv1_pb2.pyi +21 -5
  40. sky/serve/server/server.py +8 -7
  41. sky/server/common.py +21 -15
  42. sky/server/constants.py +1 -1
  43. sky/server/daemons.py +23 -17
  44. sky/server/requests/executor.py +7 -3
  45. sky/server/requests/request_names.py +80 -0
  46. sky/server/server.py +103 -35
  47. sky/skylet/constants.py +6 -1
  48. sky/skylet/events.py +7 -0
  49. sky/skylet/services.py +18 -7
  50. sky/ssh_node_pools/server.py +5 -4
  51. sky/task.py +4 -42
  52. sky/templates/kubernetes-ray.yml.j2 +1 -1
  53. sky/templates/websocket_proxy.py +140 -12
  54. sky/users/permission.py +4 -1
  55. sky/utils/db/migration_utils.py +1 -1
  56. sky/utils/resource_checker.py +4 -1
  57. sky/utils/schemas.py +23 -4
  58. sky/volumes/server/server.py +4 -3
  59. sky/workspaces/server.py +7 -6
  60. {skypilot_nightly-1.0.0.dev20251029.dist-info → skypilot_nightly-1.0.0.dev20251101.dist-info}/METADATA +36 -36
  61. {skypilot_nightly-1.0.0.dev20251029.dist-info → skypilot_nightly-1.0.0.dev20251101.dist-info}/RECORD +67 -62
  62. sky/dashboard/out/_next/static/chunks/2755.a239c652bf8684dd.js +0 -26
  63. /sky/dashboard/out/_next/static/{DabuSAKsc_y0wyJxpTIdQ → 8ixeA0NVQJN8HUdijid8b}/_buildManifest.js +0 -0
  64. /sky/dashboard/out/_next/static/{DabuSAKsc_y0wyJxpTIdQ → 8ixeA0NVQJN8HUdijid8b}/_ssgManifest.js +0 -0
  65. {skypilot_nightly-1.0.0.dev20251029.dist-info → skypilot_nightly-1.0.0.dev20251101.dist-info}/WHEEL +0 -0
  66. {skypilot_nightly-1.0.0.dev20251029.dist-info → skypilot_nightly-1.0.0.dev20251101.dist-info}/entry_points.txt +0 -0
  67. {skypilot_nightly-1.0.0.dev20251029.dist-info → skypilot_nightly-1.0.0.dev20251101.dist-info}/licenses/LICENSE +0 -0
  68. {skypilot_nightly-1.0.0.dev20251029.dist-info → skypilot_nightly-1.0.0.dev20251101.dist-info}/top_level.txt +0 -0
sky/__init__.py CHANGED
@@ -7,7 +7,7 @@ import urllib.request
7
7
  from sky.utils import directory_utils
8
8
 
9
9
  # Replaced with the current commit when building the wheels.
10
- _SKYPILOT_COMMIT_SHA = '501e7213a39f27c1a11db3aade5ef878b47bf066'
10
+ _SKYPILOT_COMMIT_SHA = '2205c51a08e8dc517375ba0f653557257c6f6751'
11
11
 
12
12
 
13
13
  def _get_git_commit():
@@ -37,7 +37,7 @@ def _get_git_commit():
37
37
 
38
38
 
39
39
  __commit__ = _get_git_commit()
40
- __version__ = '1.0.0.dev20251029'
40
+ __version__ = '1.0.0.dev20251101'
41
41
  __root_dir__ = directory_utils.get_sky_dir()
42
42
 
43
43
 
sky/adaptors/aws.py CHANGED
@@ -34,6 +34,7 @@ import time
34
34
  import typing
35
35
  from typing import Callable, Literal, Optional, TypeVar
36
36
 
37
+ from sky import skypilot_config
37
38
  from sky.adaptors import common
38
39
  from sky.utils import annotations
39
40
  from sky.utils import common_utils
@@ -119,12 +120,27 @@ def _create_aws_object(creation_fn_or_cls: Callable[[], T],
119
120
  f'{common_utils.format_exception(e)}.')
120
121
 
121
122
 
123
+ def get_workspace_profile() -> Optional[str]:
124
+ """Get AWS profile name from workspace config."""
125
+ return skypilot_config.get_workspace_cloud('aws').get('profile', None)
126
+
127
+
122
128
  # The LRU cache needs to be thread-local to avoid multiple threads sharing the
123
129
  # same session object, which is not guaranteed to be thread-safe.
124
130
  @_thread_local_lru_cache()
125
- def session(check_credentials: bool = True):
126
- """Create an AWS session."""
127
- s = _create_aws_object(boto3.session.Session, 'session')
131
+ def session(check_credentials: bool = True, profile: Optional[str] = None):
132
+ """Create an AWS session.
133
+
134
+ Args:
135
+ check_credentials: Whether to check if credentials are available.
136
+ profile: AWS profile name to use. If None, uses default credentials.
137
+ """
138
+ if profile is not None:
139
+ logger.debug(f'Using AWS profile \'{profile}\'.')
140
+ s = _create_aws_object(
141
+ lambda: boto3.session.Session(profile_name=profile), 'session')
142
+ else:
143
+ s = _create_aws_object(boto3.session.Session, 'session')
128
144
  if check_credentials and s.get_credentials() is None:
129
145
  # s.get_credentials() can be None if there are actually no credentials,
130
146
  # or if we fail to get credentials from IMDS (e.g. due to throttling).
@@ -180,13 +196,14 @@ def resource(service_name: str, **kwargs):
180
196
  kwargs['config'] = config
181
197
 
182
198
  check_credentials = kwargs.pop('check_credentials', True)
199
+ profile = get_workspace_profile()
183
200
 
184
201
  # Need to use the client retrieved from the per-thread session to avoid
185
202
  # thread-safety issues (Directly creating the client with boto3.resource()
186
203
  # is not thread-safe). Reference: https://stackoverflow.com/a/59635814
187
204
  return _create_aws_object(
188
- lambda: session(check_credentials=check_credentials).resource(
189
- service_name, **kwargs), 'resource')
205
+ lambda: session(check_credentials=check_credentials, profile=profile).
206
+ resource(service_name, **kwargs), 'resource')
190
207
 
191
208
 
192
209
  # New typing overloads can be added as needed.
@@ -221,14 +238,15 @@ def client(service_name: str, **kwargs):
221
238
  _assert_kwargs_builtin_type(kwargs)
222
239
 
223
240
  check_credentials = kwargs.pop('check_credentials', True)
241
+ profile = get_workspace_profile()
224
242
 
225
243
  # Need to use the client retrieved from the per-thread session to avoid
226
244
  # thread-safety issues (Directly creating the client with boto3.client() is
227
245
  # not thread-safe). Reference: https://stackoverflow.com/a/59635814
228
246
 
229
247
  return _create_aws_object(
230
- lambda: session(check_credentials=check_credentials).client(
231
- service_name, **kwargs), 'client')
248
+ lambda: session(check_credentials=check_credentials, profile=profile).
249
+ client(service_name, **kwargs), 'client')
232
250
 
233
251
 
234
252
  @common.load_lazy_modules(modules=_LAZY_MODULES)
sky/client/cli/command.py CHANGED
@@ -1383,7 +1383,26 @@ def _handle_jobs_queue_request(
1383
1383
  try:
1384
1384
  if not is_called_by_user:
1385
1385
  usage_lib.messages.usage.set_internal()
1386
- result = sdk.stream_and_get(request_id)
1386
+ # Call both stream_and_get functions in parallel
1387
+ def get_jobs_queue_result():
1388
+ return sdk.stream_and_get(request_id)
1389
+
1390
+ def get_pool_status_result():
1391
+ if pool_status_request_id is not None:
1392
+ try:
1393
+ return sdk.stream_and_get(pool_status_request_id)
1394
+ except Exception: # pylint: disable=broad-except
1395
+ # If getting pool status fails, just continue without it
1396
+ return None
1397
+ return None
1398
+
1399
+ with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
1400
+ jobs_future = executor.submit(get_jobs_queue_result)
1401
+ pool_status_future = executor.submit(get_pool_status_result)
1402
+
1403
+ result = jobs_future.result()
1404
+ pool_status_result = pool_status_future.result()
1405
+
1387
1406
  if isinstance(result, tuple):
1388
1407
  managed_jobs_, total, status_counts, _ = result
1389
1408
  if only_in_progress:
@@ -1400,13 +1419,6 @@ def _handle_jobs_queue_request(
1400
1419
  managed_jobs_ = result
1401
1420
  num_in_progress_jobs = len(
1402
1421
  set(job['job_id'] for job in managed_jobs_))
1403
- # Try to get pool status if request was made
1404
- if pool_status_request_id is not None:
1405
- try:
1406
- pool_status_result = sdk.stream_and_get(pool_status_request_id)
1407
- except Exception: # pylint: disable=broad-except
1408
- # If getting pool status fails, just continue without it
1409
- pool_status_result = None
1410
1422
  except exceptions.ClusterNotUpError as e:
1411
1423
  controller_status = e.cluster_status
1412
1424
  msg = str(e)
@@ -4665,7 +4677,8 @@ def jobs_launch(
4665
4677
  else:
4666
4678
  # TODO(tian): This can be very long. Considering have a "group id"
4667
4679
  # and query all job ids with the same group id.
4668
- job_ids_str = ','.join(map(str, job_ids))
4680
+ # Sort job ids to ensure consistent ordering.
4681
+ job_ids_str = ','.join(map(str, sorted(job_ids)))
4669
4682
  click.secho(
4670
4683
  f'Jobs submitted with IDs: {colorama.Fore.CYAN}'
4671
4684
  f'{job_ids_str}{colorama.Style.RESET_ALL}.'
@@ -4779,19 +4792,28 @@ def jobs_queue(verbose: bool, refresh: bool, skip_finished: bool,
4779
4792
  fields = fields + _USER_NAME_FIELD
4780
4793
  if verbose:
4781
4794
  fields = fields + _USER_HASH_FIELD
4782
- managed_jobs_request_id = managed_jobs.queue(
4783
- refresh=refresh,
4784
- skip_finished=skip_finished,
4785
- all_users=all_users,
4786
- limit=max_num_jobs_to_show,
4787
- fields=fields)
4788
- # Try to get pool status for worker information
4789
- pool_status_request_id = None
4790
- try:
4791
- pool_status_request_id = managed_jobs.pool_status(pool_names=None)
4792
- except Exception: # pylint: disable=broad-except
4793
- # If pool_status fails, we'll just skip the worker information
4794
- pass
4795
+ # Call both managed_jobs.queue and managed_jobs.pool_status in parallel
4796
+ def get_managed_jobs_queue():
4797
+ return managed_jobs.queue(refresh=refresh,
4798
+ skip_finished=skip_finished,
4799
+ all_users=all_users,
4800
+ limit=max_num_jobs_to_show,
4801
+ fields=fields)
4802
+
4803
+ def get_pool_status():
4804
+ try:
4805
+ return managed_jobs.pool_status(pool_names=None)
4806
+ except Exception: # pylint: disable=broad-except
4807
+ # If pool_status fails, we'll just skip the worker information
4808
+ return None
4809
+
4810
+ with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
4811
+ managed_jobs_future = executor.submit(get_managed_jobs_queue)
4812
+ pool_status_future = executor.submit(get_pool_status)
4813
+
4814
+ managed_jobs_request_id = managed_jobs_future.result()
4815
+ pool_status_request_id = pool_status_future.result()
4816
+
4795
4817
  num_jobs, msg = _handle_jobs_queue_request(
4796
4818
  managed_jobs_request_id,
4797
4819
  pool_status_request_id=pool_status_request_id,
@@ -6368,7 +6390,9 @@ INT_OR_NONE = IntOrNone()
6368
6390
  is_flag=True,
6369
6391
  default=False,
6370
6392
  required=False,
6371
- help='Show requests of all statuses.')
6393
+ help=('Show requests of all statuses, including finished ones '
6394
+ '(SUCCEEDED, FAILED, CANCELLED). By default, only active '
6395
+ 'requests (PENDING, RUNNING) are shown.'))
6372
6396
  @click.option(
6373
6397
  '--limit',
6374
6398
  '-l',
sky/clouds/aws.py CHANGED
@@ -1,6 +1,7 @@
1
1
  """Amazon Web Services."""
2
2
  import enum
3
3
  import fnmatch
4
+ import functools
4
5
  import hashlib
5
6
  import json
6
7
  import os
@@ -8,7 +9,10 @@ import re
8
9
  import subprocess
9
10
  import time
10
11
  import typing
11
- from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Union
12
+ from typing import (Any, Callable, Dict, Iterator, List, Literal, Optional, Set,
13
+ Tuple, TypeVar, Union)
14
+
15
+ from typing_extensions import ParamSpec
12
16
 
13
17
  from sky import catalog
14
18
  from sky import clouds
@@ -113,6 +117,37 @@ _EFA_DOCKER_RUN_OPTIONS = [
113
117
  _EFA_IMAGE_NAME = 'Deep Learning Base OSS Nvidia Driver GPU AMI' \
114
118
  ' (Ubuntu 22.04) 20250808'
115
119
 
120
+ # For functions that needs caching per AWS profile.
121
+ _AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE = 5
122
+
123
+ T = TypeVar('T')
124
+ P = ParamSpec('P')
125
+
126
+
127
+ def aws_profile_aware_lru_cache(*lru_cache_args,
128
+ scope: Literal['global', 'request'] = 'request',
129
+ **lru_cache_kwargs) -> Callable:
130
+ """Similar to annotations.lru_cache, but automatically includes the
131
+ AWS profile (if set in the workspace config) in the cache key.
132
+ """
133
+
134
+ def decorator(func: Callable[P, T]) -> Callable[P, T]:
135
+
136
+ @annotations.lru_cache(scope, *lru_cache_args, **lru_cache_kwargs)
137
+ def cached_impl(aws_profile, *args, **kwargs):
138
+ del aws_profile # Only used as part of the cache key.
139
+ return func(*args, **kwargs)
140
+
141
+ @functools.wraps(func)
142
+ def wrapper(*args, **kwargs):
143
+ aws_profile = aws.get_workspace_profile()
144
+ return cached_impl(aws_profile, *args, **kwargs)
145
+
146
+ wrapper.cache_clear = cached_impl.cache_clear # type: ignore[attr-defined]
147
+ return wrapper
148
+
149
+ return decorator
150
+
116
151
 
117
152
  def _is_efa_instance_type(instance_type: str) -> bool:
118
153
  """Check if the instance type is in EFA supported instance family."""
@@ -462,7 +497,8 @@ class AWS(clouds.Cloud):
462
497
  return image_size
463
498
 
464
499
  @classmethod
465
- @annotations.lru_cache(scope='request', maxsize=1)
500
+ @aws_profile_aware_lru_cache(scope='request',
501
+ maxsize=_AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE)
466
502
  def get_image_root_device_name(cls, image_id: str,
467
503
  region: Optional[str]) -> str:
468
504
  if image_id.startswith('skypilot:'):
@@ -788,8 +824,9 @@ class AWS(clouds.Cloud):
788
824
  return cls._check_credentials()
789
825
 
790
826
  @classmethod
791
- @annotations.lru_cache(scope='request',
792
- maxsize=1) # Cache since getting identity is slow.
827
+ # Cache since getting identity is slow.
828
+ @aws_profile_aware_lru_cache(scope='request',
829
+ maxsize=_AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE)
793
830
  def _check_credentials(cls) -> Tuple[bool, Optional[str]]:
794
831
  """Checks if the user has access credentials to AWS."""
795
832
 
@@ -924,9 +961,16 @@ class AWS(clouds.Cloud):
924
961
  return AWSIdentityType.SHARED_CREDENTIALS_FILE
925
962
 
926
963
  @classmethod
927
- @annotations.lru_cache(scope='request', maxsize=1)
964
+ @aws_profile_aware_lru_cache(scope='request',
965
+ maxsize=_AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE)
928
966
  def _aws_configure_list(cls) -> Optional[bytes]:
929
- proc = subprocess.run('aws configure list',
967
+ cmd = 'aws configure list'
968
+ # Profile takes precedence over default configs.
969
+ profile = aws.get_workspace_profile()
970
+ if profile is not None:
971
+ # If profile does not exist, we will get returncode 255.
972
+ cmd += f' --profile {profile}'
973
+ proc = subprocess.run(cmd,
930
974
  shell=True,
931
975
  check=False,
932
976
  stdout=subprocess.PIPE,
@@ -936,8 +980,9 @@ class AWS(clouds.Cloud):
936
980
  return proc.stdout
937
981
 
938
982
  @classmethod
939
- @annotations.lru_cache(scope='request',
940
- maxsize=1) # Cache since getting identity is slow.
983
+ # Cache since getting identity is slow.
984
+ @aws_profile_aware_lru_cache(scope='request',
985
+ maxsize=_AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE)
941
986
  def _sts_get_caller_identity(cls) -> Optional[List[List[str]]]:
942
987
  try:
943
988
  sts = aws.client('sts', check_credentials=False)
@@ -1018,8 +1063,9 @@ class AWS(clouds.Cloud):
1018
1063
  return [user_ids]
1019
1064
 
1020
1065
  @classmethod
1021
- @annotations.lru_cache(scope='request',
1022
- maxsize=1) # Cache since getting identity is slow.
1066
+ # Cache since getting identity is slow.
1067
+ @aws_profile_aware_lru_cache(scope='request',
1068
+ maxsize=_AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE)
1023
1069
  def get_user_identities(cls) -> Optional[List[List[str]]]:
1024
1070
  """Returns a [UserId, Account] list that uniquely identifies the user.
1025
1071
 
@@ -1114,6 +1160,7 @@ class AWS(clouds.Cloud):
1114
1160
  # provider of the cluster to be launched in this function and make sure
1115
1161
  # the cluster will not be used for launching clusters in other clouds,
1116
1162
  # e.g. jobs controller.
1163
+
1117
1164
  if self._current_identity_type(
1118
1165
  ) != AWSIdentityType.SHARED_CREDENTIALS_FILE:
1119
1166
  return {}
@@ -1123,7 +1170,8 @@ class AWS(clouds.Cloud):
1123
1170
  if os.path.exists(os.path.expanduser(f'~/.aws/{filename}'))
1124
1171
  }
1125
1172
 
1126
- @annotations.lru_cache(scope='request', maxsize=1)
1173
+ @aws_profile_aware_lru_cache(scope='request',
1174
+ maxsize=_AWS_PROFILE_SCOPED_FUNC_CACHE_SIZE)
1127
1175
  def can_credential_expire(self) -> bool:
1128
1176
  identity_type = self._current_identity_type()
1129
1177
  return (identity_type is not None and
@@ -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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-485984ca04e021d0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_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":"DabuSAKsc_y0wyJxpTIdQ","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-e38d5319cd10a3a0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_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":"8ixeA0NVQJN8HUdijid8b","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1,26 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2755],{81260:function(e,t,s){s.d(t,{Z:function(){return r}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let r=(0,s(60998).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},47603:function(e,t,s){s.d(t,{Z:function(){return r}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let r=(0,s(60998).Z)("Trash2",[["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"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},1812:function(e,t,s){s.d(t,{X:function(){return l}});var r=s(85893),n=s(67294);let a=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let t=e.message;return t.includes("failed:")&&(t=t.split("failed:")[1].trim()),t},l=e=>{let{error:t,title:s="Error",onDismiss:l}=e,[o,i]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{t&&i(!1)},[t]),!t||o)return null;let c="string"==typeof t?t:a(t);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:[s,":"]})," ",c]})})]}),(0,r.jsx)("button",{onClick:()=>{i(!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"})})})]})})}},27669:function(e,t,s){s.r(t),s.d(t,{Users:function(){return H}});var r=s(85893),n=s(67294),a=s(45697),l=s.n(a),o=s(55739),i=s(41664),c=s.n(i),u=s(11163),d=s(30803),m=s(68764),x=s(53081),h=s(23266),p=s(68969),f=s(6378),g=s(36856),b=s(51214),j=s(94545),y=s(36989),v=s(60998);/**
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 w=(0,v.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 N=s(13626),k=s(81260);/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */let C=(0,v.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"}]]),_=(0,v.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"}]]);var S=s(16826),R=s(70282),E=s(43767);/**
22
+ * @license lucide-react v0.407.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */let D=(0,v.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"}]]),I=(0,v.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 T=s(47603),L=s(27325);s(9353);var U=s(23001),F=s(66235),Z=s(37673),A=s(47145),P=s(50326),O=s(1812),M=s(47615),z=s(10546);let q=new Set(M.statusGroups.active),V=[{label:"Name",value:"name"},{label:"GPU",value:"gpu type"},{label:"Infra",value:"infra"},{label:"User ID",value:"user id"},{label:"Role",value:"role"}],B=(e,t)=>{if(!e)return 0;let s=e;if("string"==typeof e)try{let t=e.replace(/'/g,'"').replace(/None/g,"null");s=JSON.parse(t)}catch(t){return console.error("Failed to parse accelerators string:",e,t),0}if("object"==typeof s&&null!==s){let e=Object.entries(s);return 0===e.length?0:(e.length>1&&console.warn("".concat(t," has ").concat(e.length," accelerator entries:"),s),Number(e[0][1])||0)}return 0},G=(e,t)=>e&&e.includes("@")?e.split("@")[0]:e||"N/A",J=(e,t)=>e&&e.includes("@")?e:t||"-",K=b.nb.REFRESH_INTERVAL,$=e=>{let{message:t,onDismiss:s}=e;return t?(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:t})})]}),s&&(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:s,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 H(){let e=(0,u.useRouter)(),{userEmail:t}=(0,F.Ap)(),[s,a]=(0,n.useState)(!1),l=(0,n.useRef)(null),i=(0,U.X)(),[c,m]=(0,n.useState)(!1),[g,b]=(0,n.useState)({username:"",password:"",role:"user"}),[j,y]=(0,n.useState)(!1),[v,R]=(0,n.useState)({open:!1,message:"",userName:""}),[E,D]=(0,n.useState)(null),[I,T]=(0,n.useState)(!1),[L,Z]=(0,n.useState)(!1),[M,q]=(0,n.useState)(!1),[B,G]=(0,n.useState)(null),[J,H]=(0,n.useState)(!1),[Q,Y]=(0,n.useState)(null),[ee,et]=(0,n.useState)("import"),[es,er]=(0,n.useState)(!1),[en,ea]=(0,n.useState)(null),[el,eo]=(0,n.useState)(""),[ei,ec]=(0,n.useState)(!1),[eu,ed]=(0,n.useState)(null),[em,ex]=(0,n.useState)(!1),[eh,ep]=(0,n.useState)(null),[ef,eg]=(0,n.useState)(null),[eb,ej]=(0,n.useState)(!1),[ey,ev]=(0,n.useState)(null),[ew,eN]=(0,n.useState)(null),[ek,eC]=(0,n.useState)(void 0),[e_,eS]=(0,n.useState)(void 0),[eR,eE]=(0,n.useState)(!0),[eD,eI]=(0,n.useState)("users"),[eT,eL]=(0,n.useState)(!1),[eU,eF]=(0,n.useState)(!1),[eZ,eA]=(0,n.useState)(null),[eP,eO]=(0,n.useState)(!1),[eM,ez]=(0,n.useState)(""),[eq,eV]=(0,n.useState)(""),[eB,eG]=(0,n.useState)([]),[eJ,eK]=(0,n.useState)({name:[],"user id":[],role:[],"gpu type":[],infra:[]}),[e$,eH]=(0,n.useState)(()=>{if(e.isReady){let t=e.query.deduplicate;if(void 0!==t)return"true"===t}return!0});(0,n.useEffect)(()=>{if(e.isReady){let s=e.query.deduplicate;if(void 0===s)eW(!t);else{let e="true"===s;e$!==e&&eH(e)}}},[e.isReady,e.query.deduplicate,t]);let eW=t=>{let s={...e.query};s.deduplicate=t.toString(),e.replace({pathname:e.pathname,query:s},void 0,{shallow:!0})},eX=t=>{(0,z.eG)(e,t)},eQ=new Map([["name","Name"],["user id","User ID"],["role","Role"],["gpu type","GPU"],["infra","Infra"]]);(0,n.useEffect)(()=>{if(e.isReady&&"users"===eD){let t=(0,z.Fu)(e,eQ);t.length>0&&eG(t)}},[e.isReady,eD]),(0,n.useEffect)(()=>{e.isReady&&("service-accounts"===e.query.tab&&e_?eI("service-accounts"):eI("users"))},[e.isReady,e.query.tab,e_]),(0,n.useEffect)(()=>{(async function(){eE(!0);try{let e=await A.x.get("/api/health");if(e.ok){let t=await e.json();eC(!!t.basic_auth_enabled),eS(!!t.service_account_token_enabled)}else eC(!1),eS(!1)}catch(e){eC(!1),eS(!1)}finally{eE(!1)}})()},[]);let eY=(0,n.useCallback)(async()=>{if(E&&Date.now()-E.timestamp<3e5)return E;T(!0);try{let e=await A.x.get("/users/role");if(!e.ok){let t=await e.json();throw Error(t.detail||"Failed to get user role")}let t=await e.json(),s={role:t.role,name:t.name,id:t.id,timestamp:Date.now()};return D(s),T(!1),s}catch(e){throw T(!1),e}},[E]);(0,n.useEffect)(()=>{eY().catch(()=>{console.error("Failed to get user role")})},[eY]);let e0=async(e,t)=>{try{let s=await eY();if("admin"!==s.role)return R({open:!0,message:e,userName:s.name.toLowerCase()}),!1;return t(),!0}catch(e){return console.error("Failed to check user role:",e),R({open:!0,message:"Error: ".concat(e.message),userName:""}),!1}},e1=()=>{f.default.invalidate(x.R),f.default.invalidate(h.getClusters),f.default.invalidate(p.getManagedJobs,[{allUsers:!0,skipFinished:!0,fields:["user_hash","status"]}]),l.current&&l.current()},e2=async()=>{if(!g.username||!g.password){eN(Error("Username and password are required.")),m(!1);return}y(!0),eN(null),ev(null);try{let e=await A.x.post("/users/create",g);if(!e.ok){let t=await e.json();throw Error(t.detail||"Failed to create user")}ev('User "'.concat(g.username,'" created successfully!')),m(!1),b({username:"",password:"",role:"user"}),e1()}catch(e){eN(e),m(!1),b({username:"",password:"",role:"user"})}finally{y(!1)}},e4=async e=>{let t=e.target.files[0];t&&(G(t),Y(null))},e3=async()=>{if(!B){alert("Please select a CSV file first.");return}H(!0);try{let e=new FileReader;e.onload=async e=>{try{let t=e.target.result,s=await A.x.post("/users/import",{csv_content:t});if(!s.ok){let e=await s.json();throw Error(e.detail||"Failed to import users")}let r=await s.json(),n="Import completed. ".concat(r.success_count," users created successfully.");r.error_count>0&&(n+="\n".concat(r.error_count," failed."),r.creation_errors.length>0&&(n+="\nErrors: ".concat(r.creation_errors.slice(0,3).join(", ")),r.creation_errors.length>3&&(n+=" and ".concat(r.creation_errors.length-3," more...")))),Y({message:n}),r.success_count>0&&e1()}catch(e){alert("Error importing users: ".concat(e.message))}finally{H(!1)}},e.readAsText(B)}catch(e){alert("Error reading file: ".concat(e.message)),H(!1)}},e5=async e=>{ea(e),eo(""),er(!0)},e6=async()=>{if(!el){eN(Error("Please enter a new password."));return}ec(!0),ed(null);try{let e=await A.x.post("/users/update",{user_id:en.userId,password:el});if(!e.ok){let t=await e.json();throw Error(t.detail||"Failed to reset password")}ev('Password reset successfully for user "'.concat(en.usernameDisplay,'"!')),er(!1),ea(null),eo("")}catch(e){er(!1),ea(null),eo(""),ed(null),eN(e)}finally{ec(!1)}},e7=async()=>{if(eh){ej(!0),eg(null);try{let e=await A.x.post("/users/delete",{user_id:eh.userId});if(!e.ok){let t=await e.json();throw Error(t.detail||"Failed to delete user")}ev('User "'.concat(eh.usernameDisplay,'" deleted successfully!')),ex(!1),ep(null),e1()}catch(e){ex(!1),ep(null),eg(null),eN(e)}finally{ej(!1)}}},e8=()=>{ex(!1),ep(null)},e9=()=>{er(!1),ea(null),eo("")};return eR?(0,r.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,r.jsx)(o.Z,{}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)("button",{className:e_?"leading-none mr-6 pb-2 px-2 border-b-2 ".concat("users"===eD?"text-sky-blue border-sky-500":"text-gray-500 hover:text-gray-700 border-transparent"):"leading-none mr-6 pb-2 px-2",onClick:()=>{eI("users"),e.push("/users",void 0,{shallow:!0})},children:"Users"}),e_&&(0,r.jsx)("button",{className:"leading-none pb-2 px-2 border-b-2 ".concat("service-accounts"===eD?"text-sky-blue border-sky-500":"text-gray-500 hover:text-gray-700 border-transparent"),onClick:()=>{eI("service-accounts"),e.push("/users?tab=service-accounts",void 0,{shallow:!0})},children:"Service Accounts"})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[s&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(o.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),"users"===eD&&ek&&(null==E?void 0:E.role)==="admin"&&(0,r.jsx)("button",{onClick:async()=>{await e0("cannot create users",()=>{m(!0)})},className:"text-sky-blue hover:text-sky-blue-bright flex items-center rounded px-2 py-1 mr-2",title:"Create New User",children:"+ New User"}),"users"===eD&&ek&&(null==E?void 0:E.role)==="admin"&&(0,r.jsxs)("button",{onClick:async()=>{await e0("cannot import users",()=>{q(!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)(w,{className:"h-4 w-4 mr-1"}),"Import/Export"]}),(0,r.jsxs)("button",{onClick:e1,disabled:s,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(N.Z,{className:"h-4 w-4 mr-1.5"}),!i&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:["users"===eD?(0,r.jsx)("div",{className:"w-full sm:w-auto max-w-md",children:(0,r.jsx)(z.ML,{propertyList:V,valueList:eJ,setFilters:eG,updateURLParams:eX,placeholder:"Filter users"})}):(0,r.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,r.jsx)("input",{type:"text",placeholder:"Search by service account name, or created by",value:eq,onChange:e=>{eV(e.target.value)},className:"h-8 w-full px-3 pr-8 text-sm border border-gray-300 rounded-md focus:ring-1 focus:ring-sky-500 focus:border-sky-500 outline-none"}),eq&&(0,r.jsx)("button",{onClick:()=>{eV("")},className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear search",children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),"users"===eD&&!t&&(0,r.jsxs)("label",{className:"flex items-center cursor-pointer ml-4",children:[(0,r.jsx)("input",{type:"checkbox",checked:e$,onChange:e=>{let t=e.target.checked;eH(t),eW(t)},className:"sr-only"}),(0,r.jsx)("div",{className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors ".concat(e$?"bg-sky-600":"bg-gray-300"),children:(0,r.jsx)("span",{className:"inline-block h-3 w-3 transform rounded-full bg-white transition-transform ".concat(e$?"translate-x-5":"translate-x-1")})}),(0,r.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Deduplicate users"})]}),"service-accounts"===eD&&e_&&(0,r.jsxs)("button",{onClick:()=>{e0("cannot create service account tokens",()=>{eL(!0)})},className:"ml-4 bg-sky-600 hover:bg-sky-700 text-white flex items-center rounded-md px-3 py-1 text-sm font-medium transition-colors duration-200",title:"Create Service Account",children:[(0,r.jsx)(k.Z,{className:"h-4 w-4 mr-2"}),"Create Service Account"]})]}),"users"===eD&&(0,r.jsx)(z.x$,{filters:eB,setFilters:eG,updateURLParams:eX}),(0,r.jsxs)("div",{className:"fixed top-20 right-4 z-[9999] max-w-md",children:[(0,r.jsx)($,{message:ey,onDismiss:()=>ev(null)}),(0,r.jsx)(O.X,{error:ew,title:"Error",onDismiss:()=>eN(null)})]}),"users"===eD?(0,r.jsx)(W,{refreshInterval:K,setLoading:a,refreshDataRef:l,checkPermissionAndAct:e0,roleLoading:I,onResetPassword:e5,onDeleteUser:e=>{e0("cannot delete users",()=>{ep(e),ex(!0)})},basicAuthEnabled:ek,currentUserRole:null==E?void 0:E.role,currentUserId:null==E?void 0:E.id,filters:eB,setValueList:eK,deduplicateUsers:e$}):e_&&(0,r.jsx)(X,{checkPermissionAndAct:e0,userRoleCache:E,setCreateSuccess:ev,setCreateError:eN,showCreateDialog:eT,setShowCreateDialog:eL,showRotateDialog:eU,setShowRotateDialog:eF,tokenToRotate:eZ,setTokenToRotate:eA,rotating:eP,setRotating:eO,searchQuery:eq,setSearchQuery:eV}),(0,r.jsx)(P.Vq,{open:c,onOpenChange:e=>{m(e),e||eN(null)},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-md",children:[(0,r.jsx)(P.fK,{children:(0,r.jsx)(P.$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:g.username,onChange:e=>b({...g,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:L?"text":"password",value:g.password,onChange:e=>b({...g,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:()=>Z(!L),children:L?(0,r.jsx)(C,{className:"h-4 w-4"}):(0,r.jsx)(_,{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:g.role,onChange:e=>b({...g,role:e.target.value}),children:[(0,r.jsx)("option",{value:"user",children:"User"}),(0,r.jsx)("option",{value:"admin",children:"Admin"})]})]})]}),(0,r.jsxs)(P.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:()=>m(!1),disabled:j,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:e2,disabled:j,children:j?"Creating...":"Create"})]})]})}),(0,r.jsx)(P.Vq,{open:v.open,onOpenChange:e=>{R(t=>({...t,open:e})),e||eN(null)},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-md transition-all duration-200 ease-in-out",children:[(0,r.jsxs)(P.fK,{children:[(0,r.jsx)(P.$N,{children:"Permission Denied"}),(0,r.jsx)(P.Be,{children:I?(0,r.jsxs)("div",{className:"flex items-center py-2",children:[(0,r.jsx)(o.Z,{size:16,className:"mr-2"}),(0,r.jsx)("span",{children:"Checking permissions..."})]}):(0,r.jsx)(r.Fragment,{children:v.userName?(0,r.jsxs)(r.Fragment,{children:[v.userName," is logged in as non-admin and ",v.message,"."]}):v.message})})]}),(0,r.jsx)(P.cN,{children:(0,r.jsx)(d.z,{variant:"outline",onClick:()=>R(e=>({...e,open:!1})),disabled:I,children:"OK"})})]})}),(0,r.jsx)(P.Vq,{open:M,onOpenChange:e=>{q(e),e||eN(null)},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-lg",children:[(0,r.jsx)(P.fK,{children:(0,r.jsx)(P.$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"===ee?"border-b-2 border-sky-500 text-sky-600":"text-gray-500 hover:text-gray-700"),onClick:()=>et("import"),children:"Import"}),(0,r.jsx)("button",{className:"px-4 py-2 text-sm font-medium ".concat("export"===ee?"border-b-2 border-sky-500 text-sky-600":"text-gray-500 hover:text-gray-700"),onClick:()=>et("export"),children:"Export"})]}),(0,r.jsx)("div",{className:"flex flex-col gap-4 py-4",children:"import"===ee?(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:e4,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."]})]}),Q&&(0,r.jsx)("div",{className:"p-3 bg-green-50 border border-green-200 rounded text-green-700 text-sm",children:Q.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)(P.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:()=>q(!1),disabled:J,children:"Cancel"}),"import"===ee?(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:e3,disabled:J||!B,children:J?"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 A.x.get("/users/export");if(!e.ok){let t=await e.json();throw Error(t.detail||"Failed to export users")}let t=await e.json(),s=t.csv_content,r=new Blob([s],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(r),a=document.createElement("a");a.href=n;let l=new Date,o=e=>String(e).padStart(2,"0"),i=l.getFullYear(),c=o(l.getMonth()+1),u=o(l.getDate()),d=o(l.getHours()),m=o(l.getMinutes()),x=o(l.getSeconds());a.download="users_export_".concat(i,"-").concat(c,"-").concat(u,"-").concat(d,"-").concat(m,"-").concat(x,".csv"),a.click(),URL.revokeObjectURL(n),alert("Successfully exported ".concat(t.user_count," users to CSV file."))}catch(e){alert("Error exporting users: ".concat(e.message))}},children:[(0,r.jsx)(S.Z,{className:"h-4 w-4 mr-1"}),"Export"]})]})]})}),(0,r.jsx)(P.Vq,{open:es,onOpenChange:e=>{e||(e9(),eN(null))},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(P.fK,{children:[(0,r.jsx)(P.$N,{children:"Reset Password"}),(0,r.jsxs)(P.Be,{children:["Enter a new password for"," ",(null==en?void 0:en.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:el,onChange:e=>eo(e.target.value),autoFocus:!0})]})}),(0,r.jsxs)(P.cN,{children:[(0,r.jsx)(d.z,{variant:"outline",onClick:e9,disabled:ei,children:"Cancel"}),(0,r.jsx)(d.z,{variant:"default",onClick:e6,disabled:ei||!el,className:"bg-sky-600 text-white hover:bg-sky-700",children:ei?"Resetting...":"Reset Password"})]})]})}),(0,r.jsx)(P.Vq,{open:em,onOpenChange:e=>{e||(e8(),eN(null))},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(P.fK,{children:[(0,r.jsx)(P.$N,{children:"Delete User"}),(0,r.jsxs)(P.Be,{children:['Are you sure you want to delete user "',(null==eh?void 0:eh.usernameDisplay)||"this user",'"? This action cannot be undone.']})]}),(0,r.jsxs)(P.cN,{children:[(0,r.jsx)(d.z,{variant:"outline",onClick:e8,disabled:eb,children:"Cancel"}),(0,r.jsx)(d.z,{variant:"destructive",onClick:e7,disabled:eb,children:eb?"Deleting...":"Delete"})]})]})})]})}function W(e){let{refreshInterval:t,setLoading:s,refreshDataRef:a,checkPermissionAndAct:l,roleLoading:i,onResetPassword:u,onDeleteUser:d,basicAuthEnabled:b,currentUserRole:v,currentUserId:w,filters:N,setValueList:k,deduplicateUsers:C}=e,[_,S]=(0,n.useState)([]),[L,U]=(0,n.useState)(!0),[F,P]=(0,n.useState)(!1),[O,M]=(0,n.useState)({key:"username",direction:"ascending"}),[V,K]=(0,n.useState)(null),[$,H]=(0,n.useState)(""),[W,X]=(0,n.useState)({}),[Q,Y]=(0,n.useState)(!1),ee=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];s&&e&&s(!0),e&&U(!0),Y(!1);try{let t=await f.default.get(x.R),r=(t||[]).map(e=>({...e,usernameDisplay:G(e.username,e.userId),fullEmailID:J(e.username,e.userId),clusterCount:-1,jobCount:-1,gpuCount:-1}));S(r),P(!0),s&&e&&s(!1),e&&U(!1);let[n,a]=await Promise.all([f.default.get(h.getClusters),f.default.get(p.getManagedJobs,[{allUsers:!0,skipFinished:!0,fields:["user_hash","status","accelerators","job_name","job_id","infra"]}])]),l=a.jobs||[],o={},i=e=>{if(!e)return null;let t=e;if("string"==typeof e)try{let s=e.replace(/'/g,'"').replace(/None/g,"null");t=JSON.parse(s)}catch(e){return null}if("object"==typeof t&&null!==t){let e=Object.entries(t);if(e.length>0)return e[0][0]}return null},c=(e,t,s,r,n,a)=>{e&&t&&(o[e]||(o[e]={}),o[e][t]||(o[e][t]={}),o[e].Total||(o[e].Total={}),o[e][t].Total||(o[e][t].Total={clusterCount:0,jobCount:0,gpuCount:0}),o[e][t].Total.clusterCount+=r,o[e][t].Total.jobCount+=n,o[e][t].Total.gpuCount+=a,s&&(o[e][t][s]||(o[e][t][s]={clusterCount:0,jobCount:0,gpuCount:0}),o[e][t][s].clusterCount+=r,o[e][t][s].jobCount+=n,o[e][t][s].gpuCount+=a,o[e].Total[s]||(o[e].Total[s]={clusterCount:0,jobCount:0,gpuCount:0}),o[e].Total[s].clusterCount+=r,o[e].Total[s].jobCount+=n,o[e].Total[s].gpuCount+=a))};for(let e of n||[]){let t=e.user_hash;if(!t)continue;let s=i(e.gpus),r=e.infra,n=0;if("STOPPED"!==e.status&&"TERMINATED"!==e.status){let t=B(e.gpus,"Cluster ".concat(e.cluster)),s=e.num_nodes||1;n=t*s}c(t,r,s,1,0,n)}let u=e=>{if(!e||"string"!=typeof e)return 1;let t=e.match(/^(\d+)x/);return t?parseInt(t[1],10):1};for(let e of l||[]){if(!q.has(e.status))continue;let t=e.user_hash;if(!t)continue;let s=i(e.accelerators),r=e.infra,n=B(e.accelerators,"Job ".concat(e.job_id)),a=u(e.resources_str_full),l=n*a;c(t,r,s,0,1,l)}X(o),Y(!0);let d=(t||[]).map(e=>{let t=0,s=0,r=0,a=0;for(let r of n||[])if(r.user_hash===e.userId&&(t++,"STOPPED"!==r.status&&"TERMINATED"!==r.status)){let e=B(r.gpus,"Cluster ".concat(r.cluster)),t=r.num_nodes||1;s+=e*t}for(let t of l||[])if(t.user_hash===e.userId&&q.has(t.status)){r++;let e=B(t.accelerators,"Job ".concat(t.job_id)),s=u(t.resources_str_full);a+=e*s}return{...e,usernameDisplay:G(e.username,e.userId),fullEmailID:J(e.username,e.userId),clusterCount:t,jobCount:r,gpuCount:s+a}}),m=new Set,g=new Set;for(let e of Object.values(o)){for(let t of Object.keys(e))"Total"!==t&&m.add(t);if(e.Total)for(let t of Object.keys(e.Total))g.add(t)}let b=new Set,j=new Set,y=new Set;d.forEach(e=>{e.usernameDisplay&&b.add(e.usernameDisplay),e.userId&&j.add(e.userId),e.role&&y.add(e.role)}),k({name:Array.from(b).sort(),"user id":Array.from(j).sort(),role:Array.from(y).sort(),"gpu type":Array.from(g).sort(),infra:Array.from(m).sort()}),S(d)}catch(t){console.error("Failed to fetch or process user data:",t),S([]),P(!0),s&&e&&s(!1),e&&U(!1)}},[s]);(0,n.useEffect)(()=>{a&&(a.current=()=>ee(!0))},[a,ee]),(0,n.useEffect)(()=>{(async()=>{P(!1),U(!0),await g.ZP.preloadForPage("users"),ee(!0)})();let e=setInterval(()=>{"visible"===window.document.visibilityState&&ee(!1)},t);return()=>clearInterval(e)},[ee,t]);let et=(0,n.useMemo)(()=>{let e=_,t=N.filter(e=>"GPU"!==e.property&&"Infra"!==e.property),s=N.filter(e=>"GPU"===e.property),r=N.filter(e=>"Infra"===e.property);t.length>0&&(e=(0,z.cm)(_.map(e=>({...e,name:e.usernameDisplay,"user id":e.userId})),t));let n=(e,t,s)=>{let r=0,n=0,a=0,l=W[e];if(!l)return{clusterCount:0,jobCount:0,gpuCount:0};let o=t.map(e=>e.toLowerCase()),i=s.map(e=>e.toLowerCase()),c=o.length>0,u=i.length>0;if(c&&u){for(let e of i)for(let[t,s]of Object.entries(l))if("Total"!==t&&t.toLowerCase()===e)for(let e of o)for(let[t,l]of Object.entries(s))"Total"!==t&&t.toLowerCase()===e&&(r+=l.clusterCount,n+=l.jobCount,a+=l.gpuCount)}else if(u){for(let e of i)for(let[t,s]of Object.entries(l))if("Total"!==t&&t.toLowerCase()===e&&s.Total){let e=s.Total;r+=e.clusterCount,n+=e.jobCount,a+=e.gpuCount}}else if(c&&l.Total)for(let e of o)for(let[t,s]of Object.entries(l.Total))t.toLowerCase()===e&&(r+=s.clusterCount,n+=s.jobCount,a+=s.gpuCount);return{clusterCount:r,jobCount:n,gpuCount:a}},a=s.length>0,l=r.length>0;if(a||l){let t=s.map(e=>e.value).filter(Boolean),o=r.map(e=>e.value).filter(Boolean),i=t.map(e=>e.toLowerCase()),c=o.map(e=>e.toLowerCase());e=(e=e.filter(e=>{let t=W[e.userId];if(!t)return!1;if(a&&l){for(let e of c)for(let[s,r]of Object.entries(t))if("Total"!==s&&s.toLowerCase()===e){for(let e of i)for(let t of Object.keys(r))if("Total"!==t&&t.toLowerCase()===e)return!0}}else if(l){for(let e of c)for(let s of Object.keys(t))if("Total"!==s&&s.toLowerCase()===e)return!0}else if(a&&t.Total){for(let e of i)for(let s of Object.keys(t.Total))if(s.toLowerCase()===e)return!0}return!1})).map(e=>{let s=n(e.userId,t,o);return{...e,clusterCount:s.clusterCount,jobCount:s.jobCount,gpuCount:s.gpuCount}})}if(C){let t={};e.forEach(e=>{let s=e.usernameDisplay;t[s]?(t[s].userIds.push(e.userId),-1!==e.clusterCount&&(-1===t[s].clusterCount?t[s].clusterCount=e.clusterCount:t[s].clusterCount+=e.clusterCount),-1!==e.jobCount&&(-1===t[s].jobCount?t[s].jobCount=e.jobCount:t[s].jobCount+=e.jobCount),-1!==e.gpuCount&&(-1===t[s].gpuCount?t[s].gpuCount=e.gpuCount:t[s].gpuCount+=e.gpuCount),e.created_at&&(!t[s].created_at||e.created_at<t[s].created_at)&&(t[s].created_at=e.created_at)):t[s]={...e,userIds:[e.userId],clusterCount:e.clusterCount,jobCount:e.jobCount,gpuCount:e.gpuCount,created_at:e.created_at}}),e=Object.values(t)}return(0,j.R0)(e,O.key,O.direction)},[_,O,N,C,W]),es=e=>{let t="ascending";O.key===e&&"ascending"===O.direction&&(t="descending"),M({key:e,direction:t})},er=e=>O.key===e?"ascending"===O.direction?" ↑":" ↓":"",en=async(e,t)=>{await l("cannot edit user role",()=>{K(e),H(t)})},ea=()=>{K(null),H("")},el=async e=>{if(!e||!$){console.error("User ID or role is missing."),alert("Error: User ID or role is missing.");return}U(!0);try{let t=await A.x.post("/users/update",{user_id:e,role:$});if(!t.ok){let e=await t.json();throw Error(e.detail||"Failed to update role")}f.default.invalidate(x.R),await ee(!0),ea()}catch(e){console.error("Failed to update user role:",e),alert("Error updating role: ".concat(e.message))}finally{U(!1)}};return L&&0===_.length&&!F?(0,r.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,r.jsx)(o.Z,{})}):F?N.some(e=>"GPU"===e.property||"Infra"===e.property)&&!Q?(0,r.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,r.jsx)(o.Z,{}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading filtered data..."})]}):et&&0!==et.length?(0,r.jsx)(Z.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(m.iA,{className:"min-w-full",children:[(0,r.jsx)(m.xD,{children:(0,r.jsxs)(m.SC,{children:[(0,r.jsxs)(m.ss,{onClick:()=>es("usernameDisplay"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["Name",er("usernameDisplay")]}),!C&&(0,r.jsxs)(m.ss,{onClick:()=>es("fullEmailID"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["User ID",er("fullEmailID")]}),!C&&(0,r.jsxs)(m.ss,{onClick:()=>es("role"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["Role",er("role")]}),(0,r.jsxs)(m.ss,{onClick:()=>es("created_at"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["Joined",er("created_at")]}),(0,r.jsxs)(m.ss,{onClick:()=>es("gpuCount"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["GPUs",er("gpuCount")]}),(0,r.jsxs)(m.ss,{onClick:()=>es("clusterCount"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["Clusters",er("clusterCount")]}),(0,r.jsxs)(m.ss,{onClick:()=>es("jobCount"),className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50 w-1/6",children:["Jobs",er("jobCount")]}),!C&&(b||"admin"===v)&&(0,r.jsx)(m.ss,{className:"whitespace-nowrap w-1/7",children:"Actions"})]})}),(0,r.jsx)(m.RM,{children:et.map(e=>(0,r.jsxs)(m.SC,{children:[(0,r.jsx)(m.pj,{className:"truncate",title:e.username,children:e.usernameDisplay}),!C&&(0,r.jsx)(m.pj,{className:"truncate",title:e.fullEmailID,children:e.fullEmailID}),!C&&(0,r.jsx)(m.pj,{className:"truncate",title:e.role,children:(0,r.jsx)("div",{className:"flex items-center gap-2",children:V===e.userId?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("select",{value:$,onChange:e=>H(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:()=>el(e.userId),className:"text-green-600 hover:text-green-800 p-1",title:"Save",children:(0,r.jsx)(R.Z,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:ea,className:"text-gray-500 hover:text-gray-700 p-1",title:"Cancel",children:(0,r.jsx)(E.Z,{className:"h-4 w-4"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"capitalize",children:e.role}),"admin"===v&&(0,r.jsx)("button",{onClick:()=>en(e.userId,e.role),className:"text-blue-600 hover:text-blue-700 p-1",title:"Edit role",children:(0,r.jsx)(D,{className:"h-3 w-3"})})]})})}),(0,r.jsx)(m.pj,{className:"truncate",children:e.created_at?(0,r.jsx)(y.Zg,{date:new Date(1e3*e.created_at)}):"-"}),(0,r.jsx)(m.pj,{children:-1===e.gpuCount?(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)(o.Z,{size:10,className:"mr-1"}),"Loading..."]}):(0,r.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium ".concat(e.gpuCount>0?"bg-purple-100 text-purple-600":"bg-gray-100 text-gray-500"),title:"Total GPUs: ".concat(e.gpuCount),children:e.gpuCount})}),(0,r.jsx)(m.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)(o.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-600 hover:bg-blue-200 hover:text-blue-700":"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)(m.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)(o.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-600 hover:bg-green-200 hover:text-green-700":"bg-gray-100 text-gray-500 hover:bg-gray-200 hover:text-gray-700"),title:"View ".concat(e.jobCount," active job").concat(1!==e.jobCount?"s":""," for ").concat(e.usernameDisplay),children:e.jobCount})}),!C&&(b||"admin"===v)&&(0,r.jsx)(m.pj,{className:"relative",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[b&&(0,r.jsx)("button",{onClick:"admin"===v||e.userId===w?async()=>{u(e)}:void 0,className:"admin"===v||e.userId===w?"text-blue-600 hover:text-blue-700 p-1":"text-gray-300 cursor-not-allowed p-1",title:"admin"===v||e.userId===w?"Reset Password":"You can only reset your own password",disabled:"admin"!==v&&e.userId!==w,children:(0,r.jsx)(I,{className:"h-4 w-4"})}),"admin"===v&&(0,r.jsx)("button",{onClick:()=>d(e),className:"text-red-600 hover:text-red-700 p-1",title:"Delete User",children:(0,r.jsx)(T.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:N.length>0?"No users match your filters.":"No users found."}),(0,r.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:N.length>0?"Try adjusting your filter criteria.":"There are currently no users to display."})]}):(0,r.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,r.jsx)(o.Z,{}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading users..."})]})}function X(e){let{checkPermissionAndAct:t,userRoleCache:s,setCreateSuccess:a,setCreateError:l,showCreateDialog:i,setShowCreateDialog:u,showRotateDialog:d,setShowRotateDialog:x,tokenToRotate:g,setTokenToRotate:b,rotating:j,setRotating:v,searchQuery:w,setSearchQuery:k}=e,[C,_]=(0,n.useState)([]),[S,U]=(0,n.useState)(!0),[F,O]=(0,n.useState)(!1),[M,z]=(0,n.useState)(null),[V,G]=(0,n.useState)(null),[J,K]=(0,n.useState)({token_name:"",expires_in_days:30}),[$,H]=(0,n.useState)(""),[W,X]=(0,n.useState)(!1),[Q,Y]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(""),[es,er]=(0,n.useState)(null),[en,ea]=(0,n.useState)(null),[el,eo]=(0,n.useState)(null),[ei,ec]=(0,n.useState)(""),[eu,ed]=(0,n.useState)([]),em=async()=>{try{U(!0);let e=await A.x.get("/users/service-account-tokens");if(!e.ok){console.error("Failed to fetch tokens"),_([]),ed([]);return}let t=await e.json();_(t||[]);let[s,r]=await Promise.all([f.default.get(h.getClusters),f.default.get(p.getManagedJobs,[{allUsers:!0,skipFinished:!0,fields:["user_hash","status","accelerators","job_id","infra"]}])]),n=s||[],a=(null==r?void 0:r.jobs)||[],l=(t||[]).map(e=>{let t=e.service_account_user_id,s=0,r=0,l=0,o=0;for(let e of n)e.user_hash===t&&(s++,"STOPPED"!==e.status&&"TERMINATED"!==e.status&&(r+=B(e.gpus,"Cluster ".concat(e.cluster))));for(let e of a)e.user_hash===t&&q.has(e.status)&&(l++,o+=B(e.accelerators,"Job ".concat(e.job_name||e.job_id)));return{...e,clusterCount:s,jobCount:l,gpuCount:r+o,primaryRole:e.service_account_roles&&e.service_account_roles.length>0?e.service_account_roles[0]:"user"}});ed(l)}catch(e){console.error("Error fetching tokens and counts:",e),_([]),ed([])}finally{U(!1)}};(0,n.useEffect)(()=>{em()},[]);let ex=async(e,s)=>{await t("cannot edit service account role",()=>{eo(e),ec(s)})},eh=()=>{eo(null),ec("")},ep=async e=>{if(!e||!ei){console.error("Token ID or role is missing."),l(Error("Token ID or role is missing."));return}U(!0);try{let t=await A.x.post("/users/service-account-tokens/update-role",{token_id:e,role:ei});if(!t.ok){let e=await t.json();throw Error(e.detail||"Failed to update role")}a("Service account role updated successfully!"),await em(),eh()}catch(e){console.error("Failed to update service account role:",e),l(e)}finally{U(!1)}},ef=async e=>{try{await navigator.clipboard.writeText(e),et("Copied!"),setTimeout(()=>et(""),2e3)}catch(e){console.error("Failed to copy:",e)}},eg=async()=>{if(!J.token_name.trim()){l(Error("Token name is required"));return}X(!0);try{let e={token_name:J.token_name.trim(),expires_in_days:""===J.expires_in_days?null:J.expires_in_days},t=await A.x.post("/users/service-account-tokens",e);if(t.ok){let e=await t.json();er(e.token),K({token_name:"",expires_in_days:30}),await em()}else{let e=await t.json();throw Error(e.detail||"Failed to create token")}}catch(e){l(e)}finally{X(!1)}},eb=async()=>{if(M){Y(!0),G(null);try{let e=await A.x.post("/users/service-account-tokens/delete",{token_id:M.token_id});if(e.ok)a('Service account "'.concat(M.token_name,'" deleted successfully!')),O(!1),z(null),G(null),await em();else{let t=await e.json();throw Error(t.detail||"Failed to delete service account")}}catch(e){O(!1),z(null),G(null),l(e)}finally{Y(!1)}}},ej=async()=>{if(g){v(!0);try{let e={token_id:g.token_id,expires_in_days:""===$?null:parseInt($)},t=await A.x.post("/users/service-account-tokens/rotate",e);if(t.ok){let e=await t.json();ea(e.token),await em()}else{let e=await t.json();throw Error(e.detail||"Failed to rotate token")}}catch(e){l(e)}finally{v(!1)}}},ey=eu.filter(e=>{var t,s,r,n;if(!(null==w?void 0:w.trim()))return!0;let a=w.toLowerCase();return(null===(t=e.token_name)||void 0===t?void 0:t.toLowerCase().includes(a))||(null===(s=e.creator_name)||void 0===s?void 0:s.toLowerCase().includes(a))||(null===(r=e.service_account_name)||void 0===r?void 0:r.toLowerCase().includes(a))||(null===(n=e.primaryRole)||void 0===n?void 0:n.toLowerCase().includes(a))});return S&&0===eu.length?(0,r.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,r.jsx)(o.Z,{size:32}),(0,r.jsx)("span",{className:"ml-3",children:"Loading tokens..."})]}):(0,r.jsxs)(r.Fragment,{children:[0===ey.length?(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)(I,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,r.jsx)("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:(null==w?void 0:w.trim())?"No tokens match your search":"No service accounts"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:(null==w?void 0:w.trim())?"Try adjusting your search terms.":"No service accounts have been created yet."})]}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Z.Zb,{children:(0,r.jsxs)(m.iA,{children:[(0,r.jsx)(m.xD,{children:(0,r.jsxs)(m.SC,{children:[(0,r.jsx)(m.ss,{children:"Name"}),(0,r.jsx)(m.ss,{children:"Created by"}),(0,r.jsx)(m.ss,{children:"Role"}),(0,r.jsx)(m.ss,{children:"Clusters"}),(0,r.jsx)(m.ss,{children:"Jobs"}),(0,r.jsx)(m.ss,{children:"GPUs"}),(0,r.jsx)(m.ss,{children:"Created"}),(0,r.jsx)(m.ss,{children:"Last used"}),(0,r.jsx)(m.ss,{children:"Expires"}),(0,r.jsx)(m.ss,{children:"Actions"})]})}),(0,r.jsx)(m.RM,{children:ey.map(e=>(0,r.jsxs)(m.SC,{children:[(0,r.jsx)(m.pj,{className:"truncate",title:e.token_name,children:e.token_name}),(0,r.jsx)(m.pj,{className:"truncate",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{children:e.creator_name||"Unknown"}),e.creator_user_hash!==(null==s?void 0:s.id)&&(0,r.jsx)("span",{className:"ml-2 px-1.5 py-0.5 text-xs bg-gray-100 text-gray-600 rounded",children:"Other"})]})}),(0,r.jsx)(m.pj,{className:"truncate",children:(0,r.jsx)("div",{className:"flex items-center gap-2",children:el===e.token_id?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("select",{value:ei,onChange:e=>ec(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:()=>ep(e.token_id),className:"text-green-600 hover:text-green-800 p-1",title:"Save",children:(0,r.jsx)(R.Z,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:eh,className:"text-gray-500 hover:text-gray-700 p-1",title:"Cancel",children:(0,r.jsx)(E.Z,{className:"h-4 w-4"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"capitalize",children:e.primaryRole}),((null==s?void 0:s.role)==="admin"||e.creator_user_hash===(null==s?void 0:s.id))&&(0,r.jsx)("button",{onClick:()=>ex(e.token_id,e.primaryRole),className:"text-blue-600 hover:text-blue-700 p-1",title:"Edit role",children:(0,r.jsx)(D,{className:"h-3 w-3"})})]})})}),(0,r.jsx)(m.pj,{children:(0,r.jsx)(c(),{href:"/clusters?user=".concat(encodeURIComponent(e.service_account_user_id)),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-600 hover:bg-blue-200 hover:text-blue-700":"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.token_name),children:e.clusterCount})}),(0,r.jsx)(m.pj,{children:(0,r.jsx)(c(),{href:"/jobs?user=".concat(encodeURIComponent(e.service_account_user_id)),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-600 hover:bg-green-200 hover:text-green-700":"bg-gray-100 text-gray-500 hover:bg-gray-200 hover:text-gray-700"),title:"View ".concat(e.jobCount," active job").concat(1!==e.jobCount?"s":""," for ").concat(e.token_name),children:e.jobCount})}),(0,r.jsx)(m.pj,{children:(0,r.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium ".concat(e.gpuCount>0?"bg-purple-100 text-purple-600":"bg-gray-100 text-gray-500"),title:"Total GPUs: ".concat(e.gpuCount),children:e.gpuCount})}),(0,r.jsx)(m.pj,{className:"truncate",children:e.created_at?(0,r.jsx)(y.Zg,{date:new Date(1e3*e.created_at)}):"Never"}),(0,r.jsx)(m.pj,{className:"truncate",children:e.last_used_at?(0,r.jsx)(y.Zg,{date:new Date(1e3*e.last_used_at)}):"Never"}),(0,r.jsx)(m.pj,{className:"truncate",children:e.expires_at?new Date(1e3*e.expires_at)<new Date?(0,r.jsx)("span",{className:"text-red-600",children:"Expired"}):(0,r.jsx)(y.Zg,{date:new Date(1e3*e.expires_at)}):"Never"}),(0,r.jsx)(m.pj,{children:(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[((null==s?void 0:s.role)==="admin"||e.creator_user_hash===(null==s?void 0:s.id))&&(0,r.jsx)(y.WH,{content:"Rotate token",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{t("cannot rotate service account tokens",()=>{b(e),x(!0)})},className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:(0,r.jsx)(N.Z,{className:"h-4 w-4"})})}),((null==s?void 0:s.role)==="admin"||e.creator_user_hash===(null==s?void 0:s.id))&&(0,r.jsx)(y.WH,{content:"Delete ".concat(e.token_name),className:"capitalize text-sm text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{t("cannot delete service account tokens",()=>{z(e),O(!0)})},className:"text-red-600 hover:text-red-800 font-medium inline-flex items-center",children:(0,r.jsx)(T.Z,{className:"h-4 w-4"})})})]})})]},e.token_id))})]})})}),(0,r.jsx)(P.Vq,{open:i,onOpenChange:e=>{u(e),e||(er(null),l(null))},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-2xl",children:[(0,r.jsxs)(P.fK,{children:[(0,r.jsx)(P.$N,{children:"Create Service Account"}),(0,r.jsx)(P.Be,{children:"Create a new service account with an API token for programmatic access to SkyPilot."})]}),(0,r.jsx)("div",{className:"flex flex-col gap-4 py-4",children:es?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center mb-3",children:[(0,r.jsx)("h4",{className:"text-sm font-medium text-green-900",children:"⚠️ Service account created successfully - save this token now!"}),(0,r.jsx)(y.WH,{content:ee?"Copied!":"Copy token",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>ef(es),className:"flex items-center text-green-600 hover:text-green-800 transition-colors duration-200 p-1 ml-2",children:ee?(0,r.jsx)(R.Z,{className:"w-4 h-4"}):(0,r.jsx)(L.Z,{className:"w-4 h-4"})})})]}),(0,r.jsx)("p",{className:"text-sm text-green-700 mb-3",children:"This service account token will not be shown again. Please copy and store it securely."}),(0,r.jsx)("div",{className:"bg-white border border-green-300 rounded-md p-3",children:(0,r.jsx)("code",{className:"text-sm text-gray-800 font-mono break-all block",children:es})})]})}):(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:"Service Account Name"}),(0,r.jsx)("input",{className:"border rounded px-3 py-2 w-full",placeholder:"e.g., ci-pipeline, monitoring-system",value:J.token_name,onChange:e=>K({...J,token_name: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:"Expiration (days)"}),(0,r.jsx)("input",{type:"number",className:"border rounded px-3 py-2 w-full",placeholder:"e.g., 30",min:"0",max:"365",value:J.expires_in_days||"",onChange:e=>K({...J,expires_in_days:e.target.value?parseInt(e.target.value):null})}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Leave empty or enter 0 to never expire. Maximum 365 days."})]})]})}),(0,r.jsx)(P.cN,{children:es?(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:()=>{u(!1),er(null)},children:"Close"}):(0,r.jsxs)(r.Fragment,{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:()=>{u(!1),er(null)},disabled:W,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:eg,disabled:W||!J.token_name.trim(),children:W?"Creating...":"Create Token"})]})})]})}),(0,r.jsx)(P.Vq,{open:F,onOpenChange:e=>{O(e),e||(z(null),l(null))},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(P.fK,{children:[(0,r.jsx)(P.$N,{children:"Delete Service Account Token"}),(0,r.jsxs)(P.Be,{children:['Are you sure you want to delete the service account "',null==M?void 0:M.token_name,'"',(null==M?void 0:M.creator_user_hash)!==(null==s?void 0:s.id)&&(null==s?void 0:s.role)==="admin"?" owned by ".concat(null==M?void 0:M.creator_name):"","? This action cannot be undone and will immediately revoke access for any systems using this token."]})]}),(0,r.jsxs)(P.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),z(null)},disabled:Q,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-red-600 text-white hover:bg-red-700 h-10 px-4 py-2",onClick:eb,disabled:Q,children:Q?"Deleting...":"Delete Token"})]})]})}),(0,r.jsx)(P.Vq,{open:d,onOpenChange:e=>{x(e),e||(b(null),H(""),ea(null),l(null))},children:(0,r.jsxs)(P.cZ,{className:"sm:max-w-2xl",children:[(0,r.jsxs)(P.fK,{children:[(0,r.jsx)(P.$N,{children:"Rotate Service Account Token"}),(0,r.jsxs)(P.Be,{children:['Rotate the service account token "',null==g?void 0:g.token_name,'"',(null==g?void 0:g.creator_user_hash)!==(null==s?void 0:s.id)&&(null==s?void 0:s.role)==="admin"?" owned by ".concat(null==g?void 0:g.creator_name):"",". This will generate a new token value and invalidate the current one."]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-4 py-4",children:en?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center mb-3",children:[(0,r.jsx)("h4",{className:"text-sm font-medium text-green-900",children:"\uD83D\uDD04 Service account token rotated successfully - save this new token now!"}),(0,r.jsx)(y.WH,{content:ee?"Copied!":"Copy token",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>ef(en),className:"flex items-center text-green-600 hover:text-green-800 transition-colors duration-200 p-1 ml-2",children:ee?(0,r.jsx)(R.Z,{className:"w-4 h-4"}):(0,r.jsx)(L.Z,{className:"w-4 h-4"})})})]}),(0,r.jsx)("p",{className:"text-sm text-green-700 mb-3",children:"This new token replaces the old one. Please copy and store it securely. The old token is now invalid."}),(0,r.jsx)("div",{className:"bg-white border border-green-300 rounded-md p-3",children:(0,r.jsx)("code",{className:"text-sm text-gray-800 font-mono break-all block",children:en})})]})}):(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:"New Expiration (days)"}),(0,r.jsx)("input",{type:"number",className:"border rounded px-3 py-2 w-full",placeholder:"Leave empty to preserve current expiration",min:"0",max:"365",value:$,onChange:e=>H(e.target.value)}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Leave empty to preserve current expiration. Enter number of days for new expiration, or enter 0 to set to never expire. Maximum 365 days."})]}),(0,r.jsx)("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded",children:(0,r.jsx)("p",{className:"text-sm text-amber-700",children:"⚠️ Any systems using the current token will need to be updated with the new token."})})]})}),(0,r.jsx)(P.cN,{children:en?(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-green-600 text-white hover:bg-green-700 h-10 px-4 py-2",onClick:()=>{x(!1),b(null),H(""),ea(null)},children:"Close"}):(0,r.jsxs)(r.Fragment,{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:()=>{x(!1),b(null),H(""),ea(null)},disabled:j,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:ej,disabled:j,children:j?"Rotating...":"Rotate Token"})]})})]})})]})}W.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}},12003:function(e,t,s){s.d(t,{j:function(){return l}});var r=s(90512);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=r.W,l=(e,t)=>s=>{var r;if((null==t?void 0:t.variants)==null)return a(e,null==s?void 0:s.class,null==s?void 0:s.className);let{variants:l,defaultVariants:o}=t,i=Object.keys(l).map(e=>{let t=null==s?void 0:s[e],r=null==o?void 0:o[e];if(null===t)return null;let a=n(t)||n(r);return l[e][a]}),c=s&&Object.entries(s).reduce((e,t)=>{let[s,r]=t;return void 0===r||(e[s]=r),e},{});return a(e,i,null==t?void 0:null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:s,className:r,...n}=t;return Object.entries(n).every(e=>{let[t,s]=e;return Array.isArray(s)?s.includes({...o,...c}[t]):({...o,...c})[t]===s})?[...e,s,r]:e},[]),null==s?void 0:s.class,null==s?void 0:s.className)}}}]);
@@ -1 +1 @@
1
- !function(){"use strict";var e,t,n,r,c,o,u,i,f,a={},s={};function d(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}},r=!0;try{a[e](n,n.exports,d),r=!1}finally{r&&delete s[e]}return n.exports}d.m=a,e=[],d.O=function(t,n,r,c){if(n){c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[n,r,c];return}for(var u=1/0,o=0;o<e.length;o++){for(var n=e[o][0],r=e[o][1],c=e[o][2],i=!0,f=0;f<n.length;f++)u>=c&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(i=!1,c<u&&(u=c));if(i){e.splice(o--,1);var a=r();void 0!==a&&(t=a)}}return t},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},d.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var c=Object.create(null);d.r(c);var o={};t=t||[null,n({}),n([]),n(n)];for(var u=2&r&&e;"object"==typeof u&&!~t.indexOf(u);u=n(u))Object.getOwnPropertyNames(u).forEach(function(t){o[t]=function(){return e[t]}});return o.default=function(){return e},d.d(c,o),c},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return 2350===e?"static/chunks/2350.fab69e61bac57b23.js":2369===e?"static/chunks/2369.fc20f0c2c8ed9fe7.js":3937===e?"static/chunks/3937.210053269f121201.js":9025===e?"static/chunks/9025.c12318fb6a1a9093.js":4937===e?"static/chunks/4937.a2baa2df5572a276.js":3294===e?"static/chunks/3294.87a13fba0058865b.js":8640===e?"static/chunks/8640.5b9475a2d18c5416.js":2755===e?"static/chunks/2755.a239c652bf8684dd.js":9847===e?"static/chunks/9847.3aaca6bb33455140.js":4725===e?"static/chunks/4725.a830b5c9e7867c92.js":3785===e?"static/chunks/3785.170be320e0060eaf.js":9360===e?"static/chunks/9360.10a3aac7aad5e3aa.js":"static/chunks/"+e+"-"+({616:"3d59f75e2ccf9321",1141:"c3c10e2c6ed71a8f",1272:"1ef0bf0237faccdb",1871:"81adbc5f25dff78f",3850:"ff4a9a69d978632b",4282:"49b2065b7336e496",5739:"d67458fcb1386c92",6130:"2be46d70a38f1e82",6601:"06114c982db410b6",6856:"5c94d394259cdb6e",6989:"01359c57e018caa4",6990:"f6818c84ed8f1c86",7359:"c8d04e06886000b3",7411:"b15471acd2cba716",7615:"80aa7b09f45a86d2",8969:"4ed9236db997b42b",9353:"cff34f7e773b2e2b"})[e]+".js"},d.miniCssF=function(e){},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},c="_N_E:",d.l=function(e,t,n,o){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var u,i,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var s=f[a];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==c+n){u=s;break}}u||(i=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,d.nc&&u.setAttribute("nonce",d.nc),u.setAttribute("data-webpack",c+n),u.src=d.tu(e)),r[e]=[t];var b=function(t,n){u.onerror=u.onload=null,clearTimeout(l);var c=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),c&&c.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=b.bind(null,u.onerror),u.onload=b.bind(null,u.onload),i&&document.head.appendChild(u)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.tt=function(){return void 0===o&&(o={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o},d.tu=function(e){return d.tt().createScriptURL(e)},d.p="/dashboard/_next/",u={2272:0},d.f.j=function(e,t){var n=d.o(u,e)?u[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(2272!=e){var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var c=d.p+d.u(e),o=Error();d.l(c,function(t){if(d.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",o.name="ChunkLoadError",o.type=r,o.request=c,n[1](o)}},"chunk-"+e,e)}else u[e]=0}},d.O.j=function(e){return 0===u[e]},i=function(e,t){var n,r,c=t[0],o=t[1],i=t[2],f=0;if(c.some(function(e){return 0!==u[e]})){for(n in o)d.o(o,n)&&(d.m[n]=o[n]);if(i)var a=i(d)}for(e&&e(t);f<c.length;f++)r=c[f],d.o(u,r)&&u[r]&&u[r][0](),u[r]=0;return d.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(i.bind(null,0)),f.push=i.bind(null,f.push.bind(f)),d.nc=void 0}();
1
+ !function(){"use strict";var e,t,n,r,c,o,u,i,f,a={},s={};function d(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}},r=!0;try{a[e](n,n.exports,d),r=!1}finally{r&&delete s[e]}return n.exports}d.m=a,e=[],d.O=function(t,n,r,c){if(n){c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[n,r,c];return}for(var u=1/0,o=0;o<e.length;o++){for(var n=e[o][0],r=e[o][1],c=e[o][2],i=!0,f=0;f<n.length;f++)u>=c&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(i=!1,c<u&&(u=c));if(i){e.splice(o--,1);var a=r();void 0!==a&&(t=a)}}return t},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},d.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var c=Object.create(null);d.r(c);var o={};t=t||[null,n({}),n([]),n(n)];for(var u=2&r&&e;"object"==typeof u&&!~t.indexOf(u);u=n(u))Object.getOwnPropertyNames(u).forEach(function(t){o[t]=function(){return e[t]}});return o.default=function(){return e},d.d(c,o),c},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return 2350===e?"static/chunks/2350.fab69e61bac57b23.js":2369===e?"static/chunks/2369.fc20f0c2c8ed9fe7.js":3937===e?"static/chunks/3937.210053269f121201.js":9025===e?"static/chunks/9025.c12318fb6a1a9093.js":4937===e?"static/chunks/4937.a2baa2df5572a276.js":3294===e?"static/chunks/3294.87a13fba0058865b.js":8640===e?"static/chunks/8640.5b9475a2d18c5416.js":2755===e?"static/chunks/2755.d6dc6d530fed0b61.js":9847===e?"static/chunks/9847.3aaca6bb33455140.js":4725===e?"static/chunks/4725.a830b5c9e7867c92.js":3785===e?"static/chunks/3785.170be320e0060eaf.js":9360===e?"static/chunks/9360.10a3aac7aad5e3aa.js":"static/chunks/"+e+"-"+({616:"3d59f75e2ccf9321",1141:"c3c10e2c6ed71a8f",1272:"1ef0bf0237faccdb",1871:"81adbc5f25dff78f",3850:"ff4a9a69d978632b",4282:"49b2065b7336e496",5739:"d67458fcb1386c92",6130:"2be46d70a38f1e82",6601:"06114c982db410b6",6856:"5c94d394259cdb6e",6989:"01359c57e018caa4",6990:"f6818c84ed8f1c86",7359:"c8d04e06886000b3",7411:"b15471acd2cba716",7615:"80aa7b09f45a86d2",8969:"4ed9236db997b42b",9353:"cff34f7e773b2e2b"})[e]+".js"},d.miniCssF=function(e){},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},c="_N_E:",d.l=function(e,t,n,o){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var u,i,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var s=f[a];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==c+n){u=s;break}}u||(i=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,d.nc&&u.setAttribute("nonce",d.nc),u.setAttribute("data-webpack",c+n),u.src=d.tu(e)),r[e]=[t];var b=function(t,n){u.onerror=u.onload=null,clearTimeout(l);var c=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),c&&c.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=b.bind(null,u.onerror),u.onload=b.bind(null,u.onload),i&&document.head.appendChild(u)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.tt=function(){return void 0===o&&(o={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o},d.tu=function(e){return d.tt().createScriptURL(e)},d.p="/dashboard/_next/",u={2272:0},d.f.j=function(e,t){var n=d.o(u,e)?u[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(2272!=e){var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var c=d.p+d.u(e),o=Error();d.l(c,function(t){if(d.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",o.name="ChunkLoadError",o.type=r,o.request=c,n[1](o)}},"chunk-"+e,e)}else u[e]=0}},d.O.j=function(e){return 0===u[e]},i=function(e,t){var n,r,c=t[0],o=t[1],i=t[2],f=0;if(c.some(function(e){return 0!==u[e]})){for(n in o)d.o(o,n)&&(d.m[n]=o[n]);if(i)var a=i(d)}for(e&&e(t);f<c.length;f++)r=c[f],d.o(u,r)&&u[r]&&u[r][0](),u[r]=0;return d.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(i.bind(null,0)),f.push=i.bind(null,f.push.bind(f)),d.nc=void 0}();
@@ -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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-485984ca04e021d0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/616-3d59f75e2ccf9321.js" defer=""></script><script src="/dashboard/_next/static/chunks/6130-2be46d70a38f1e82.js" defer=""></script><script src="/dashboard/_next/static/chunks/5739-d67458fcb1386c92.js" defer=""></script><script src="/dashboard/_next/static/chunks/7411-b15471acd2cba716.js" defer=""></script><script src="/dashboard/_next/static/chunks/6989-01359c57e018caa4.js" defer=""></script><script src="/dashboard/_next/static/chunks/3850-ff4a9a69d978632b.js" defer=""></script><script src="/dashboard/_next/static/chunks/9353-cff34f7e773b2e2b.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters/%5Bcluster%5D/%5Bjob%5D-ac4a217f17b087cb.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters/[cluster]/[job]","query":{},"buildId":"DabuSAKsc_y0wyJxpTIdQ","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-e38d5319cd10a3a0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/616-3d59f75e2ccf9321.js" defer=""></script><script src="/dashboard/_next/static/chunks/6130-2be46d70a38f1e82.js" defer=""></script><script src="/dashboard/_next/static/chunks/5739-d67458fcb1386c92.js" defer=""></script><script src="/dashboard/_next/static/chunks/7411-b15471acd2cba716.js" defer=""></script><script src="/dashboard/_next/static/chunks/6989-01359c57e018caa4.js" defer=""></script><script src="/dashboard/_next/static/chunks/3850-ff4a9a69d978632b.js" defer=""></script><script src="/dashboard/_next/static/chunks/9353-cff34f7e773b2e2b.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters/%5Bcluster%5D/%5Bjob%5D-ac4a217f17b087cb.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters/[cluster]/[job]","query":{},"buildId":"8ixeA0NVQJN8HUdijid8b","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
@@ -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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-485984ca04e021d0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/616-3d59f75e2ccf9321.js" defer=""></script><script src="/dashboard/_next/static/chunks/6130-2be46d70a38f1e82.js" defer=""></script><script src="/dashboard/_next/static/chunks/5739-d67458fcb1386c92.js" defer=""></script><script src="/dashboard/_next/static/chunks/7411-b15471acd2cba716.js" defer=""></script><script src="/dashboard/_next/static/chunks/1272-1ef0bf0237faccdb.js" defer=""></script><script src="/dashboard/_next/static/chunks/7359-c8d04e06886000b3.js" defer=""></script><script src="/dashboard/_next/static/chunks/6212-7bd06f60ba693125.js" defer=""></script><script src="/dashboard/_next/static/chunks/6989-01359c57e018caa4.js" defer=""></script><script src="/dashboard/_next/static/chunks/3850-ff4a9a69d978632b.js" defer=""></script><script src="/dashboard/_next/static/chunks/8969-4ed9236db997b42b.js" defer=""></script><script src="/dashboard/_next/static/chunks/6990-f6818c84ed8f1c86.js" defer=""></script><script src="/dashboard/_next/static/chunks/9353-cff34f7e773b2e2b.js" defer=""></script><script src="/dashboard/_next/static/chunks/4282-49b2065b7336e496.js" defer=""></script><script src="/dashboard/_next/static/chunks/6601-06114c982db410b6.js" defer=""></script><script src="/dashboard/_next/static/chunks/7615-80aa7b09f45a86d2.js" defer=""></script><script src="/dashboard/_next/static/chunks/6856-5c94d394259cdb6e.js" defer=""></script><script src="/dashboard/_next/static/chunks/1871-81adbc5f25dff78f.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters/%5Bcluster%5D-1704039ccaf997cf.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters/[cluster]","query":{},"buildId":"DabuSAKsc_y0wyJxpTIdQ","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-e38d5319cd10a3a0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/616-3d59f75e2ccf9321.js" defer=""></script><script src="/dashboard/_next/static/chunks/6130-2be46d70a38f1e82.js" defer=""></script><script src="/dashboard/_next/static/chunks/5739-d67458fcb1386c92.js" defer=""></script><script src="/dashboard/_next/static/chunks/7411-b15471acd2cba716.js" defer=""></script><script src="/dashboard/_next/static/chunks/1272-1ef0bf0237faccdb.js" defer=""></script><script src="/dashboard/_next/static/chunks/7359-c8d04e06886000b3.js" defer=""></script><script src="/dashboard/_next/static/chunks/6212-7bd06f60ba693125.js" defer=""></script><script src="/dashboard/_next/static/chunks/6989-01359c57e018caa4.js" defer=""></script><script src="/dashboard/_next/static/chunks/3850-ff4a9a69d978632b.js" defer=""></script><script src="/dashboard/_next/static/chunks/8969-4ed9236db997b42b.js" defer=""></script><script src="/dashboard/_next/static/chunks/6990-f6818c84ed8f1c86.js" defer=""></script><script src="/dashboard/_next/static/chunks/9353-cff34f7e773b2e2b.js" defer=""></script><script src="/dashboard/_next/static/chunks/4282-49b2065b7336e496.js" defer=""></script><script src="/dashboard/_next/static/chunks/6601-06114c982db410b6.js" defer=""></script><script src="/dashboard/_next/static/chunks/7615-80aa7b09f45a86d2.js" defer=""></script><script src="/dashboard/_next/static/chunks/6856-5c94d394259cdb6e.js" defer=""></script><script src="/dashboard/_next/static/chunks/1871-81adbc5f25dff78f.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters/%5Bcluster%5D-1704039ccaf997cf.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters/[cluster]","query":{},"buildId":"8ixeA0NVQJN8HUdijid8b","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
@@ -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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-485984ca04e021d0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters-9e0df5442b04f7d0.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/DabuSAKsc_y0wyJxpTIdQ/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters","query":{},"buildId":"DabuSAKsc_y0wyJxpTIdQ","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
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/0748ce22df867032.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/0748ce22df867032.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-e38d5319cd10a3a0.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-cf60a09ccd051a10.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-f15ccb73239a3bf1.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-bde01e4a2beec258.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/clusters-9e0df5442b04f7d0.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/8ixeA0NVQJN8HUdijid8b/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/clusters","query":{},"buildId":"8ixeA0NVQJN8HUdijid8b","assetPrefix":"/dashboard","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>