Add checking for localhost in hostname fields.

This commit is contained in:
Joseph Schorr 2015-01-15 14:36:05 -05:00
parent cc453e7d10
commit 3a3945779d
3 changed files with 25 additions and 6 deletions

View file

@ -62,7 +62,7 @@
<td>
<span class="config-string-field" binding="config.SERVER_HOSTNAME"
placeholder="Hostname (and optional port if non-standard)"
pattern="^[a-zA-Z-0-9\.]+(:[0-9]+)?$"></span>
pattern="{{ HOSTNAME_REGEX }}"></span>
<div class="help-text">
The HTTP host (and optionally the port number if a non-standard HTTP/HTTPS port) of the location
where the registry will be accessible on the network
@ -121,7 +121,8 @@
<td>
<span class="config-string-field" binding="mapped.redis.host"
placeholder="The redis server hostname"
pattern="^[a-zA-Z-0-9\.]+(:[0-9]+)?$"></span>
pattern="{{ HOSTNAME_REGEX }}"
validator="validateHostname(value)">></span>
</td>
</tr>
<tr>
@ -216,7 +217,8 @@
<td>
<span class="config-string-field" binding="config.MAIL_SERVER"
placeholder="SMTP server for sending e-mail"
pattern="^[a-zA-Z-0-9\.]+(:[0-9]+)?$"></span>
pattern="{{ HOSTNAME_REGEX }}"
validator="validateHostname(value)">></span>
</td>
</tr>
<tr>
@ -377,7 +379,7 @@
<span class="config-string-field"
binding="config.GITHUB_LOGIN_CONFIG.GITHUB_ENDPOINT"
placeholder="https://my.githubserver"
pattern="^https?://([a-zA-Z0-9]+\.?\/?)+$">
pattern="{{ GITHUB_REGEX }}">
</span>
<div class="help-text">
The Github Enterprise endpoint. Must start with http:// or https://.
@ -509,7 +511,7 @@
<span class="config-string-field"
binding="config.GITHUB_TRIGGER_CONFIG.GITHUB_ENDPOINT"
placeholder="https://my.githubserver"
pattern="^https?://([a-zA-Z0-9]+\.?\/?)+$">
pattern="{{ GITHUB_REGEX }}">
</span>
<div class="help-text">
The Github Enterprise endpoint. Must start with http:// or https://.

View file

@ -3,5 +3,8 @@
<input type="text" class="form-control" placeholder="{{ placeholder || '' }}"
ng-model="binding" ng-trim="false" ng-minlength="1"
ng-pattern="getRegexp(pattern)" required>
<div class="alert alert-danger" ng-show="errorMessage">
{{ errorMessage }}
</div>
</form>
</div>