Skip to content

Commit

Permalink
Fixed CWA History tables displaying from oldest to newest, adding ser…
Browse files Browse the repository at this point in the history
…ver stats to stats / history page, fixed show_full_history page after last commit and fixed 1 and 0 being stored in fixer db instead of True and False
  • Loading branch information
crocodilestick committed Jan 6, 2025
1 parent 81c7d17 commit 9ab6661
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 13 deletions.
2 changes: 1 addition & 1 deletion root/app/calibre-web/cps/cwa_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def set_cwa_settings():
@admin_required
def cwa_history_show():
cwa_db = CWA_DB()
data_enforcement= cwa_db.enforce_show(paths=False, verbose=False, web_ui=True)
data_enforcement = cwa_db.enforce_show(paths=False, verbose=False, web_ui=True)
data_enforcement_with_paths = cwa_db.enforce_show(paths=True, verbose=False, web_ui=True)
data_imports = cwa_db.get_import_history(verbose=False)
data_conversions = cwa_db.get_conversion_history(verbose=False)
Expand Down
66 changes: 66 additions & 0 deletions root/app/calibre-web/cps/static/css/caliBlur.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 32 additions & 8 deletions root/app/calibre-web/cps/templates/cwa_history.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
<div class="discover">
<h2>{{title}}</h2>

<div>
<h3>Calibre-Web Automated - Server Stats</h3>
<div class="cwa_stats_container">
<div class="cwa_stats_section">
<div class="cwa_stats_header">Total Books</div>
<div class="cwa_stats_value">129</div>
</div>
<div class="cwa_stats_section">
<div class="cwa_stats_header">Books Enforced</div>
<div class="cwa_stats_value">123</div>
</div>
<div class="cwa_stats_section">
<div class="cwa_stats_header">Books Converted</div>
<div class="cwa_stats_value">672</div>
</div>
<div class="cwa_stats_section">
<div class="cwa_stats_header">Books Fixed</div>
<div class="cwa_stats_value">342</div>
</div>
</div>
</div>

<div>
<h3>Calibre-Web Automated Conversion History</h3>
<a class="btn btn-default" href="{{ url_for('cwa_history.show_full_conversions') }}">{{_('Click to See More')}}</a><br>
Expand All @@ -12,7 +34,7 @@ <h3>Calibre-Web Automated Conversion History</h3>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data_conversions %}
{% for row in data_conversions|reverse %}
<tr>
{% for cell in row %}
<td>{{ cell }}</td>
Expand All @@ -31,7 +53,7 @@ <h3>Calibre-Web Automated Import History</h3>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data_imports %}
{% for row in data_imports|reverse %}
<tr>
{% for cell in row %}
<td>{{ cell }}</td>
Expand All @@ -50,7 +72,7 @@ <h3>Calibre-Web Automated EPUB Fixer History</h3>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data_epub_fixer %}
{% for row in data_epub_fixer|reverse %}
<tr>
{% for cell in row %}
<td>{{ cell }}</td>
Expand All @@ -66,10 +88,12 @@ <h4><i>EPUB Fixer History with Paths & Fixes</i></h4>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data_epub_fixer_with_fixes %}
{% for row in data_epub_fixer_with_fixes|reverse %}
<tr>
{% for cell in row %}
<td style="max-height: 20rem; overflow-y: scroll; display: flex;">{{ cell | replace("\n", "<br>") | safe }}</td>
<td>
<div style="max-height: 20rem; overflow-y: auto;">{{ cell | replace("\n", "<br>") | safe }}</div>
</td>
{% endfor %}
</tr>
{% endfor %}
Expand All @@ -85,7 +109,7 @@ <h3>Calibre-Web Automated Enforcement History</h3>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data_enforcement %}
{% for row in data_enforcement|reverse %}
<tr>
{% for cell in row %}
<td>{{ cell }}</td>
Expand All @@ -101,7 +125,7 @@ <h4><i>Enforcement History with Paths</i></h4>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data_enforcement_with_paths %}
{% for row in data_enforcement_with_paths|reverse %}
<tr>
{% for cell in row %}
<td>{{ cell }}</td>
Expand All @@ -112,4 +136,4 @@ <h4><i>Enforcement History with Paths</i></h4>
</div>

</div>
{% endblock %}
{% endblock %}
8 changes: 5 additions & 3 deletions root/app/calibre-web/cps/templates/cwa_history_full.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ <h3>{{title}}</h3><br>
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in data %}
{% for row in data|reverse %}
<tr>
{% for cell in row %}
<td style="max-height: 20rem; overflow-y: scroll; display: flex;">{{ cell | replace("\n", "<br>") | safe }}</td>
<td>
<div style="max-height: 20rem; overflow-y: auto;">{{ cell | replace("\n", "<br>") | safe }}</div>
</td>
{% endfor %}
</tr>
{% endfor %}
</table>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion scripts/kindle_epub_fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def add_entry_to_db(self, input_path, output_path):
fixed_problems = "No fixes required"

self.db.epub_fixer_add_entry(Path(input_path).stem,
self.manually_triggered,
bool(self.manually_triggered),
len(self.fixed_problems),
str(self.cwa_settings['auto_backup_epub_fixes']),
output_path,
Expand Down

0 comments on commit 9ab6661

Please sign in to comment.