diff --git a/public/ods/ui/host_config/host_config.js b/public/ods/ui/host_config/host_config.js
index 5fdcc32..c5fb4b1 100644
--- a/public/ods/ui/host_config/host_config.js
+++ b/public/ods/ui/host_config/host_config.js
@@ -6,6 +6,7 @@ steal(
'./host_config.css',
'./views/init.ejs',
'./views/server_row.ejs',
+ './views/pattern_tip.ejs',
'ods/models/cluster.js',
'lib/jquery-ui-1.10.3.custom.css',
'lib/jquery-ui-1.10.3.custom.js',
@@ -17,17 +18,26 @@ steal(
init: function() {
this.element.html(this.view('init'));
- $("#clear").click(function() {
- $(".config_hostname input").val("");
- });
-
var self = this;
+ $("#pattern").change(function() {
+ var pattern = $("#pattern").val();
+ if (pattern == "Switch IP") {
+ $("#custom-pattern").hide();
+ } else if (pattern == "Switch alias") {
+ $("#custom-pattern").hide();
+ } else if (pattern == "Host") {
+ $("#custom-pattern").hide();
+ } else if (pattern == "Custom") {
+ $("#custom-pattern").show();
+ }
+ });
+
$("#dialog-confirm").dialog({
autoOpen: false,
resizable: false,
height: 200,
- width: 400,
+ width: 500,
modal: true,
buttons: {
"Fill values": function() {
@@ -38,6 +48,8 @@ steal(
self.fillHostnameBySwitchAlias();
} else if (pattern == "Host") {
self.fillHostnameByServer();
+ } else if (pattern == "Custom") {
+ self.fillHostnameByCustomStr();
}
$(this).dialog("close");
@@ -53,7 +65,7 @@ steal(
content: function() {
var element = $(this);
if (element.is("[data-geo]")) {
- return "
Switch IP
- Host name pattern:
-
- Switch IP
- Switch alias
- Host
-
+
Host name pattern:
+
+
+ Host
+ Switch IP
+ Switch alias
+ Custom
+
+
+
@@ -31,7 +35,8 @@
Port
Host name
- IP address
+ Management IP
+ Tenant IP
Roles
diff --git a/public/ods/ui/host_config/views/pattern_tip.ejs b/public/ods/ui/host_config/views/pattern_tip.ejs
new file mode 100644
index 0000000..06f227c
--- /dev/null
+++ b/public/ods/ui/host_config/views/pattern_tip.ejs
@@ -0,0 +1,17 @@
+
+ Switch IP:
+ Use the IP address and port for the switch to which the host is attached
+
+
+ Switch alias:
+ Use the switch alias for the switch and port to which the host is attached
+
+
+ Server:
+ Auto-increment integer value based on the last generated value
+
+
+ Custom:
+ Pre-defined patterns include {switchIp}, {port}, {d.1}, {d.2}, {d.3}, {d.4},
+ {mgtIpPart1}, {mgtIpPart2}, {mgtIpPart3}, {mgtIpPart4},
+ {tntIpPart1}, {tntIpPart2}, {tntIpPart3}, {tntIpPart4}
\ No newline at end of file
diff --git a/public/ods/ui/host_config/views/server_row.ejs b/public/ods/ui/host_config/views/server_row.ejs
index ce41daf..44b38d8 100644
--- a/public/ods/ui/host_config/views/server_row.ejs
+++ b/public/ods/ui/host_config/views/server_row.ejs
@@ -6,7 +6,10 @@
-
+
+
+
+
diff --git a/public/ods/ui/install_review/install_review.js b/public/ods/ui/install_review/install_review.js
index 24542fb..4855505 100644
--- a/public/ods/ui/install_review/install_review.js
+++ b/public/ods/ui/install_review/install_review.js
@@ -87,7 +87,7 @@ steal(
initServerTable: function() {
this.dataTable = $('#tb_server_review').dataTable({
- "sScrollY": "200px",
+ "sScrollY": "450px",
"bPaginate": false,
"bScrollCollapse": true,
"aoColumns": [{
@@ -95,19 +95,32 @@ steal(
}, {
"mData": "mac"
}, {
- "mData": "server_ip"
+ "mData": "management_ip"
+ }, {
+ "mData": "tenant_ip"
}, {
"mData": "switch_ip"
}, {
"mData": "port"
+ }, {
+ "mData": "roles",
+ "mRender": function(data, type, full) {
+ if (data.length == 0) {
+ return "auto";
+ } else if (data.toString().length <=10) {
+ return data;
+ } else {
+ return data.toString().substring(0, 10) + " ...";
+ }
+ }
}],
"aoColumnDefs": [{
bSortable: false,
- aTargets: [0, 1, 2]
+ aTargets: [0, 1, 2, 3, 6]
}],
"aaSorting": [
- [3, "asc"],
- [4, "asc"]
+ [4, "asc"],
+ [5, "asc"]
]
});
$('.dataTables_info').remove();
diff --git a/public/ods/ui/install_review/install_review_test.html b/public/ods/ui/install_review/install_review_test.html
index 5102c2b..8dd2d2f 100644
--- a/public/ods/ui/install_review/install_review_test.html
+++ b/public/ods/ui/install_review/install_review_test.html
@@ -28,9 +28,11 @@
id: 10,
mac: "28:6e:31:47:c8:6c",
port: "1",
- server_ip: "10.2.172.9",
+ management_ip: "10.2.172.9",
+ tenant_ip: "192.168.100.101",
switch_ip: "172.29.8.40",
- vlan: "1"
+ vlan: "1",
+ roles: ["role1", "role2", "role3", "role4", "role5", "role6", "role7"]
};
var server2 = {
@@ -39,9 +41,11 @@
id: 20,
mac: "28:6e:31:34:fd:28",
port: "2",
- server_ip: "10.2.172.9",
+ management_ip: "10.2.172.10",
+ tenant_ip: "192.168.100.102",
switch_ip: "172.29.8.40",
- vlan: "2"
+ vlan: "2",
+ roles: ["role2"]
};
if (config["172.29.8.40"] == undefined) {
diff --git a/public/ods/ui/install_review/views/init.ejs b/public/ods/ui/install_review/views/init.ejs
index ad67180..1c5fbd1 100644
--- a/public/ods/ui/install_review/views/init.ejs
+++ b/public/ods/ui/install_review/views/init.ejs
@@ -73,9 +73,11 @@
Host name
MAC Addr
- Server IP
+ Mgt IP
+ Tenant IP
Switch IP
Port
+ Roles
diff --git a/public/ods/ui/networking/networking.js b/public/ods/ui/networking/networking.js
index a57dac9..61ac8ff 100644
--- a/public/ods/ui/networking/networking.js
+++ b/public/ods/ui/networking/networking.js
@@ -137,9 +137,24 @@ steal(
// verify IP range
if (!$(".ipaddress").hasClass("error") && this.nicErr == 0) {
- this.verifyIpRange(mgt_ipstart, mgt_ipend, this.options.odsState.servers.length);
- if (!this.ipRangeValid) {
+ var mgtIpRangeValid = this.verifyIpRange(mgt_ipstart, mgt_ipend, this.options.odsState.servers.length);
+ var tenantIpRangeValid = this.verifyIpRange(tenant_ipstart, tenant_ipend, this.options.odsState.servers.length);
+
+ var mindex = mgt_ipstart.lastIndexOf('.') + 1;
+ var mgtIpPrefix = mgt_ipstart.substring(0, mindex);
+ var mgtIpStartLastDigit = mgt_ipstart.substring(mindex);
+ var mgtIpEndLastDigit = mgt_ipend.substring(mindex);
+
+ var tindex = tenant_ipstart.lastIndexOf('.') + 1;
+ var tenantIpPrefix = tenant_ipstart.substring(0, tindex);
+ var tenantIpStartLastDigit = tenant_ipstart.substring(tindex);
+ var tenantIpEndLastDigit = tenant_ipend.substring(tindex);
+
+
+ if (!mgtIpRangeValid) {
alert("The management IP range is not valid.");
+ } else if (!tenantIpRangeValid) {
+ alert("The tenant IP range is not valid.");
} else {
// config server ip
var server_count = this.options.odsState.servers.length;
@@ -181,7 +196,8 @@ steal(
for (var key in serverData) {
var servers = serverData[key];
for (var i = 0; i < servers.length; i++) {
- serverData[key][i]['server_ip'] = this.startPrefix + (parseInt(this.startLastDigit) + j);
+ serverData[key][i]['management_ip'] = mgtIpPrefix + (parseInt(mgtIpStartLastDigit) + j);
+ serverData[key][i]['tenant_ip'] = tenantIpPrefix + (parseInt(tenantIpStartLastDigit) + j);
j++;
}
}
@@ -355,20 +371,18 @@ steal(
},
verifyIpRange: function(start, end, minCount) {
- this.ipRangeValid = false;
-
var rindex = start.lastIndexOf('.') + 1;
- this.startPrefix = start.substring(0, rindex);
- this.endPrefix = end.substring(0, rindex);
- this.startLastDigit = start.substring(rindex);
- this.endLastDigit = end.substring(rindex);
+ var startPrefix = start.substring(0, rindex);
+ var endPrefix = end.substring(0, rindex);
+ var startLastDigit = start.substring(rindex);
+ var endLastDigit = end.substring(rindex);
- if (this.startPrefix != this.endPrefix) {
- this.ipRangeValid = false;
- } else if (parseInt(this.endLastDigit) - parseInt(this.startLastDigit) < minCount) {
- this.ipRangeValid = false;
+ if (startPrefix != endPrefix) {
+ return false;
+ } else if (parseInt(endLastDigit) - parseInt(startLastDigit) < minCount) {
+ return false;
} else {
- this.ipRangeValid = true;
+ return true;
}
},
diff --git a/public/ods/ui/servers/servers.js b/public/ods/ui/servers/servers.js
index 4866935..b57bea8 100644
--- a/public/ods/ui/servers/servers.js
+++ b/public/ods/ui/servers/servers.js
@@ -217,7 +217,7 @@ steal(
},
'getSelectedServers': function() {
- console.log("displayNodes ", this.displayNodes);
+ this.dataTable.fnFilter('');
var selectedServers = [];
this.options.odsState.servers = [];