fix(webui): duplicate pages show total size saving

This commit is contained in:
Gauthier Roebroeck 2022-01-27 10:35:48 +08:00
parent 388c4f5f30
commit e9bf064cb2
4 changed files with 12 additions and 2 deletions

View file

@ -534,7 +534,8 @@
"action_ignore": "Ignore",
"matches_n": "No matches | 1 match | {count} matches",
"title": "Duplicate pages",
"unknown_size": "Unknown size"
"unknown_size": "Unknown size",
"delete_to_save": "Delete to save {size}"
},
"duplicates": {
"file_hash": "File hash",

View file

@ -3,6 +3,7 @@ export interface PageHashUnknownDto {
mediaType: string,
sizeBytes?: number,
size?: string,
totalSize?: string,
matchCount: number,
}

View file

@ -31,14 +31,21 @@
<v-card-text>
<div>{{ element.mediaType }}</div>
<div>{{ element.size || $t('duplicate_pages.unknown_size') }}</div>
<v-btn
@click="showDialogMatches(element)"
outlined
rounded
class="mt-2"
class="my-4"
>
{{ $tc('duplicate_pages.matches_n', element.matchCount) }}
</v-btn>
<div
v-if="element.totalSize"
style="max-width: 100px"
>{{ $t('duplicate_pages.delete_to_save', {size: element.totalSize}) }}
</div>
</v-card-text>
</v-col>
</v-row>

View file

@ -8,6 +8,7 @@ data class PageHashUnknownDto(
val mediaType: String,
val sizeBytes: Long?,
val size: String? = sizeBytes?.let { BinaryByteUnit.format(it) },
val totalSize: String ? = sizeBytes?.let { BinaryByteUnit.format(it * matchCount) },
val matchCount: Int,
)