From bae54e43b21b732a368426fe1ff4517fc9c3e01a Mon Sep 17 00:00:00 2001 From: Frank Wuerthwein Date: Fri, 8 May 2009 23:45:53 +0000 Subject: Move format_time from rrdFlot into rrdFlotSupport --- src/lib/rrdFlot.js | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'src/lib/rrdFlot.js') diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js index e57ff6d..bc9a8a6 100644 --- a/src/lib/rrdFlot.js +++ b/src/lib/rrdFlot.js @@ -138,42 +138,6 @@ rrdFlot.prototype.createHTML = function() { // ====================================== // Populate RRA and RD info rrdFlot.prototype.populateRes = function() { - function format_time(s) { - if (s<120) { - return s+"s"; - } else { - var s60=s%60; - var m=(s-s60)/60; - if ((m<10) && (s60>9)) { - return m+":"+s60+"min"; - } if (m<120) { - return m+"min"; - } else { - var m60=m%60; - var h=(m-m60)/60; - if ((h<12) && (m60>9)) { - return h+":"+m60+"h"; - } if (h<48) { - return h+"h"; - } else { - var h24=h%24; - var d=(h-h24)/24; - if ((d<7) && (h24>0)) { - return d+" days "+h24+"h"; - } if (d<60) { - return d+" days"; - } else { - var d30=d%30; - var mt=(d-d30)/30; - return mt+" months"; - } - } - } - - } - } - - var form_el=document.getElementById(this.res_id); // First clean up anything in the element @@ -186,7 +150,7 @@ rrdFlot.prototype.populateRes = function() { var step=rra.getStep(); var rows=rra.getNrRows(); var period=step*rows; - var rra_label=format_time(step)+" ("+format_time(period)+" total)"; + var rra_label=rfs_format_time(step)+" ("+rfs_format_time(period)+" total)"; form_el.appendChild(new Option(rra_label,i)); } }; -- cgit v1.2.3-54-g00ecf