Add cross-link to Turtle Dashboard in App component
This commit is contained in:
@@ -22,6 +22,8 @@ function App() {
|
|||||||
const [showSettings, setShowSettings] = useState(false);
|
const [showSettings, setShowSettings] = useState(false);
|
||||||
const [, forceRender] = useState(0);
|
const [, forceRender] = useState(0);
|
||||||
|
|
||||||
|
const turtleDashboardUrl = import.meta.env.VITE_TURTLE_DASHBOARD_URL || `${window.location.protocol}//${window.location.hostname}:4444`;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
connect();
|
connect();
|
||||||
}, [connect]);
|
}, [connect]);
|
||||||
@@ -34,10 +36,6 @@ function App() {
|
|||||||
|
|
||||||
const staleSecs = lastUpdate ? Math.floor((Date.now() - lastUpdate) / 1000) : null;
|
const staleSecs = lastUpdate ? Math.floor((Date.now() - lastUpdate) / 1000) : null;
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
connect();
|
|
||||||
}, [connect]);
|
|
||||||
|
|
||||||
const renderPanelContent = () => {
|
const renderPanelContent = () => {
|
||||||
switch (panelTab) {
|
switch (panelTab) {
|
||||||
case 'inventory':
|
case 'inventory':
|
||||||
@@ -60,6 +58,16 @@ function App() {
|
|||||||
<div className="app-header">
|
<div className="app-header">
|
||||||
<h1>⛏️ Inventory Manager</h1>
|
<h1>⛏️ Inventory Manager</h1>
|
||||||
<div className="header-right">
|
<div className="header-right">
|
||||||
|
{/* Cross-link to Turtle Dashboard */}
|
||||||
|
<a
|
||||||
|
href={turtleDashboardUrl}
|
||||||
|
className="cross-link-btn"
|
||||||
|
title="Open Turtle Control Dashboard"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
🐢 Turtles
|
||||||
|
</a>
|
||||||
{/* Settings gear button */}
|
{/* Settings gear button */}
|
||||||
<button
|
<button
|
||||||
className="settings-gear"
|
className="settings-gear"
|
||||||
|
|||||||
Reference in New Issue
Block a user