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..f0b06dd6a48 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;
@@ -169,6 +169,11 @@ th {
vertical-align: bottom;
}
+/* scroll DataTables horizontally without splitting header and body into separate tables */
+.dt-layout-table > div {
+ overflow-x: auto;
+}
+
td.firstcell {
border-left: 0;
}
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..ca8644837b0 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
@@ -61,6 +61,7 @@
*/
var dataTableRefs = new Map();
+var dataTableColKeys = new Map();
/**
* This function returns the entire response from session storage
@@ -150,9 +151,16 @@ function getDataTableCols(storageKey) {
* and executes an ajax method to load the data.
*/
function refreshTable(table, storageKey) {
+ var dataTableRef = dataTableRefs.get(table);
+ var colsKey = JSON.stringify(getStoredColumns(storageKey));
+
+ // If column data has not changed, only reload the rows so scroll position and column state do not reset
+ if (dataTableRef != null && dataTableColKeys.get(table) === colsKey) {
+ ajaxReloadTable(dataTableRef);
+ return;
+ }
// Destroy the DataTable
- var dataTableRef = dataTableRefs.get(table);
if (dataTableRef != null) {
dataTableRef.destroy();
}
@@ -182,6 +190,7 @@ function refreshTable(table, storageKey) {
dataTableRef = createDataTable(table, storageKey);
ajaxReloadTable(dataTableRef);
dataTableRefs.set(table, dataTableRef);
+ dataTableColKeys.set(table, colsKey);
}
/**
@@ -253,9 +262,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",