New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOSED - TP: Adds Server Capabilities UI #3977
Conversation
Refer to this link for build results (access rights to CI server needed): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulled and tested this locally it works as expected. Can view/remove/create server capabilities and it correctly handles errors. On the code side havent been in the TP code much so I'll defer to others but I did not personally see any issues with it.
leading and trailing spaces are ignore and doesn't throw errors. |
I guess we do not have requirement on what the values in Server capabilities can be. However, the UI indicates that |
I'd like to remove allowing dot, if no one objects. While it's valid in most parts of a URL, if we limit to |
i think that's fine. the api strips them out. |
I'm good with that. Is this a good UI error message?
based on that. This is fine:
not really sure anyone would do that....but they could... |
define special |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
6468a23
to
e8bbac3
Compare
for example following names for server capabilities doesn't make sense. |
|
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
}; | ||
|
||
this.getServerCapability = function(name) { | ||
return $http.get(ENV.api['root'] + 'server_capabilities?name=' + name).then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of string concatenation, use the params
key of the optional args object, like you do above in getServerCapabilty
. This ensures proper URI Encoding.
return $http.get(ENV.api['root'] + 'server_capabilities', {params: {"name": name}}).then(r=>r.data.response[0],e=>{throw e;})
}; | ||
|
||
this.deleteServerCapability = function(name) { | ||
return $http.delete(ENV.api['root'] + 'server_capabilities?name=' + name).then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above RE: proper query param usage
<div class="x_title"> | ||
<ol class="breadcrumb pull-left"> | ||
<li><a ng-click="navigateToPath('/server-capabilities')">Server Capabilities</a></li> | ||
<li class="active">{{serverCapabilityName}}</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
::
for one-time binding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. i forgot you can't change the name on a server cap
}); | ||
}; | ||
|
||
$scope.serverCapabilityName = angular.copy(serverCapability.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to use angular.copy
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep i think you are right because you can't change a server cap name even if you wanted to
modalInstance.result.then(function() { | ||
deleteServerCapability(serverCapability); | ||
}, function () { | ||
// do nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do nothing; at least log the error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not an error but i can log something like "action cancelled". actually maybe i just kill this handler.
modalInstance.result.then(function() { | ||
deleteServerCapability(serverCapability); | ||
}, function () { | ||
// do nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, RE doing nothing.
</ol> | ||
<div class="pull-right"> | ||
<button name="createServerCapabilityButton" class="btn btn-primary" title="Create Server Capability" ng-click="createServerCapability()"><i class="fa fa-plus"></i></button> | ||
<button class="btn btn-default" title="Refresh" ng-click="refresh()"><i class="fa fa-refresh"></i></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type
s of these buttons
are both submit
, and I don't think they ought to be
<br> | ||
<table id="serverCapabilitiesTable" class="table responsive-utilities jambo_table"> | ||
<thead> | ||
<tr class="headings"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this class do? couldn't you just use the selector: thead tr
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a jquery datatables thing. i'll see if it's not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i took it out. seems to have not changed anything.
************************** | ||
Manage Server Capabilities | ||
************************** | ||
Server capabilities are designed to enable system operators to control the flow of delivery service traffic through caches (Edges or Mids) with ONLY the required capabilities. For example, delivery services that serve large binary files should only be routed to caches with sufficient disk cache. Currently, this can be controlled at the Edge tier where system operators can explicitly assign only Edge caches with sufficient disk cache to the delivery service. However, the system operators do not have control of the Mid tier and cannot dictate which Mid caches are qualified to serve these large binary files. This will cause a problem if a Mid cache with insufficient disk cache is asked to serve the large binary files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've got a bunch of unlinked term
s in here: "delivery service", "cache" (should be "cache server" in many cases), maybe a couple of others.
Verbal stress on a word in a sentence should be indicated with emphasis roles. Typically you'd do that with asterisks:
*this text is emphasized*
What's an "operator"? I think you mean
... users with the "operator" :term:`Role` ("operators") ...
this.name=element(by.name('name')); | ||
this.createButton=element(by.buttonText('Create')); | ||
this.deleteButton=element(by.buttonText('Delete')); | ||
this.searchFilter=element(by.id('serverCapabilitiesTable_filter')).element(by.css('label')).element(by.css('input')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you combine this into one by.css
? by.css('label input')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe but they seem fine separate to me. i'm sure all of this UI test framework could be cleaned up.
Refer to this link for build results (access rights to CI server needed): |
I got into rebase hell so I'm closing this PR and opened #3993 |
What does this PR (Pull Request) do?
DO NOT MERGE UNTIL #3966 is merged
This PR enhances TP to support the creation, viewing and deletion of server capabilities. See blueprint for a better explanation of server capabilities.
It also includes UI tests to view, create and delete a server capability
It also includes some documentation under the quick how to section. Note: the docs are a little light at the moment but will fill in as the other feature are complete (assigning a server capability to a server and delivery service).
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
The following criteria are ALL met by this PR