Skip to content

Commit 1b0bd82

Browse files
committed
[dashboard] Optionally: have an explicit modal for re-starting
1 parent 2c30263 commit 1b0bd82

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import React, { Suspense, useEffect } from "react";
1212
import { v4 } from 'uuid';
1313
import Arrow from "../components/Arrow";
1414
import ContextMenu from "../components/ContextMenu";
15+
//import Modal from "../components/Modal";
1516
import PendingChangesDropdown from "../components/PendingChangesDropdown";
1617
import { watchHeadlessLogs } from "../components/PrebuildLogs";
1718
import { getGitpodService, gitpodHostUrl } from "../service/service";
@@ -80,7 +81,7 @@ export interface StartWorkspaceState {
8081
clientID?: string
8182
};
8283
ideOptions?: IDEOptions;
83-
showRestartModal?: boolean;
84+
//showRestartModal?: boolean;
8485
/**
8586
* This flag is used to break the autostart-cycle explained in https://github.com/gitpod-io/gitpod/issues/8043
8687
*/
@@ -133,7 +134,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
133134
const params = this.props.parameters;
134135
if (params?.trigger === "redirect_from_ws_cluster"
135136
|| params?.trigger === "redirect_from_supervisor") {
136-
this.setState({ dontAutostart: true });
137+
this.setState({ dontAutostart: true /*, showRestartModal: true*/ });
137138
this.fetchWorkspaceInfo(undefined);
138139
return;
139140
}
@@ -357,7 +358,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
357358
}
358359

359360
render() {
360-
const { error } = this.state;
361+
const { error, /*showRestartModal*/ } = this.state;
361362
const isHeadless = this.state.workspace?.type !== 'regular';
362363
const isPrebuilt = WithPrebuild.is(this.state.workspace?.context);
363364
let phase = StartPhase.Preparing;
@@ -522,6 +523,12 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
522523
}
523524

524525
return <StartPage phase={phase} error={error} title={title}>
526+
{/* {showRestartModal &&
527+
RestartWorkspaceModal(this.state.workspace, () => {
528+
this.setState({ showRestartModal: false });
529+
this.startWorkspace(true);
530+
})
531+
} */}
525532
{statusMessage}
526533
</StartPage>;
527534
}
@@ -598,3 +605,23 @@ function HeadlessWorkspaceView(props: { instanceId: string }) {
598605
</Suspense>
599606
</StartPage>;
600607
}
608+
609+
// function RestartWorkspaceModal(workspace: Workspace | undefined, onStart: () => void) {
610+
// return <Modal visible={true} closeable={false} onClose={() => { }}>
611+
// <h3 className="flex">
612+
// <span className="flex-grow">Restart workspace?</span>
613+
// </h3>
614+
// <div className="border-t border-b border-gray-200 dark:border-gray-800 mt-4 -mx-6 px-6 py-2">
615+
// <a onClick={onStart} className="rounded-xl group hover:bg-gray-100 dark:hover:bg-gray-800 flex p-3 my-1">
616+
// <div className="w-full">
617+
// <p className="text-base text-black dark:text-gray-100 font-bold">{workspace?.id}</p>
618+
// <p className="truncate" title={workspace?.contextURL}>{workspace?.contextURL}</p>
619+
// </div>
620+
// </a>
621+
// </div>
622+
// <div className="flex justify-end mt-6">
623+
// <a href={gitpodHostUrl.asDashboard().toString()}><button className="secondary">Go to Dashboard</button></a>
624+
// <a onClick={onStart} className="ml-2"><button>Restart</button></a>
625+
// </div>
626+
// </Modal>;
627+
// }

0 commit comments

Comments
 (0)