Authored by jack.xue

update

... ... @@ -338,9 +338,10 @@
},
success: function (response) {
console.log(response.data);
//将查询到的数据,update到选择框中
genarateGroupSelectOption(response.data.groupList, response.data.selectGroup);
genarateIpSelectOption(response.data.ipList, response.data.selectIp);
genarateUpdateGroupSelectOption(response.data.groupList, response.data.selectGroup);
genarateUpdateIpSelectOption(response.data.ipList, response.data.selectIp);
},
error: function (e) {
}
... ... @@ -353,12 +354,14 @@
* @param optionList
* @param selectedValue
*/
function genarateGroupSelectOption(optionList, selectedValue) {
var innerHTML = "<select id='updatemoHostIpGroup' class='form-control' style='width:40%;' onchange='groupSelectOnChange()'>";
function genarateUpdateGroupSelectOption(optionList, selectedValue) {
var innerHTML = "<select id='updatemoHostIpGroup' class='form-control' style='width:40%;' onchange='groupUpdateSelectOnChange()'>";
for (var i = 0; i < optionList.length; i++) {
innerHTML += "<option value='" + optionList[i] + "'>" + optionList[i] + "</option>";
}
innerHTML += "</select>";
console.log(innerHTML);
console.log(document.getElementById("updatemoHostIpGroupDiv"));
document.getElementById("updatemoHostIpGroupDiv").innerHTML = innerHTML;
document.getElementById("updatemoHostIpGroup").value = selectedValue;
}
... ... @@ -369,8 +372,8 @@
* @param optionList
* @param selectedValue
*/
function genarateIpSelectOption(optionList, selectedValue) {
var innerHTML = "<select id='updatemoHostIpGroup' class='form-control' style='width:70%;'>";
function genarateUpdateIpSelectOption(optionList, selectedValue) {
var innerHTML = "<select id='updatemoHostIp' class='form-control' style='width:70%;'>";
for (var i = 0; i < optionList.length; i++) {
innerHTML += "<option value='" + optionList[i] + "'>" + optionList[i] + "</option>";
}
... ... @@ -382,7 +385,7 @@
/**
* 主机组选择框选中属性发生变化时,则异步查询当前主机组号下的ip列表,并且刷新ip列表
*/
function groupSelectOnChange() {
function groupUpdateSelectOnChange() {
var group = $('#updatemoHostIpGroup option:selected').val().replace(/\'/g, '\"');
$.ajax({
url: contextPath + "/mobject/queryHost",
... ... @@ -395,7 +398,7 @@
success: function (response) {
//将查询到的数据,update到选择框中
console.log(response.data);
genarateIpSelectOption(response.data.ipList, response.data.selectIp);
genarateUpdateIpSelectOption(response.data.ipList, response.data.selectIp);
},
error: function (e) {
}
... ...
... ... @@ -160,7 +160,7 @@ function genarateIpSelectOption(optionList, selectedValue) {
if(optionList == null) {
}
var innerHTML = "<select id='addmoHostIpGroup' class='form-control' style='width:70%;'>";
var innerHTML = "<select id='addmoHostIp' class='form-control' style='width:70%;'>";
for (var i = 0; i < optionList.length; i++) {
innerHTML += "<option value='" + optionList[i] + "'>" + optionList[i] + "</option>";
}
... ...