|
@@ -48,7 +48,9 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
// return validator.isHostname(hostname) && (!(/^\-/.test(hostname) || /\-$/.test(hostname)));
|
|
|
return true;
|
|
|
},
|
|
|
-
|
|
|
+ /**
|
|
|
+ * set not installed hosts to the hostNameArr
|
|
|
+ */
|
|
|
updateHostNameArr: function(){
|
|
|
this.hostNameArr = this.get('hostNames').trim().split(new RegExp("\\s+", "g"));
|
|
|
this.patternExpression();
|
|
@@ -61,7 +63,10 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
}
|
|
|
this.set('hostNameArr', tempArr);
|
|
|
},
|
|
|
-
|
|
|
+ /**
|
|
|
+ * validate host names
|
|
|
+ * @return {Boolean}
|
|
|
+ */
|
|
|
isAllHostNamesValid: function () {
|
|
|
var self = this;
|
|
|
var result = true;
|
|
@@ -77,7 +82,9 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
},
|
|
|
|
|
|
hostsError: null,
|
|
|
-
|
|
|
+ /**
|
|
|
+ * set hostsError if host names don't pass validation
|
|
|
+ */
|
|
|
checkHostError: function () {
|
|
|
if (this.get('hostNames').trim() === '') {
|
|
|
this.set('hostsError', Em.I18n.t('installer.step2.hostName.error.required'));
|
|
@@ -169,7 +176,10 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
|
|
|
this.proceedNext();
|
|
|
},
|
|
|
-
|
|
|
+ /**
|
|
|
+ * check is there a pattern expression in host name textarea
|
|
|
+ * push hosts that match pattern in hostNamesArr
|
|
|
+ */
|
|
|
patternExpression: function(){
|
|
|
this.isPattern = false;
|
|
|
var self = this;
|
|
@@ -178,7 +188,7 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
var start, end, extra = {0:""};
|
|
|
if(/\[\d*\-\d*\]/.test(a)){
|
|
|
start=a.match(/\[\d*/);
|
|
|
- end=a.match(/\-\d*/);
|
|
|
+ end=a.match(/\-\d*]/);
|
|
|
|
|
|
start=start[0].substr(1);
|
|
|
end=end[0].substr(1);
|
|
@@ -203,7 +213,11 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
});
|
|
|
this.hostNameArr = hostNames;
|
|
|
},
|
|
|
-
|
|
|
+ /**
|
|
|
+ * launch hosts to bootstrap
|
|
|
+ * and save already registered hosts
|
|
|
+ * @return {Boolean}
|
|
|
+ */
|
|
|
proceedNext: function(){
|
|
|
if (this.get('manualInstall') === true) {
|
|
|
this.manualInstallPopup();
|
|
@@ -226,7 +240,10 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
this.saveHosts();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ /**
|
|
|
+ * show popup with hosts generated by pattern
|
|
|
+ * @param hostNames
|
|
|
+ */
|
|
|
hostNamePatternPopup: function (hostNames) {
|
|
|
var self = this;
|
|
|
App.ModalPopup.show({
|
|
@@ -241,7 +258,10 @@ App.WizardStep2Controller = Em.Controller.extend({
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ /**
|
|
|
+ * show notify that installation is manual
|
|
|
+ * save hosts
|
|
|
+ */
|
|
|
manualInstallPopup: function () {
|
|
|
var self = this;
|
|
|
App.ModalPopup.show({
|