trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewr...@apache.org
Subject [2/3] incubator-trafficcontrol git commit: hooks up routing methods component
Date Tue, 09 May 2017 13:59:37 GMT
hooks up routing methods component


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

Branch: refs/heads/master
Commit: 440cc5937580bbf18a6fe68348e0c522165b1a42
Parents: c07c82c
Author: Jeremy Mitchell <mitchell852@gmail.com>
Authored: Tue May 9 07:51:39 2017 -0600
Committer: Dewayne Richardson <dewrich@apache.org>
Committed: Tue May 9 07:59:31 2017 -0600

----------------------------------------------------------------------
 .../ui/app/src/common/api/CDNService.js         | 16 ++++
 .../widget/capacity/WidgetCapacityController.js |  8 +-
 .../widget/capacity/widget.capacity.tpl.html    | 16 ++--
 .../widget/routing/WidgetRoutingController.js   | 24 ++++--
 .../modules/widget/routing/_widget.routing.scss |  3 +
 .../widget/routing/widget.routing.tpl.html      | 91 +++++++++++++++-----
 .../monitor/dashboard/dashboard.tpl.html        | 54 +-----------
 .../experimental/ui/app/src/styles/main.scss    |  1 +
 8 files changed, 120 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/common/api/CDNService.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/api/CDNService.js b/traffic_ops/experimental/ui/app/src/common/api/CDNService.js
index b24f412..881c0f1 100644
--- a/traffic_ops/experimental/ui/app/src/common/api/CDNService.js
+++ b/traffic_ops/experimental/ui/app/src/common/api/CDNService.js
@@ -104,6 +104,22 @@ var CDNService = function($http, $q, Restangular, locationUtils, messageModel,
E
         return request.promise;
     };
 
+    this.getRoutingMethods = function() {
+        var request = $q.defer();
+
+        $http.get(ENV.api['root'] + "cdns/routing")
+            .then(
+                function(result) {
+                    request.resolve(result.data.response);
+                },
+                function(fault) {
+                    request.reject();
+                }
+            );
+
+        return request.promise;
+    };
+
     this.getCurrentStats = function() {
         var request = $q.defer();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/WidgetCapacityController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/WidgetCapacityController.js
b/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/WidgetCapacityController.js
index 6a0227a..e7c57cb 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/WidgetCapacityController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/WidgetCapacityController.js
@@ -22,10 +22,10 @@ var WidgetCapacityController = function($scope, cdnService) {
 	var getCapacity = function() {
 		cdnService.getCapacity()
 			.then(function(response) {
-				$scope.availablePercent = Math.round(response.availablePercent * 100) / 100;
-				$scope.utilizedPercent = Math.round(response.utilizedPercent * 100) / 100;
-				$scope.maintenancePercent = Math.round(response.maintenancePercent * 100) / 100;
-				$scope.unavailablePercent = Math.round(response.unavailablePercent * 100) / 100;
+				$scope.availablePercent = response.availablePercent;
+				$scope.utilizedPercent = response.utilizedPercent;
+				$scope.maintenancePercent = response.maintenancePercent;
+				$scope.unavailablePercent = response.unavailablePercent;
 
 				var data = [];
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/widget.capacity.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/widget.capacity.tpl.html
b/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/widget.capacity.tpl.html
index 96f1fb5..8e07478 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/widget.capacity.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/widget/capacity/widget.capacity.tpl.html
@@ -11,27 +11,27 @@
                 <table class="tile_info">
                     <tr>
                         <td>
-                            <p><i class="fa fa-square green"></i>Available
</p>
+                            <p><i class="fa fa-square green"></i>Available</p>
                         </td>
-                        <td>{{availablePercent}}%</td>
+                        <td>{{availablePercent | number:2}}%</td>
                     </tr>
                     <tr>
                         <td>
-                            <p><i class="fa fa-square blue"></i>Utilized
</p>
+                            <p><i class="fa fa-square blue"></i>Utilized</p>
                         </td>
-                        <td>{{utilizedPercent}}%</td>
+                        <td>{{utilizedPercent | number:2}}%</td>
                     </tr>
                     <tr>
                         <td>
-                            <p><i class="fa fa-square gray"></i>Maint </p>
+                            <p><i class="fa fa-square gray"></i>Maintenance</p>
                         </td>
-                        <td>{{maintenancePercent}}%</td>
+                        <td>{{maintenancePercent | number:2}}%</td>
                     </tr>
                     <tr>
                         <td>
-                            <p><i class="fa fa-square red"></i>Down </p>
+                            <p><i class="fa fa-square red"></i>Down</p>
                         </td>
-                        <td>{{unavailablePercent}}%</td>
+                        <td>{{unavailablePercent | number:2}}%</td>
                     </tr>
                 </table>
             </td>

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/WidgetRoutingController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/WidgetRoutingController.js
b/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/WidgetRoutingController.js
index dc8f03c..da97948 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/WidgetRoutingController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/WidgetRoutingController.js
@@ -17,17 +17,29 @@
  * under the License.
  */
 
-var WidgetRoutingController = function(routing, $scope) {
+var WidgetRoutingController = function($scope, cdnService) {
+
+	var getRoutingMethods = function() {
+		cdnService.getRoutingMethods()
+			.then(function(response) {
+				$scope.native = response.cz;
+				$scope.thirdParty = response.geo;
+				$scope.federated = response.fed;
+				$scope.miss = response.miss;
+				$scope.static = response.staticRoute;
+				$scope.dsr = response.dsr;
+				$scope.error = response.err;
+				$scope.regionalAlternate = response.regionalAlternate;
+				$scope.regionalDenied = response.regionalDenied;
+			});
+	};
 
 	var init = function() {
-		if (routing) {
-			// only set this if it's passed in
-			$scope.routing = routing;
-		}
+		getRoutingMethods();
 	};
 	init();
 
 };
 
-WidgetRoutingController.$inject = ['routing', '$scope'];
+WidgetRoutingController.$inject = ['$scope', 'cdnService'];
 module.exports = WidgetRoutingController;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/_widget.routing.scss
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/_widget.routing.scss
b/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/_widget.routing.scss
new file mode 100644
index 0000000..0aa2686
--- /dev/null
+++ b/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/_widget.routing.scss
@@ -0,0 +1,3 @@
+.widget_summary .w_right span {
+  font-size: 16px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/widget.routing.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/widget.routing.tpl.html
b/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/widget.routing.tpl.html
index d45372c..d70493a 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/widget.routing.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/widget/routing/widget.routing.tpl.html
@@ -8,46 +8,53 @@
         </div>
         <div class="w_center w_55">
             <div class="progress">
-                <div class="progress-bar bg-green" role="progressbar" aria-valuenow="60"
aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
-                    <span class="sr-only">60% Complete</span>
-                </div>
+                <div class="progress-bar" role="progressbar" ng-style="{'width': native
+ '%'}" style="background-color: #357EBD;"></div>
             </div>
         </div>
         <div class="w_right w_20">
-            <span>60%</span>
+            <span>{{native | number:3}}%</span>
         </div>
         <div class="clearfix"></div>
     </div>
-
     <div class="widget_summary">
         <div class="w_left w_25">
             <span>3rd Party</span>
         </div>
         <div class="w_center w_55">
             <div class="progress">
-                <div class="progress-bar bg-green" role="progressbar" aria-valuenow="60"
aria-valuemin="0" aria-valuemax="100" style="width: 20%;">
-                    <span class="sr-only">60% Complete</span>
-                </div>
+                <div class="progress-bar" role="progressbar" ng-style="{'width': thirdParty
+ '%'}" style="background-color: #263C53;"></div>
             </div>
         </div>
         <div class="w_right w_20">
-            <span>20%</span>
+            <span>{{thirdParty | number:3}}%</span>
         </div>
         <div class="clearfix"></div>
     </div>
     <div class="widget_summary">
         <div class="w_left w_25">
-            <span>DSR</span>
+            <span>Federated</span>
         </div>
         <div class="w_center w_55">
             <div class="progress">
-                <div class="progress-bar bg-green" role="progressbar" aria-valuenow="60"
aria-valuemin="0" aria-valuemax="100" style="width: 10%;">
-                    <span class="sr-only">60% Complete</span>
-                </div>
+                <div class="progress-bar" role="progressbar" ng-style="{'width': federated
+ '%'}" style="background-color: #8a00e6;"></div>
             </div>
         </div>
         <div class="w_right w_20">
-            <span>10%</span>
+            <span>{{federated | number:3}}%</span>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="widget_summary">
+        <div class="w_left w_25">
+            <span>Miss</span>
+        </div>
+        <div class="w_center w_55">
+            <div class="progress">
+                <div class="progress-bar" role="progressbar" ng-style="{'width': miss
+ '%'}" style="background-color: #a94442;"></div>
+            </div>
+        </div>
+        <div class="w_right w_20">
+            <span>{{miss | number:3}}%</span>
         </div>
         <div class="clearfix"></div>
     </div>
@@ -57,29 +64,67 @@
         </div>
         <div class="w_center w_55">
             <div class="progress">
-                <div class="progress-bar bg-green" role="progressbar" aria-valuenow="60"
aria-valuemin="0" aria-valuemax="100" style="width: 5%;">
-                    <span class="sr-only">60% Complete</span>
-                </div>
+                <div class="progress-bar" role="progressbar" ng-style="{'width': static
+ '%'}" style="background-color: #cccccc;"></div>
             </div>
         </div>
         <div class="w_right w_20">
-            <span>5%</span>
+            <span>{{static | number:3}}%</span>
         </div>
         <div class="clearfix"></div>
     </div>
     <div class="widget_summary">
         <div class="w_left w_25">
-            <span>Federated</span>
+            <span>DSR</span>
+        </div>
+        <div class="w_center w_55">
+            <div class="progress">
+                <div class="progress-bar" role="progressbar" ng-style="{'width': dsr +
'%'}" style="background-color: #3c763d;"></div>
+            </div>
+        </div>
+        <div class="w_right w_20">
+            <span>{{dsr | number:3}}%</span>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="widget_summary">
+        <div class="w_left w_25">
+            <span>Error</span>
+        </div>
+        <div class="w_center w_55">
+            <div class="progress">
+                <div class="progress-bar" role="progressbar" ng-style="{'width': error
+ '%'}" style="background-color: #E74C3C"></div>
+            </div>
+        </div>
+        <div class="w_right w_20">
+            <span>{{error | number:3}}%</span>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="widget_summary">
+        <div class="w_left w_25">
+            <span>Regional Alternate</span>
+        </div>
+        <div class="w_center w_55">
+            <div class="progress">
+                <div class="progress-bar" role="progressbar" ng-style="{'width': regionalAlternate
+ '%'}" style="background-color: #666666;"></div>
+            </div>
+        </div>
+        <div class="w_right w_20">
+            <span>{{regionalAlternate | number:3}}%</span>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="widget_summary">
+        <div class="w_left w_25">
+            <span>Regional Denied</span>
         </div>
         <div class="w_center w_55">
             <div class="progress">
-                <div class="progress-bar bg-green" role="progressbar" aria-valuenow="60"
aria-valuemin="0" aria-valuemax="100" style="width: 5%;">
-                    <span class="sr-only">60% Complete</span>
-                </div>
+                <div class="progress-bar" role="progressbar" ng-style="{'width': regionalDenied
+ '%'}" style="background-color: #666666;"></div>
             </div>
         </div>
         <div class="w_right w_20">
-            <span>5%</span>
+            <span>{{regionalDenied | number:3}}%</span>
         </div>
         <div class="clearfix"></div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/modules/private/monitor/dashboard/dashboard.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/modules/private/monitor/dashboard/dashboard.tpl.html
b/traffic_ops/experimental/ui/app/src/modules/private/monitor/dashboard/dashboard.tpl.html
index 5254378..87d6257 100644
--- a/traffic_ops/experimental/ui/app/src/modules/private/monitor/dashboard/dashboard.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/modules/private/monitor/dashboard/dashboard.tpl.html
@@ -18,7 +18,6 @@ under the License.
 -->
 
 <div role="main">
-    <!-- top tiles -->
     <div class="row tile_count">
         <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
             <span class="count_top"><i class="fa fa-bolt"></i> Total Bandwidth</span>
@@ -45,71 +44,22 @@ under the License.
             <div class="count">999</div>
         </div>
     </div>
-    <!-- /top tiles -->
-
-    <!-- cdn graphs -->
     <div ng-repeat="cdn in ::cdns">
         <div class="row">
             <div class="col-md-12 col-sm-12 col-xs-12 chartContainer" data-cdnid="{{::cdn.id}}"
ui-view="cdnChartContent"></div>
         </div>
         <br>
     </div>
-    <!-- /cdn graphs -->
-
     <div class="row">
-
-
         <div class="col-md-4 col-sm-4 col-xs-12">
             <div class="x_panel tile fixed_height_320" ui-view="capacityContent"></div>
-        </div>
-
-        <div class="col-md-4 col-sm-4 col-xs-12">
-            <div class="x_panel tile fixed_height_320" ui-view="routingContent"></div>
-        </div>
-        <div class="col-md-4 col-sm-4 col-xs-12">
-            <div class="x_panel tile fixed_height_320">
-                <div class="x_title">
-                    <h3>Something Else</h3>
-                </div>
-                <div class="x_content">
-                    <div class="dashboard-widget-content">
-                        <ul class="quick-list">
-                            <li><i class="fa fa-calendar-o"></i><a href="#">Foo</a>
-                            </li>
-                            <li><i class="fa fa-bars"></i><a href="#">Bar</a>
-                            </li>
-                            <li><i class="fa fa-bar-chart"></i><a href="#">Foo</a>
</li>
-                            <li><i class="fa fa-line-chart"></i><a href="#">Bar</a>
-                            </li>
-                            <li><i class="fa fa-bar-chart"></i><a href="#">Foo</a>
</li>
-                            <li><i class="fa fa-line-chart"></i><a href="#">Bar</a>
-                            </li>
-                            <li><i class="fa fa-area-chart"></i><a href="#">Foo</a>
-                            </li>
-                        </ul>
-
-                        <div class="sidebar-widget">
-                            <h4>Something</h4>
-                            <canvas width="150" height="80" id="chart_gauge_01" class=""
style="width: 160px; height: 100px;"></canvas>
-                            <div class="goal-wrapper">
-                                <span id="gauge-text" class="gauge-value pull-left">0</span>
-                                <span class="gauge-value pull-left">%</span>
-                                <span id="goal-text" class="goal-value pull-right">100%</span>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <div class="row">
-        <div class="col-md-4 col-sm-4 col-xs-12">
-            <div class="x_panel" ui-view="changeLogsContent"></div>
+            <div class="x_panel tile" ui-view="routingContent"></div>
         </div>
         <div class="col-md-8 col-sm-8 col-xs-12">
             <div class="row">
                 <div class="col-md-12 col-sm-12 col-xs-12">
                     <div class="x_panel" ui-view="cacheGroupsContent"></div>
+                    <div class="x_panel" ui-view="changeLogsContent"></div>
                 </div>
             </div>
         </div>

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/440cc593/traffic_ops/experimental/ui/app/src/styles/main.scss
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/styles/main.scss b/traffic_ops/experimental/ui/app/src/styles/main.scss
index b981edb..3ad9e63 100755
--- a/traffic_ops/experimental/ui/app/src/styles/main.scss
+++ b/traffic_ops/experimental/ui/app/src/styles/main.scss
@@ -35,6 +35,7 @@ $fa-font-path: "../assets/fonts";
 @import "../common/modules/release/release";
 @import "../common/modules/widget/capacity/widget.capacity";
 @import "../common/modules/widget/cdnChart/widget.cdnChart";
+@import "../common/modules/widget/routing/widget.routing";
 
 // public
 @import "../modules/public/login/login";


Mime
View raw message