Implement data clean-up dialog (#4072)

* [wip] Add user data cleanup service

* Add clean-up report viewer

* Fix review comments

* Add function comments

* Implement item actions

* Fix UI styles

* Add placeholder for empty results, update category description view

* Add displayEmptyPlaceholder method to show message when results list is empty

* Adjust menu buttons row

* Delete char-scoped data bank attachments on character deletion

* Data Bank: Handle character attachments on rename

* Remove line breaks in description strings

* Drop the category when the last item is deleted

* Skip invalid hashes instead of bailing
This commit is contained in:
Cohee
2025-06-01 13:56:34 +03:00
committed by GitHub
parent 7f47f84c9f
commit 3ec9b1a099
15 changed files with 1475 additions and 62 deletions

View File

@@ -0,0 +1,68 @@
<div class="dataMaidCategory inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<div class="dataMaidCategoryHeader">
<div class="dataMaidCategoryDetails">
<div class="dataMaidCategoryName" data-i18n="{{name}}">
{{name}}
</div>
<small>{{description}}</small>
<div class="dataMaidCategoryInfo">
<small>
<i class="fa-solid fa-file-alt fa-sm"></i>
{{totalItems}}
</small>
<span>&VerticalBar;</span>
<small>
<i class="fa-solid fa-hdd fa-sm"></i>
{{totalSize}}
</small>
</div>
</div>
<div class="dataMaidDeleteAll right_menu_button" title="Delete all items in this category" data-i18n="[title]Delete all items in this category">
<i class="fa-solid fa-fw fa-broom"></i>
</div>
</div>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
</div>
<div class="dataMaidCategoryContent inline-drawer-content">
<div class="flex-container">
{{#each items}}
{{#with this}}
<div class="dataMaidItem" data-hash="{{hash}}">
<div class="dataMaidItemHeader">
<div class="dataMaidItemName">
{{#if parent}}
<span class="dataMaidItemParent">({{parent}})</span>
<span>/</span>
{{/if}}
<b>{{name}}</b>
</div>
<div class="dataMaidItemActions">
<button class="dataMaidItemView menu_button menu_button_icon margin0" title="View item content" data-i18n="[title]View item content">
<i class="fa-solid fa-fw fa-eye"></i>
</button>
<button class="dataMaidItemDownload menu_button menu_button_icon margin0" title="Download item" data-i18n="[title]Download item">
<i class="fa-solid fa-fw fa-download"></i>
</button>
<button class="dataMaidItemDelete menu_button menu_button_icon margin0" title="Delete this item" data-i18n="[title]Delete this item">
<i class="fa-solid fa-fw fa-trash-alt"></i>
</button>
</div>
</div>
<div class="dataMaidItemInfo">
<small>
<i class="fa-solid fa-file fa-sm"></i>
{{size}}
</small>
<span>&VerticalBar;</span>
<small>
<i class="fa-solid fa-calendar fa-sm"></i>
{{date}}
</small>
</div>
</div>
{{/with}}
{{/each}}
</div>
</div>
</div>

View File

@@ -0,0 +1,25 @@
<div class="dataMaidDialog">
<div class="dataMaidDialogHeader">
<div class="dataMaidHeaderInfo info-block warning margin0">
<small data-i18n="Once deleted, the files will be gone forever!">
Once deleted, the files will be gone forever!
</small>
<br>
<small data-i18n="Make sure to back up your data in advance.">
Make sure to back up your data in advance.
</small>
</div>
<button class="menu_button menu_button_icon dataMaidStartButton">
<i class="fa fa-cog"></i>
<span data-i18n="Scan">Scan</span>
</button>
</div>
<hr>
<div class="dataMaidPlaceholder" data-i18n="No results yet. Tap 'Scan' to start scanning.">
No results yet. Tap 'Scan' to start scanning.
</div>
<div class="displayNone dataMaidSpinner">
<i class="fa-solid fa-spinner fa-spin fa-3x"></i>
</div>
<div class="dataMaidResultsList"></div>
</div>