YARN-7171: RM UI should sort memory / cores numerically. Contributed by Ahmed Hussein
This commit is contained in:
parent
a65aca2fef
commit
d1ca9432dd
@ -41,6 +41,29 @@ jQuery.fn.dataTableExt.oSort['title-numeric-desc'] = function(a,b) {
|
|||||||
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 'numeric-ignore-strings' sort type
|
||||||
|
jQuery.fn.dataTableExt.oSort['num-ignore-str-asc'] = function(a, b) {
|
||||||
|
if (isNaN(a) && isNaN(b)) return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||||
|
|
||||||
|
if (isNaN(a)) return 1;
|
||||||
|
if (isNaN(b)) return -1;
|
||||||
|
|
||||||
|
x = parseFloat(a);
|
||||||
|
y = parseFloat(b);
|
||||||
|
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||||
|
};
|
||||||
|
|
||||||
|
jQuery.fn.dataTableExt.oSort['num-ignore-str-desc'] = function(a, b) {
|
||||||
|
if (isNaN(a) && isNaN(b)) return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||||
|
|
||||||
|
if (isNaN(a)) return 1;
|
||||||
|
if (isNaN(b)) return -1;
|
||||||
|
|
||||||
|
x = parseFloat(a);
|
||||||
|
y = parseFloat(b);
|
||||||
|
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||||
|
};
|
||||||
|
|
||||||
jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
|
jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
|
||||||
var
|
var
|
||||||
_that = this,
|
_that = this,
|
||||||
|
@ -51,8 +51,9 @@ private static String getAppsTableColumnDefs(
|
|||||||
sb.append("[\n")
|
sb.append("[\n")
|
||||||
.append("{'sType':'natural', 'aTargets': [0]")
|
.append("{'sType':'natural', 'aTargets': [0]")
|
||||||
.append(", 'mRender': parseHadoopID }")
|
.append(", 'mRender': parseHadoopID }")
|
||||||
.append("\n, {'sType':'numeric', 'aTargets': [6, 7, 8]")
|
.append("\n, {'sType':'num-ignore-str', 'aTargets': [6, 7, 8]")
|
||||||
.append(", 'mRender': renderHadoopDate }")
|
.append(", 'mRender': renderHadoopDate }")
|
||||||
|
.append("\n, {'sType':'num-ignore-str', 'aTargets': [11, 12, 13, 14, 15] }")
|
||||||
.append("\n, {'sType':'numeric', bSearchable:false, 'aTargets':");
|
.append("\n, {'sType':'numeric', bSearchable:false, 'aTargets':");
|
||||||
if (isFairSchedulerPage) {
|
if (isFairSchedulerPage) {
|
||||||
sb.append("[15]");
|
sb.append("[15]");
|
||||||
|
Loading…
Reference in New Issue
Block a user