Skip to content

Commit 6b09249

Browse files
committed
move notebook servers to be first; auto-start server on select
1 parent c46c100 commit 6b09249

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

src/packages/frontend/components/link-retry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const LinkRetry: React.FC<Props> = ({
104104
if (autoStart) {
105105
start();
106106
}
107-
}, []);
107+
}, [href]);
108108

109109
function renderError() {
110110
if (!error) return;

src/packages/frontend/project/named-server-panel.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Jupyter notebook server is running, then pops it up in a new tab.
1010

1111
import { join } from "path";
1212
import React from "react";
13-
1413
import {
1514
Icon,
1615
IconName,
@@ -144,14 +143,14 @@ export const NamedServerPanel: React.FC<Props> = ({
144143
{description}
145144
<br />
146145
<br />
147-
Click the link below to start your {longName} server. It will then
148-
attempt to open in a new browser tab. If this doesn't work, check for
149-
a popup blocker warning!
146+
Starting your {longName} server. It will then attempt to open in a new
147+
browser tab. If this doesn't work, check for a popup blocker warning!
150148
</Paragraph>
151149
<Paragraph
152150
style={{ textAlign: "center", fontSize: "14pt", margin: "15px" }}
153151
>
154152
<LinkRetry
153+
autoStart
155154
href={serverURL(project_id, name)}
156155
loadingText="Launching server..."
157156
onClick={() => {

src/packages/frontend/project/servers/project-servers.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,30 @@ export function ProjectServers(props: Props) {
163163
}
164164

165165
const items: TabsProps["items"] = [];
166+
items.push({
167+
key: "notebooks",
168+
label: (
169+
<span style={{ fontSize: "14pt" }}>
170+
<Icon name="jupyter" /> Notebook Servers
171+
</span>
172+
),
173+
children: (
174+
<>
175+
<Paragraph>
176+
You can run various servers inside this project. They run in the same
177+
environment, have access to the same files, and stop when the project
178+
stops. You can also{" "}
179+
<A href={"https://doc.cocalc.com/howto/webserver.html"}>
180+
run your own servers
181+
</A>
182+
.
183+
</Paragraph>
184+
{renderNamedServers()}
185+
<Divider plain />
186+
{renderSageServerControl()}
187+
</>
188+
),
189+
});
166190
if (computeServersEnabled()) {
167191
items.push({
168192
key: "compute-servers",
@@ -193,30 +217,6 @@ export function ProjectServers(props: Props) {
193217
children: <CloudFilesystems project_id={project_id} />,
194218
});
195219
}
196-
items.push({
197-
key: "notebooks",
198-
label: (
199-
<span style={{ fontSize: "14pt" }}>
200-
<Icon name="jupyter" /> Notebook Servers
201-
</span>
202-
),
203-
children: (
204-
<>
205-
<Paragraph>
206-
You can run various servers inside this project. They run in the same
207-
environment, have access to the same files, and stop when the project
208-
stops. You can also{" "}
209-
<A href={"https://doc.cocalc.com/howto/webserver.html"}>
210-
run your own servers
211-
</A>
212-
.
213-
</Paragraph>
214-
{renderNamedServers()}
215-
<Divider plain />
216-
{renderSageServerControl()}
217-
</>
218-
),
219-
});
220220

221221
return (
222222
<div style={{ ...ROOT_STYLE, margin: "0 auto" }}>

0 commit comments

Comments
 (0)