mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Update styling of FileTreeView
This commit is contained in:
@@ -117,7 +117,7 @@ export default function FileTreeView({onPathChange}: { onPathChange: (file: stri
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 bg-contrast">
|
||||
<div className="flex flex-col flex-1 w-full gap-4 overflow-hidden">
|
||||
<TreeView
|
||||
data={flattenedFileTree}
|
||||
aria-label="directory tree"
|
||||
@@ -133,7 +133,7 @@ export default function FileTreeView({onPathChange}: { onPathChange: (file: stri
|
||||
<IconContext.Provider value={{size: 32, weight: "regular"}}>
|
||||
<div {...getNodeProps()}
|
||||
className={`
|
||||
flex flex-row items-center gap-2
|
||||
flex flex-row items-center gap-2 w-full
|
||||
rounded-md cursor-pointer
|
||||
${isSelected ? 'bg-primary' : 'hover:bg-primary/20'}`
|
||||
}
|
||||
@@ -144,7 +144,6 @@ export default function FileTreeView({onPathChange}: { onPathChange: (file: stri
|
||||
</IconContext.Provider>
|
||||
)}
|
||||
/>
|
||||
<pre>{JSON.stringify(flattenedFileTree, null, 2)}</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class FilesystemService {
|
||||
if (path == null || path.isEmpty()) {
|
||||
val roots = FileSystems.getDefault().rootDirectories.toList()
|
||||
|
||||
if (roots.size > 1) return roots.map {
|
||||
if (getHostOperatingSystem() == OperatingSystemType.WINDOWS) return roots.map {
|
||||
FileDto(
|
||||
it.root.toString(),
|
||||
if (it.isDirectory()) FileType.DIRECTORY else FileType.FILE,
|
||||
@@ -31,7 +31,7 @@ class FilesystemService {
|
||||
)
|
||||
}
|
||||
|
||||
// If there is only one root, return its contents
|
||||
// UNIX file systems only have one root, so return its contents directly
|
||||
return safeReadDirectoryContents(roots.first().toString())
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ class FilesystemService {
|
||||
Path(path).toFile().listFiles()
|
||||
.filter { !it.isHidden }
|
||||
.map { FileDto(it.name, if (it.isDirectory) FileType.DIRECTORY else FileType.FILE, it.hashCode()) }
|
||||
} catch (e: Exception) {
|
||||
log.error(e) { "Error reading directory contents of $path" }
|
||||
} catch (_: Exception) {
|
||||
log.error { "Error reading directory contents of $path" }
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user