This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 96015e9  HBASE-24652 master-status UI make date type fields sortable
96015e9 is described below

commit 96015e9669158d5b0426814628adad825fa91f4e
Author: eomiks <jeongmin....@navercorp.com>
AuthorDate: Mon Jun 29 01:18:45 2020 +0900

    HBASE-24652 master-status UI make date type fields sortable
---
 .../apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon   | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
index dcedb28..8cebaaa 100644
--- 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
+++ 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
@@ -453,8 +453,20 @@ AssignmentManager assignmentManager = 
master.getAssignmentManager();
                     return $.tablesorter.formatFloat( s.replace(/,/g,'') );
                 }, type: "numeric"
             });
+            $.tablesorter.addParser(
+            {
+                id: "dateTime",
+                is: function (s) {
+                    return 
/^([a-zA-Z]{3}\s){2}\d{2}\s\d{2}:\d{2}:\d{2}\s[a-zA-Z]{3}\s\d{4}$/.test(s);
+                }, format: function (s) {
+                    var split = s.split(" ");
+                    var time = Date.parse(split[1] + " " + split[2] + " " + 
split[3] + " " + split[5]);
+                    return $.tablesorter.formatFloat(time);
+                }, type: "numeric"
+            });
             $("#baseStatsTable").tablesorter({
                 headers: {
+                    1: {sorter: 'dateTime'},
                     4: {sorter: 'separator'},
                     5: {sorter: 'separator'}
                 }

Reply via email to