-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
220 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ | |
top: 0; | ||
margin-top: 1rem; | ||
right: 0; | ||
bottom: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
client/src/features/sessionsV2/SessionList/Actions.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@import "~bootstrap/scss/functions"; | ||
@import "~bootstrap/scss/variables"; | ||
@import "~bootstrap/scss/variables-dark"; | ||
@import "~bootstrap/scss/maps"; | ||
@import "~bootstrap/scss/mixins"; | ||
|
||
.actionsButton { | ||
bottom: 0; | ||
margin-bottom: 1rem; | ||
|
||
@include media-breakpoint-up(md) { | ||
top: 0; | ||
margin-top: 1rem; | ||
right: 0; | ||
bottom: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
client/src/features/sessionsV2/SessionList/SessionLauncherActions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/*! | ||
* Copyright 2025 - Swiss Data Science Center (SDSC) | ||
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and | ||
* Eidgenössische Technische Hochschule Zürich (ETHZ). | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import cx from "classnames"; | ||
import { PlayCircle } from "react-bootstrap-icons"; | ||
import { Button, UncontrolledTooltip } from "reactstrap"; | ||
|
||
import { useProject } from "../../ProjectPageV2/ProjectPageContainer/ProjectPageContainer"; | ||
import type { SessionLauncher, SessionV2 } from "../sessionsV2.types"; | ||
import StartSessionButton from "../StartSessionButton"; | ||
import { useRef } from "react"; | ||
|
||
interface SessionLauncherActionsProps { | ||
launcher: SessionLauncher; | ||
sessions: SessionV2[]; | ||
} | ||
|
||
export default function SessionLauncherActions({ | ||
launcher, | ||
sessions, | ||
}: SessionLauncherActionsProps) { | ||
const { project } = useProject(); | ||
|
||
if (sessions.length > 0) { | ||
return <DisabledLaunchButton />; | ||
} | ||
|
||
return ( | ||
<StartSessionButton | ||
launcherId={launcher.id} | ||
namespace={project.namespace} | ||
slug={project.slug} | ||
/> | ||
); | ||
} | ||
|
||
function DisabledLaunchButton() { | ||
const ref = useRef<HTMLSpanElement>(null); | ||
|
||
return ( | ||
<> | ||
<span className="d-inline-block" tabIndex={0} ref={ref}> | ||
<Button type="button" color="primary" disabled size="sm"> | ||
<PlayCircle className={cx("bi", "me-1")} /> | ||
Launch | ||
</Button> | ||
</span> | ||
<UncontrolledTooltip target={ref}> | ||
A session is already running from this launcher | ||
</UncontrolledTooltip> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters