fixed terminal
This commit is contained in:
parent
4bc815c963
commit
340dd92e8a
@ -444,6 +444,15 @@ export const SERVER_ACTIONS: ActionInfo[] = [
|
||||
permissions: Permission.Start,
|
||||
response_action: "Ignore"
|
||||
},
|
||||
{
|
||||
name: "Terminal",
|
||||
args: {
|
||||
},
|
||||
requestType: "post",
|
||||
endpoint: "/servers/{server_id}/attach",
|
||||
permissions: Permission.RunCommand,
|
||||
response_action: "Terminal"
|
||||
},
|
||||
{
|
||||
name: "Stop",
|
||||
args: {
|
||||
@ -572,15 +581,6 @@ export const SERVER_ACTIONS: ActionInfo[] = [
|
||||
definitions: definitions,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Interactive",
|
||||
args: {
|
||||
},
|
||||
requestType: "post",
|
||||
endpoint: "/servers/{server_id}/attach",
|
||||
permissions: Permission.RunCommand,
|
||||
response_action: "Terminal"
|
||||
},
|
||||
]
|
||||
|
||||
export const CREATE_SERVER_ACTION: ActionInfo = {
|
||||
|
@ -16,7 +16,6 @@ import Popper from '@mui/material/Popper';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import MenuList from '@mui/material/MenuList';
|
||||
import { Permission } from "./actions";
|
||||
import { Terminal } from "xterm";
|
||||
import TerminalComponent from "./terminal";
|
||||
|
||||
export const apiAuthenticatedContext: Context<[boolean, Dispatch<boolean>]> = createContext([false, (value: boolean) => {}] as [boolean, Dispatch<boolean>])
|
||||
@ -32,6 +31,17 @@ export const formModalStyle = {
|
||||
p: 4,
|
||||
borderRadius: 3,
|
||||
}
|
||||
export const terminalModalStyle = {
|
||||
position: 'absolute' as 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
width: '70%',
|
||||
bgcolor: 'background.paper',
|
||||
p: 4,
|
||||
borderRadius: 3,
|
||||
padding: 10,
|
||||
}
|
||||
|
||||
export const getDesignTokens = (mode: PaletteMode) => ({
|
||||
palette: {
|
||||
@ -278,7 +288,7 @@ export function ActionItem(p: { action: ActionInfo, identifierSubstring?: string
|
||||
onClose={() => { setTerminal(null); }}
|
||||
open={terminal != null}
|
||||
>
|
||||
<Box sx={formModalStyle}>
|
||||
<Box sx={terminalModalStyle}>
|
||||
<TerminalComponent websocket={terminal} />
|
||||
</Box>
|
||||
</Modal>
|
||||
|
Loading…
x
Reference in New Issue
Block a user