Fix Archive Results column sizing

This commit is contained in:
Nick Sweeting 2026-08-09 16:31:22 -04:00
parent 7e124f9472
commit 0605068221
No known key found for this signature in database
3 changed files with 47 additions and 10 deletions

View File

@ -210,7 +210,7 @@ def render_archiveresults_list(archiveresults_qs, limit=50, config=None):
<td style="padding: 10px 12px; white-space: nowrap; font-size: 20px;" title="{plugin_text}">
{icon}
</td>
<td style="padding: 10px 12px; white-space: nowrap; word-break: normal; font-weight: 500; color: #334155;">
<td class="archive-results-plugin" style="padding: 10px 12px; font-weight: 500; color: #334155;">
<a href="{output_link_attr}" target="_blank"
style="color: #334155; text-decoration: none;"
title="View output fullscreen"
@ -219,7 +219,7 @@ def render_archiveresults_list(archiveresults_qs, limit=50, config=None):
{plugin_text}
</a>
</td>
<td style="padding: 10px 12px; max-width: 280px; white-space: nowrap; word-break: normal;">
<td class="archive-results-output" style="padding: 10px 12px; max-width: 280px;">
<span onclick="document.getElementById('{row_id}').open = !document.getElementById('{row_id}').open"
style="display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
color: #2563eb; text-decoration: none; font-family: ui-monospace, monospace; font-size: 12px; cursor: pointer;"
@ -227,10 +227,10 @@ def render_archiveresults_list(archiveresults_qs, limit=50, config=None):
{output_display}
</span>
</td>
<td style="padding: 10px 12px; white-space: nowrap; color: #64748b; font-size: 12px; text-align: right;">
<td class="archive-results-files" style="padding: 10px 12px; color: #64748b; font-size: 12px; text-align: right;">
{output_file_count}
</td>
<td style="padding: 10px 12px; white-space: normal; word-break: normal; overflow-wrap: normal; color: #64748b; font-size: 12px;">
<td class="archive-results-completed" style="padding: 10px 12px; color: #64748b; font-size: 12px;">
{end_time}
</td>
<td style="padding: 10px 12px; white-space: nowrap;">
@ -302,16 +302,16 @@ def render_archiveresults_list(archiveresults_qs, limit=50, config=None):
return mark_safe(f"""
<div style="border: 1px solid #e2e8f0; border-radius: 8px; overflow-x: auto; overflow-y: hidden; background: #fff; width: 100%;">
<table style="width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 14px;">
<table class="archive-results-table" style="width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 14px;">
<thead>
<tr style="background: #f8fafc; border-bottom: 2px solid #e2e8f0;">
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Details</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Status</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; width: 32px;"></th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Plugin</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Output</th>
<th style="padding: 10px 12px; text-align: right; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Files</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Completed</th>
<th class="archive-results-plugin" style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Plugin</th>
<th class="archive-results-output" style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Output</th>
<th class="archive-results-files" style="padding: 10px 12px; text-align: right; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Files</th>
<th class="archive-results-completed" style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Completed</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Process</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Machine</th>
<th style="padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;">Version</th>

View File

@ -1434,6 +1434,33 @@ body.model-crawl.change-list #result_list td.field-short_id a {
filter: grayscale(100%);
}
.archive-results-table th,
.archive-results-table td {
word-break: normal;
overflow-wrap: normal;
}
.archive-results-table .archive-results-plugin {
min-width: 120px;
white-space: nowrap;
}
.archive-results-table .archive-results-output {
min-width: 180px;
white-space: nowrap;
}
.archive-results-table .archive-results-files {
width: 52px;
min-width: 52px;
white-space: nowrap;
}
.archive-results-table .archive-results-completed {
min-width: 96px;
white-space: normal;
}
#result_list tbody td.field-cmd_str pre,
#result_list tbody td.field-output_str pre {

View File

@ -197,10 +197,20 @@ def test_archiveresult_admin_links_plugin_and_process(real_hook_result):
assert ">-</a>" not in inline_html
assert "overflow-x: auto; overflow-y: hidden" in inline_html
assert "min-width: 1100px" in inline_html
assert inline_html.count("white-space: nowrap; word-break: normal") == 2
assert inline_html.count('class="archive-results-plugin"') == 2
assert inline_html.count('class="archive-results-output"') == 2
assert inline_html.count('class="archive-results-files"') == 2
assert inline_html.count('class="archive-results-completed"') == 2
assert "display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis;" in inline_html
assert '<wbr> <span style="white-space: nowrap;">' in inline_html
admin_css = (Path(__file__).parents[1] / "templates" / "static" / "admin.css").read_text()
assert ".archive-results-table th,\n.archive-results-table td {\n word-break: normal;" in admin_css
assert ".archive-results-table .archive-results-plugin {\n min-width: 120px;" in admin_css
assert ".archive-results-table .archive-results-output {\n min-width: 180px;" in admin_css
assert ".archive-results-table .archive-results-files {\n width: 52px;\n min-width: 52px;" in admin_css
assert ".archive-results-table .archive-results-completed {\n min-width: 96px;\n white-space: normal;" in admin_css
@pytest.mark.django_db(transaction=True)
def test_deleting_binary_and_process_records_preserves_results(real_hook_result):