dstack 0.18.38__py3-none-any.whl → 0.18.40rc1__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.
- dstack/_internal/cli/services/configurators/fleet.py +1 -1
- dstack/_internal/cli/services/configurators/gateway.py +10 -1
- dstack/_internal/cli/utils/common.py +1 -2
- dstack/_internal/core/models/configurations.py +21 -0
- dstack/_internal/core/models/runs.py +1 -0
- dstack/_internal/core/models/volumes.py +9 -0
- dstack/_internal/core/services/logs.py +4 -1
- dstack/_internal/core/services/ssh/attach.py +6 -5
- dstack/_internal/proxy/lib/models.py +1 -0
- dstack/_internal/proxy/lib/testing/common.py +2 -0
- dstack/_internal/server/app.py +7 -3
- dstack/_internal/server/background/tasks/process_submitted_jobs.py +2 -2
- dstack/_internal/server/schemas/runner.py +1 -0
- dstack/_internal/server/services/fleets.py +1 -1
- dstack/_internal/server/services/jobs/configurators/base.py +10 -0
- dstack/_internal/server/services/jobs/configurators/dev.py +3 -0
- dstack/_internal/server/services/jobs/configurators/service.py +3 -0
- dstack/_internal/server/services/jobs/configurators/task.py +3 -0
- dstack/_internal/server/services/proxy/repo.py +1 -0
- dstack/_internal/server/services/proxy/services/service_proxy.py +4 -0
- dstack/_internal/server/services/runs.py +5 -4
- dstack/_internal/server/statics/index.html +1 -1
- dstack/_internal/server/statics/{main-623e02815ab7a6b56019.js → main-11ec5e4a00ea6ec833e3.js} +3 -3
- dstack/_internal/server/statics/{main-623e02815ab7a6b56019.js.map → main-11ec5e4a00ea6ec833e3.js.map} +1 -1
- dstack/api/_public/runs.py +8 -0
- dstack/api/server/__init__.py +19 -3
- dstack/api/server/_fleets.py +6 -1
- dstack/api/server/_runs.py +28 -8
- dstack/version.py +1 -1
- {dstack-0.18.38.dist-info → dstack-0.18.40rc1.dist-info}/METADATA +6 -7
- {dstack-0.18.38.dist-info → dstack-0.18.40rc1.dist-info}/RECORD +40 -40
- tests/_internal/core/services/test_logs.py +16 -6
- tests/_internal/server/background/tasks/test_process_submitted_jobs.py +74 -1
- tests/_internal/server/routers/test_runs.py +4 -0
- tests/_internal/server/services/proxy/routers/test_service_proxy.py +39 -0
- tests/_internal/server/services/runner/test_client.py +6 -2
- {dstack-0.18.38.dist-info → dstack-0.18.40rc1.dist-info}/LICENSE.md +0 -0
- {dstack-0.18.38.dist-info → dstack-0.18.40rc1.dist-info}/WHEEL +0 -0
- {dstack-0.18.38.dist-info → dstack-0.18.40rc1.dist-info}/entry_points.txt +0 -0
- {dstack-0.18.38.dist-info → dstack-0.18.40rc1.dist-info}/top_level.txt +0 -0
|
@@ -22,6 +22,7 @@ from dstack._internal.core.models.gateways import (
|
|
|
22
22
|
GatewayStatus,
|
|
23
23
|
)
|
|
24
24
|
from dstack._internal.core.models.repos.base import Repo
|
|
25
|
+
from dstack._internal.core.services.diff import diff_models
|
|
25
26
|
from dstack._internal.utils.common import local_time
|
|
26
27
|
from dstack.api._public import Client
|
|
27
28
|
|
|
@@ -56,7 +57,15 @@ class GatewayConfigurator(BaseApplyConfigurator):
|
|
|
56
57
|
confirm_message += "Create the gateway?"
|
|
57
58
|
else:
|
|
58
59
|
action_message += f"Found gateway [code]{plan.spec.configuration.name}[/]."
|
|
59
|
-
|
|
60
|
+
diff = diff_models(
|
|
61
|
+
plan.spec.configuration,
|
|
62
|
+
plan.current_resource.configuration,
|
|
63
|
+
)
|
|
64
|
+
changed_fields = list(diff.keys())
|
|
65
|
+
if (
|
|
66
|
+
plan.current_resource.configuration == plan.spec.configuration
|
|
67
|
+
or changed_fields == ["default"]
|
|
68
|
+
):
|
|
60
69
|
if command_args.yes and not command_args.force:
|
|
61
70
|
# --force is required only with --yes,
|
|
62
71
|
# otherwise we may ask for force apply interactively.
|
|
@@ -25,8 +25,7 @@ LIVE_TABLE_REFRESH_RATE_PER_SEC = 1
|
|
|
25
25
|
LIVE_TABLE_PROVISION_INTERVAL_SECS = 2
|
|
26
26
|
NO_OFFERS_WARNING = (
|
|
27
27
|
"[warning]"
|
|
28
|
-
"
|
|
29
|
-
" Please check the requirements table above or visit the troubleshooting guide:"
|
|
28
|
+
"No matching instance offers available. Possible reasons:"
|
|
30
29
|
" https://dstack.ai/docs/guides/troubleshooting/#no-offers"
|
|
31
30
|
"[/]\n"
|
|
32
31
|
)
|
|
@@ -21,6 +21,7 @@ from dstack._internal.core.models.volumes import MountPoint, VolumeConfiguration
|
|
|
21
21
|
CommandsList = List[str]
|
|
22
22
|
ValidPort = conint(gt=0, le=65536)
|
|
23
23
|
SERVICE_HTTPS_DEFAULT = True
|
|
24
|
+
STRIP_PREFIX_DEFAULT = True
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class RunConfigurationType(str, Enum):
|
|
@@ -130,6 +131,16 @@ class BaseRunConfiguration(CoreModel):
|
|
|
130
131
|
description="Use image with NVIDIA CUDA Compiler (NVCC) included. Mutually exclusive with `image`"
|
|
131
132
|
),
|
|
132
133
|
]
|
|
134
|
+
single_branch: Annotated[
|
|
135
|
+
Optional[bool],
|
|
136
|
+
Field(
|
|
137
|
+
description=(
|
|
138
|
+
"Whether to clone and track only the current branch or all remote branches."
|
|
139
|
+
" Relevant only when using remote Git repos."
|
|
140
|
+
" Defaults to `false` for dev environments and to `true` for tasks and services"
|
|
141
|
+
)
|
|
142
|
+
),
|
|
143
|
+
] = None
|
|
133
144
|
env: Annotated[
|
|
134
145
|
Env,
|
|
135
146
|
Field(description="The mapping or the list of environment variables"),
|
|
@@ -236,6 +247,16 @@ class ServiceConfigurationParams(CoreModel):
|
|
|
236
247
|
),
|
|
237
248
|
),
|
|
238
249
|
] = None
|
|
250
|
+
strip_prefix: Annotated[
|
|
251
|
+
bool,
|
|
252
|
+
Field(
|
|
253
|
+
description=(
|
|
254
|
+
"Strip the `/proxy/services/<project name>/<run name>/` path prefix"
|
|
255
|
+
" when forwarding requests to the service. Only takes effect"
|
|
256
|
+
" when running the service without a gateway"
|
|
257
|
+
)
|
|
258
|
+
),
|
|
259
|
+
] = STRIP_PREFIX_DEFAULT
|
|
239
260
|
model: Annotated[
|
|
240
261
|
Optional[Union[AnyModel, str]],
|
|
241
262
|
Field(
|
|
@@ -184,6 +184,7 @@ class JobSpec(CoreModel):
|
|
|
184
184
|
home_dir: Optional[str]
|
|
185
185
|
image_name: str
|
|
186
186
|
privileged: bool = False
|
|
187
|
+
single_branch: Optional[bool] = None
|
|
187
188
|
max_duration: Optional[int]
|
|
188
189
|
stop_duration: Optional[int] = None
|
|
189
190
|
registry_auth: Optional[RegistryAuth]
|
|
@@ -136,6 +136,15 @@ class VolumeMountPoint(CoreModel):
|
|
|
136
136
|
class InstanceMountPoint(CoreModel):
|
|
137
137
|
instance_path: Annotated[str, Field(description="The absolute path on the instance (host)")]
|
|
138
138
|
path: Annotated[str, Field(description="The absolute path in the container")]
|
|
139
|
+
optional: Annotated[
|
|
140
|
+
bool,
|
|
141
|
+
Field(
|
|
142
|
+
description=(
|
|
143
|
+
"Allow running without this volume"
|
|
144
|
+
" in backends that do not support instance volumes"
|
|
145
|
+
),
|
|
146
|
+
),
|
|
147
|
+
] = False
|
|
139
148
|
|
|
140
149
|
_validate_instance_path = validator("instance_path", allow_reuse=True)(
|
|
141
150
|
_validate_mount_point_path
|
|
@@ -42,11 +42,14 @@ class URLReplacer:
|
|
|
42
42
|
qs = {k: v[0] for k, v in urllib.parse.parse_qs(url.query).items()}
|
|
43
43
|
if app_spec and app_spec.url_query_params is not None:
|
|
44
44
|
qs.update({k.encode(): v.encode() for k, v in app_spec.url_query_params.items()})
|
|
45
|
+
path = url.path
|
|
46
|
+
if not path.startswith(self.path_prefix.removesuffix(b"/")):
|
|
47
|
+
path = concat_url_path(self.path_prefix, path)
|
|
45
48
|
|
|
46
49
|
url = url._replace(
|
|
47
50
|
scheme=("https" if self.secure else "http").encode(),
|
|
48
51
|
netloc=(self.hostname if omit_port else f"{self.hostname}:{local_port}").encode(),
|
|
49
|
-
path=
|
|
52
|
+
path=path,
|
|
50
53
|
query=urllib.parse.urlencode(qs).encode(),
|
|
51
54
|
)
|
|
52
55
|
return url.geturl()
|
|
@@ -56,6 +56,7 @@ class SSHAttach:
|
|
|
56
56
|
ssh_port: int,
|
|
57
57
|
container_ssh_port: int,
|
|
58
58
|
user: str,
|
|
59
|
+
container_user: str,
|
|
59
60
|
id_rsa_path: PathLike,
|
|
60
61
|
ports_lock: PortsLock,
|
|
61
62
|
run_name: str,
|
|
@@ -74,7 +75,7 @@ class SSHAttach:
|
|
|
74
75
|
self.control_sock_path = FilePath(control_sock_path)
|
|
75
76
|
self.identity_file = FilePath(id_rsa_path)
|
|
76
77
|
self.tunnel = SSHTunnel(
|
|
77
|
-
destination=run_name,
|
|
78
|
+
destination=f"root@{run_name}",
|
|
78
79
|
identity=self.identity_file,
|
|
79
80
|
forwarded_sockets=ports_to_forwarded_sockets(
|
|
80
81
|
ports=self.ports,
|
|
@@ -91,7 +92,7 @@ class SSHAttach:
|
|
|
91
92
|
self.host_config = {
|
|
92
93
|
"HostName": hostname,
|
|
93
94
|
"Port": ssh_port,
|
|
94
|
-
"User": user,
|
|
95
|
+
"User": user if dockerized else container_user,
|
|
95
96
|
"IdentityFile": self.identity_file,
|
|
96
97
|
"IdentitiesOnly": "yes",
|
|
97
98
|
"StrictHostKeyChecking": "no",
|
|
@@ -111,7 +112,7 @@ class SSHAttach:
|
|
|
111
112
|
self.container_config = {
|
|
112
113
|
"HostName": "localhost",
|
|
113
114
|
"Port": container_ssh_port,
|
|
114
|
-
"User":
|
|
115
|
+
"User": container_user,
|
|
115
116
|
"IdentityFile": self.identity_file,
|
|
116
117
|
"IdentitiesOnly": "yes",
|
|
117
118
|
"StrictHostKeyChecking": "no",
|
|
@@ -122,7 +123,7 @@ class SSHAttach:
|
|
|
122
123
|
self.container_config = {
|
|
123
124
|
"HostName": hostname,
|
|
124
125
|
"Port": ssh_port,
|
|
125
|
-
"User":
|
|
126
|
+
"User": container_user,
|
|
126
127
|
"IdentityFile": self.identity_file,
|
|
127
128
|
"IdentitiesOnly": "yes",
|
|
128
129
|
"StrictHostKeyChecking": "no",
|
|
@@ -136,7 +137,7 @@ class SSHAttach:
|
|
|
136
137
|
self.host_config = {
|
|
137
138
|
"HostName": hostname,
|
|
138
139
|
"Port": container_ssh_port,
|
|
139
|
-
"User":
|
|
140
|
+
"User": container_user,
|
|
140
141
|
"IdentityFile": self.identity_file,
|
|
141
142
|
"IdentitiesOnly": "yes",
|
|
142
143
|
"StrictHostKeyChecking": "no",
|
|
@@ -29,6 +29,7 @@ def make_service(
|
|
|
29
29
|
domain: Optional[str] = None,
|
|
30
30
|
https: Optional[bool] = None,
|
|
31
31
|
auth: bool = False,
|
|
32
|
+
strip_prefix: bool = True,
|
|
32
33
|
) -> Service:
|
|
33
34
|
return Service(
|
|
34
35
|
project_name=project_name,
|
|
@@ -37,6 +38,7 @@ def make_service(
|
|
|
37
38
|
https=https,
|
|
38
39
|
auth=auth,
|
|
39
40
|
client_max_body_size=2**20,
|
|
41
|
+
strip_prefix=strip_prefix,
|
|
40
42
|
replicas=(
|
|
41
43
|
Replica(
|
|
42
44
|
id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
dstack/_internal/server/app.py
CHANGED
|
@@ -7,7 +7,7 @@ from pathlib import Path
|
|
|
7
7
|
from typing import Awaitable, Callable, List
|
|
8
8
|
|
|
9
9
|
import sentry_sdk
|
|
10
|
-
from fastapi import FastAPI, Request, status
|
|
10
|
+
from fastapi import FastAPI, Request, Response, status
|
|
11
11
|
from fastapi.datastructures import URL
|
|
12
12
|
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
|
|
13
13
|
from fastapi.staticfiles import StaticFiles
|
|
@@ -215,10 +215,14 @@ def register_routes(app: FastAPI, ui: bool = True):
|
|
|
215
215
|
@app.middleware("http")
|
|
216
216
|
async def log_request(request: Request, call_next):
|
|
217
217
|
start_time = time.time()
|
|
218
|
-
response = await call_next(request)
|
|
218
|
+
response: Response = await call_next(request)
|
|
219
219
|
process_time = time.time() - start_time
|
|
220
220
|
logger.debug(
|
|
221
|
-
"Processed request %s %s in %s
|
|
221
|
+
"Processed request %s %s in %s. Status: %s",
|
|
222
|
+
request.method,
|
|
223
|
+
request.url,
|
|
224
|
+
f"{process_time:0.6f}s",
|
|
225
|
+
response.status_code,
|
|
222
226
|
)
|
|
223
227
|
return response
|
|
224
228
|
|
|
@@ -64,7 +64,7 @@ from dstack._internal.server.services.pools import (
|
|
|
64
64
|
)
|
|
65
65
|
from dstack._internal.server.services.runs import (
|
|
66
66
|
check_can_attach_run_volumes,
|
|
67
|
-
|
|
67
|
+
check_run_spec_requires_instance_mounts,
|
|
68
68
|
get_offer_volumes,
|
|
69
69
|
get_run_volume_models,
|
|
70
70
|
get_run_volumes,
|
|
@@ -418,7 +418,7 @@ async def _run_job_on_new_instance(
|
|
|
418
418
|
master_job_provisioning_data=master_job_provisioning_data,
|
|
419
419
|
volumes=volumes,
|
|
420
420
|
privileged=job.job_spec.privileged,
|
|
421
|
-
instance_mounts=
|
|
421
|
+
instance_mounts=check_run_spec_requires_instance_mounts(run.run_spec),
|
|
422
422
|
)
|
|
423
423
|
# Limit number of offers tried to prevent long-running processing
|
|
424
424
|
# in case all offers fail.
|
|
@@ -239,7 +239,6 @@ async def get_plan(
|
|
|
239
239
|
user: UserModel,
|
|
240
240
|
spec: FleetSpec,
|
|
241
241
|
) -> FleetPlan:
|
|
242
|
-
# TODO: refactor offers logic into a separate module to avoid depending on runs
|
|
243
242
|
current_fleet: Optional[Fleet] = None
|
|
244
243
|
current_fleet_id: Optional[uuid.UUID] = None
|
|
245
244
|
if spec.configuration.name is not None:
|
|
@@ -259,6 +258,7 @@ async def get_plan(
|
|
|
259
258
|
requirements=_get_fleet_requirements(spec),
|
|
260
259
|
)
|
|
261
260
|
offers = [offer for _, offer in offers_with_backends]
|
|
261
|
+
_remove_fleet_spec_sensitive_info(spec)
|
|
262
262
|
plan = FleetPlan(
|
|
263
263
|
project_name=project.name,
|
|
264
264
|
user=user.name,
|
|
@@ -63,6 +63,10 @@ class JobConfigurator(ABC):
|
|
|
63
63
|
def _shell_commands(self) -> List[str]:
|
|
64
64
|
pass
|
|
65
65
|
|
|
66
|
+
@abstractmethod
|
|
67
|
+
def _default_single_branch(self) -> bool:
|
|
68
|
+
pass
|
|
69
|
+
|
|
66
70
|
@abstractmethod
|
|
67
71
|
def _default_max_duration(self) -> Optional[int]:
|
|
68
72
|
pass
|
|
@@ -104,6 +108,7 @@ class JobConfigurator(ABC):
|
|
|
104
108
|
image_name=self._image_name(),
|
|
105
109
|
user=await self._user(),
|
|
106
110
|
privileged=self._privileged(),
|
|
111
|
+
single_branch=self._single_branch(),
|
|
107
112
|
max_duration=self._max_duration(),
|
|
108
113
|
stop_duration=self._stop_duration(),
|
|
109
114
|
registry_auth=self._registry_auth(),
|
|
@@ -172,6 +177,11 @@ class JobConfigurator(ABC):
|
|
|
172
177
|
def _privileged(self) -> bool:
|
|
173
178
|
return self.run_spec.configuration.privileged
|
|
174
179
|
|
|
180
|
+
def _single_branch(self) -> bool:
|
|
181
|
+
if self.run_spec.configuration.single_branch is None:
|
|
182
|
+
return self._default_single_branch()
|
|
183
|
+
return self.run_spec.configuration.single_branch
|
|
184
|
+
|
|
175
185
|
def _max_duration(self) -> Optional[int]:
|
|
176
186
|
if self.run_spec.merged_profile.max_duration in [None, True]:
|
|
177
187
|
return self._default_max_duration()
|
|
@@ -40,6 +40,9 @@ class DevEnvironmentJobConfigurator(JobConfigurator):
|
|
|
40
40
|
commands += ["tail -f /dev/null"] # idle
|
|
41
41
|
return commands
|
|
42
42
|
|
|
43
|
+
def _default_single_branch(self) -> bool:
|
|
44
|
+
return False
|
|
45
|
+
|
|
43
46
|
def _default_max_duration(self) -> Optional[int]:
|
|
44
47
|
return DEFAULT_MAX_DURATION_SECONDS
|
|
45
48
|
|
|
@@ -11,6 +11,9 @@ class ServiceJobConfigurator(JobConfigurator):
|
|
|
11
11
|
def _shell_commands(self) -> List[str]:
|
|
12
12
|
return self.run_spec.configuration.commands
|
|
13
13
|
|
|
14
|
+
def _default_single_branch(self) -> bool:
|
|
15
|
+
return True
|
|
16
|
+
|
|
14
17
|
def _default_max_duration(self) -> Optional[int]:
|
|
15
18
|
return None
|
|
16
19
|
|
|
@@ -25,6 +25,9 @@ class TaskJobConfigurator(JobConfigurator):
|
|
|
25
25
|
def _shell_commands(self) -> List[str]:
|
|
26
26
|
return self.run_spec.configuration.commands
|
|
27
27
|
|
|
28
|
+
def _default_single_branch(self) -> bool:
|
|
29
|
+
return True
|
|
30
|
+
|
|
28
31
|
def _default_max_duration(self) -> Optional[int]:
|
|
29
32
|
return DEFAULT_MAX_DURATION_SECONDS
|
|
30
33
|
|
|
@@ -12,6 +12,7 @@ from dstack._internal.proxy.lib.services.service_connection import (
|
|
|
12
12
|
ServiceConnectionPool,
|
|
13
13
|
get_service_replica_client,
|
|
14
14
|
)
|
|
15
|
+
from dstack._internal.utils.common import concat_url_path
|
|
15
16
|
from dstack._internal.utils.logging import get_logger
|
|
16
17
|
|
|
17
18
|
logger = get_logger(__name__)
|
|
@@ -37,6 +38,9 @@ async def proxy(
|
|
|
37
38
|
|
|
38
39
|
client = await get_service_replica_client(service, repo, service_conn_pool)
|
|
39
40
|
|
|
41
|
+
if not service.strip_prefix:
|
|
42
|
+
path = concat_url_path(request.scope.get("root_path", "/"), request.url.path)
|
|
43
|
+
|
|
40
44
|
try:
|
|
41
45
|
upstream_request = await build_upstream_request(request, path, client)
|
|
42
46
|
except ClientDisconnect:
|
|
@@ -330,7 +330,7 @@ async def get_plan(
|
|
|
330
330
|
multinode=jobs[0].job_spec.jobs_per_replica > 1,
|
|
331
331
|
volumes=volumes,
|
|
332
332
|
privileged=jobs[0].job_spec.privileged,
|
|
333
|
-
instance_mounts=
|
|
333
|
+
instance_mounts=check_run_spec_requires_instance_mounts(run_spec),
|
|
334
334
|
)
|
|
335
335
|
|
|
336
336
|
job_plans = []
|
|
@@ -897,9 +897,10 @@ def get_offer_mount_point_volume(
|
|
|
897
897
|
raise ServerClientError("Failed to find an eligible volume for the mount point")
|
|
898
898
|
|
|
899
899
|
|
|
900
|
-
def
|
|
900
|
+
def check_run_spec_requires_instance_mounts(run_spec: RunSpec) -> bool:
|
|
901
901
|
return any(
|
|
902
|
-
is_core_model_instance(mp, InstanceMountPoint)
|
|
902
|
+
is_core_model_instance(mp, InstanceMountPoint) and not mp.optional
|
|
903
|
+
for mp in run_spec.configuration.volumes
|
|
903
904
|
)
|
|
904
905
|
|
|
905
906
|
|
|
@@ -967,7 +968,7 @@ def _validate_run_spec_and_set_defaults(run_spec: RunSpec):
|
|
|
967
968
|
_UPDATABLE_SPEC_FIELDS = ["repo_code_hash", "configuration"]
|
|
968
969
|
# Most service fields can be updated via replica redeployment.
|
|
969
970
|
# TODO: Allow updating other fields when a rolling deployment is supported.
|
|
970
|
-
_UPDATABLE_CONFIGURATION_FIELDS = ["replicas", "scaling"]
|
|
971
|
+
_UPDATABLE_CONFIGURATION_FIELDS = ["replicas", "scaling", "strip_prefix"]
|
|
971
972
|
|
|
972
973
|
|
|
973
974
|
def _can_update_run_spec(current_run_spec: RunSpec, new_run_spec: RunSpec) -> bool:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>dstack</title><meta name="description" content="Get GPUs at the best prices and availability from a wide range of providers. No cloud account of your own is required.
|
|
2
2
|
"/><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"><meta name="og:title" content="dstack"><meta name="og:type" content="article"><meta name="og:image" content="/splash_thumbnail.png"><meta name="og:description" content="Get GPUs at the best prices and availability from a wide range of providers. No cloud account of your own is required.
|
|
3
|
-
"><link rel="icon" type="image/x-icon" href="/assets/favicon.ico"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="48x48" href="/assets/favicon-48x48.png"><link rel="manifest" href="/assets/manifest.webmanifest"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><meta name="application-name" content="dstackai"><link rel="apple-touch-icon" sizes="57x57" href="/assets/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/assets/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/assets/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/assets/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/assets/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/assets/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/assets/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/assets/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="167x167" href="/assets/apple-touch-icon-167x167.png"><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon-180x180.png"><link rel="apple-touch-icon" sizes="1024x1024" href="/assets/apple-touch-icon-1024x1024.png"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="dstackai"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-640x1136.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-1136x640.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-750x1334.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-1334x750.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1125x2436.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2436x1125.png"><link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1170x2532.png"><link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2532x1170.png"><link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1179x2556.png"><link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2556x1179.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-828x1792.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-1792x828.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1242x2688.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2688x1242.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1242x2208.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2208x1242.png"><link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1284x2778.png"><link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2778x1284.png"><link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1290x2796.png"><link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2796x1290.png"><link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1488x2266.png"><link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2266x1488.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1536x2048.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2048x1536.png"><link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1620x2160.png"><link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2160x1620.png"><link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1640x2160.png"><link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2160x1640.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1668x2388.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2388x1668.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1668x2224.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2224x1668.png"><link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-2048x2732.png"><link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2732x2048.png"><meta name="msapplication-TileColor" content="#fff"><meta name="msapplication-TileImage" content="/assets/mstile-144x144.png"><meta name="msapplication-config" content="/assets/browserconfig.xml"><link rel="yandex-tableau-widget" href="/assets/yandex-browser-manifest.json"><script defer="defer" src="/main-
|
|
3
|
+
"><link rel="icon" type="image/x-icon" href="/assets/favicon.ico"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="48x48" href="/assets/favicon-48x48.png"><link rel="manifest" href="/assets/manifest.webmanifest"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><meta name="application-name" content="dstackai"><link rel="apple-touch-icon" sizes="57x57" href="/assets/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/assets/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/assets/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/assets/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/assets/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/assets/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/assets/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/assets/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="167x167" href="/assets/apple-touch-icon-167x167.png"><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon-180x180.png"><link rel="apple-touch-icon" sizes="1024x1024" href="/assets/apple-touch-icon-1024x1024.png"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="dstackai"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-640x1136.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-1136x640.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-750x1334.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-1334x750.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1125x2436.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2436x1125.png"><link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1170x2532.png"><link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2532x1170.png"><link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1179x2556.png"><link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2556x1179.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-828x1792.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-1792x828.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1242x2688.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2688x1242.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1242x2208.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2208x1242.png"><link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1284x2778.png"><link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2778x1284.png"><link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1290x2796.png"><link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2796x1290.png"><link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1488x2266.png"><link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2266x1488.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1536x2048.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2048x1536.png"><link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1620x2160.png"><link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2160x1620.png"><link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1640x2160.png"><link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2160x1640.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1668x2388.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2388x1668.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-1668x2224.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2224x1668.png"><link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/assets/apple-touch-startup-image-2048x2732.png"><link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/assets/apple-touch-startup-image-2732x2048.png"><meta name="msapplication-TileColor" content="#fff"><meta name="msapplication-TileImage" content="/assets/mstile-144x144.png"><meta name="msapplication-config" content="/assets/browserconfig.xml"><link rel="yandex-tableau-widget" href="/assets/yandex-browser-manifest.json"><script defer="defer" src="/main-11ec5e4a00ea6ec833e3.js"></script><link href="/main-fc56d1f4af8e57522a1c.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div class="b-page-header" id="header"></div><div id="root"></div></body></html>
|
dstack/_internal/server/statics/{main-623e02815ab7a6b56019.js → main-11ec5e4a00ea6ec833e3.js}
RENAMED
|
@@ -120672,7 +120672,7 @@ var src_fleetApi=src_rtk_query_react_esm_createApi({reducerPath:"fleetApi",baseQ
|
|
|
120672
120672
|
;// ./src/pages/Fleets/List/hooks.tsx
|
|
120673
120673
|
function src_List_hooks_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_List_hooks_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_List_hooks_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_List_hooks_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_useEmptyMessages=function(_ref){var clearFilters=_ref.clearFilters,isDisabledClearFilter=_ref.isDisabledClearFilter,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,renderEmptyMessage=(0,src_react.useCallback)(function(){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("fleets.empty_message_title"),message:t("fleets.empty_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{disabled:isDisabledClearFilter,onClick:clearFilters},t("common.clearFilter")))},[clearFilters,isDisabledClearFilter]),renderNoMatchMessage=(0,src_react.useCallback)(function(){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("fleets.nomatch_message_title"),message:t("fleets.nomatch_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{disabled:isDisabledClearFilter,onClick:clearFilters},t("common.clearFilter")))},[clearFilters,isDisabledClearFilter]);return{renderEmptyMessage:renderEmptyMessage,renderNoMatchMessage:renderNoMatchMessage}};var src_useColumnsDefinitions=function(){var _useTranslation2=src_useTranslation_useTranslation(),t=_useTranslation2.t,columns=[{id:"fleet_name",header:t("fleets.fleet"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.FLEETS.DETAILS.FORMAT(item.project_name,item.id)},item.name)}},{id:"status",header:t("fleets.instances.status"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getFleetStatusIconType(item.status)},t("fleets.statuses.".concat(item.status)))}},{id:"project",header:t("fleets.instances.project"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(item.project_name)},item.project_name)}},{id:"instances",header:t("fleets.instances.title"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.INSTANCES.LIST+"?fleetId=".concat(item.id)},src_getFleetInstancesLinkText(item))}},{id:"started",header:t("fleets.instances.started"),cell:function(item){return src_format_format(new Date(item.created_at),src_consts_DATE_TIME_FORMAT)}},{id:"price",header:t("fleets.instances.price"),cell:function(item){var price=src_getFleetPrice(item);return"number"==typeof price?"$".concat(price):"-"}}];return{columns:columns}};var src_useFilters=function(){var _useLocalStorageState=src_useLocalStorageState("fleet-list-is-active",!0),_useLocalStorageState2=src_slicedToArray_slicedToArray(_useLocalStorageState,2),onlyActive=_useLocalStorageState2[0],setOnlyActive=_useLocalStorageState2[1],_useState=(0,src_react.useState)(null),_useState2=src_slicedToArray_slicedToArray(_useState,2),selectedProject=_useState2[0],setSelectedProject=_useState2[1],_useGetProjectsQuery=src_useGetProjectsQuery(),projectsData=_useGetProjectsQuery.data,projectOptions=(0,src_react.useMemo)(function(){return null!==projectsData&&void 0!==projectsData&&projectsData.length?projectsData.map(function(project){return{label:project.project_name,value:project.project_name}}):[]},[projectsData]);return{projectOptions:projectOptions,selectedProject:selectedProject,setSelectedProject:setSelectedProject,onlyActive:onlyActive,setOnlyActive:setOnlyActive,clearFilters:function(){setOnlyActive(!1),setSelectedProject(null)},isDisabledClearFilter:!selectedProject&&!onlyActive}};var src_useFleetsData=function(_ref2){var project_name=_ref2.project_name,only_active=_ref2.only_active,_useState3=(0,src_react.useState)([]),_useState4=src_slicedToArray_slicedToArray(_useState3,2),data=_useState4[0],setData=_useState4[1],_useState5=(0,src_react.useState)(1),_useState6=src_slicedToArray_slicedToArray(_useState5,2),pagesCount=_useState6[0],setPagesCount=_useState6[1],_useState7=(0,src_react.useState)(!1),_useState8=src_slicedToArray_slicedToArray(_useState7,2),disabledNext=_useState8[0],setDisabledNext=_useState8[1],lastRequestParams=(0,src_react.useRef)(void 0),_useLazyGetFleetsQuer=src_useLazyGetFleetsQuery(),_useLazyGetFleetsQuer2=src_slicedToArray_slicedToArray(_useLazyGetFleetsQuer,2),getFleets=_useLazyGetFleetsQuer2[0],_useLazyGetFleetsQuer3=_useLazyGetFleetsQuer2[1],isLoading=_useLazyGetFleetsQuer3.isLoading,isFetching=_useLazyGetFleetsQuer3.isFetching,getFleetsRequest=function(params){return lastRequestParams.current=params,getFleets(src_List_hooks_objectSpread({project_name:project_name,only_active:only_active,limit:src_DEFAULT_TABLE_PAGE_SIZE},params)).unwrap()};(0,src_react.useEffect)(function(){getFleetsRequest().then(function(result){setPagesCount(1),setDisabledNext(!1),setData(result)})},[project_name,only_active]);var nextPage=/*#__PURE__*/function(){var _ref3=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(){var result;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(0===data.length||disabledNext)){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,getFleetsRequest({prev_created_at:data[data.length-1].created_at,prev_id:data[data.length-1].id});case 5:result=_context.sent,0<result.length?(setPagesCount(function(count){return count+1}),setData(result)):setDisabledNext(!0),_context.next=12;break;case 9:_context.prev=9,_context.t0=_context["catch"](2),console.log(_context.t0);case 12:case"end":return _context.stop()}},_callee,null,[[2,9]])}));return function(){return _ref3.apply(this,arguments)}}(),prevPage=/*#__PURE__*/function(){var _ref4=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee2(){var result,reversedData;return src_regenerator_default().wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(1!==pagesCount){_context2.next=2;break}return _context2.abrupt("return");case 2:return _context2.prev=2,_context2.next=5,getFleetsRequest({prev_created_at:data[0].created_at,prev_id:data[0].id,ascending:!0});case 5:result=_context2.sent,setDisabledNext(!1),0<result.length?(setPagesCount(function(count){return count-1}),reversedData=src_toConsumableArray_toConsumableArray(result).reverse(),setData(reversedData)):setPagesCount(1),_context2.next=13;break;case 10:_context2.prev=10,_context2.t0=_context2["catch"](2),console.log(_context2.t0);case 13:case"end":return _context2.stop()}},_callee2,null,[[2,10]])}));return function(){return _ref4.apply(this,arguments)}}();return{data:data,pagesCount:pagesCount,disabledNext:disabledNext,isLoading:isLoading||isFetching,nextPage:nextPage,prevPage:prevPage,refreshList:function(){getFleetsRequest(lastRequestParams.current).then(function(result){setDisabledNext(!1),setData(result)})}}};
|
|
120674
120674
|
;// ./src/pages/Fleets/List/useDeleteFleet.ts
|
|
120675
|
-
var src_useDeleteFleet=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useDeleteFleetMutati=src_useDeleteFleetMutation(),_useDeleteFleetMutati2=src_slicedToArray_slicedToArray(_useDeleteFleetMutati,1),deleteFleet=_useDeleteFleetMutati2[0],_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useState=(0,src_react.useState)(function(){return!1}),_useState2=src_slicedToArray_slicedToArray(_useState,2),isDeleting=_useState2[0],setIsDeleting=_useState2[1],namesOfFleetsGroupByProjectName=function(volumes){return volumes.reduce(function(acc,fleet){return acc[fleet.project_name]?acc[fleet.project_name].push(fleet.name):acc[fleet.project_name]=[fleet.name],acc},{})},deleteFleets=(0,src_react.useCallback)(/*#__PURE__*/function(){var _ref=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(fleets){var groupedFleets,requests;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(fleets.length){_context.next=2;break}return _context.abrupt("return",Promise.reject("No fleets"));case 2:return setIsDeleting(!0),groupedFleets=namesOfFleetsGroupByProjectName(fleets),requests=Object.keys(groupedFleets).map(function(projectName){return deleteFleet({projectName:projectName,fleetNames:groupedFleets[projectName]}).unwrap()}),_context.abrupt("return",Promise.all(requests).finally(function(){return setIsDeleting(!1)}).catch(function(error){var
|
|
120675
|
+
var src_useDeleteFleet=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useDeleteFleetMutati=src_useDeleteFleetMutation(),_useDeleteFleetMutati2=src_slicedToArray_slicedToArray(_useDeleteFleetMutati,1),deleteFleet=_useDeleteFleetMutati2[0],_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useState=(0,src_react.useState)(function(){return!1}),_useState2=src_slicedToArray_slicedToArray(_useState,2),isDeleting=_useState2[0],setIsDeleting=_useState2[1],namesOfFleetsGroupByProjectName=function(volumes){return volumes.reduce(function(acc,fleet){return acc[fleet.project_name]?acc[fleet.project_name].push(fleet.name):acc[fleet.project_name]=[fleet.name],acc},{})},deleteFleets=(0,src_react.useCallback)(/*#__PURE__*/function(){var _ref=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(fleets){var groupedFleets,requests;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(fleets.length){_context.next=2;break}return _context.abrupt("return",Promise.reject("No fleets"));case 2:return setIsDeleting(!0),groupedFleets=namesOfFleetsGroupByProjectName(fleets),requests=Object.keys(groupedFleets).map(function(projectName){return deleteFleet({projectName:projectName,fleetNames:groupedFleets[projectName]}).unwrap()}),_context.abrupt("return",Promise.all(requests).finally(function(){return setIsDeleting(!1)}).catch(function(error){var errorText=null===error||void 0===error?void 0:error.error,errorData=error.data;if(src_isRequestFormErrors2(errorData)){var errorDetail=errorData.detail;errorText=errorDetail.flatMap(function(_ref2){var msg=_ref2.msg;return msg}).join(", ")}pushNotification({type:"error",content:t("common.server_error",{error:errorText})})}));case 6:case"end":return _context.stop()}},_callee)}));return function(){return _ref.apply(this,arguments)}}(),[]);return{deleteFleets:deleteFleets,isDeleting:isDeleting}};
|
|
120676
120676
|
;// ./src/pages/Fleets/List/styles.module.scss
|
|
120677
120677
|
// extracted by mini-css-extract-plugin
|
|
120678
120678
|
/* harmony default export */ const src_List_styles_module = ({"filters":"rqgZE","select":"vUVw3","activeOnly":"G9M9A","clear":"k4hsS"});
|
|
@@ -120685,7 +120685,7 @@ var src_FleetDetails=function(){var _params$fleetId,_params$projectName,_data$na
|
|
|
120685
120685
|
;// ./src/services/instance.ts
|
|
120686
120686
|
var src_instanceApi=src_rtk_query_react_esm_createApi({reducerPath:"instanceApi",baseQuery:src_fetchBaseQuery({prepareHeaders:src_fetchBaseQueryHeaders}),tagTypes:["Instance","Instances"],endpoints:function(builder){return{getInstances:builder.query({query:function(body){return{url:src_API.INSTANCES.LIST(),method:"POST",body:body}},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref){var name=_ref.name;return{type:"Instance",id:name}})),["Instances"]):["Instances"]}}),deleteInstances:builder.mutation({query:function(_ref2){var projectName=_ref2.projectName,fleetName=_ref2.fleetName,instancesNums=_ref2.instancesNums;return{url:src_API.PROJECTS.FLEET_INSTANCES_DELETE(projectName),method:"POST",body:{name:fleetName,instance_nums:instancesNums}}},invalidatesTags:["Instances"]})}}});var src_useLazyGetInstancesQuery=src_instanceApi.useLazyGetInstancesQuery,src_useDeleteInstancesMutation=src_instanceApi.useDeleteInstancesMutation;
|
|
120687
120687
|
;// ./src/pages/Instances/List/hooks/useActions.ts
|
|
120688
|
-
var src_useActions=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useDeleteInstancesMu=src_useDeleteInstancesMutation(),_useDeleteInstancesMu2=src_slicedToArray_slicedToArray(_useDeleteInstancesMu,1),deleteInstances=_useDeleteInstancesMu2[0],_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useState=(0,src_react.useState)(function(){return!1}),_useState2=src_slicedToArray_slicedToArray(_useState,2),isDeleting=_useState2[0],setIsDeleting=_useState2[1],instancesGroupByFleetName=function(instances){return instances.reduce(function(acc,instance){var key="".concat(instance.project_name,"/").concat(instance.fleet_name);return acc[key]?acc[key].push(instance.instance_num):acc[key]=[instance.instance_num],acc},{})},deleteFleets=(0,src_react.useCallback)(/*#__PURE__*/function(){var _ref=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(instances){var groupedInstances,requests;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(instances.length){_context.next=2;break}return _context.abrupt("return",Promise.reject("No instances"));case 2:return setIsDeleting(!0),groupedInstances=instancesGroupByFleetName(instances),requests=Object.keys(groupedInstances).map(function(key){var _key$split=key.split("/"),_key$split2=src_slicedToArray_slicedToArray(_key$split,2),projectName=_key$split2[0],fleetName=_key$split2[1];return deleteInstances({projectName:projectName,fleetName:fleetName,instancesNums:groupedInstances[key]}).unwrap()}),_context.abrupt("return",Promise.all(requests).finally(function(){return setIsDeleting(!1)}).catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:
|
|
120688
|
+
var src_useActions=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useDeleteInstancesMu=src_useDeleteInstancesMutation(),_useDeleteInstancesMu2=src_slicedToArray_slicedToArray(_useDeleteInstancesMu,1),deleteInstances=_useDeleteInstancesMu2[0],_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useState=(0,src_react.useState)(function(){return!1}),_useState2=src_slicedToArray_slicedToArray(_useState,2),isDeleting=_useState2[0],setIsDeleting=_useState2[1],instancesGroupByFleetName=function(instances){return instances.reduce(function(acc,instance){var key="".concat(instance.project_name,"/").concat(instance.fleet_name);return acc[key]?acc[key].push(instance.instance_num):acc[key]=[instance.instance_num],acc},{})},deleteFleets=(0,src_react.useCallback)(/*#__PURE__*/function(){var _ref=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(instances){var groupedInstances,requests;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(instances.length){_context.next=2;break}return _context.abrupt("return",Promise.reject("No instances"));case 2:return setIsDeleting(!0),groupedInstances=instancesGroupByFleetName(instances),requests=Object.keys(groupedInstances).map(function(key){var _key$split=key.split("/"),_key$split2=src_slicedToArray_slicedToArray(_key$split,2),projectName=_key$split2[0],fleetName=_key$split2[1];return deleteInstances({projectName:projectName,fleetName:fleetName,instancesNums:groupedInstances[key]}).unwrap()}),_context.abrupt("return",Promise.all(requests).finally(function(){return setIsDeleting(!1)}).catch(function(error){var errorText=null===error||void 0===error?void 0:error.error,errorData=error.data;if(src_isRequestFormErrors2(errorData)){var errorDetail=errorData.detail;errorText=errorDetail.flatMap(function(_ref2){var msg=_ref2.msg;return msg}).join(", ")}pushNotification({type:"error",content:t("common.server_error",{error:errorText})})}));case 6:case"end":return _context.stop()}},_callee)}));return function(){return _ref.apply(this,arguments)}}(),[]);return{deleteFleets:deleteFleets,isDeleting:isDeleting}};
|
|
120689
120689
|
;// ./src/pages/Instances/List/hooks/useColumnDefinitions.tsx
|
|
120690
120690
|
var src_useColumnDefinitions_useColumnsDefinitions=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,columns=[{id:"fleet_name",header:t("fleets.fleet"),cell:function(item){return item.fleet_name&&item.project_name?/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.FLEETS.DETAILS.FORMAT(item.project_name,item.fleet_id)},item.fleet_name):"-"}},{id:"instance_num",header:t("fleets.instances.instance_num"),cell:function(item){return item.instance_num}},{id:"project_name",header:t("fleets.instances.project"),cell:function(item){return item.project_name?/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(item.project_name)},item.project_name):item.project_name}},{id:"hostname",header:t("fleets.instances.hostname"),cell:function(item){return item.hostname}},{id:"backend",header:t("fleets.instances.backend"),cell:function(item){return item.backend}},{id:"region",header:t("fleets.instances.region"),cell:function(item){return item.region}},{id:"instance_type",header:t("fleets.instances.instance_type"),cell:function(item){var _item$instance_type$n,_item$instance_type;return null!==(_item$instance_type$n=null===(_item$instance_type=item.instance_type)||void 0===_item$instance_type?void 0:_item$instance_type.name)&&void 0!==_item$instance_type$n?_item$instance_type$n:"-"}},{id:"resources",header:t("fleets.instances.resources"),cell:function(item){var _item$instance_type$r,_item$instance_type2;return null!==(_item$instance_type$r=null===(_item$instance_type2=item.instance_type)||void 0===_item$instance_type2?void 0:_item$instance_type2.resources.description)&&void 0!==_item$instance_type$r?_item$instance_type$r:"-"}},{id:"spot",header:t("fleets.instances.spot"),cell:function(item){var _item$instance_type3;return(null===(_item$instance_type3=item.instance_type)||void 0===_item$instance_type3?void 0:_item$instance_type3.resources.spot)&&/*#__PURE__*/src_react.createElement(src_Icon,{name:"check"})}},{id:"status",header:t("fleets.instances.status"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(item.status)},t("fleets.instances.statuses.".concat(item.status)))}},{id:"started",header:t("fleets.instances.started"),cell:function(item){return src_format_format(new Date(item.created),src_consts_DATE_TIME_FORMAT)}},{id:"price",header:t("fleets.instances.price"),cell:function(item){return"number"==typeof item.price?"$".concat(item.price):"-"}}];return{columns:columns}};
|
|
120691
120691
|
;// ./src/pages/Instances/List/hooks/useEmptyMessage.tsx
|
|
@@ -129264,4 +129264,4 @@ var src_container=document.getElementById("root"),src_src_theme={tokens:{fontFam
|
|
|
129264
129264
|
|
|
129265
129265
|
/******/ })()
|
|
129266
129266
|
;
|
|
129267
|
-
//# sourceMappingURL=main-
|
|
129267
|
+
//# sourceMappingURL=main-11ec5e4a00ea6ec833e3.js.map
|