mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 21:39:06 +08:00
Update disconnected state UI (#1758)
This commit is contained in:
1 parent
797e9012fb
commit
e48468cfae
3 files changed
+37
-14
No files matched your search
@@ -17,6 +17,7 @@ code {
|
|||||||
.App {
|
.App {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
background-color: #1d222a;
|
||||||
}
|
}
|
||||||
|
|
||||||
$base-color1: #292d39;
|
$base-color1: #292d39;
|
||||||
@@ -358,8 +359,32 @@ $sidebar-width: 100% !default;
|
|||||||
border: $custom-border;
|
border: $custom-border;
|
||||||
}
|
}
|
||||||
|
|
||||||
.RenderWindow {
|
#not-connected-overlay {
|
||||||
z-index: 1;
|
position: absolute;
|
||||||
|
background-color: #1d222a;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
z-index: 10;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#not-connected-overlay-text {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
background-color: #393939;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
color: #ff6969;
|
||||||
|
font-size: 18px;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ViewerWindow-render-crop-container {
|
.ViewerWindow-render-crop-container {
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
export default function RenderWindow() {
|
export default function RenderWindow() {
|
||||||
|
const isWebsocketConnected = useSelector(
|
||||||
|
(state) => state.websocketState.isConnected,
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="RenderWindow">
|
<div className="RenderWindow">
|
||||||
|
<div id="not-connected-overlay" hidden={isWebsocketConnected}>
|
||||||
|
<div id="not-connected-overlay-text">Renderer Disconnected</div>
|
||||||
|
</div>
|
||||||
<img
|
<img
|
||||||
id="background-image"
|
id="background-image"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
alt="Render window"
|
alt="Render window"
|
||||||
|
z-index="1"
|
||||||
|
hidden={!isWebsocketConnected}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -66,11 +66,6 @@ export default function StatusPanel(props: StatusPanelProps) {
|
|||||||
const is_training_text = isTraining ? 'Pause Training' : 'Resume Training';
|
const is_training_text = isTraining ? 'Pause Training' : 'Resume Training';
|
||||||
const training_icon = isTraining ? <PauseIcon /> : <PlayArrowIcon />;
|
const training_icon = isTraining ? <PauseIcon /> : <PlayArrowIcon />;
|
||||||
|
|
||||||
const websocket_connected_text = isWebsocketConnected
|
|
||||||
? 'Renderer Connected'
|
|
||||||
: 'Renderer Disconnected';
|
|
||||||
const websocket_connected_color = isWebsocketConnected ? 'success' : 'error';
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="StatusPanel">
|
<div className="StatusPanel">
|
||||||
<div className="StatusPanel-play-button">
|
<div className="StatusPanel-play-button">
|
||||||
@@ -128,13 +123,6 @@ export default function StatusPanel(props: StatusPanelProps) {
|
|||||||
<b>Resolution:</b> {eval_res}
|
<b>Resolution:</b> {eval_res}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
|
||||||
className="StatusPanel-button"
|
|
||||||
color={websocket_connected_color}
|
|
||||||
style={{ textTransform: 'none' }}
|
|
||||||
>
|
|
||||||
{websocket_connected_text}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user