This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gateway): Add Virtual-Host support
Closes gravitee-io/issues#1594
- Loading branch information
Showing
15 changed files
with
213 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
src/management/api/proxy/general/apiProxyEntrypoints.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<!-- | ||
Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
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. | ||
--> | ||
<form name="apiProxyCtrl.formApi" ng-submit="apiProxyCtrl.update(apiProxyCtrl.api)" novalidate> | ||
<div class="gv-forms" layout="column"> | ||
<div class="gv-forms-header"> | ||
<h1>Entrypoints</h1> | ||
<a permission permission-only="'api-definition-u'" ng-click="apiProxyCtrl.switchVirtualHostMode()" ng-if="!apiProxyCtrl.virtualHostModeEnabled">Switch to virtual-hosts mode</a> | ||
<a permission permission-only="'api-definition-u'" ng-click="apiProxyCtrl.switchVirtualHostMode()" ng-if="apiProxyCtrl.virtualHostModeEnabled">Switch to context-path mode</a> | ||
</div> | ||
|
||
<div class="gv-form"> | ||
<h2>General</h2> | ||
<div class="gv-form-content"> | ||
|
||
<div layout-gt-sm="row" ng-if="!apiProxyCtrl.virtualHostModeEnabled"> | ||
<md-input-container class="md-block" flex-gt-sm permission permission-only="'api-gateway_definition-u'"> | ||
<label>Gateway context-path</label> | ||
<input ng-model="apiProxyCtrl.api.proxy.virtual_hosts[0].path" type="text" name="contextPath" | ||
ng-pattern="/^\/[\/.a-zA-Z0-9-_]+$/" minlength="3" | ||
required> | ||
<div class="hint" ng-if="apiProxyCtrl.formApi.contextPath.$valid || apiProxyCtrl.formApi.contextPath.$pristine"> | ||
Path where API is exposed, must start with a '/' and must contain any letter, capitalize letter, number, dash or underscore. | ||
</div> | ||
<div ng-messages="apiProxyCtrl.formApi.contextPath.$error"> | ||
<div ng-message="required">Context path is required.</div> | ||
<div ng-message="minlength">Context path has to be more than 3 characters long.</div> | ||
<div ng-message="pattern">Context path is not valid (must start with a '/' and must contain any letter, capitalize letter, number, dash or underscore)</div> | ||
</div> | ||
</md-input-container> | ||
<md-input-container class="md-block" flex-gt-sm permission permission-except="'api-gateway_definition-u'"> | ||
<label>Gateway context path</label> | ||
<input ng-model="apiProxyCtrl.api.proxy.virtual_hosts[0].path" type="text" | ||
ng-pattern="/^\/[\/.a-zA-Z0-9-_]+$/" disabled | ||
required> | ||
</md-input-container> | ||
</div> | ||
|
||
<div layout-gt-sm="row" ng-if="apiProxyCtrl.virtualHostModeEnabled"> | ||
<div layout="column" layout-sm="column" flex> | ||
<h5 style="color: grey;"> | ||
<span>Virtual Hosts</span> | ||
<ng-md-icon icon="add_circle_outline" style="fill: #b1bdc5;" aria-label="Add virtual-host" ng-click="apiProxyCtrl.addVirtualHost()">Add virtual-host</ng-md-icon> | ||
</h5> | ||
<div class="ipsum" style="color: grey; margin-bottom: 30px">Use sharding tags to control where the API must be deployed.</div> | ||
|
||
<div layout="row" layout-sm="column" layout-align="center center" ng-repeat="vHost in apiProxyCtrl.api.proxy.virtual_hosts"> | ||
<ng-md-icon icon="remove_circle_outline" style="fill: #b1bdc5;" aria-label="Delete virtual-host" ng-click="apiProxyCtrl.removeVirtualHost($index)"></ng-md-icon> | ||
|
||
<div flex="5" hide-xs hide-sm> | ||
<!-- Spacer //--> | ||
</div> | ||
|
||
<md-input-container class="md-block" flex-gt-sm> | ||
<input aria-label="Listening Host" name="vhost{{$index}}-host" ng-model="vHost.host" type="text" placeholder="Listening host"> | ||
<div class="hint" ng-if="vHost.host === undefined || vHost.host === '' || apiProxyCtrl.formApi['vhost'+$index+'-host'].$dirty"> | ||
Host which must be set into the HTTP request to access this entrypoint. | ||
</div> | ||
</md-input-container> | ||
|
||
<div flex="5" hide-xs hide-sm> | ||
<!-- Spacer //--> | ||
</div> | ||
|
||
<md-input-container class="md-block" flex-gt-sm> | ||
<input aria-label="Listening Path" ng-model="vHost.path" | ||
name="vhost{{$index}}-path" | ||
type="text" placeholder="Listening path" | ||
ng-pattern="/^\/[\/.a-zA-Z0-9-_]*$/" | ||
required> | ||
<div class="hint" ng-if="vHost.path === undefined || vHost.path === '' || apiProxyCtrl.formApi['vhost'+$index+'-path'].$dirty"> | ||
Path where API is exposed, must start with a '/' and must contain any letter, capitalize letter, number, dash or underscore. | ||
</div> | ||
<div ng-messages="apiProxyCtrl.formApi['vhost'+$index+'-path'].$error"> | ||
<div ng-message="required">Listening path is required.</div> | ||
<div ng-message="pattern">Listening path is not valid (must start with a '/' and must contain any letter, capitalize letter, number, dash or underscore)</div> | ||
</div> | ||
</md-input-container> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="md-actions gravitee-api-save-button" layout="row"> | ||
<md-button permission permission-only="'api-definition-u'" class="md-raised md-primary" type="submit" ng-disabled="apiProxyCtrl.formApi.$invalid || apiProxyCtrl.formApi.$pristine"> | ||
Save | ||
</md-button> | ||
<md-button permission permission-only="'api-definition-u'" class="md-raised" type="button" ng-click="apiProxyCtrl.reset()" ng-disabled="apiProxyCtrl.formApi.$pristine"> | ||
Reset | ||
</md-button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</form> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.