@@ -7,7 +7,6 @@ import type { MenuProps } from "antd";
77import { A , Icon } from "@cocalc/frontend/components" ;
88import { useMemo , useState } from "react" ;
99import getTitle from "./get-title" ;
10- import { avatar_fontcolor } from "@cocalc/frontend/account/avatar/font-color" ;
1110import { redux , useTypedRedux } from "@cocalc/frontend/app-framework" ;
1211import { LogModal } from "./compute-server-log" ;
1312import { EditModal } from "./compute-server" ;
@@ -46,8 +45,6 @@ function getItems({
4645 id,
4746 project_id,
4847 account_id,
49- title,
50- color,
5148 isAdmin,
5249} : {
5350 id : number ;
@@ -82,34 +79,9 @@ function getItems({
8279
8380 const titleAndColor = {
8481 key : "title-color" ,
85- icon : < Icon name = "server " /> ,
82+ icon : < Icon name = "colors " /> ,
8683 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" ,
11385 } ;
11486 const jupyterlab = {
11587 key : "top-jupyterlab" ,
@@ -133,29 +105,10 @@ function getItems({
133105 key : "xpra" ,
134106 label : "X11 Desktop" ,
135107 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 ,
159112 } ;
160113
161114 const optionItems : (
@@ -257,36 +210,6 @@ function getItems({
257210 ] ,
258211 } ;
259212
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-
290213 const help = {
291214 key : "help" ,
292215 icon : < Icon name = "question-circle" /> ,
@@ -344,17 +267,33 @@ function getItems({
344267 } ,
345268 jupyterlab ,
346269 vscode ,
270+ xpra ,
347271 {
348272 type : "divider" ,
349273 } ,
350- launch ,
351- logs ,
274+ settings ,
352275 options ,
353276 {
354277 type : "divider" ,
355278 } ,
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+ } ,
356296 help ,
357- settings ,
358297 // {
359298 // key: "control",
360299 // icon: <Icon name="wrench" />,
@@ -471,7 +410,7 @@ export default function Menu({
471410 setTitle ( await getTitle ( id ) ) ;
472411 } ) ( ) ;
473412 return {
474- items : getItems ( { ... title , id, project_id, account_id, isAdmin } ) ,
413+ items : getItems ( { id, project_id, account_id, isAdmin } ) ,
475414 onClick : async ( obj ) => {
476415 setOpen ( false ) ;
477416 let cmd = obj . key . startsWith ( "top-" ) ? obj . key . slice ( 4 ) : obj . key ;
0 commit comments