-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Link for external endpoints #399
Conversation
Current coverage is
|
@@ -22,6 +22,7 @@ export default function serviceEndpointDirective() { | |||
templateUrl: 'replicationcontrollerdetail/serviceendpoint.html', | |||
scope: { | |||
'endpoint': '=', | |||
'url': '@', |
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.
When url param is '@' you'll show it as a link when the value is 'foo'
'true'
'false'
or 'x'
. How about changing it to =
?
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 parameter should have a more descriptive name. Url does not convey what it actually is. You wouldn't know that this is a boolean value to display the endpoint as a link. How about is-http
or is-external-http
or something else to say that this is an externally available http endpoint. Using this info we can display this as a link.
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 was thinking about some heuristic that would actually establish if endpoint
has something that is worth showing as a link. Checking common ports (HTTP/HTTPS) and maybe trying to actually check if this link points to something that browser can display.
Checking this as true in code would make link available for everything and this is not desired I guess.
What do you think?
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 you document what the param means? A short note would suffice.
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.
@floreks I think this is not feasible. We would have to ping the server. This would be slow and might do harm to it.
@@ -111,7 +111,7 @@ | |||
<span flex="initial" class="kd-replicationcontroller-card-section-title">External endpoint</span> | |||
<div flex> | |||
<div ng-repeat="endpoint in ::ctrl.replicationController.externalEndpoints track by $index"> | |||
<kd-service-endpoint endpoint="::endpoint"></kd-service-endpoint> | |||
<kd-service-endpoint endpoint="::endpoint" url="true"></kd-service-endpoint> |
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.
Add an implementation note here that says why we always show external endpoints as links. Basically the same as you did in the PR comment. Use <!-- .... --!>
This is really helpful. Small change that brings a lot. Thanks! :) |
2344bdf
to
c413e90
Compare
what about separating the directive "kd-service-endpoint" in two directives instead of the boolean flag? e.g.: kd-external-endpoint PTAL |
Yes, this makes a lot of sense. I expect that we'll write a more sophisticated logic to detect whether to link-ify an endpoint and kd-external-endpoint directive would be a place for this. Please do this :) |
8d240bf
to
66b8edf
Compare
PTAL |
@@ -14,9 +14,10 @@ | |||
limitations under the License. | |||
--> | |||
|
|||
|
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.
Not needed here.
b6d9a4e
to
799b886
Compare
PTAL |
PTAL, a few style comments. Reviewed 6 of 9 files at r2, 1 of 1 files at r3. src/app/frontend/replicationcontrollerdetail/externalendpoint_directive.js, line 20 [r3] (raw file): src/app/frontend/replicationcontrollerdetail/internalendpoint_directive.js, line 20 [r3] (raw file): Comments from the review on Reviewable.io |
799b886
to
82a1a1c
Compare
82a1a1c
to
bd67629
Compare
Thanks, PTAL |
Reviewed 1 of 9 files at r2, 4 of 4 files at r4. Comments from the review on Reviewable.io |
In demos, I want to show the running application after deployment in an easy way. I think this is also a natural behavior for users to deploy and then check the running application.
Now, the user could copy & paste the text from the endpoint, but even this is not possible any longer as the text is potentially shortened.
To solve that, I created a http link for external endpoints. It is also indicated by the mock-ups.
After thinking about it for a while I realized that this might not be correct all the time. Nodeports could be anything, e.g. a Minecraft server - not necessarily a HTTP server. In case of GCE load-balancer I am not sure. I assume it is only intended for HTTP...
After contemplating again, I still think I should add such a link. The advantages outweight the disadvantages. Maybe we style it a little bit differently. I am tempted to just add an icon next to the link, like in the mockup.
Any opinion?