Skip to content

Commit

Permalink
put back workspacelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
laushinka committed Jun 19, 2022
1 parent 4666613 commit 8386a8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 1 addition & 4 deletions components/dashboard/src/components/PrebuildLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function PrebuildLogs(props: PrebuildLogsProps) {
const [workspace, setWorkspace] = useState<Workspace | undefined>();
const [workspaceInstance, setWorkspaceInstance] = useState<WorkspaceInstance | undefined>();
const [error, setError] = useState<Error | undefined>();
const [logsEmitter, setLogsEmitter] = useState(new EventEmitter());
const [logsEmitter] = useState(new EventEmitter());

useEffect(() => {
const disposables = new DisposableCollection();
Expand All @@ -36,9 +36,6 @@ export default function PrebuildLogs(props: PrebuildLogsProps) {
if (!props.workspaceId) {
return;
}
if (props.logsEmitter) {
setLogsEmitter(props.logsEmitter);
}
try {
const info = await getGitpodService().server.getWorkspace(props.workspaceId);
if (info.latestInstance) {
Expand Down
1 change: 1 addition & 0 deletions components/dashboard/src/projects/Prebuilds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ function PrebuildStatusDescription(props: { prebuild: PrebuildWithStatus }) {
}

export function PrebuildStatus(props: { prebuild: PrebuildWithStatus }) {
console.log("prebuild status: ", props.prebuild.status);
const prebuild = props.prebuild;

return (
Expand Down
8 changes: 6 additions & 2 deletions components/dashboard/src/start/CreateWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ import StartWorkspace, { parseProps } from "./StartWorkspace";
import { openAuthorizeWindow } from "../provider-utils";
import { SelectAccountPayload } from "@gitpod/gitpod-protocol/lib/auth";
import { SelectAccountModal } from "../settings/SelectAccountModal";
import PrebuildLogs, { watchHeadlessLogs } from "../components/PrebuildLogs";
import { watchHeadlessLogs } from "../components/PrebuildLogs";
import CodeText from "../components/CodeText";
import FeedbackComponent from "../feedback-form/FeedbackComponent";
import { isGitpodIo } from "../utils";
import { PrebuildStatus } from "../projects/Prebuilds";

const WorkspaceLogs = React.lazy(() => import("../components/WorkspaceLogs"));

export interface CreateWorkspaceProps {
contextUrl: string;
}
Expand Down Expand Up @@ -246,6 +248,7 @@ export default class CreateWorkspace extends React.Component<CreateWorkspaceProp
</Modal>
);
} else if (result?.runningWorkspacePrebuild) {
console.log("we have a running prebuild");
return (
<RunningPrebuildView
runningPrebuild={result.runningWorkspacePrebuild}
Expand Down Expand Up @@ -487,6 +490,7 @@ function RunningPrebuildView(props: RunningPrebuildViewProps) {
}

setPrebuild(prebuild);
console.log("we have prebuild? ", prebuild);
},
}),
);
Expand All @@ -499,7 +503,7 @@ function RunningPrebuildView(props: RunningPrebuildViewProps) {
return (
<StartPage title="Prebuild in Progress">
<Suspense fallback={<div />}>
<PrebuildLogs logsEmitter={logsEmitter} workspaceId={props.runningPrebuild.workspaceID} />
<WorkspaceLogs logsEmitter={logsEmitter} />
{prebuild && <PrebuildStatus prebuild={prebuild} />}
</Suspense>
<button
Expand Down

0 comments on commit 8386a8f

Please sign in to comment.