better handling of invalid paths in store view

feat/vaults
Tomáš Mládek 2022-02-21 22:25:48 +01:00
parent b35ffab860
commit 9541c397e3
2 changed files with 13 additions and 4 deletions

View File

@ -608,6 +608,10 @@ pub async fn latest_files(state: web::Data<State>) -> Result<HttpResponse, Error
files_by_hash.get_mut(&file.hash).unwrap().push(file);
}
for paths in files_by_hash.values_mut() {
paths.sort_unstable_by_key(|f| !f.valid);
}
let mut blobs = files_by_hash
.iter()
.map(|(hash, files)| {

View File

@ -27,7 +27,7 @@
</tr>
{#each store.blobs as blob}
<tbody>
<tr>
<tr class:invalid={!blob.paths[0].valid}>
<td class="hash"
><UpObject link address={blob.hash} labels={[]} /></td
>
@ -43,7 +43,7 @@
</td>
</tr>
{#each blob.paths.slice(1) as path}
<tr>
<tr class:invalid={!path.valid}>
<td />
<td />
<td class="path">{path.path}</td>
@ -90,12 +90,17 @@
.size {
white-space: nowrap;
}
.invalid {
font-weight: 200;
}
tbody:nth-child(odd) {
font-weight: 300;
font-weight: 350;
}
tbody:nth-child(even) {
font-weight: 500;
font-weight: 450;
}
}
</style>