Fix Dynamix API routing and menu placement
This commit is contained in:
+9
-2
@@ -26,7 +26,10 @@ init();
|
||||
|
||||
async function init() {
|
||||
try {
|
||||
state.config = await api(apiUrl('config'));
|
||||
state.config = await api(apiUrl('config.php'));
|
||||
if (!state.config.roots?.length) {
|
||||
throw new Error('No U-Navigator roots configured');
|
||||
}
|
||||
statusText.textContent = `${state.config.roots.length} Root, ${state.config.readOnly ? 'Read-only' : 'Schreibzugriff aktiv'}`;
|
||||
openExplorer(state.config.roots[0].path);
|
||||
openProperties();
|
||||
@@ -36,7 +39,11 @@ async function init() {
|
||||
}
|
||||
}
|
||||
|
||||
function openExplorer(initialPath = state.config?.roots[0]?.path) {
|
||||
function openExplorer(initialPath = state.config?.roots?.[0]?.path) {
|
||||
if (!initialPath) {
|
||||
statusText.textContent = 'Kein Root-Pfad konfiguriert';
|
||||
return null;
|
||||
}
|
||||
const win = createWindow('Explorer', 'explorer', {
|
||||
width: 760,
|
||||
height: 460,
|
||||
|
||||
Reference in New Issue
Block a user