mirror of
https://github.com/Jackzmc/storage.git
synced 2025-05-05 21:33:20 +00:00
Fix file parent again
This commit is contained in:
parent
5214ea543c
commit
ab1b808b13
2 changed files with 10 additions and 3 deletions
|
@ -45,7 +45,12 @@ pub async fn list_library_files(route: &Route, libraries: &State<Arc<Mutex<Libra
|
|||
|
||||
// TODO:
|
||||
// parent
|
||||
let parent = path.clone();
|
||||
let mut parent = path.to_string_lossy();
|
||||
if parent == "/" {
|
||||
parent = "".into();
|
||||
} else if parent != "" {
|
||||
parent = format!("{}/", parent).into();
|
||||
}
|
||||
let mut seg_path = PathBuf::new();
|
||||
let segments: Vec<PathSegmentPiece> = path.iter()
|
||||
.map(|segment| {
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="code">
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<table class="table is-fullwidth">
|
||||
<thead>
|
||||
|
@ -65,10 +67,10 @@
|
|||
</td>
|
||||
<td class="filecell-label pl-4">
|
||||
{{#if (eq type "folder")}}
|
||||
<a href="{{../parent}}/{{ path }}">{{ path }}/</a>
|
||||
<a href="{{../parent}}{{ path }}">{{ path }}/</a>
|
||||
{{/if}}
|
||||
{{#if (eq type "file") }}
|
||||
<a target="_blank" href="/file/{{../library.id}}/{{../parent}}/{{ path }}">{{ path }}</a>
|
||||
<a target="_blank" href="/file/{{../library.id}}/{{../parent}}{{ path }}">{{ path }}</a>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{ bytes size }}</td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue