diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/css/screen.css b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/css/screen.css index 05a4a78eddb..76b2eb98f3f 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/css/screen.css +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/css/screen.css @@ -132,8 +132,8 @@ table { .table-bordered th, .table-bordered td { - border: 1px solid light-dark(#ddd, #444) !important; - } + border: 1px solid light-dark(#ddd, #444) !important; +} table.sortable { border-left: 0; @@ -152,6 +152,7 @@ td { padding-top: 0.15em; padding-bottom: 0.15em; color: #333333; + white-space: nowrap; } th { @@ -167,6 +168,7 @@ th { color: #333333; font-size: 10pt; vertical-align: bottom; + white-space: nowrap; } td.firstcell { diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server_process_common.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server_process_common.js index 687083a1db2..e971ddc019c 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server_process_common.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server_process_common.js @@ -150,6 +150,9 @@ function getDataTableCols(storageKey) { * and executes an ajax method to load the data. */ function refreshTable(table, storageKey) { + // save the current scroll position of the table + var $scrollContainer = $(table).parent('.dt-scroll-body'); + var currentScrollTop = $scrollContainer.scrollTop(); // Destroy the DataTable var dataTableRef = dataTableRefs.get(table); @@ -182,6 +185,8 @@ function refreshTable(table, storageKey) { dataTableRef = createDataTable(table, storageKey); ajaxReloadTable(dataTableRef); dataTableRefs.set(table, dataTableRef); + // restore the scroll position + $scrollContainer.scrollTop(currentScrollTop); } /** @@ -246,6 +251,7 @@ function refreshServerInformation(callback, table, storageKey, banner, bannerMsg */ function createDataTable(table, storageKey) { var dataTableRef = new DataTable(table, { + "scrollX": true, "autoWidth": false, "ajax": function (data, callback) { callback({ @@ -253,9 +259,24 @@ function createDataTable(table, storageKey) { }); }, "buttons": [{ - "extend": 'colvis', - "text": '', - "titleAttr": 'Columns' + "extend": 'colvis', + "text": '', + "titleAttr": 'Columns', + }, + { + "extend": 'spacer' + }, + { + "text": 'Reset', + "titleAttr": 'Reset column selection and column order', + action: function (e, table) { + // reset column selection + table.columns().visible(true); + // reset column order + if (table.colReorder) { + table.colReorder.reset(); + } + } }], "layout": { "topStart": "pageLength", @@ -384,5 +405,6 @@ function createDataTable(table, storageKey) { ], "columns": getDataTableCols(storageKey) }); + return dataTableRef; }