diff --git a/Maintenance/test_handling/Summary_Script.js b/Maintenance/test_handling/Summary_Script.js index dfac558e195..90a87da08e5 100644 --- a/Maintenance/test_handling/Summary_Script.js +++ b/Maintenance/test_handling/Summary_Script.js @@ -179,23 +179,25 @@ function platformContainer(platforms) { $tplTable.toggle(); } }).appendTo($container); - const $tplTable = $('', { class: 'tpl-table', css: { display: 'none' } }).appendTo($container); + const $tplTable = $('
', { + class: 'tablesorter', + css: { + display: 'none', + maxWidth: '300px' + } + }).appendTo($container); const $thead = $('').appendTo($tplTable); const $tbody = $('').appendTo($tplTable); const $headerRow = $(''); - $('').append( $(' - `); } @@ -276,6 +277,7 @@ function showVersionsForTPL(tplName) { if (!tplFound) { $modalBody.append(''); } + $modalTable.trigger("update"); $modal.show(); $('.close').click(function() { $modal.hide(); @@ -285,28 +287,6 @@ function showVersionsForTPL(tplName) { $modal.hide(); } }); - const $thead = $modalTable.find('thead'); - initializeTableSorting($thead, $modalBody); - $thead.find('.sortable').first().click(); -} - -function initializeTableSorting($thead, $tbody) { - let sortOrder = 1; - $thead.find('.sortable').click(function() { - const columnIndex = $(this).data('sort'); - const rows = $tbody.find('tr').get(); - rows.sort((a, b) => { - const keyA = $(a).children('td').eq(columnIndex).text().toUpperCase(); - const keyB = $(b).children('td').eq(columnIndex).text().toUpperCase(); - if (keyA < keyB) return -1 * sortOrder; - if (keyA > keyB) return 1 * sortOrder; - return 0; - }); - $.each(rows, (_index, row) => { - $tbody.append(row); - }); - sortOrder *= -1; - }); } function main() { @@ -319,7 +299,9 @@ function main() { platformContainer(data.platforms); packageContainer(data.platforms); $packageContainer.hide(); - + $(document).ready(function() { + $("table.tablesorter").tablesorter(); + }); const urlParams = new URLSearchParams(window.location.search); const platform = urlParams.get('platform'); if (platform) { diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index 63e7a74101e..cbdf6f1c03f 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -838,6 +838,7 @@ sub create_summary_page { Summary + + EOF if (-e $summary_script_src) { copy($summary_script_src, $summary_script_dest) or die "Copy failed: $!"; diff --git a/Maintenance/test_handling/testresult.css b/Maintenance/test_handling/testresult.css index 7eb5096eba8..0345403739e 100644 --- a/Maintenance/test_handling/testresult.css +++ b/Maintenance/test_handling/testresult.css @@ -170,11 +170,6 @@ TABLE.result TD > a.package_name { color: #1A0DAB; } -.sortable{ - cursor: pointer; - text-decoration: underline; -} - /* TPL Modal */ .modal { display: none; @@ -222,24 +217,51 @@ TABLE.result TD > a.package_name { color: #555; } -.modaltable{ +table.tablesorter { + width: 100%; + margin: 20px 0; border-collapse: collapse; - cellspacing: 0; + background-color: #f0f0f0; + color: #333; + font-family: Arial, sans-serif; } -.modalHeader{ - text-align: center; - width: auto; +table.tablesorter thead th { + background-color: #d9d9d9; + color: #333; + font-weight: bold; + padding: 10px; + border: 1px solid #ccc; + text-align: left; + cursor: pointer; } -.modalBody { - text-align: center; +table.tablesorter thead th.tablesorter-headerAsc { + background-repeat: no-repeat; + background-position: right center; + padding-right: 20px; } -.modal-table-row { - border-bottom: 2px ridge #000; +table.tablesorter thead th.tablesorter-headerDesc { + background-repeat: no-repeat; + background-position: right center; + padding-right: 20px; } -.modal-table-row td { - padding: 7px; -} \ No newline at end of file +table.tablesorter tbody tr:nth-child(odd) { + background-color: #e6e6e6; +} + +table.tablesorter tbody tr:nth-child(even) { + background-color: #f0f0f0; +} + +table.tablesorter tbody td { + padding: 8px; + border: 1px solid #ccc; + text-align: left; +} + +table.tablesorter tbody tr:hover { + background-color: #d1d1d1 +}
', { class: 'sortable', 'data-sort': 0, text: 'Library' }).appendTo($headerRow); - $('', { class: 'sortable', 'data-sort': 1, text: 'Version' }).appendTo($headerRow); - $('', { class: 'sortable', 'data-sort': 2, text: 'Status' }).appendTo($headerRow); + $('', { text: 'Library' }).appendTo($headerRow); + $('', { text: 'Version' }).appendTo($headerRow); $headerRow.appendTo($thead); tplArray.forEach(tpl => { $('
').html(`${tpl.name}`), $('').text(tpl.version || 'N/A'), - $('').text(tpl.status) ).appendTo($tbody); }); - initializeTableSorting($thead, $tbody); - $thead.find('.sortable').first().click(); $('.tpl-link').click(function(event) { event.preventDefault(); const tplName = $(this).data('tpl'); @@ -268,7 +270,6 @@ function showVersionsForTPL(tplName) {
No versions of this TPL found across platforms.