cloudStack - Pod page - new button "Add Network Device" - implement type PxeServer.

This commit is contained in:
Jessica Wang 2011-04-28 14:44:13 -07:00
parent a15cf40ff5
commit e815ed6df7
3 changed files with 88 additions and 9 deletions

View File

@ -3,6 +3,12 @@ label.network.device=Network Device
label.add.network.device=Add Network Device
label.network.device.type=Network Device Type
label.DHCP.server.type=DHCP Server Type
label.Pxe.server.type=Pxe Server Type
label.PING.storage.IP=PING storage IP
label.PING.dir=PING Directory
label.TFT.dir=TFT Directory
label.PING.CIFS.username=PING CIFS username
label.PING.CIFS.password=PING CIFS password
#Labels
label.PreSetup=PreSetup

View File

@ -656,7 +656,7 @@ dictionary = {
<div class="dialog_formcontent">
<form action="#" method="post" id="form5">
<ol>
<li>
<li input_group="general">
<label>
<fmt:message key="label.type"/>:</label>
<select class="select" id="network_device_type">
@ -666,22 +666,22 @@ dictionary = {
<div id="network_device_type_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
</div>
</li>
<li>
<li input_group="general">
<label><fmt:message key="label.url"/>:</label>
<input class="text" type="text" id="url"/>
<div id="url_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li>
<li input_group="general">
<label><fmt:message key="label.username"/>:</label>
<input class="text" type="text" id="username"/>
<div id="username_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li>
<li input_group="general">
<label><fmt:message key="label.password"/>:</label>
<input class="text" type="password" id="password"/>
<div id="password_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li>
<li input_group="ExternalDhcp" style="display:none;" id="DHCP_server_type_container">
<label>
<fmt:message key="label.DHCP.server.type"/>:</label>
<select class="select" id="DHCP_server_type">
@ -689,8 +689,43 @@ dictionary = {
<option value="Dnsmasq">Dnsmasq</option>
</select>
<div id="DHCP_server_type_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
</div>
</li>
<li input_group="PxeServer" style="display:none;" id="Pxe_server_type_container">
<label>
<fmt:message key="label.Pxe.server.type"/>:</label>
<select class="select" id="Pxe_server_type">
<option value="PING">PING</option>
<option value="DMCD">DMCD</option>
</select>
<div id="Pxe_server_type_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
</div>
</li>
<li input_group="PxeServer" style="display:none;" id="PING_storage_IP_container">
<label><fmt:message key="label.PING.storage.IP"/>:</label>
<input class="text" type="text" id="PING_storage_IP"/>
<div id="PING_storage_IP_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li input_group="PxeServer" style="display:none;" id="PING_dir_container">
<label><fmt:message key="label.PING.dir"/>:</label>
<input class="text" type="text" id="PING_dir"/>
<div id="PING_dir_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li input_group="PxeServer" style="display:none;" id="TFT_dir_container">
<label><fmt:message key="label.TFT.dir"/>:</label>
<input class="text" type="text" id="TFT_dir"/>
<div id="TFT_dir_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li input_group="PxeServer" style="display:none;" id="PING_CIFS_username_container">
<label><fmt:message key="label.PING.CIFS.username"/>:</label>
<input class="text" type="text" id="PING_CIFS_username"/>
<div id="PING_CIFS_username_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
<li input_group="PxeServer" style="display:none;" id="PING_CIFS_password_container">
<label><fmt:message key="label.PING.CIFS.password"/>:</label>
<input class="text" type="password" id="PING_CIFS_password"/>
<div id="PING_CIFS_password_errormsg" class="dialog_formcontent_errormsg" style="display:none;" ></div>
</li>
</ol>
</form>
</div>

View File

@ -899,8 +899,23 @@ function bindAddIpRangeToPodButton($leftmenuItem1) {
}
function bindAddNetworkDeviceButton($leftmenuItem1) {
function bindAddNetworkDeviceButton($leftmenuItem1) {
var $dialog = $("#dialog_add_network_device");
$dialog.find("#network_device_type").bind("change", function(event){
if($(this).val() == "ExternalDhcp") {
$dialog.find('li[input_group="ExternalDhcp"]').show();
$dialog.find('li[input_group="PxeServer"]').hide();
}
else if($(this).val() == "PxeServer"){
$dialog.find('li[input_group="ExternalDhcp"]').hide();
$dialog.find('li[input_group="PxeServer"]').show();
}
return false;
});
$("#add_network_device_button").unbind("click").bind("click", function(event) {
$dialog.find("#network_device_type").change();
if($("#tab_content_networkdevice").css("display") == "none")
$("#tab_networkdevice").click();
@ -917,7 +932,17 @@ function bindAddNetworkDeviceButton($leftmenuItem1) {
var isValid = true;
isValid &= validateString("URL", $thisDialog.find("#url"), $thisDialog.find("#url_errormsg"));
isValid &= validateString("Username", $thisDialog.find("#username"), $thisDialog.find("#username_errormsg"));
isValid &= validateString("Password", $thisDialog.find("#password"), $thisDialog.find("#password_errormsg"));
isValid &= validateString("Password", $thisDialog.find("#password"), $thisDialog.find("#password_errormsg"));
if($("#PING_storage_IP_container").css("display") != "none")
isValid &= validateString("PING storage IP", $thisDialog.find("#PING_storage_IP"), $thisDialog.find("#PING_storage_IP_errormsg"));
if($("#PING_dir_container").css("display") != "none")
isValid &= validateString("PING directory", $thisDialog.find("#PING_dir"), $thisDialog.find("#PING_dir_errormsg"));
if($("#TFT_dir_container").css("display") != "none")
isValid &= validateString("TFT directory", $thisDialog.find("#TFT_dir"), $thisDialog.find("#TFT_dir_errormsg"));
if($("#PING_CIFS_username_container").css("display") != "none")
isValid &= validateString("PING CIFS username", $thisDialog.find("#PING_CIFS_username"), $thisDialog.find("#PING_CIFS_username_errormsg"), true);
if($("#PING_CIFS_password_container").css("display") != "none")
isValid &= validateString("PING CIFS password", $thisDialog.find("#PING_CIFS_password"), $thisDialog.find("#PING_CIFS_password_errormsg"), true);
if (!isValid)
return;
@ -930,8 +955,21 @@ function bindAddNetworkDeviceButton($leftmenuItem1) {
array1.push("&networkdeviceparameterlist[0].url="+$thisDialog.find("#url").val());
array1.push("&networkdeviceparameterlist[0].username="+$thisDialog.find("#username").val());
array1.push("&networkdeviceparameterlist[0].password="+$thisDialog.find("#password").val());
array1.push("&networkdeviceparameterlist[0].dhcpservertype=" + $thisDialog.find("#DHCP_server_type").val());
if($("#DHCP_server_type_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].dhcpservertype=" + $thisDialog.find("#DHCP_server_type").val());
if($("#Pxe_server_type_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].pxeservertype=" + $thisDialog.find("#Pxe_server_type").val());
if($("#PING_storage_IP_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].pingstorageserverip=" + $thisDialog.find("#PING_storage_IP").val());
if($("#PING_dir_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].pingdir=" + $thisDialog.find("#PING_dir").val());
if($("#TFT_dir_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].tftpdir=" + $thisDialog.find("#TFT_dir").val());
if($("#PING_CIFS_username_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].pingcifsusername=" + $thisDialog.find("#PING_CIFS_username").val());
if($("#PING_CIFS_password_container").css("display") != "none")
array1.push("&networkdeviceparameterlist[0].pingcifspassword=" + $thisDialog.find("#PING_CIFS_password").val());
$.ajax({
data: createURL("command=addNetworkdevice" + array1.join("")),
dataType: "json",