You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/02/19 18:33:39 UTC

[GitHub] [trafficcontrol] ocket8888 opened a new pull request #4415: Updated Traffic Portal to use TO API v2.0

ocket8888 opened a new pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415
 
 
   legacy configuration file generation routes were not updated to 2.0
   ## What does this PR (Pull Request) do?
   - [x] This PR is not related to any Issue
   
   Upgrades Traffic Portal to use TO API v2, and removes functionality related to endpoints that don't exist in v2. The exception being display of generated configuration files - a special "legacy" API root was added to the environment just to be the base for those calls.
   
   ## Which Traffic Control components are affected by this PR?
   - Traffic Portal
   
   ## What is the best way to verify this PR?
   Run the TP end-to-end tests. Probably also actually run TP and make sure nothing's horrendously broken.
   
   ## The following criteria are ALL met by this PR
   - [x] Tests are unmodified as the intention is to retain supported behavior
   - [x] Traffic Portal's internals are undocumented.
   - [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [x] This PR includes any and all required license headers
   - [x] This PR does not include a database migration
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-589237101
 
 
   > https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L59
   > https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceRegexService.js#L34
   
   There're no query parameter equivalents for these two.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384627697
 
 

 ##########
 File path: traffic_portal/app/src/common/api/JobService.js
 ##########
 @@ -31,9 +31,8 @@ var JobService = function($http, ENV) {
 	};
 
 	this.createJob = function(job) {
-		return $http.post(ENV.api['root'] + 'user/current/jobs', job).then(
+		return $http.post(ENV.api['root'] + 'jobs', job).then(
 
 Review comment:
   Oh, I updated the wrong controller. FormNewJobController isn't the controller for the new jobs form...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384173401
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/widget.dashboardStats.tpl.html
 ##########
 @@ -19,43 +19,43 @@
 
 <div class="col-md-4 col-sm-6 col-xs-12">
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Bandwidth</span>
-        <div class="count">{{totalBandwidth}}</div>
+        <label for="totalBandwidth" class="count_top">Current Bandwidth</label>
+        <output id="totalBandwidth" class="count">{{totalBandwidth}}</output>
     </div>
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Connections</span>
-        <div class="count">{{totalConnections}}</div>
+        <label for="totalConnections" class="count_top">Current Connections</label>
+        <output id="totalConnections" class="count">{{totalConnections}}</output>
     </div>
 </div>
 <div class="col-md-8 col-sm-6 col-xs-12">
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></span>
-            <div class="count green">{{totalOnline}}</div>
+            <label for="totalOnline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></label>
+            <output id="totalOnline" class="count green">{{totalOnline}}</output>
         </div>
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></span>
-            <div class="count red">{{totalOffline}}</div>
+            <label for="totaloffline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></label>
+            <output id="totalOffline" class="count red">{{totalOffline}}</output>
         </div>
     </div>
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top">Online Caches</span>
-            <div class="count">{{online()}}</div>
+            <label for="online-caches" class="count_top">Online Caches</label>
+            <output id="online-caches" class="count">{{online()}}</output>
 
 Review comment:
   oh, here's your problem. should say {{online}} and not {{online()}}

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384174323
 
 

 ##########
 File path: traffic_portal/app/src/app.js
 ##########
 @@ -339,8 +332,6 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/cacheGroupServers').name,
         require('./common/modules/table/cacheGroupStaticDnsEntries').name,
         require('./common/modules/table/capabilities').name,
-        require('./common/modules/table/capabilityEndpoints').name,
 
 Review comment:
   actually, i put them there even though capabilities are not in use yet and they are not accessible via a menu but you can still get to them by going to:
   
   https://tp.domain.net/#!/capabilities/auth/users
   https://tp.domain.net/#!/capabilities/auth/endpoints

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r382093380
 
 

 ##########
 File path: traffic_portal/app/src/common/api/JobService.js
 ##########
 @@ -31,7 +31,7 @@ var JobService = function($http, ENV) {
 	};
 
 	this.createJob = function(job) {
-		return $http.post(ENV.api['root'] + 'user/current/jobs', job).then(
+		return $http.post(ENV.api['root'] + 'jobs', job).then(
 			function (result) {
 				console.info('new job created: ', result);
 
 Review comment:
   I guess. Idk if having that is really a problem, but it's gone.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-589164028
 
 
   > I don't mind waiting a bit to see what happens, but I could also just do another PR next week. Up to you at this point, I suppose.
   
   i think a follow up PR would be fine.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-590462203
 
 
   retest this please

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r381582958
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/form/capability/form.capability.tpl.html
 ##########
 @@ -18,41 +18,31 @@
 -->
 
 <div class="x_panel">
-    <div class="x_title">
-        <ol class="breadcrumb pull-left">
-            <li><a ng-click="navigateToPath('/capabilities')">Capabilities</a></li>
-            <li class="active">{{capName}}</li>
-        </ol>
-        <div class="pull-right" role="group" ng-show="!settings.isNew">
-            <button class="btn btn-primary" title="View Endpoints" ng-click="viewEndpoints()">View Endpoints</button>
-            <!--<button class="btn btn-primary" title="View Users" ng-click="viewUsers()">View Users</button>-->
-        </div>
-        <div class="clearfix"></div>
-    </div>
-    <div class="x_content">
-        <br>
-        <form name="capForm" class="form-horizontal form-label-left" novalidate>
-            <div class="form-group" ng-class="{'has-error': hasError(capForm.name), 'has-feedback': hasError(capForm.name)}">
-                <label class="control-label col-md-2 col-sm-2 col-xs-12">Name *</label>
-                <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input name="name" type="text" class="form-control" placeholder="Example: foo-read or foo-write" ng-disabled="!settings.isNew" ng-model="capability.name" ng-pattern="/^\S*$/" required autofocus>
-                    <small class="input-error" ng-show="hasPropertyError(capForm.name, 'required')">Required</small>
-                    <small class="input-error" ng-show="hasPropertyError(capForm.name, 'pattern')">No spaces</small>
-                    <span ng-show="hasError(capForm.name)" class="form-control-feedback"><i class="fa fa-times"></i></span>
-                </div>
-            </div>
-            <div class="form-group" ng-class="{'has-error': hasError(capForm.description), 'has-feedback': hasError(capForm.description)}">
-                <label class="control-label col-md-2 col-sm-2 col-xs-12">Description *</label>
-                <div class="col-md-10 col-sm-10 col-xs-12">
-                    <textarea name="description" type="text" class="form-control" ng-model="capability.description" rows="10" required autofocus></textarea>
-                    <small class="input-error" ng-show="hasPropertyError(capForm.description, 'required')">Required</small>
-                    <span ng-show="hasError(capForm.description)" class="form-control-feedback"><i class="fa fa-times"></i></span>
-                </div>
-            </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-danger" ng-show="!settings.isNew" ng-click="confirmDelete(capability)">Delete</button>
-                <button type="button" class="btn btn-success" ng-disabled="capForm.$pristine || capForm.$invalid" ng-click="confirmSave(capability)">{{settings.saveLabel}}</button>
-            </div>
-        </form>
-    </div>
+	<div class="x_title">
 
 Review comment:
   shouldn't this form be gone? or are you still allowing them to "view the capability"? seems like viewing all capabilities in the table would be sufficient.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384200789
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/widget.dashboardStats.tpl.html
 ##########
 @@ -19,43 +19,43 @@
 
 <div class="col-md-4 col-sm-6 col-xs-12">
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Bandwidth</span>
-        <div class="count">{{totalBandwidth}}</div>
+        <label for="totalBandwidth" class="count_top">Current Bandwidth</label>
+        <output id="totalBandwidth" class="count">{{totalBandwidth}}</output>
     </div>
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Connections</span>
-        <div class="count">{{totalConnections}}</div>
+        <label for="totalConnections" class="count_top">Current Connections</label>
+        <output id="totalConnections" class="count">{{totalConnections}}</output>
     </div>
 </div>
 <div class="col-md-8 col-sm-6 col-xs-12">
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></span>
-            <div class="count green">{{totalOnline}}</div>
+            <label for="totalOnline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></label>
+            <output id="totalOnline" class="count green">{{totalOnline}}</output>
         </div>
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></span>
-            <div class="count red">{{totalOffline}}</div>
+            <label for="totaloffline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></label>
+            <output id="totalOffline" class="count red">{{totalOffline}}</output>
         </div>
     </div>
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top">Online Caches</span>
-            <div class="count">{{online()}}</div>
+            <label for="online-caches" class="count_top">Online Caches</label>
+            <output id="online-caches" class="count">{{online()}}</output>
 
 Review comment:
   but it said `{{online()}}` before? If I do `{{online}}` it'll say something like `function online()` in the output.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384201759
 
 

 ##########
 File path: traffic_portal/app/src/app.js
 ##########
 @@ -339,8 +332,6 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/cacheGroupServers').name,
         require('./common/modules/table/cacheGroupStaticDnsEntries').name,
         require('./common/modules/table/capabilities').name,
-        require('./common/modules/table/capabilityEndpoints').name,
 
 Review comment:
   It's an inaccessible state through the UI; if you want to see those you have to already know they exist. Clicking on the table won't do anything anymore - and to get there you have to use direct URL navigation. I can leave them in but at this point they're something that's been un-linked from something that itself was just un-linked from a view that's never been linked at all (afaik).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-589164809
 
 
   actually, these are pretty easy ones to change to the query param version. want to just do it as part of this PR?
   
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceService.js#L147
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L59
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L73
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceRegexService.js#L34

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 merged pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 merged pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r381593243
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/form/capability/form.capability.tpl.html
 ##########
 @@ -18,41 +18,31 @@
 -->
 
 <div class="x_panel">
-    <div class="x_title">
-        <ol class="breadcrumb pull-left">
-            <li><a ng-click="navigateToPath('/capabilities')">Capabilities</a></li>
-            <li class="active">{{capName}}</li>
-        </ol>
-        <div class="pull-right" role="group" ng-show="!settings.isNew">
-            <button class="btn btn-primary" title="View Endpoints" ng-click="viewEndpoints()">View Endpoints</button>
-            <!--<button class="btn btn-primary" title="View Users" ng-click="viewUsers()">View Users</button>-->
-        </div>
-        <div class="clearfix"></div>
-    </div>
-    <div class="x_content">
-        <br>
-        <form name="capForm" class="form-horizontal form-label-left" novalidate>
-            <div class="form-group" ng-class="{'has-error': hasError(capForm.name), 'has-feedback': hasError(capForm.name)}">
-                <label class="control-label col-md-2 col-sm-2 col-xs-12">Name *</label>
-                <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input name="name" type="text" class="form-control" placeholder="Example: foo-read or foo-write" ng-disabled="!settings.isNew" ng-model="capability.name" ng-pattern="/^\S*$/" required autofocus>
-                    <small class="input-error" ng-show="hasPropertyError(capForm.name, 'required')">Required</small>
-                    <small class="input-error" ng-show="hasPropertyError(capForm.name, 'pattern')">No spaces</small>
-                    <span ng-show="hasError(capForm.name)" class="form-control-feedback"><i class="fa fa-times"></i></span>
-                </div>
-            </div>
-            <div class="form-group" ng-class="{'has-error': hasError(capForm.description), 'has-feedback': hasError(capForm.description)}">
-                <label class="control-label col-md-2 col-sm-2 col-xs-12">Description *</label>
-                <div class="col-md-10 col-sm-10 col-xs-12">
-                    <textarea name="description" type="text" class="form-control" ng-model="capability.description" rows="10" required autofocus></textarea>
-                    <small class="input-error" ng-show="hasPropertyError(capForm.description, 'required')">Required</small>
-                    <span ng-show="hasError(capForm.description)" class="form-control-feedback"><i class="fa fa-times"></i></span>
-                </div>
-            </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-danger" ng-show="!settings.isNew" ng-click="confirmDelete(capability)">Delete</button>
-                <button type="button" class="btn btn-success" ng-disabled="capForm.$pristine || capForm.$invalid" ng-click="confirmSave(capability)">{{settings.saveLabel}}</button>
-            </div>
-        </form>
-    </div>
+	<div class="x_title">
 
 Review comment:
   I guess the table is probably sufficient, but yeah, that was the intention here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384200191
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/WidgetDashboardStatsController.js
 ##########
 @@ -64,9 +64,18 @@ var WidgetDashboardStatsController = function($scope, $interval, $filter, locati
 	};
 
 	var getServerCount = function() {
-		serverService.getEdgeStatusCount()
+		serverService.getServers()
 			.then(function(result) {
-				serverCount = result;
+				serverCount.set("ONLINE", 0);
 
 Review comment:
   hmm... worked for me. I'll look for it tomorrow

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384156338
 
 

 ##########
 File path: traffic_portal/app/src/app.js
 ##########
 @@ -339,8 +332,6 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/cacheGroupServers').name,
         require('./common/modules/table/cacheGroupStaticDnsEntries').name,
         require('./common/modules/table/capabilities').name,
-        require('./common/modules/table/capabilityEndpoints').name,
 
 Review comment:
   i don't think there's any reason to remove these views. capability endpoints and capability users are still relevant views. i think you should just leave them for future use.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384206020
 
 

 ##########
 File path: traffic_portal/app/src/app.js
 ##########
 @@ -339,8 +332,6 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/cacheGroupServers').name,
         require('./common/modules/table/cacheGroupStaticDnsEntries').name,
         require('./common/modules/table/capabilities').name,
-        require('./common/modules/table/capabilityEndpoints').name,
 
 Review comment:
   yeah, if you leave them in, i can link them via a context menu on the caps table at a later date since you removed the page where they were previously linked from (the edit capability page)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384205050
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/widget.dashboardStats.tpl.html
 ##########
 @@ -19,43 +19,43 @@
 
 <div class="col-md-4 col-sm-6 col-xs-12">
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Bandwidth</span>
-        <div class="count">{{totalBandwidth}}</div>
+        <label for="totalBandwidth" class="count_top">Current Bandwidth</label>
+        <output id="totalBandwidth" class="count">{{totalBandwidth}}</output>
     </div>
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Connections</span>
-        <div class="count">{{totalConnections}}</div>
+        <label for="totalConnections" class="count_top">Current Connections</label>
+        <output id="totalConnections" class="count">{{totalConnections}}</output>
     </div>
 </div>
 <div class="col-md-8 col-sm-6 col-xs-12">
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></span>
-            <div class="count green">{{totalOnline}}</div>
+            <label for="totalOnline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></label>
+            <output id="totalOnline" class="count green">{{totalOnline}}</output>
         </div>
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></span>
-            <div class="count red">{{totalOffline}}</div>
+            <label for="totaloffline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></label>
+            <output id="totalOffline" class="count red">{{totalOffline}}</output>
         </div>
     </div>
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top">Online Caches</span>
-            <div class="count">{{online()}}</div>
+            <label for="online-caches" class="count_top">Online Caches</label>
+            <output id="online-caches" class="count">{{online()}}</output>
 
 Review comment:
   oh, you're right. sorry. i guess i was making assumptions (and didn't read it closely) why it wasn't working for me.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-590361711
 
 
   retest this please

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r381582425
 
 

 ##########
 File path: traffic_portal/app/src/common/api/JobService.js
 ##########
 @@ -31,7 +31,7 @@ var JobService = function($http, ENV) {
 	};
 
 	this.createJob = function(job) {
-		return $http.post(ENV.api['root'] + 'user/current/jobs', job).then(
+		return $http.post(ENV.api['root'] + 'jobs', job).then(
 			function (result) {
 				console.info('new job created: ', result);
 
 Review comment:
   want to remove this console line?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384172206
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/WidgetDashboardStatsController.js
 ##########
 @@ -64,9 +64,18 @@ var WidgetDashboardStatsController = function($scope, $interval, $filter, locati
 	};
 
 	var getServerCount = function() {
-		serverService.getEdgeStatusCount()
+		serverService.getServers()
 			.then(function(result) {
-				serverCount = result;
+				serverCount.set("ONLINE", 0);
 
 Review comment:
   this doesn't seem to be working. i know i have 6 reported servers and it shows `0` in the UI.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384205050
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/widget.dashboardStats.tpl.html
 ##########
 @@ -19,43 +19,43 @@
 
 <div class="col-md-4 col-sm-6 col-xs-12">
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Bandwidth</span>
-        <div class="count">{{totalBandwidth}}</div>
+        <label for="totalBandwidth" class="count_top">Current Bandwidth</label>
+        <output id="totalBandwidth" class="count">{{totalBandwidth}}</output>
     </div>
     <div class="col-md-6 col-sm-12 col-xs-12 tile_stats_count current">
-        <span class="count_top">Current Connections</span>
-        <div class="count">{{totalConnections}}</div>
+        <label for="totalConnections" class="count_top">Current Connections</label>
+        <output id="totalConnections" class="count">{{totalConnections}}</output>
     </div>
 </div>
 <div class="col-md-8 col-sm-6 col-xs-12">
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></span>
-            <div class="count green">{{totalOnline}}</div>
+            <label for="totalOnline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Healthy Caches</a></label>
+            <output id="totalOnline" class="count green">{{totalOnline}}</output>
         </div>
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></span>
-            <div class="count red">{{totalOffline}}</div>
+            <label for="totaloffline" class="count_top"><a ng-click="navigateToPath('/cache-stats')">Unhealthy Caches</a></label>
+            <output id="totalOffline" class="count red">{{totalOffline}}</output>
         </div>
     </div>
     <div class="col-md-4 col-sm-12 col-xs-12 tile_stats_count">
         <div class="col-md-6 col-sm-6 col-xs-6">
-            <span class="count_top">Online Caches</span>
-            <div class="count">{{online()}}</div>
+            <label for="online-caches" class="count_top">Online Caches</label>
+            <output id="online-caches" class="count">{{online()}}</output>
 
 Review comment:
   oh, you're right. sorry. i guess i was making assumptions why it wasn't working for me.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384613012
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/widget/dashboardStats/WidgetDashboardStatsController.js
 ##########
 @@ -64,9 +64,18 @@ var WidgetDashboardStatsController = function($scope, $interval, $filter, locati
 	};
 
 	var getServerCount = function() {
-		serverService.getEdgeStatusCount()
+		serverService.getServers()
 			.then(function(result) {
-				serverCount = result;
+				serverCount.set("ONLINE", 0);
 
 Review comment:
   Ah, I had a typo left over from when I had to convert it from a `for...of` loop to a `for...in`. Should be working now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-588498688
 
 
   I haven't looked thru this yet but i know there are some places that need to be updated due to certain routes being deprecated and not available in 2.0. i.e.
   
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceService.js#L147
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L59
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L73
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceRegexService.js#L34
   
   also, probably just search for
   
   `todo: change to use query param when it is supported`
   
   to see if anything else can be changed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r381584001
 
 

 ##########
 File path: traffic_portal/app/src/common/modules/table/capabilities/table.capabilities.tpl.html
 ##########
 @@ -38,7 +37,7 @@
             </tr>
             </thead>
             <tbody>
-            <tr ng-click="editCapability(c.name)" ng-repeat="c in ::capabilities">
+            <tr ng-click="viewCapability(c.name)" ng-repeat="c in ::capabilities">
 
 Review comment:
   seems like the click could go away. you get everything you need in the table.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 edited a comment on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-588498688
 
 
   I haven't looked thru this yet but i know there are some places that need to be updated due to certain routes being deprecated and not available in 2.0. i.e.
   
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceService.js#L147
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L59
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/RegionService.js#L73
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/DeliveryServiceRegexService.js#L34
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/ParameterService.js#L98
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/api/ServerService.js#L201
   
   also, probably just search for
   
   `todo: change to use query param when it is supported`
   
   to see if anything else can be changed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#discussion_r384162356
 
 

 ##########
 File path: traffic_portal/app/src/common/api/JobService.js
 ##########
 @@ -31,9 +31,8 @@ var JobService = function($http, ENV) {
 	};
 
 	this.createJob = function(job) {
-		return $http.post(ENV.api['root'] + 'user/current/jobs', job).then(
+		return $http.post(ENV.api['root'] + 'jobs', job).then(
 
 Review comment:
   i am unable to create a "job" directly from a delivery service. i.e. https://tp.domain.com/#!/delivery-services/2/jobs/new?type=HTTP and try to create a job. 
   
   `deliveryService: cannot be blank., startTime: must be in the future`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mhoppa commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
mhoppa commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-590459098
 
 
   I think this needs a merge from master in order to pass running into old unit test build issue that was fixed in https://github.com/apache/trafficcontrol/pull/4417 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-590701632
 
 
   As written? No they will not:
   
   https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/routing/routes.go#L316
   https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/routing/routes.go#L180
   
   The plan is that when those routes are deprecated they will be removed from clients.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4415: Updated Traffic Portal to use TO API v2.0
URL: https://github.com/apache/trafficcontrol/pull/4415#issuecomment-588515582
 
 
   A lot (all?) of those aren't actually deprecated yet - and certainly weren't when I made these changes - though it looks like they probably will be unless someone speaks up in the next couple of days.
   
   I don't mind waiting a bit to see what happens, but I could also just do another PR next week. Up to you at this point, I suppose.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services