Merge pull request #2804 from kush-bavishi/CommonNameAutoAdditionAsDNS
Common name auto addition as domain name
This commit is contained in:
commit
3a512d5bda
|
@ -33,6 +33,8 @@
|
||||||
uib-tooltip="If you need a certificate with multiple domains enter your primary domain here and the rest under 'Subject Alternate Names' by clicking 'More Options'"
|
uib-tooltip="If you need a certificate with multiple domains enter your primary domain here and the rest under 'Subject Alternate Names' by clicking 'More Options'"
|
||||||
ng-model="certificate.commonName" placeholder="Common Name" class="form-control"
|
ng-model="certificate.commonName" placeholder="Common Name" class="form-control"
|
||||||
ng-maxlength="64"
|
ng-maxlength="64"
|
||||||
|
ng-blur="certificate.attachCommonName()"
|
||||||
|
ng-focus="certificate.removeCommonName()"
|
||||||
required/>
|
required/>
|
||||||
|
|
||||||
<p ng-show="trackingForm.commonName.$invalid && !trackingForm.commonName.$pristine" class="help-block">
|
<p ng-show="trackingForm.commonName.$invalid && !trackingForm.commonName.$pristine" class="help-block">
|
||||||
|
|
|
@ -18,6 +18,26 @@ angular.module('lemur')
|
||||||
this.authority = authority;
|
this.authority = authority;
|
||||||
this.authority.maxDate = moment(this.authority.notAfter).subtract(1, 'days').format('YYYY/MM/DD');
|
this.authority.maxDate = moment(this.authority.notAfter).subtract(1, 'days').format('YYYY/MM/DD');
|
||||||
},
|
},
|
||||||
|
attachCommonName: function () {
|
||||||
|
if (this.extensions === undefined) {
|
||||||
|
this.extensions = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.extensions.subAltNames === undefined) {
|
||||||
|
this.extensions.subAltNames = {'names': []};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (angular.isString(this.commonName)) {
|
||||||
|
this.extensions.subAltNames.names.unshift({'nameType': 'DNSName', 'value': this.commonName});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
removeCommonName: function () {
|
||||||
|
if (angular.isDefined(this.extensions) && angular.isDefined(this.extensions.subAltNames)) {
|
||||||
|
if (angular.equals(this.extensions.subAltNames.names[0].value, this.commonName)) {
|
||||||
|
this.extensions.subAltNames.names.shift();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
attachSubAltName: function () {
|
attachSubAltName: function () {
|
||||||
if (this.extensions === undefined) {
|
if (this.extensions === undefined) {
|
||||||
this.extensions = {};
|
this.extensions = {};
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
"bower": "^1.8.2",
|
"bower": "^1.8.2",
|
||||||
"browser-sync": "^2.3.1",
|
"browser-sync": "^2.3.1",
|
||||||
"del": "^2.2.2",
|
"del": "^2.2.2",
|
||||||
"gulp": "^3.8.11",
|
|
||||||
"gulp-autoprefixer": "^3.1.1",
|
"gulp-autoprefixer": "^3.1.1",
|
||||||
"gulp-cache": "^0.4.5",
|
"gulp-cache": "^0.4.5",
|
||||||
"gulp-concat": "^2.4.1",
|
"gulp-concat": "^2.4.1",
|
||||||
|
@ -60,6 +59,7 @@
|
||||||
"test": "gulp test"
|
"test": "gulp test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"gulp": "^3.9.1",
|
||||||
"jshint": "^2.8.0",
|
"jshint": "^2.8.0",
|
||||||
"karma-chrome-launcher": "^2.0.0"
|
"karma-chrome-launcher": "^2.0.0"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue