Skip to content

Commit d711edf

Browse files
[UI] Bugfix of the dev environment page's Connect section
1 parent b69821a commit d711edf

File tree

2 files changed

+34
-3
lines changed
  • frontend/src/pages
    • Project/Details/Settings
    • Runs/Details/RunDetails/ConnectToRunWithDevEnvConfiguration

2 files changed

+34
-3
lines changed

frontend/src/pages/Project/Details/Settings/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export const ProjectSettings: React.FC = () => {
224224
allowSkipTo={true}
225225
steps={[
226226
{
227-
title: 'Install CLI',
227+
title: 'Install',
228228
// info: <InfoLink onFollow={() => openHelpPanel(CLI_INFO)} />,
229229
description: 'To use dstack, install the CLI on your local machine.',
230230
content: (

frontend/src/pages/Runs/Details/RunDetails/ConnectToRunWithDevEnvConfiguration/index.tsx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import {
1818

1919
import { copyToClipboard } from 'libs';
2020

21+
import { useConfigProjectCliCommand } from 'pages/Project/hooks/useConfigProjectCliComand';
22+
2123
import styles from './styles.module.scss';
2224

2325
const UvInstallCommand = 'uv tool install dstack -U';
@@ -27,7 +29,7 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
2729
const { t } = useTranslation();
2830

2931
const getAttachCommand = (runData: IRun) => {
30-
const attachCommand = `dstack attach ${runData.run_spec.run_name}`;
32+
const attachCommand = `dstack attach ${runData.run_spec.run_name} --logs`;
3133

3234
const copyAttachCommand = () => {
3335
copyToClipboard(attachCommand);
@@ -52,6 +54,8 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
5254

5355
const openInIDEUrl = `${run.run_spec.configuration.ide}://vscode-remote/ssh-remote+${run.run_spec.run_name}/${run.run_spec.working_dir || 'workflow'}`;
5456

57+
const [configCliCommand, copyCliCommand] = useConfigProjectCliCommand({ projectName: run.project_name });
58+
5559
return (
5660
<Container>
5761
<Header variant="h2">Connect</Header>
@@ -177,6 +181,33 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
177181
},
178182
]}
179183
/>
184+
185+
<Box>And then configure the project.</Box>
186+
187+
<div className={styles.codeWrapper}>
188+
<Code className={styles.code}>{configCliCommand}</Code>
189+
190+
<div className={styles.copy}>
191+
<Popover
192+
dismissButton={false}
193+
position="top"
194+
size="small"
195+
triggerType="custom"
196+
content={
197+
<StatusIndicator type="success">
198+
{t('common.copied')}
199+
</StatusIndicator>
200+
}
201+
>
202+
<Button
203+
formAction="none"
204+
iconName="copy"
205+
variant="normal"
206+
onClick={copyCliCommand}
207+
/>
208+
</Popover>
209+
</div>
210+
</div>
180211
</SpaceBetween>
181212
</ExpandableSection>
182213
</SpaceBetween>
@@ -233,7 +264,7 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
233264
/>
234265
)}
235266

236-
{run.status === 'running' && (
267+
{run.status !== 'running' && (
237268
<SpaceBetween size="s">
238269
<Box />
239270
<Alert type="info">Waiting for the run to start.</Alert>

0 commit comments

Comments
 (0)