mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 06:49:13 +08:00
Add additional help messages to modal (#400)
This commit is contained in:
1 parent
1fb5e40761
commit
6b97edbbad
3 files changed
+145
-23
No files matched your search
@@ -104,8 +104,8 @@ $sidebar-width: 100% !default;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.StatusPanel .StatusPanel-play-button {
|
.StatusPanel .StatusPanel-play-button {
|
||||||
width: 90%;
|
width: 100%;
|
||||||
margin: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.StatusPanel .StatusPanel-button-group {
|
.StatusPanel .StatusPanel-button-group {
|
||||||
@@ -139,16 +139,13 @@ $sidebar-width: 100% !default;
|
|||||||
|
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// Landing Modal styling
|
// Landing Modal styling
|
||||||
// .LandingModal {
|
|
||||||
// display: block;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.LandingModal-box {
|
.LandingModal-box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
width: 400px; // 400
|
width: 600px; // 400
|
||||||
background-color: $base-color2;
|
background-color: $base-color2;
|
||||||
border: 2px solid #000;
|
border: 2px solid #000;
|
||||||
// box-shadow: 24px 24px;
|
// box-shadow: 24px 24px;
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
|
/* eslint-disable react/jsx-props-no-spreading */
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { Box, Button, Modal, Typography } from '@mui/material';
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Modal,
|
||||||
|
Typography,
|
||||||
|
Tabs,
|
||||||
|
Tab,
|
||||||
|
Chip,
|
||||||
|
Link,
|
||||||
|
} from '@mui/material';
|
||||||
|
import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded';
|
||||||
|
|
||||||
import WebSocketUrlField from '../WebSocketUrlField';
|
import WebSocketUrlField from '../WebSocketUrlField';
|
||||||
|
|
||||||
@@ -8,14 +19,66 @@ interface LandingModalProps {
|
|||||||
initial_state: object;
|
initial_state: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface TabPanelProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
index: number;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
function TabPanel(props: TabPanelProps) {
|
||||||
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="tabpanel"
|
||||||
|
hidden={value !== index}
|
||||||
|
id={`simple-tabpanel-${index}`}
|
||||||
|
aria-labelledby={`simple-tab-${index}`}
|
||||||
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
|
{...other}
|
||||||
|
>
|
||||||
|
<Box sx={{ p: 3, padding: 0 }}>
|
||||||
|
<Typography component="div">{children}</Typography>
|
||||||
|
</Box>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function a11yProps(index: number) {
|
||||||
|
return {
|
||||||
|
id: `simple-tab-${index}`,
|
||||||
|
'aria-controls': `simple-tabpanel-${index}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default function LandingModel(props: LandingModalProps) {
|
export default function LandingModel(props: LandingModalProps) {
|
||||||
const [open, setOpen] = React.useState(props.initial_state);
|
const [open, setOpen] = React.useState(props.initial_state);
|
||||||
const handleOpen = () => setOpen(true);
|
const handleOpen = () => setOpen(true);
|
||||||
const handleClose = () => setOpen(false);
|
const handleClose = () => setOpen(false);
|
||||||
|
|
||||||
const text_1 = `At the top right is the Status Panel where you can connect to a WebSocket and see the train/eval status of your NeRF model. The WebSocket URL takes the form <domain-or-ip_address>:<port>.`;
|
const text_intro = `At the top right is the Status Panel where you can connect to a WebSocket and see the train/eval status of your NeRF model. The WebSocket URL takes the form <domain-or-ip_address>:<port>.`;
|
||||||
const text_2 =
|
|
||||||
'If the WebSocket is not connecting, make sure your port is being forwarded properly!';
|
const command = `ssh -L localhost:7007:localhost:7007 USER@REMOTE.SERVER.IP`;
|
||||||
|
|
||||||
|
const platform = window.navigator.platform.toLowerCase();
|
||||||
|
let initial_tab = 0;
|
||||||
|
if (platform.includes('mac')) {
|
||||||
|
initial_tab = 0;
|
||||||
|
} else if (platform.includes('linux')) {
|
||||||
|
initial_tab = 1;
|
||||||
|
} else if (platform.includes('win')) {
|
||||||
|
initial_tab = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [tabValue, setTabValue] = React.useState(initial_tab);
|
||||||
|
|
||||||
|
const handleTabChange = (event: React.SyntheticEvent, newValue: number) => {
|
||||||
|
setTabValue(newValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCopy = () => {
|
||||||
|
navigator.clipboard.writeText(command);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="LandingModal">
|
<div className="LandingModal">
|
||||||
@@ -47,13 +110,73 @@ export default function LandingModel(props: LandingModalProps) {
|
|||||||
sx={{ mt: 2 }}
|
sx={{ mt: 2 }}
|
||||||
>
|
>
|
||||||
<div className="LandingModel-content">
|
<div className="LandingModel-content">
|
||||||
<b>Getting Started</b>
|
<h2>Getting Started</h2>
|
||||||
<p>{text_1}</p>
|
<p>{text_intro}</p>
|
||||||
<p>
|
<p>
|
||||||
You can enter your WebSocket URL in the Status Panel or here:
|
You can enter your WebSocket URL in the Status Panel or here:
|
||||||
</p>
|
</p>
|
||||||
<WebSocketUrlField />
|
<WebSocketUrlField />
|
||||||
<p>{text_2}</p>
|
<h3>Remote Server</h3>
|
||||||
|
<p>
|
||||||
|
If you are using a remote server, make sure to forward the port.
|
||||||
|
This can be accomplished by running the following command on
|
||||||
|
this machine.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
||||||
|
<Tabs
|
||||||
|
value={tabValue}
|
||||||
|
onChange={handleTabChange}
|
||||||
|
aria-label="os tabs"
|
||||||
|
>
|
||||||
|
<Tab label="Mac OS" {...a11yProps(0)} />
|
||||||
|
<Tab label="Linux" {...a11yProps(1)} />
|
||||||
|
<Tab label="Windows" {...a11yProps(2)} />
|
||||||
|
</Tabs>
|
||||||
|
</Box>
|
||||||
|
<TabPanel value={tabValue} index={0}>
|
||||||
|
<p>
|
||||||
|
SSH must be set up on the remote machine. Then run the
|
||||||
|
following on this machine:
|
||||||
|
</p>
|
||||||
|
<Chip
|
||||||
|
label={command}
|
||||||
|
onDelete={handleCopy}
|
||||||
|
deleteIcon={<ContentCopyRoundedIcon />}
|
||||||
|
/>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel value={tabValue} index={1}>
|
||||||
|
<p>
|
||||||
|
SSH must be set up on the remote machine. Then run the
|
||||||
|
following on this machine:
|
||||||
|
</p>
|
||||||
|
<Chip
|
||||||
|
label={command}
|
||||||
|
onDelete={handleCopy}
|
||||||
|
deleteIcon={<ContentCopyRoundedIcon />}
|
||||||
|
/>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel value={tabValue} index={2}>
|
||||||
|
<p>
|
||||||
|
SSH must be set up on the remote machine. Then run the
|
||||||
|
following on this machine in PowerShell:
|
||||||
|
</p>
|
||||||
|
<Chip
|
||||||
|
label={command}
|
||||||
|
onDelete={handleCopy}
|
||||||
|
deleteIcon={<ContentCopyRoundedIcon />}
|
||||||
|
/>
|
||||||
|
<p>
|
||||||
|
If OpenSSH is not installed, refer to this{' '}
|
||||||
|
<Link
|
||||||
|
href="http://woshub.com/using-native-ssh-client-windows/"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
|
guide
|
||||||
|
</Link>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
</TabPanel>
|
||||||
</div>
|
</div>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -73,16 +73,18 @@ export default function StatusPanel(props: StatusPanelProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="StatusPanel">
|
<div className="StatusPanel">
|
||||||
<Button
|
<div className="StatusPanel-play-button">
|
||||||
className="StatusPanel-play-button"
|
<Button
|
||||||
variant="contained"
|
className="StatusPanel-play-button"
|
||||||
color="secondary"
|
variant="contained"
|
||||||
onClick={handlePlayChange}
|
color="secondary"
|
||||||
disabled={!isWebsocketConnected}
|
onClick={handlePlayChange}
|
||||||
startIcon={training_icon}
|
disabled={!isWebsocketConnected}
|
||||||
>
|
startIcon={training_icon}
|
||||||
{is_training_text}
|
>
|
||||||
</Button>
|
{is_training_text}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<Button
|
<Button
|
||||||
className="StatusPanel-hide-scene-button"
|
className="StatusPanel-hide-scene-button"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|||||||
Reference in new issue
Block a user