accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [53/54] [abbrv] accumulo git commit: ACCUMULO-2181 Added missing sorting for tables
Date Thu, 06 Jul 2017 20:43:47 GMT
ACCUMULO-2181 Added missing sorting for tables


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ccd9fb56
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ccd9fb56
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ccd9fb56

Branch: refs/heads/master
Commit: ccd9fb5644ee481e9b344229a4e5a587b6482ab8
Parents: dd75ed8
Author: Luis Tavarez <zeravat@outlook.com>
Authored: Wed Apr 5 12:47:16 2017 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Thu Jul 6 16:22:41 2017 -0400

----------------------------------------------------------------------
 .../src/main/resources/resources/bulkImport.js  | 19 +++++----
 .../src/main/resources/resources/master.js      | 26 ++++++------
 .../src/main/resources/resources/tservers.js    | 44 +++++++++++---------
 3 files changed, 48 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ccd9fb56/server/monitor/src/main/resources/resources/bulkImport.js
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/resources/resources/bulkImport.js b/server/monitor/src/main/resources/resources/bulkImport.js
index 9e9b2a6..15cce25 100644
--- a/server/monitor/src/main/resources/resources/bulkImport.js
+++ b/server/monitor/src/main/resources/resources/bulkImport.js
@@ -125,9 +125,11 @@ function refreshServerBulkTable() {
 /**
  * Sorts the bulkImportStatus table on the selected column
  *
+ * @param {string} table Table ID to sort
  * @param {number} n Column number to sort by
  */
-function sortTable(n) {
+function sortTable(table, n) {
+  var tableIDs = ['bulkImportStatus', 'masterBulkImportStatus'];
 
   if (sessionStorage.tableColumnSort !== undefined &&
       sessionStorage.tableColumnSort == n &&
@@ -137,8 +139,9 @@ function sortTable(n) {
     direction = sessionStorage.direction === undefined ?
         'asc' : sessionStorage.direction;
   }
+  sessionStorage.tableColumn = tableIDs[table];
   sessionStorage.tableColumnSort = n;
-  sortTables('bulkImportStatus', direction, n);
+  sortTables(tableIDs[table], direction, n);
 }
 
 /**
@@ -165,13 +168,13 @@ function createBulkImportHeader() {
    * Adds the columns, add sortTable function on click,
    * if the column has a description, add title taken from the global.js
    */
-  items.push('<th class="firstcell" onclick="sortTable(0)" >Directory&nbsp;' +
+  items.push('<th class="firstcell" onclick="sortTable(1,0)" >Directory&nbsp;'
+
       '</th>');
 
-  items.push('<th onclick="sortTable(1)" title="' +
+  items.push('<th onclick="sortTable(1,1)" title="' +
       descriptions['Import Age'] + '">Age&nbsp;</th>');
 
-  items.push('<th onclick="sortTable(2)" title="' +
+  items.push('<th onclick="sortTable(1,2)" title="' +
       descriptions['Import State'] + '">State&nbsp;</th>');
 
   $('<tr/>', {
@@ -198,10 +201,10 @@ function createServerBulkHeader() {
    * Adds the columns, add sortTable function on click,
    * if the column has a description, add title taken from the global.js
    */
-  items.push('<th class="firstcell" onclick="sortTable(0)">Server&nbsp;</th>');
-  items.push('<th onclick="sortTable(1)" title="' + descriptions['# Imports'] +
+  items.push('<th class="firstcell" onclick="sortTable(0,0)">Server&nbsp;</th>');
+  items.push('<th onclick="sortTable(0,1)" title="' + descriptions['# Imports'] +
       '">#&nbsp;</th>');
-  items.push('<th onclick="sortTable(2)" title="' + descriptions['Oldest Age'] +
+  items.push('<th onclick="sortTable(0,2)" title="' + descriptions['Oldest Age'] +
       '">Oldest&nbsp;Age&nbsp;</th>');
 
   $('<tr/>', {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ccd9fb56/server/monitor/src/main/resources/resources/master.js
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/resources/resources/master.js b/server/monitor/src/main/resources/resources/master.js
index bc98a97..a4c4c3e 100644
--- a/server/monitor/src/main/resources/resources/master.js
+++ b/server/monitor/src/main/resources/resources/master.js
@@ -188,7 +188,7 @@ function refreshMasterTable() {
  *
  * @param {number} n Column number to sort by
  */
-function sortTable(n) {
+function sortMasterTable(n) {
   if (sessionStorage.tableColumnSort !== undefined &&
       sessionStorage.tableColumnSort == n &&
       sessionStorage.direction !== undefined) {
@@ -226,37 +226,37 @@ function createHeader() {
    * Adds the columns, add sortTable function on click,
    * if the column has a description, add title taken from the global.js
    */
-  items.push('<th class="firstcell" onclick="sortTable(0)" title="' +
+  items.push('<th class="firstcell" onclick="sortMasterTable(0)" title="' +
       descriptions['Master'] + '">Master&nbsp;</th>');
 
-  items.push('<th onclick="sortTable(1)" title="' +
+  items.push('<th onclick="sortMasterTable(1)" title="' +
       descriptions['# Online Tablet Servers'] +
       '">#&nbsp;Online<br />Tablet&nbsp;Servers&nbsp;</th>');
 
-  items.push('<th onclick="sortTable(2)" title="' +
+  items.push('<th onclick="sortMasterTable(2)" title="' +
       descriptions['# Total Tablet Servers'] +
       '">#&nbsp;Total<br />Tablet&nbsp;Servers&nbsp;</th>');
 
-  items.push('<th onclick="sortTable(3)" title="' +
+  items.push('<th onclick="sortMasterTable(3)" title="' +
       descriptions['Last GC'] + '">Last&nbsp;GC&nbsp;</th>');
 
-  items.push('<th onclick="sortTable(4)" title="' +
+  items.push('<th onclick="sortMasterTable(4)" title="' +
       descriptions['# Tablets'] + '">#&nbsp;Tablets&nbsp;</th>');
 
-  items.push('<th onclick="sortTable(5)">#&nbsp;Unassigned' +
+  items.push('<th onclick="sortMasterTable(5)">#&nbsp;Unassigned' +
       '<br />Tablets&nbsp;</th>');
-  items.push('<th onclick="sortTable(6)" title="' +
+  items.push('<th onclick="sortMasterTable(6)" title="' +
       descriptions['Total Entries'] + '">Entries&nbsp;</th>');
-  items.push('<th onclick="sortTable(7)" title="' +
+  items.push('<th onclick="sortMasterTable(7)" title="' +
       descriptions['Total Ingest'] + '">Ingest&nbsp;</th>');
-  items.push('<th onclick="sortTable(8)" title="' +
+  items.push('<th onclick="sortMasterTable(8)" title="' +
       descriptions['Total Entries Read'] + '">Entries<br />Read&nbsp;</th>');
-  items.push('<th onclick="sortTable(9)" title="' +
+  items.push('<th onclick="sortMasterTable(9)" title="' +
       descriptions['Total Entries Returned'] +
       '">Entries<br />Returned&nbsp;</th>');
-  items.push('<th onclick="sortTable(10)" title="' +
+  items.push('<th onclick="sortMasterTable(10)" title="' +
       descriptions['Max Hold Time'] + '">Hold&nbsp;Time&nbsp;</th>');
-  items.push('<th onclick="sortTable(11)" title="' +
+  items.push('<th onclick="sortMasterTable(11)" title="' +
       descriptions['OS Load'] + '">OS&nbsp;Load&nbsp;</th>');
 
   $('<tr/>', {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ccd9fb56/server/monitor/src/main/resources/resources/tservers.js
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/resources/resources/tservers.js b/server/monitor/src/main/resources/resources/tservers.js
index d8c109a..7f19c2d 100644
--- a/server/monitor/src/main/resources/resources/tservers.js
+++ b/server/monitor/src/main/resources/resources/tservers.js
@@ -76,9 +76,9 @@ function refreshBadTServersTable() {
 
     var items = [];
 
-    items.push('<th class="firstcell" onclick="sortTable(0)">' +
+    items.push('<th class="firstcell" onclick="sortTable(0,0)">' +
         'Tablet&nbsp;Server&nbsp;</th>');
-    items.push('<th onclick="sortTable(1)">Tablet&nbsp;Server&nbsp;' +
+    items.push('<th onclick="sortTable(0,1)">Tablet&nbsp;Server&nbsp;' +
         'Status&nbsp;</th>');
 
     $('<tr/>', {
@@ -130,10 +130,10 @@ function refreshDeadTServersTable() {
 
     var items = [];
 
-    items.push('<th class="firstcell" onclick="sortTable(0)">' +
+    items.push('<th class="firstcell" onclick="sortTable(1,0)">' +
         'Server&nbsp;</th>');
-    items.push('<th onclick="sortTable(1)">Last&nbsp;Updated&nbsp;</th>');
-    items.push('<th onclick="sortTable(2)">Event&nbsp;</th>');
+    items.push('<th onclick="sortTable(1,1)">Last&nbsp;Updated&nbsp;</th>');
+    items.push('<th onclick="sortTable(1,2)">Event&nbsp;</th>');
     items.push('<th>Clear</th>');
 
     $('<tr/>', {
@@ -254,9 +254,12 @@ function refreshTServersTable() {
 /**
  * Sorts the tservers table on the selected column
  *
+ * @param {string} table Table ID to sort
  * @param {number} n Column number to sort by
  */
-function sortTable(n) {
+function sortTable(table, n) {
+  var tableIDs = ['badtservers', 'deadtservers', 'tservers'];
+
   if (sessionStorage.tableColumnSort !== undefined &&
       sessionStorage.tableColumnSort == n &&
       sessionStorage.direction !== undefined) {
@@ -265,8 +268,9 @@ function sortTable(n) {
     direction = sessionStorage.direction === undefined ?
         'asc' : sessionStorage.direction;
   }
+  sessionStorage.tableColumn = tableIDs[table];
   sessionStorage.tableColumnSort = n;
-  sortTables('tservers', direction, n);
+  sortTables(tableIDs[table], direction, n);
 }
 
 /**
@@ -286,32 +290,32 @@ function createHeader() {
 
   var items = [];
 
-  items.push('<th class="firstcell" onclick="sortTable(0)">Server&nbsp;</th>');
-  items.push('<th onclick="sortTable(1)">Hosted&nbsp;Tablets&nbsp;</th>');
-  items.push('<th onclick="sortTable(2)">Last&nbsp;Contact&nbsp;</th>');
-  items.push('<th onclick="sortTable(3)" title="' +
+  items.push('<th class="firstcell" onclick="sortTable(2,0)">Server&nbsp;</th>');
+  items.push('<th onclick="sortTable(2,1)">Hosted&nbsp;Tablets&nbsp;</th>');
+  items.push('<th onclick="sortTable(2,2)">Last&nbsp;Contact&nbsp;</th>');
+  items.push('<th onclick="sortTable(2,3)" title="' +
       descriptions['Entries'] + '">Entries&nbsp;</th>');
-  items.push('<th onclick="sortTable(4)" title="' +
+  items.push('<th onclick="sortTable(2,4)" title="' +
       descriptions['Ingest'] + '">Ingest&nbsp;</th>');
-  items.push('<th onclick="sortTable(5)" title="' +
+  items.push('<th onclick="sortTable(2,5)" title="' +
       descriptions['Query'] + '">Query&nbsp;</th>');
-  items.push('<th onclick="sortTable(6)" title="' +
+  items.push('<th onclick="sortTable(2,6)" title="' +
       descriptions['Hold Time'] + '">Hold&nbsp;Time&nbsp;</th>');
-  items.push('<th onclick="sortTable(7)" title="' +
+  items.push('<th onclick="sortTable(2,7)" title="' +
       descriptions['Running Scans'] + '">Running<br />Scans&nbsp;</th>');
-  items.push('<th onclick="sortTable(8)" title="' +
+  items.push('<th onclick="sortTable(2,8)" title="' +
       descriptions['Minor Compactions'] +
       '">Minor<br />Compactions&nbsp;</th>');
-  items.push('<th onclick="sortTable(9)" title="' +
+  items.push('<th onclick="sortTable(2,9)" title="' +
       descriptions['Major Compactions'] +
       '">Major<br />Compactions&nbsp;</th>');
-  items.push('<th onclick="sortTable(10)" title="' +
+  items.push('<th onclick="sortTable(2,10)" title="' +
       descriptions['Index Cache Hit Rate'] +
       '">Index Cache<br />Hit Rate&nbsp;</th>');
-  items.push('<th onclick="sortTable(11)" title="' +
+  items.push('<th onclick="sortTable(2,11)" title="' +
       descriptions['Data Cache Hit Rate'] +
       '">Data Cache<br />Hit Rate&nbsp;</th>');
-  items.push('<th onclick="sortTable(12)" title="' +
+  items.push('<th onclick="sortTable(2,12)" title="' +
       descriptions['OS Load'] + '">OS&nbsp;Load&nbsp;</th>');
 
   $('<tr/>', {


Mime
View raw message