Skip to content

Commit b24cae4

Browse files
committed
compute servers: add direct x11 launcher button, since x11 desktop is popular
1 parent 32cb2a4 commit b24cae4

File tree

2 files changed

+48
-24
lines changed

2 files changed

+48
-24
lines changed

src/packages/frontend/compute/launcher.tsx

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Launcher buttons shown for a running compute server.
33
*/
44

5-
import { Button, Modal, Spin } from "antd";
5+
import { Button, Modal, Spin, Tooltip } from "antd";
66
import { Icon } from "@cocalc/frontend/components";
77
import { useImages } from "@cocalc/frontend/compute/images-hook";
88
import { useMemo, useState } from "react";
@@ -48,29 +48,46 @@ export default function Launcher({
4848
</Button>*/}
4949

5050
{apps["jupyterlab"] != null && (
51-
<Button
52-
onClick={() => setAppName("jupyterlab")}
53-
type="text"
54-
size="small"
55-
style={{ color: "#666" }}
56-
>
57-
<Icon
58-
name={apps["jupyterlab"].icon}
59-
style={{ marginRight: "-5px" }}
60-
/>
61-
JupyterLab
62-
</Button>
51+
<Tooltip title={apps["jupyterlab"].tip} placement="left">
52+
<Button
53+
onClick={() => setAppName("jupyterlab")}
54+
type="text"
55+
size="small"
56+
style={{ color: "#666" }}
57+
>
58+
<Icon
59+
name={apps["jupyterlab"].icon}
60+
style={{ marginRight: "-5px" }}
61+
/>
62+
JupyterLab
63+
</Button>
64+
</Tooltip>
6365
)}
6466
{apps["vscode"] != null && (
65-
<Button
66-
onClick={() => setAppName("vscode")}
67-
type="text"
68-
size="small"
69-
style={{ color: "#666" }}
70-
>
71-
<Icon name={apps["vscode"].icon} style={{ marginRight: "-5px" }} />
72-
VS Code
73-
</Button>
67+
<Tooltip title={apps["vscode"].tip} placement="left">
68+
<Button
69+
onClick={() => setAppName("vscode")}
70+
type="text"
71+
size="small"
72+
style={{ color: "#666" }}
73+
>
74+
<Icon name={apps["vscode"].icon} style={{ marginRight: "-5px" }} />
75+
VS Code
76+
</Button>
77+
</Tooltip>
78+
)}
79+
{apps["xpra"] != null && (
80+
<Tooltip title={apps["xpra"].tip} placement="left">
81+
<Button
82+
onClick={() => setAppName("xpra")}
83+
type="text"
84+
size="small"
85+
style={{ color: "#666" }}
86+
>
87+
<Icon name={apps["xpra"].icon} style={{ marginRight: "-5px" }} />
88+
Desktop
89+
</Button>
90+
</Tooltip>
7491
)}
7592
</div>
7693
);
@@ -151,7 +168,7 @@ export function AppLauncherModal({
151168
return <Spin />;
152169
}
153170
const image = server.configuration?.image ?? "defaults";
154-
const apps = IMAGES[image]?.apps ?? IMAGES["defaults"]?.apps ?? {};
171+
const apps = getApps(image);
155172

156173
return (
157174
<Modal
@@ -169,6 +186,7 @@ export function AppLauncherModal({
169186
onCancel={close}
170187
destroyOnClose
171188
>
189+
{apps[name]?.tip}
172190
<AppLauncher
173191
name={name}
174192
configuration={server.configuration}

src/packages/frontend/compute/menu.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ export function getApps(image) {
3838
if (IMAGES.getIn([image, "jupyterKernels"]) === false) {
3939
apps = { ...apps, jupyterlab: undefined };
4040
}
41+
if (apps["xpra"]) {
42+
if (!apps["xpra"].tip) {
43+
apps["xpra"].tip =
44+
"Launch an X11 Linux Graphical Desktop environment running directly on the compute server.";
45+
}
46+
}
4147
return apps;
4248
}
4349

@@ -103,7 +109,7 @@ function getItems({
103109
};
104110
const xpra = {
105111
key: "xpra",
106-
label: "X11 Desktop",
112+
label: "Desktop",
107113
icon: <Icon name="desktop" />,
108114
disabled:
109115
apps["xpra"] == null ||

0 commit comments

Comments
 (0)