Compare commits
3
Commits
000389a581
...
c339436d4c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c339436d4c
|
||
|
|
72962af606
|
||
|
|
13037f1e59
|
No files matched your search
@@ -2,13 +2,19 @@
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
"identifier": "default",
|
||||
"description": "Capability for the main window",
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"shell:default",
|
||||
"dialog:default",
|
||||
"opener:default"
|
||||
"opener:default",
|
||||
{
|
||||
"identifier": "opener:allow-open-path",
|
||||
"allow": [
|
||||
{
|
||||
"path": "**"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -102,7 +102,7 @@ fn stream(node: &serde_json::Value, parent: &str, map: &mut HashMap<String, Vec<
|
||||
format!("{}/{}", parent, name)
|
||||
};
|
||||
|
||||
let is_dir = children.as_ref().map(|c| !c.is_empty()).unwrap_or(false);
|
||||
let is_dir = PathBuf::from(&path).is_dir();
|
||||
|
||||
map.entry(parent.to_string()).or_default().push(FileInfo {
|
||||
name: name.to_string(),
|
||||
|
||||
+11
-3
@@ -12,7 +12,7 @@ import {
|
||||
import { v5 as uuidv5 } from 'uuid'
|
||||
import prettyBytes from 'pretty-bytes'
|
||||
import { ask, message, open } from '@tauri-apps/plugin-dialog'
|
||||
import { revealItemInDir } from '@tauri-apps/plugin-opener'
|
||||
import { openPath, revealItemInDir } from '@tauri-apps/plugin-opener'
|
||||
|
||||
interface Disk {
|
||||
name: string
|
||||
@@ -186,7 +186,9 @@ export default function App () {
|
||||
className='flex justify-between px-2 py-1 cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 transition-colors rounded-lg'
|
||||
onClick={() => {
|
||||
if (f.is_dir) setCurrentPath(f.path)
|
||||
else openPath(f.path)
|
||||
}}
|
||||
title={f.is_dir ? undefined : 'Click to open the file'}
|
||||
>
|
||||
<p>
|
||||
<FontAwesomeIcon
|
||||
@@ -196,7 +198,10 @@ export default function App () {
|
||||
{f.name}
|
||||
</p>
|
||||
<div className='flex flex-row gap-2 items-center'>
|
||||
<div className='w-4 h-6 flex justify-center items-center'>
|
||||
<div
|
||||
className='w-4 h-6 flex justify-center items-center'
|
||||
title={'Click to show the ' + f.is_dir ? 'folder' : 'file'}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faFolderOpen}
|
||||
className='text-white/60 hover:text-white/75 transition-all hover:scale-110'
|
||||
@@ -206,7 +211,10 @@ export default function App () {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className='w-4 h-6 flex justify-center items-center'>
|
||||
<div
|
||||
className='w-4 h-6 flex justify-center items-center'
|
||||
title={'Click to delete the ' + f.is_dir ? 'folder' : 'file'}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faTrashCan}
|
||||
className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110'
|
||||
|
||||
Reference in new issue
Block a user