Merge pull request #1518 from loganhz/cert

Update certificates page
This commit is contained in:
Vincent Fiduccia 2018-01-02 10:32:21 -07:00 committed by GitHub
commit 0031949daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 42 deletions

View File

@ -61,8 +61,8 @@
<label class="section">{{t 'certificatesPage.detail.domainNames.labelText'}}</label>
<div>
<ul class="list-unstyled">
{{#if model.certificate.CN}}
<li><a href="https://{{model.certificate.CN}}" target="_blank">{{model.certificate.CN}}</a> (CN)</li>
{{#if model.certificate.cn}}
<li><a href="https://{{model.certificate.cn}}" target="_blank">{{model.certificate.cn}}</a> (CN)</li>
{{#each model.certificate.displaySans as |san|}}
<li><a href="https://{{san}}" target="_blank">{{san}}</a></li>
{{/each}}

View File

@ -4,20 +4,14 @@ export default Controller.extend({
sortBy: 'name',
headers: [
{
name: 'state',
sort: ['sortState','name','id'],
translationKey: 'certificatesPage.index.table.header.state',
width: 125,
},
{
name: 'name',
sort: ['name','id'],
name: 'name',
sort: ['name', 'id'],
translationKey: 'certificatesPage.index.table.header.name',
},
{
name: 'cn',
searchField: ['CN'],
sort: ['CN','id'],
searchField: ['cn'],
sort: ['cn','id'],
translationKey: 'certificatesPage.index.table.header.domain',
},
{
@ -26,5 +20,12 @@ export default Controller.extend({
translationKey: 'certificatesPage.index.table.header.expires',
width: 120,
},
{
name: 'created',
sort: ['created', 'id'],
classNames: 'text-right pr-20',
searchField: 'created',
translationKey: 'certificatesPage.index.table.header.created',
},
],
});

View File

@ -6,6 +6,7 @@
{{form-name-description
model=primaryResource
nameRequired=true
descriptionShown=false
namePlaceholder="certificatesPage.new.form.name.placeholder"
descriptionPlaceholder="certificatesPage.new.form.description.placeholder"
}}

View File

@ -49,17 +49,17 @@ export default Resource.extend({
// subjectAlternativeNames can be null:
return (this.get('subjectAlternativeNames')||[])
.slice()
.removeObject(this.get('CN'))
.removeObject(this.get('cn'))
.filter((san) => {
return (san+'').indexOf('@') === -1;
});
}.property('CN','subjectAlternativeNames.[]'),
}.property('cn','subjectAlternativeNames.[]'),
countableSans: function() {
var sans = this.get('displaySans').slice();
if ( this.get('CN') )
if ( this.get('cn') )
{
sans.pushObject(this.get('CN'));
sans.pushObject(this.get('cn'));
}
var commonBases = sans.filter((name) => {
@ -69,12 +69,12 @@ export default Resource.extend({
});
return this.get('displaySans').slice().removeObjects(commonBases);
}.property('displaySans.[]','CN'),
}.property('displaySans.[]','cn'),
displayDetailedName: function() {
var name = (this.get('name') || '('+this.get('id')+')');
var str = name;
var cn = this.get('CN');
var cn = this.get('cn');
var sans = this.get('countableSans.length');
var more = '';
@ -97,5 +97,5 @@ export default Resource.extend({
}
return str;
}.property('id','name','CN','countableSans.length')
}.property('id','name','cn','countableSans.length')
});

View File

@ -1,17 +1,14 @@
<td data-title="{{t 'generic.state'}}:">
{{badge-state model=model}}
</td>
<td data-title="{{t 'generic.name'}}:" class="force-wrap">
{{#link-to "certificates.detail" model.id}}{{model.displayName}}{{/link-to}}
</td>
<td data-title="{{t 'certificatesPage.table.cn'}}:">
{{#if model.CN}}
{{model.CN}}
{{#if model.cn}}
{{model.cn}}
{{#if model.countableSans.length}}
+ {{model.countableSans.length}} other{{if (eq model.countableSans.length 1) "" "s"}}
{{/if}}
{{else}}
<span class="text-muted">None</span>
<span class="text-muted">{{t 'generic.none'}}</span>
{{/if}}
</td>
<td data-title="certificatesPage.table.expiresDate:">
@ -19,6 +16,9 @@
{{date-from-now model.expiresDate}}
</span>
</td>
<td data-title="{{t 'generic.created'}}:" class="text-right pr-20">
{{date-calendar model.created}}
</td>
<td data-title="{{t 'generic.actions'}}:" class="actions">
{{action-menu model=model}}
</td>
</td>

View File

@ -1,4 +1,4 @@
<div class="col span-4 input-group mt-0">
<div class="col span-6 input-group mt-0">
<div class="clearfix">
<label class="acc-label pt-5">{{t 'inputCertificate.key.label'}}{{field-required}}</label>
</div>
@ -11,28 +11,18 @@
}}
</div>
<div class="col span-4 input-group mt-0">
<div class="col span-6 input-group mt-0">
<div class="clearfix">
<label class="acc-label pt-5">{{t 'inputCertificate.cert.label'}}{{field-required}}</label>
<span class="protip">
{{t 'inputCertificate.cert.protip'}}
</span>
</div>
{{input-text-file
value=model.cert
value=model.certs
accept="application/x-x509-ca-cert,text/plain,.pem,.crt"
minHeight=60
placeholder="inputCertificate.cert.placeholder"
showUploadLabel=false
}}
</div>
<div class="col span-4 input-group mt-0">
<div class="clearfix">
<label class="acc-label pt-5">{{t 'inputCertificate.certChain.label'}}</label>
</div>
{{input-text-file
value=model.certChain
accept="application/x-x509-ca-cert,text/plain,.pem,.crt"
minHeight=60
placeholder="inputCertificate.certChain.placeholder"
showUploadLabel=false
}}
</div>

View File

@ -4,6 +4,7 @@
{{form-name-description
model=primaryResource
nameRequired=true
descriptionShown=false
namePlaceholder="editCertificate.name.placeholder"
descriptionPlaceholder="editCertificate.description.placeholder"
}}

View File

@ -540,6 +540,7 @@ certificatesPage:
name: Name
domain: Domain Name
expires: Expires
created: Created
body:
noData: You do not have any certificates yet.
new:
@ -2834,6 +2835,7 @@ inputCertificate:
cert:
label: Certificate
placeholder: "Paste in the primary certificate, starting with -----BEGIN CERTIFICATE-----"
protip: Please include any chain certificates that are needed.
certChain:
label: Chain Certs
placeholder: "Optional; Paste in the additional chained certificates, starting with -----BEGIN CERTIFICATE-----"