You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/01/13 19:07:55 UTC

[1/2] incubator-trafficcontrol git commit: removes percentagebar from to graph page due to incompatible license

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master a8dd14463 -> 12d80e152


removes percentagebar from to graph page due to incompatible license


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2ba6ebd0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2ba6ebd0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2ba6ebd0

Branch: refs/heads/master
Commit: 2ba6ebd0519977dac648a1e6750834f6c408c527
Parents: a8dd144
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Jan 12 15:41:11 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Jan 13 12:06:59 2017 -0700

----------------------------------------------------------------------
 traffic_ops/app/public/js/percentagebar.js      | 81 --------------------
 .../app/templates/visual_status/graphs.html.ep  | 27 +------
 2 files changed, 2 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2ba6ebd0/traffic_ops/app/public/js/percentagebar.js
----------------------------------------------------------------------
diff --git a/traffic_ops/app/public/js/percentagebar.js b/traffic_ops/app/public/js/percentagebar.js
deleted file mode 100644
index 92a50e9..0000000
--- a/traffic_ops/app/public/js/percentagebar.js
+++ /dev/null
@@ -1,81 +0,0 @@
-// From http://www.webappers.com/progressBar/lib/progress.js
-// use:
-// <script>display('<%= $short %>_percent_indicator',0,1);</script><
-// update:
-// setProgress(cdn + "_percent_indicator", Math.round(lastVal/maxGbps[cdn] * 100));
-
-/* WebAppers Progress Bar, version 0.2
-* (c) 2007 Ray Cheung
-*
-* WebAppers Progress Bar is freely distributable under the terms of an Creative Commons license.
-* For details, see the WebAppers web site: http://wwww.Webappers.com/
-*
-/*--------------------------------------------------------------------------*/
-var initial = -120;
-var imageWidth=240;
-var eachPercent = (imageWidth/2)/100;
-
-function percentLabel( id, percentage )
-{ 
-    document.write('<div id="'+id+'Text" class="percent_label">'+percentage+'%</div>'); 
-}
-
-function progressBar( id, percentage )
-{ 
-	document.write('<div id="'+id+'" class="progress_bar"></div>');
-}
-
-
-function setText (id, percent)
-{
-    $('#' + id +'Text')[0].innerHTML = percent+"%";
-}
-
-function setProgress(id, percentage)
-{
-    if (isNaN(percentage) || !isFinite(percentage)){
-	   percentage = 0;
-	}
-    var percentageWidth = eachPercent * percentage;
-    var pb = $('#' + id);
-	/* Sample Colors
-	var green = '#A4E142';
-	var yellow = '#D5E043';
-	var red = '#E05043';
-	*/
-
-	/* Mark T's colors*/
-	var green = '#76AA5E';
-	var yellow = '#C07818';
-	var red = '#6D1E05';
-	var color = green;
-	var backgroundColor = '#ccc';
-	if (percentage = 0) {
-	  color = backgroundColor;
-	} else if ((percentage > 50) && (percentage < 75)) {
-	  color = yellow;
-	} else if ((percentage > 75) && (percentage <=100))  {
-	  color = red;
-	} else {
-	  color = green;
-	}
-
-    pb.progressbar({
-	     value: percentageWidth,
-    });
-    pb.css({
-	  "background": backgroundColor
-    });
-	var pbValue = pb.find( ".ui-progressbar-value" );
-	pbValue.css({
-	  "background": color
-	});
-	//#A4E142 - Green
-	//#D5E043 - Yellow
-	//#E05043 - Red
-    var newProgress = eval(initial)+eval(percentageWidth)+'px';
-    $('#' + id)[0].style.backgroundPosition=newProgress+' 0';
-    setText(id,percentage);
-}
-
-/*--------------------------------------------------------------------------*/

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2ba6ebd0/traffic_ops/app/templates/visual_status/graphs.html.ep
----------------------------------------------------------------------
diff --git a/traffic_ops/app/templates/visual_status/graphs.html.ep b/traffic_ops/app/templates/visual_status/graphs.html.ep
index 551a8c1..30bdbb8 100644
--- a/traffic_ops/app/templates/visual_status/graphs.html.ep
+++ b/traffic_ops/app/templates/visual_status/graphs.html.ep
@@ -41,8 +41,7 @@ function getCurrentStats() {
           $('#' + cdn_name + '_conn_val').text(connections.replace(/\B(?=(\d{3})+(?!\d))/g, ",")); //toLocaleString doesnt work across browsers, this regex does.
           var capacity = Math.round(item.capacity);
           var percentage = Math.round(bandwidth/capacity * 100);
-          setProgress(cdn_name + "_percent_indicator", percentage);
-          setText(cdn_name + "_percent_indicator", "avail: " + capacity + ", used: " + percentage);
+          $('#' + cdn_name + '_percent_indicator').text("avail: " + capacity + ", used: " + percentage + "%");
         }
         if (item.cdn == "total") {
             var bandwidth = item.bandwidth.toFixed(2);
@@ -59,30 +58,9 @@ function getCurrentStats() {
 setInterval(getCurrentStats, 30000);
 
 </script>
-<script type="text/javascript" src="/js/percentagebar.js"></script>
 
 <style>
 .statistics_section { float:left; width:35%; color:white; font-size:150%; height:400px; width:305px; background-color:#1f1f1f; margin-right:5px; border:solid 1px grey; }
-.ui-progressbar {
-  position: relative;
-}
-.progress-label {
-  /*position: absolute;*/
-  left: 50%;
-  top: 4px;
-  text-shadow: 1px 1px 0 #fff;
-}
-.percent_label {
-  clear:both;
-  float:left;
-  margin-left:10px;
-}
-.progress_bar {
-  float:right;
-  height: 10px;
-  width: 100px;
-  float:right;
-}
 #graph_panel {width: 65%; float: left; border:solid 1px grey;}
 #stat_value, #total_gbps_val, #total_conn_val { font-size: 225%; text-align: right; padding-right: 10px;}
 #stat_label{padding-top: 30px;};
@@ -99,8 +77,7 @@ setInterval(getCurrentStats, 30000);
             <div id="total_gbps_val"></div>
             % foreach my $cdn ( @{ $cdn_names }) {
                 <div id ="stat_label"><%= $cdn %> Gbps: </div>
-                <div><script>percentLabel('<%= $cdn %>_percent_indicator',0);</script></div>
-                <div><script>progressBar('<%= $cdn %>_percent_indicator',0);</script></div>
+                <div id="<%= $cdn %>_percent_indicator"></div>
                 <div id="stat_value">
                     <div id="<%= $cdn %>_gbps_val"></div>
                 </div>


[2/2] incubator-trafficcontrol git commit: This closes #185.

Posted by da...@apache.org.
This closes #185.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/12d80e15
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/12d80e15
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/12d80e15

Branch: refs/heads/master
Commit: 12d80e152cf2d7c0b4187dbcd2fa1ec61cc97ee4
Parents: 2ba6ebd
Author: Dan Kirkwood <da...@gmail.com>
Authored: Fri Jan 13 12:07:47 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Jan 13 12:07:47 2017 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------