Fix certs with no CN (rancher/rancher#2018)

This commit is contained in:
Vincent Fiduccia 2015-09-30 15:36:35 -07:00
parent 4f1004bc25
commit 063955ef56
5 changed files with 22 additions and 10 deletions

View File

@ -31,7 +31,11 @@ export default Resource.extend({
countableSans: function() {
var sans = this.get('displaySans').slice();
if ( this.get('CN') )
{
sans.pushObject(this.get('CN'));
}
var commonBases = sans.filter((name) => {
return name.indexOf('*.') === 0 || name.indexOf('www.') === 0;
}).map((name) => {

View File

@ -58,10 +58,14 @@
<label class="section">Domain Names</label>
<div>
<ul class="list-unstyled">
{{#if model.CN}}
<li><a href="{{model.CN}}" target="_blank">{{model.CN}}</a> (CN)</li>
{{#each model.displaySans as |san|}}
<li><a href="{{san}}" target="_blank">{{san}}</a></li>
{{/each}}
{{else}}
<span class="text-muted">None</span>
{{/if}}
</ul>
</div>
</div>

View File

@ -28,10 +28,14 @@
{{#link-to "certificates.detail" cert.id}}{{cert.displayName}}{{/link-to}}
</td>
<td>
{{#if cert.CN}}
{{cert.CN}}
{{#if cert.countableSans.length}}
+ {{cert.countableSans.length}} other{{if (eq cert.countableSans.length 1) "" "s"}}
{{/if}}
{{else}}
<span class="text-muted">None</span>
{{/if}}
</td>
<td>
<span class="{{if cert.expiresSoon "text-bold text-danger"}}">

View File

@ -41,7 +41,7 @@ export default DriverRoute.extend({
});
},
setupController: function(controller, model) {
setupController: function(controller/*, model*/) {
this._super.apply(this,arguments);
controller.set('driver', this.get('otherChoices.firstObject.value'));
},

View File

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "0.52.0",
"version": "0.53.0",
"private": true,
"directories": {
"doc": "doc",