@@ -7,7 +7,6 @@ import type { MenuProps } from "antd";
7
7
import { A , Icon } from "@cocalc/frontend/components" ;
8
8
import { useMemo , useState } from "react" ;
9
9
import getTitle from "./get-title" ;
10
- import { avatar_fontcolor } from "@cocalc/frontend/account/avatar/font-color" ;
11
10
import { redux , useTypedRedux } from "@cocalc/frontend/app-framework" ;
12
11
import { LogModal } from "./compute-server-log" ;
13
12
import { EditModal } from "./compute-server" ;
@@ -46,8 +45,6 @@ function getItems({
46
45
id,
47
46
project_id,
48
47
account_id,
49
- title,
50
- color,
51
48
isAdmin,
52
49
} : {
53
50
id : number ;
@@ -82,34 +79,9 @@ function getItems({
82
79
83
80
const titleAndColor = {
84
81
key : "title-color" ,
85
- icon : < Icon name = "server " /> ,
82
+ icon : < Icon name = "colors " /> ,
86
83
disabled : ! is_owner ,
87
- label : (
88
- < div
89
- style = { {
90
- fontWeight : "bold" ,
91
- fontSize : "11pt" ,
92
- display : "flex" ,
93
- color : avatar_fontcolor ( color ) ,
94
- background : color ,
95
- padding : "0 5px" ,
96
- borderRadius : "3px" ,
97
- } }
98
- >
99
- < div
100
- style = { {
101
- maxWidth : "20ex" ,
102
- textOverflow : "ellipsis" ,
103
- overflow : "hidden" ,
104
- whiteSpace : "nowrap" ,
105
- marginRight : "5px" ,
106
- } }
107
- >
108
- { title }
109
- </ div >
110
- (Id: { server . project_specific_id } )
111
- </ div >
112
- ) ,
84
+ label : "Edit Title and Color" ,
113
85
} ;
114
86
const jupyterlab = {
115
87
key : "top-jupyterlab" ,
@@ -133,29 +105,10 @@ function getItems({
133
105
key : "xpra" ,
134
106
label : "X11 Desktop" ,
135
107
icon : < Icon name = "desktop" /> ,
136
- disabled : apps [ "xpra" ] == null ,
137
- } ;
138
-
139
- const logs = {
140
- key : "logs" ,
141
- label : "Logs" ,
142
- icon : < Icon name = "history" /> ,
143
- children : [
144
- {
145
- key : "control-log" ,
146
- icon : < Icon name = "history" /> ,
147
- label : "Control and Configuration Log" ,
148
- } ,
149
- {
150
- key : "serial-console-log" ,
151
- disabled :
152
- server . cloud != "google-cloud" ||
153
- server . state == "off" ||
154
- server . state == "deprovisioned" ,
155
- icon : < Icon name = "laptop" /> ,
156
- label : "Serial Console Log" ,
157
- } ,
158
- ] ,
108
+ disabled :
109
+ apps [ "xpra" ] == null ||
110
+ server . state != "running" ||
111
+ ! server . data ?. externalIp ,
159
112
} ;
160
113
161
114
const optionItems : (
@@ -257,36 +210,6 @@ function getItems({
257
210
] ,
258
211
} ;
259
212
260
- const launch = {
261
- key : "launch" ,
262
- label : "Applications" ,
263
- icon : < Icon name = "global" /> ,
264
- disabled : server . state != "running" ,
265
- children : [
266
- {
267
- key : "run-app-on" ,
268
- type : "group" ,
269
- label : "Run On Compute Server" ,
270
- children : [
271
- { ...jupyterlab , key : "jupyterlab-sub" } ,
272
- { ...vscode , key : "vscode-sub" } ,
273
- { ...xpra , key : "xpra-sub" } ,
274
- // {
275
- // key: "pluto",
276
- // label: "Pluto (Julia)",
277
- // icon: <Icon name="julia" />,
278
- // },
279
- // {
280
- // key: "rstudio",
281
- // value:"rstudio",
282
- // label: "R Studio",
283
- // icon: <Icon name="r" />,
284
- // },
285
- ] ,
286
- } ,
287
- ] ,
288
- } ;
289
-
290
213
const help = {
291
214
key : "help" ,
292
215
icon : < Icon name = "question-circle" /> ,
@@ -344,17 +267,33 @@ function getItems({
344
267
} ,
345
268
jupyterlab ,
346
269
vscode ,
270
+ xpra ,
347
271
{
348
272
type : "divider" ,
349
273
} ,
350
- launch ,
351
- logs ,
274
+ settings ,
352
275
options ,
353
276
{
354
277
type : "divider" ,
355
278
} ,
279
+ {
280
+ key : "control-log" ,
281
+ icon : < Icon name = "history" /> ,
282
+ label : "Configuration Log" ,
283
+ } ,
284
+ {
285
+ key : "serial-console-log" ,
286
+ disabled :
287
+ server . cloud != "google-cloud" ||
288
+ server . state == "off" ||
289
+ server . state == "deprovisioned" ,
290
+ icon : < Icon name = "laptop" /> ,
291
+ label : "Serial Console" ,
292
+ } ,
293
+ {
294
+ type : "divider" ,
295
+ } ,
356
296
help ,
357
- settings ,
358
297
// {
359
298
// key: "control",
360
299
// icon: <Icon name="wrench" />,
@@ -471,7 +410,7 @@ export default function Menu({
471
410
setTitle ( await getTitle ( id ) ) ;
472
411
} ) ( ) ;
473
412
return {
474
- items : getItems ( { ... title , id, project_id, account_id, isAdmin } ) ,
413
+ items : getItems ( { id, project_id, account_id, isAdmin } ) ,
475
414
onClick : async ( obj ) => {
476
415
setOpen ( false ) ;
477
416
let cmd = obj . key . startsWith ( "top-" ) ? obj . key . slice ( 4 ) : obj . key ;
0 commit comments