diff --git a/striker-ui/components/Display/FullSize.tsx b/striker-ui/components/Display/FullSize.tsx index 9e4bc6a4..45df321d 100644 --- a/striker-ui/components/Display/FullSize.tsx +++ b/striker-ui/components/Display/FullSize.tsx @@ -10,6 +10,7 @@ import { Panel } from '../Panels'; import { BLACK, RED, TEXT } from '../../lib/consts/DEFAULT_THEME'; import keyCombinations from './keyCombinations'; import putJSON from '../../lib/fetchers/putJSON'; +import { HeaderText } from '../Text'; const useStyles = makeStyles(() => ({ displayBox: { @@ -50,6 +51,7 @@ const useStyles = makeStyles(() => ({ interface PreviewProps { setMode: Dispatch>; uuid: string; + serverName: string | string[] | undefined; } interface VncConnectionProps { @@ -69,7 +71,7 @@ const extractDomain = (url: string | undefined): string | undefined => { return domain; }; -const FullSize = ({ setMode, uuid }: PreviewProps): JSX.Element => { +const FullSize = ({ setMode, uuid, serverName }: PreviewProps): JSX.Element => { const [anchorEl, setAnchorEl] = useState(null); const rfb = useRef(undefined); const [vncConnection, setVncConnection] = useState< @@ -128,6 +130,10 @@ const FullSize = ({ setMode, uuid }: PreviewProps): JSX.Element => { return ( + + + + {vncConnection && extractedDomain && ( diff --git a/striker-ui/components/Display/Preview.tsx b/striker-ui/components/Display/Preview.tsx index 0b2e6a30..6167d7ac 100644 --- a/striker-ui/components/Display/Preview.tsx +++ b/striker-ui/components/Display/Preview.tsx @@ -6,14 +6,17 @@ import DesktopWindowsIcon from '@material-ui/icons/DesktopWindows'; import CropOriginal from '@material-ui/icons/Image'; import { Panel } from '../Panels'; import { BLACK, GREY, TEXT } from '../../lib/consts/DEFAULT_THEME'; +import { HeaderText } from '../Text'; interface PreviewProps { setMode: Dispatch>; + serverName: string | string[] | undefined; } const useStyles = makeStyles(() => ({ displayBox: { padding: 0, + paddingTop: '.7em', width: '100%', }, fullScreenButton: { @@ -39,11 +42,14 @@ const useStyles = makeStyles(() => ({ }, })); -const Preview = ({ setMode }: PreviewProps): JSX.Element => { +const Preview = ({ setMode, serverName }: PreviewProps): JSX.Element => { const classes = useStyles(); return ( + + + { className={classes.button} key={server.server_uuid} component="a" - href={`/server?uuid=${server.server_uuid}`} + href={`/server?uuid=${server.server_uuid}&server_name=${server.server_name}`} > {showCheckbox && ( diff --git a/striker-ui/pages/server/index.tsx b/striker-ui/pages/server/index.tsx index 1aa79a3d..01f413b2 100644 --- a/striker-ui/pages/server/index.tsx +++ b/striker-ui/pages/server/index.tsx @@ -7,8 +7,8 @@ import { FullSize, Preview } from '../../components/Display'; import Header from '../../components/Header'; const useStyles = makeStyles((theme) => ({ - child: { - width: '18%', + preview: { + width: '20%', height: '100%', [theme.breakpoints.down('lg')]: { width: '25%', @@ -17,15 +17,6 @@ const useStyles = makeStyles((theme) => ({ width: '100%', }, }, - server: { - width: '35%', - [theme.breakpoints.down('lg')]: { - width: '25%', - }, - [theme.breakpoints.down('md')]: { - width: '100%', - }, - }, container: { display: 'flex', flexDirection: 'row', @@ -42,7 +33,7 @@ const Server = (): JSX.Element => { const classes = useStyles(); const router = useRouter(); - const { uuid } = router.query; + const { uuid, server_name } = router.query; return ( <> @@ -50,13 +41,17 @@ const Server = (): JSX.Element => { {typeof uuid === 'string' && (previewMode ? ( - - + + ) : ( - + ))}