diff --git a/src/app/components/DeviceDetailOverlay.tsx b/src/app/components/DeviceDetailOverlay.tsx index dbf0a7e..7b60882 100644 --- a/src/app/components/DeviceDetailOverlay.tsx +++ b/src/app/components/DeviceDetailOverlay.tsx @@ -37,7 +37,7 @@ export default function DeviceDetailOverlay({ }: DeviceDetailOverlayProps) { const [touchStart, setTouchStart] = useState(0); const [touchEnd, setTouchEnd] = useState(0); - const [showMediaBrowser, setShowMediaBrowser] = useState(false); + const [browsingField, setBrowsingField] = useState<'url' | 'base_url' | 'cache' | null>(null); const [showCommandMenu, setShowCommandMenu] = useState(false); const minSwipeDistance = 50; @@ -318,32 +318,76 @@ export default function DeviceDetailOverlay({ - {deviceData.url !== undefined && ( + {deviceData.base_url !== undefined && (
- +
{ const path = getDevicePath(); - updateDeviceSetting([...path, 'url'], e.target.value); + updateDeviceSetting([...path, 'base_url'], e.target.value); }} className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg" />
+
+ )} + +
+ +
+ { + const path = getDevicePath(); + updateDeviceSetting([...path, 'url'], e.target.value); + }} + className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg" + /> + +
- {mediaSetFiles && ( -
- -
- )} + {mediaSetFiles && ( +
+ +
+ )} +
+ + {deviceData.cache !== undefined && ( +
+ +
+ { + const path = getDevicePath(); + updateDeviceSetting([...path, 'cache'], e.target.value); + }} + className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg" + /> + +
)} @@ -395,11 +439,23 @@ export default function DeviceDetailOverlay({ - {showMediaBrowser && ( + {browsingField && ( { void handleFileSelect(path); setShowMediaBrowser(false); }} - onClose={() => setShowMediaBrowser(false)} + currentPath={ + browsingField === 'cache' ? (deviceData.cache || '/') : + browsingField === 'base_url' ? (deviceData.base_url || '/') : + (deviceData.url || '/') + } + onSelect={(selectedPath: string) => { + if (browsingField === 'url') { + void handleFileSelect(selectedPath); + } else { + const devPath = getDevicePath(); + updateDeviceSetting([...devPath, browsingField], selectedPath); + } + setBrowsingField(null); + }} + onClose={() => setBrowsingField(null)} /> )} diff --git a/src/app/components/StatusPage.tsx b/src/app/components/StatusPage.tsx index f9b833e..b74287b 100644 --- a/src/app/components/StatusPage.tsx +++ b/src/app/components/StatusPage.tsx @@ -146,7 +146,9 @@ export default function StatusPage({ config, setConfig }: StatusPageProps) {
Device #{activeDevice.number}
-
{activeDevice.url}
+
+ {[activeDevice.base_url, activeDevice.url].filter(Boolean).join('') || '—'} +