ui: show file names instead of full paths in shares

This commit is contained in:
2026-02-17 22:54:12 +08:00
parent 5f7599bd0d
commit aad1202d5e
2 changed files with 19 additions and 5 deletions

View File

@@ -2702,6 +2702,20 @@ handleDragLeave(e) {
return normalized.startsWith('/') ? normalized : `/${normalized}`;
},
getPathBaseName(pathValue, preferredName = '') {
if (typeof preferredName === 'string' && preferredName.trim()) {
return preferredName.trim();
}
const normalized = this.normalizeSharePath(pathValue || '/');
if (normalized === '/') {
return '/';
}
const segments = normalized.split('/').filter(Boolean);
return segments.length > 0 ? segments[segments.length - 1] : '/';
},
isShareAllFiles(share) {
if (!share) return false;
const shareType = share.share_type || 'file';