Skip to content

Commit

Permalink
link for external endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
cheld committed Feb 23, 2016
1 parent e22812c commit 66b8edf
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 9 deletions.
32 changes: 32 additions & 0 deletions src/app/frontend/replicationcontrollerdetail/externalendpoint.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
Copyright 2015 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!--
External endpoints are shown with link, to make it esay to access the deployed application.
This is important because the text might be ellipsed and copy & past not possible. The
Link is always shown independant of the endpoint capabilities to support HTTP.
-->
<div>
<span ng-repeat="port in ::endpoint.ports">
<a href="http://{{::endpoint.host}}:{{::port.port}}" target="_blank"
layout layout-align="start center">
<kd-middle-ellipsis display-string="{{::endpoint.host}}:{{::port.port}}">
</kd-middle-ellipsis>
&nbsp;
<i class="material-icons kd-text-icon">open_in_new</i>
</a>
</span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
export default function serviceEndpointDirective() {
return {
templateUrl: 'replicationcontrollerdetail/serviceendpoint.html',
templateUrl: 'replicationcontrollerdetail/externalendpoint.html',
scope: {
'endpoint': '=',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
limitations under the License.
-->


<div>
<span ng-repeat="port in ::endpoint.ports">
<kd-middle-ellipsis display-string="{{::endpoint.host}}:{{::port.port}} {{::port.protocol}}">
</kd-middle-ellipsis>
<kd-middle-ellipsis display-string="{{::endpoint.host}}:{{::port.port}} {{::port.protocol}}">
</kd-middle-ellipsis>
</span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* Returns directive definition object for the component that displays service
* endpoint (type {backendApi.Endpoint}).
* @return {!angular.Directive}
*/
export default function serviceEndpointDirective() {
return {
templateUrl: 'replicationcontrollerdetail/internalendpoint.html',
scope: {
'endpoint': '=',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import componentsModule from './../common/components/components_module';
import filtersModule from 'common/filters/filters_module';
import logsModule from 'logs/logs_module';
import replicationControllerInfo from './replicationcontrollerinfo_directive';
import serviceEndpointDirective from './serviceendpoint_directive';
import internalEndpointDirective from './internalendpoint_directive';
import externalEndpointDirective from './externalendpoint_directive';
import stateConfig from './replicationcontrollerdetail_stateconfig';
import sortedHeaderDirective from './sortedheader_directive';
import {ReplicationControllerService} from './replicationcontroller_service';
Expand All @@ -39,6 +40,7 @@ export default angular
])
.config(stateConfig)
.directive('kdReplicationControllerInfo', replicationControllerInfo)
.directive('kdServiceEndpoint', serviceEndpointDirective)
.directive('kdInternalEndpoint', internalEndpointDirective)
.directive('kdExternalEndpoint', externalEndpointDirective)
.directive('kdSortedHeader', sortedHeaderDirective)
.service('kdReplicationControllerService', ReplicationControllerService);
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
<span class="kd-replicationcontrollerinfo-line">Internal endpoint</span>
<div class="kd-replicationcontrollerinfo-subline">
<div ng-if="::service.internalEndpoint">
<kd-service-endpoint endpoint="::service.internalEndpoint"></kd-service-endpoint>
<kd-internal-endpoint endpoint="::service.internalEndpoint"></kd-internal-endpoint>
</div>
<span ng-hide="service.internalEndpoint">none</span>
</div>
<span class="kd-replicationcontrollerinfo-line">External endpoint</span>
<div class="kd-replicationcontrollerinfo-subline">
<div ng-repeat="endpoint in service.externalEndpoints">
<kd-service-endpoint endpoint="::endpoint"></kd-service-endpoint>
<kd-external-endpoint endpoint="::endpoint"></kd-external-endpoint>
</div>
<span class="kd-replicationcontrollerinfo-subline" ng-hide="::service.externalEndpoints">
none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<span flex="initial" class="kd-replicationcontroller-card-section-title">Internal endpoint</span>
<div flex>
<div ng-repeat="endpoint in ::ctrl.replicationController.internalEndpoints track by $index">
<kd-service-endpoint endpoint="::endpoint"></kd-service-endpoint>
<kd-internal-endpoint endpoint="::endpoint"></kd-internal-endpoint>
</div>
<div ng-if="::!ctrl.replicationController.internalEndpoints.length">
none
Expand All @@ -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-external-endpoint endpoint="::endpoint"></kd-external-endpoint>
</div>
<div ng-if="::!ctrl.replicationController.externalEndpoints.length">
none
Expand Down

0 comments on commit 66b8edf

Please sign in to comment.