Show permissions in properties
This commit is contained in:
+11
-1
@@ -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) => ({
|
||||
'&': '&',
|
||||
|
||||
Reference in New Issue
Block a user