diff --git a/README.md b/README.md index af55487..0626881 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Plugins -> Install Plugin -> URL einfuegen -> Install Danach oeffnen: ```text -Tools -> U-Navigator +U-Navigator ``` Es wird kein extra Webserver und kein Node.js auf Unraid benoetigt. diff --git a/build-plugin.sh b/build-plugin.sh index e6ad079..321ef2b 100755 --- a/build-plugin.sh +++ b/build-plugin.sh @@ -2,7 +2,7 @@ set -eu PLUGIN="u-navigator" -VERSION="0.2.0" +VERSION="0.2.1" PKG_DIR="packages" WORK_DIR=".plugin-build" PKG_NAME="${PLUGIN}-${VERSION}.tgz" diff --git a/packages/u-navigator-0.2.0.tgz b/packages/u-navigator-0.2.0.tgz deleted file mode 100644 index 1baa3d7..0000000 Binary files a/packages/u-navigator-0.2.0.tgz and /dev/null differ diff --git a/packages/u-navigator-0.2.1.tgz b/packages/u-navigator-0.2.1.tgz new file mode 100644 index 0000000..8c09bb1 Binary files /dev/null and b/packages/u-navigator-0.2.1.tgz differ diff --git a/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page b/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page index f87382c..b5b3f4f 100644 --- a/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page +++ b/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page @@ -1,4 +1,4 @@ -Menu="Tools" +Menu="U-Navigator" Title="U-Navigator" Icon="folder-open" --- diff --git a/public/app.js b/public/app.js index 519cec2..f84fecb 100644 --- a/public/app.js +++ b/public/app.js @@ -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, diff --git a/u-navigator.plg b/u-navigator.plg index af51a8c..1e12cf3 100644 --- a/u-navigator.plg +++ b/u-navigator.plg @@ -1,7 +1,7 @@ - + ]> @@ -14,7 +14,7 @@ https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package; -47fea71317002e9ea131ca468a870c69 +07964e296752a1f40eaf1930dfe2bdbf @@ -26,7 +26,7 @@ echo "" echo "-----------------------------------------------------------" echo " &name; &version; has been installed." echo "" -echo " Open: Tools -> U-Navigator" +echo " Open: U-Navigator" echo "-----------------------------------------------------------" echo "" diff --git a/u-navigator.plg.in b/u-navigator.plg.in index cbffe0e..9dc7109 100644 --- a/u-navigator.plg.in +++ b/u-navigator.plg.in @@ -26,7 +26,7 @@ echo "" echo "-----------------------------------------------------------" echo " &name; &version; has been installed." echo "" -echo " Open: Tools -> U-Navigator" +echo " Open: U-Navigator" echo "-----------------------------------------------------------" echo ""