Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 66 additions & 3 deletions dimos/web/templates/rerun_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,78 @@
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { background: #0a0a0f; font-family: -apple-system, system-ui, sans-serif; }
:root { --command-center-width: max(30vw, 35rem); }
.container { display: flex; width: 100%; height: 100%; }
.rerun { flex: 1; border: none; }
.command-center { width: 400px; border: none; border-left: 1px solid #333; }
.command-center {
width: var(--command-center-width);
min-width: 16rem;
border: none;
border-right: 1px solid #333;
}
.rerun { flex: 1 1 auto; border: none; min-width: 0; }
.divider {
width: 6px;
background: linear-gradient(180deg, #202530 0%, #141824 100%);
cursor: col-resize;
border-left: 1px solid #0f1016;
border-right: 1px solid #0f1016;
}
.divider:hover { background: #2a3140; }
.divider.dragging { background: #3a4458; }
body.dragging { user-select: none; cursor: col-resize; }
</style>
</head>
<body>
<div class="container">
<iframe class="rerun" src="http://localhost:9090/?url=rerun%2Bhttp%3A%2F%2Flocalhost%3A9876%2Fproxy"></iframe>
<iframe class="command-center" src="http://localhost:7779/command-center"></iframe>
<div class="divider" role="separator" aria-label="Resize panels"></div>
<iframe class="rerun" src="http://localhost:9090/?url=rerun%2Bhttp%3A%2F%2Flocalhost%3A9876%2Fproxy"></iframe>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, after launch this whole file needs to be nuked. The ports are hardcoded, it's not integrated into the react build system, etc. This PR is just a minimal change to fix the UX

</div>
<script>
(function () {
const container = document.querySelector('.container');
const divider = document.querySelector('.divider');
const commandCenter = document.querySelector('.command-center');
const body = document.body;
const minWidth = 0; // 16rem baseline for small screens

let isDragging = false;
let pointerId = null;

function onPointerMove(event) {
if (!isDragging) return;
const rect = container.getBoundingClientRect();
const dividerWidth = divider.getBoundingClientRect().width;
const available = event.clientX - rect.left - dividerWidth / 2;
const nextWidth = Math.max(minWidth, Math.min(available, rect.width));
commandCenter.style.width = `${nextWidth}px`;
document.documentElement.style.setProperty('--command-center-width', `${nextWidth}px`);
}

function stopDragging() {
if (!isDragging) return;
isDragging = false;
divider.classList.remove('dragging');
body.classList.remove('dragging');
window.removeEventListener('pointermove', onPointerMove);
window.removeEventListener('pointerup', stopDragging);
if (pointerId !== null) {
divider.releasePointerCapture(pointerId);
pointerId = null;
}
}

divider.addEventListener('pointerdown', (event) => {
event.preventDefault();
isDragging = true;
pointerId = event.pointerId;
divider.setPointerCapture(pointerId);
divider.classList.add('dragging');
body.classList.add('dragging');
window.addEventListener('pointermove', onPointerMove);
window.addEventListener('pointerup', stopDragging);
});
})();
</script>
</body>
</html>
5 changes: 4 additions & 1 deletion dimos/web/websocket_vis/websocket_vis_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ def start(self) -> None:
self._uvicorn_server_thread.start()

# Show control center link in terminal
logger.info(f"Command Center: http://localhost:{self.port}/command-center")
if self._global_config.viewer_backend == "rerun-web":
logger.info(f"Command Center: http://localhost:{self.port}")
else:
logger.info(f"Command Center: http://localhost:{self.port}/command-center")

try:
unsub = self.odom.subscribe(self._on_robot_pose)
Expand Down
Loading