Merge pull request #1482 from coreos-inc/setup-tool-checkbox

Fix checkboxes in setup tool to use a directive
This commit is contained in:
josephschorr 2016-05-20 17:54:43 -05:00
commit d6b73a41de
4 changed files with 59 additions and 69 deletions

View file

@ -431,6 +431,11 @@ a:focus {
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.config-bool-field-element input {
margin-right: 6px;
font-size: 24px;
}
.config-setup-tool-element .help-text { .config-setup-tool-element .help-text {
margin-top: 6px; margin-top: 6px;
color: #aaa; color: #aaa;

View file

@ -1,5 +1,8 @@
<div class="config-bool-field-element"> <div class="config-bool-field-element">
<form name="fieldform" novalidate> <form name="fieldform" novalidate>
<input type="checkbox" ng-model="binding"> <label>
<input type="checkbox" ng-model="binding">
<span ng-transclude/>
</label>
</form> </form>
</div> </div>

View file

@ -36,9 +36,8 @@
<tr> <tr>
<td class="non-input">Anonymous Access:</td> <td class="non-input">Anonymous Access:</td>
<td colspan="2"> <td colspan="2">
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_ANONYMOUS_ACCESS">
<input id="ftaa" type="checkbox" ng-model="config.FEATURE_ANONYMOUS_ACCESS"> Enable Anonymous Access
<label for="ftaa">Enable Anonymous Access</label>
</div> </div>
<div class="help-text"> <div class="help-text">
If enabled, public repositories and search can be accessed by anyone that can If enabled, public repositories and search can be accessed by anyone that can
@ -50,9 +49,8 @@
<tr> <tr>
<td class="non-input">User Creation:</td> <td class="non-input">User Creation:</td>
<td colspan="2"> <td colspan="2">
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_USER_CREATION">
<input id="ftuc" type="checkbox" ng-model="config.FEATURE_USER_CREATION"> Enable Open User Creation
<label for="ftuc">Enable Open User Creation</label>
</div> </div>
<div class="help-text"> <div class="help-text">
If enabled, user accounts can be created by anyone. If enabled, user accounts can be created by anyone.
@ -63,9 +61,8 @@
<tr> <tr>
<td class="non-input">Encrypted Client Password:</td> <td class="non-input">Encrypted Client Password:</td>
<td colspan="2"> <td colspan="2">
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_REQUIRE_ENCRYPTED_BASIC_AUTH">
<input id="ftet" type="checkbox" ng-model="config.FEATURE_REQUIRE_ENCRYPTED_BASIC_AUTH"> Require Encrypted Client Passwords
<label for="ftet">Require Encrypted Client Passwords</label>
</div> </div>
<div class="help-text"> <div class="help-text">
If enabled, users will not be able to login from the Docker command If enabled, users will not be able to login from the Docker command
@ -103,11 +100,12 @@
<tr> <tr>
<td>SSL:</td> <td>SSL:</td>
<td> <td>
<div class="co-checkbox"> <label class="config-bool-field-element">
<input id="enable-ssl" type="checkbox" ng-model="config.PREFERRED_URL_SCHEME" <input type="checkbox" ng-model="config.PREFERRED_URL_SCHEME"
ng-true-value="'https'" ng-false-value="'http'"> ng-true-value="'https'" ng-false-value="'http'">
<label for="enable-ssl">Enable SSL</label> Enable SSL
</div> </label>
<div class="help-text" style="margin-bottom: 10px"> <div class="help-text" style="margin-bottom: 10px">
A valid SSL certificate and private key files are required to use this option. A valid SSL certificate and private key files are required to use this option.
</div> </div>
@ -194,11 +192,11 @@
<strong>A remote storage system is required for high-availability systems.</strong> <strong>A remote storage system is required for high-availability systems.</strong>
</p> </p>
<div class="co-checkbox feature-storage-replication"> <div class="config-bool-field feature-storage-replication" binding="config.FEATURE_STORAGE_REPLICATION">
<input id="ftsr" type="checkbox" ng-model="config.FEATURE_STORAGE_REPLICATION"> Enable Storage Replication
<label for="ftsr">Enable Storage Replication</label> <div class="help-text">
<!-- TODO(josephschorr): add link to documentation --> If enabled, replicates storage to other regions. See <a href="https://tectonic.com/quay-enterprise/docs/latest/geo-replication.html" ng-safenewtab>documentation</a> for more information.
<div class="help-text">If enabled, replicates storage to other regions.</div> </div>
</div> </div>
<div class="storage-config" ng-class="$last ? 'last' : ''" ng-repeat="sc in storageConfig"> <div class="storage-config" ng-class="$last ? 'last' : ''" ng-repeat="sc in storageConfig">
@ -220,9 +218,8 @@
<tr ng-if="config.FEATURE_STORAGE_REPLICATION"> <tr ng-if="config.FEATURE_STORAGE_REPLICATION">
<td class="non-input">Set Default:</td> <td class="non-input">Set Default:</td>
<td> <td>
<div class="co-checkbox"> <div class="config-bool-field" binding="sc.defaultLocation">
<input id="default-location-{{ $index }}" ng-model="sc.defaultLocation" type="checkbox"> Replicate to storage engine by default
<label for="default-location-{{ $index }}">Replicate to storage engine by default</label>
</div> </div>
</td> </td>
</tr> </tr>
@ -257,11 +254,11 @@
placeholder="{{ field.placeholder }}" placeholder="{{ field.placeholder }}"
ng-if="field.kind == 'text'" ng-if="field.kind == 'text'"
is-optional="field.optional"></span> is-optional="field.optional"></span>
<div class="co-checkbox" ng-if="field.kind == 'bool'"> <span class="config-bool-field"
<input id="dsc-{{ field.name }}" type="checkbox" binding="sc.data[1][field.name]"
ng-model="sc.data[1][field.name]"> ng-if="field.kind == 'bool'">
<label for="dsc-{{ field.name }}">{{ field.placeholder }}</label> {{ field.placeholder }}
</div> </span>
<div ng-if="field.kind == 'option'"> <div ng-if="field.kind == 'option'">
<select ng-model="sc.data[1][field.name]"> <select ng-model="sc.data[1][field.name]">
<option ng-repeat="value in field.values" value="{{ value }}" <option ng-repeat="value in field.values" value="{{ value }}"
@ -298,11 +295,9 @@
</p> </p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_SECURITY_SCANNER">
<input id="ftsecurity" type="checkbox" ng-model="config.FEATURE_SECURITY_SCANNER"> Enable Security Scanning
<label for="ftsecurity">Enable Security Scanning</label>
</div> </div>
<div class="co-alert co-alert-info" ng-if="config.FEATURE_SECURITY_SCANNER" style="margin-top: 20px;"> <div class="co-alert co-alert-info" ng-if="config.FEATURE_SECURITY_SCANNER" style="margin-top: 20px;">
A scanner compliant with the Quay Security Scanning API must be running to use this feature. Documentation on running <a href="https://github.com/coreos/clair" ng-safenewtab>Clair</a> can be found at <a href="https://tectonic.com/quay-enterprise/docs/latest/clair.html" ng-safenewtab>Running Clair Security Scanner</a>. A scanner compliant with the Quay Security Scanning API must be running to use this feature. Documentation on running <a href="https://github.com/coreos/clair" ng-safenewtab>Clair</a> can be found at <a href="https://tectonic.com/quay-enterprise/docs/latest/clair.html" ng-safenewtab>Running Clair Security Scanner</a>.
</div> </div>
@ -343,9 +338,8 @@
<p>If enabled, all images in the registry can be fetched via <code>rkt fetch</code> or any other <a href="https://github.com/appc/spec/blob/master/spec/discovery.md" ng-safenewtab>AppC discovery</a>-compliant implementation.</p> <p>If enabled, all images in the registry can be fetched via <code>rkt fetch</code> or any other <a href="https://github.com/appc/spec/blob/master/spec/discovery.md" ng-safenewtab>AppC discovery</a>-compliant implementation.</p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_ACI_CONVERSION">
<input id="ftaci" type="checkbox" ng-model="config.FEATURE_ACI_CONVERSION"> Enable ACI Conversion
<label for="ftaci">Enable ACI Conversion</label>
</div> </div>
<div class="co-alert co-alert-info" ng-if="config.FEATURE_ACI_CONVERSION" style="margin-top: 20px;"> <div class="co-alert co-alert-info" ng-if="config.FEATURE_ACI_CONVERSION" style="margin-top: 20px;">
@ -390,9 +384,8 @@
users to reset their passwords.</p> users to reset their passwords.</p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_MAILING">
<input id="ftmail" type="checkbox" ng-model="config.FEATURE_MAILING"> Enable E-mails
<label for="ftmail">Enable E-mails</label>
</div> </div>
<table class="config-table" ng-if="config.FEATURE_MAILING"> <table class="config-table" ng-if="config.FEATURE_MAILING">
@ -415,9 +408,8 @@
<tr> <tr>
<td>TLS:</td> <td>TLS:</td>
<td> <td>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.MAIL_USE_TLS">
<input id="mut" type="checkbox" ng-model="config.MAIL_USE_TLS"> Require TLS
<label for="mut">Use TLS</label>
</div> </div>
</td> </td>
</tr> </tr>
@ -435,9 +427,8 @@
<tr> <tr>
<td>Authentication:</td> <td>Authentication:</td>
<td> <td>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.MAIL_USE_AUTH">
<input id="uma" type="checkbox" ng-model="config.MAIL_USE_AUTH"> Requires Authentication
<label for="uma">Requires Authentication</label>
</div> </div>
<table class="config-table" ng-if="config.MAIL_USE_AUTH"> <table class="config-table" ng-if="config.MAIL_USE_AUTH">
@ -684,9 +675,8 @@
<tr ng-if="config.LDAP_URI.indexOf('ldaps://') == 0"> <tr ng-if="config.LDAP_URI.indexOf('ldaps://') == 0">
<td class="non-input">Allow insecure:</td> <td class="non-input">Allow insecure:</td>
<td> <td>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.LDAP_ALLOW_INSECURE_FALLBACK">
<input id="ldapfallbacktls" type="checkbox" ng-model="config.LDAP_ALLOW_INSECURE_FALLBACK.ORG_RESTRICT" class="ng-pristine ng-valid"> Allow fallback to non-TLS connections
<label for="ldapfallbacktls">Allow fallback to non-TLS connections</label>
</div> </div>
<div class="help-text"> <div class="help-text">
If enabled, LDAP will fallback to <strong>insecure non-TLS connections</strong> if TLS does not succeed. If enabled, LDAP will fallback to <strong>insecure non-TLS connections</strong> if TLS does not succeed.
@ -716,9 +706,8 @@
</p> </p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_GITHUB_LOGIN">
<input id="ftghl" type="checkbox" ng-model="config.FEATURE_GITHUB_LOGIN"> Enable GitHub Authentication
<label for="ftghl">Enable GitHub Authentication</label>
</div> </div>
<table class="config-table" ng-if="config.FEATURE_GITHUB_LOGIN"> <table class="config-table" ng-if="config.FEATURE_GITHUB_LOGIN">
@ -761,10 +750,8 @@
<tr> <tr>
<td>Organization Filtering:</td> <td>Organization Filtering:</td>
<td> <td>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.GITHUB_LOGIN_CONFIG.ORG_RESTRICT">
<input id="ftghlof" type="checkbox" Restrict By Organization Membership
ng-model="config.GITHUB_LOGIN_CONFIG.ORG_RESTRICT">
<label for="ftghlof">Restrict By Organization Membership</label>
</div> </div>
<div class="help-text" style="margin-bottom: 20px;"> <div class="help-text" style="margin-bottom: 20px;">
@ -804,9 +791,8 @@
</p> </p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_GOOGLE_LOGIN">
<input id="ftgoa" type="checkbox" ng-model="config.FEATURE_GOOGLE_LOGIN"> Enable Google Authentication
<label for="ftgoa">Enable Google Authentication</label>
</div> </div>
<table class="config-table" ng-if="config.FEATURE_GOOGLE_LOGIN"> <table class="config-table" ng-if="config.FEATURE_GOOGLE_LOGIN">
@ -838,9 +824,8 @@
If enabled, users can submit Dockerfiles to be built and pushed by the Enterprise Registry. If enabled, users can submit Dockerfiles to be built and pushed by the Enterprise Registry.
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_BUILD_SUPPORT">
<input id="ftbs" type="checkbox" ng-model="config.FEATURE_BUILD_SUPPORT"> Enable Dockerfile Build
<label for="ftbs">Enable Dockerfile Build</label>
</div> </div>
<div ng-if="config.FEATURE_BUILD_SUPPORT" style="margin-top: 10px"> <div ng-if="config.FEATURE_BUILD_SUPPORT" style="margin-top: 10px">
@ -869,9 +854,8 @@
</p> </p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_GITHUB_BUILD">
<input id="ftgb" type="checkbox" ng-model="config.FEATURE_GITHUB_BUILD"> Enable GitHub Triggers
<label for="ftgb">Enable GitHub Triggers</label>
</div> </div>
<table class="config-table" ng-if="config.FEATURE_GITHUB_BUILD"> <table class="config-table" ng-if="config.FEATURE_GITHUB_BUILD">
@ -934,9 +918,8 @@
</p> </p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_BITBUCKET_BUILD">
<input id="ftbbb" type="checkbox" ng-model="config.FEATURE_BITBUCKET_BUILD"> Enable BitBucket Triggers
<label for="ftbbb">Enable BitBucket Triggers</label>
</div> </div>
<table class="config-table" ng-if="config.FEATURE_BITBUCKET_BUILD"> <table class="config-table" ng-if="config.FEATURE_BITBUCKET_BUILD">
@ -981,9 +964,8 @@
</p> </p>
</div> </div>
<div class="co-checkbox"> <div class="config-bool-field" binding="config.FEATURE_GITLAB_BUILD">
<input id="ftglb" type="checkbox" ng-model="config.FEATURE_GITLAB_BUILD"> Enable GitLab Triggers
<label for="ftglb">Enable GitLab Triggers</label>
</div> </div>
<table class="config-table" ng-if="config.FEATURE_GITLAB_BUILD"> <table class="config-table" ng-if="config.FEATURE_GITLAB_BUILD">

View file

@ -801,7 +801,7 @@ angular.module("core-config-setup", ['angularFileUpload'])
priority: 0, priority: 0,
templateUrl: '/static/directives/config/config-bool-field.html', templateUrl: '/static/directives/config/config-bool-field.html',
replace: false, replace: false,
transclude: false, transclude: true,
restrict: 'C', restrict: 'C',
scope: { scope: {
'binding': '=binding' 'binding': '=binding'