diff --git a/build-plugin.sh b/build-plugin.sh index a5c32d5..5b519fa 100755 --- a/build-plugin.sh +++ b/build-plugin.sh @@ -2,7 +2,7 @@ set -eu PLUGIN="u-navigator" -VERSION="2026.06.23.r012" +VERSION="2026.06.23.r013" PKG_DIR="packages" WORK_DIR=".plugin-build" PKG_NAME="${PLUGIN}-${VERSION}.tgz" diff --git a/packages/u-navigator-2026.06.23.r012.tgz b/packages/u-navigator-2026.06.23.r012.tgz deleted file mode 100644 index 55032fa..0000000 Binary files a/packages/u-navigator-2026.06.23.r012.tgz and /dev/null differ diff --git a/packages/u-navigator-2026.06.23.r013.tgz b/packages/u-navigator-2026.06.23.r013.tgz new file mode 100644 index 0000000..070a3cb Binary files /dev/null and b/packages/u-navigator-2026.06.23.r013.tgz differ diff --git a/plugin-root/usr/local/emhttp/plugins/u-navigator/api/list.php b/plugin-root/usr/local/emhttp/plugins/u-navigator/api/list.php index c1b9180..1cecac3 100644 --- a/plugin-root/usr/local/emhttp/plugins/u-navigator/api/list.php +++ b/plugin-root/usr/local/emhttp/plugins/u-navigator/api/list.php @@ -13,12 +13,20 @@ foreach (scandir($resolved['path']) ?: [] as $name) { } $full = $resolved['path'] . '/' . $name; $type = is_link($full) ? 'symlink' : (is_dir($full) ? 'directory' : (is_file($full) ? 'file' : 'other')); + $ownerId = fileowner($full); + $groupId = filegroup($full); + $perms = fileperms($full); $entries[] = [ 'name' => $name, 'path' => $full, 'type' => $type, 'size' => is_file($full) ? filesize($full) : 0, 'modifiedAt' => date(DATE_ATOM, filemtime($full) ?: time()), + 'owner' => unav_owner_name($ownerId), + 'ownerId' => $ownerId, + 'group' => unav_group_name($groupId), + 'groupId' => $groupId, + 'permissions' => $perms === false ? null : substr(sprintf('%o', $perms), -4), ]; } @@ -32,3 +40,29 @@ unav_json([ 'path' => $resolved['path'], 'entries' => $entries, ]); + +function unav_owner_name($uid): ?string { + if ($uid === false) { + return null; + } + if (function_exists('posix_getpwuid')) { + $info = posix_getpwuid($uid); + if (is_array($info) && isset($info['name'])) { + return $info['name']; + } + } + return (string)$uid; +} + +function unav_group_name($gid): ?string { + if ($gid === false) { + return null; + } + if (function_exists('posix_getgrgid')) { + $info = posix_getgrgid($gid); + if (is_array($info) && isset($info['name'])) { + return $info['name']; + } + } + return (string)$gid; +} diff --git a/server/public/app.js b/server/public/app.js index 925dd36..6b8edad 100644 --- a/server/public/app.js +++ b/server/public/app.js @@ -72,7 +72,7 @@ function openExplorer(initialPath = state.config?.roots?.[0]?.path) { path: initialPath, entries: [], selectedPath: null, - view: 'list', + view: 'icons', loading: false, error: null } @@ -347,6 +347,9 @@ function renderProperties(body) {