Show permissions in properties

This commit is contained in:
Mikei386
2026-06-23 09:06:23 +02:00
parent dd011bbaa4
commit 74ba8d0984
6 changed files with 48 additions and 4 deletions
+11 -1
View File
@@ -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) {
<dt>Pfad</dt><dd>${escapeHtml(entry.path)}</dd>
<dt>Größe</dt><dd>${formatBytes(entry.size)}</dd>
<dt>Geändert</dt><dd>${new Date(entry.modifiedAt).toLocaleString()}</dd>
<dt>Besitzer</dt><dd>${escapeHtml(formatPrincipal(entry.owner, entry.ownerId))}</dd>
<dt>Gruppe</dt><dd>${escapeHtml(formatPrincipal(entry.group, entry.groupId))}</dd>
<dt>Rechte</dt><dd>${escapeHtml(entry.permissions ? `0${entry.permissions}`.slice(-4) : '-')}</dd>
</dl>
`;
}
@@ -958,6 +961,13 @@ function formatBytes(bytes) {
return `${(value / 1024 / 1024 / 1024).toFixed(1)} GB`;
}
function formatPrincipal(name, id) {
if (name == null && id == null) return '-';
if (name == null || String(name) === String(id)) return String(id);
if (id == null) return String(name);
return `${name} (${id})`;
}
function escapeHtml(value) {
return String(value ?? '').replace(/[&<>"']/g, (char) => ({
'&': '&amp;',