|
<script language="javascript">
|
|
|
|
$(function() {
|
|
$("#name").focus();
|
|
$("#saveButton").button({ icons: { primary: "ui-icon-disk"}});
|
|
$("#cancelButton")
|
|
.button({ icons: { primary: "ui-icon-close"}})
|
|
.click( function(){ $('#dialog-form').dialog('close'); });
|
|
});
|
|
|
|
function restartStyle(){
|
|
$("#form_data p span").css("color","black");
|
|
$('#message').html("");
|
|
}
|
|
|
|
function send(){
|
|
|
|
restartStyle();
|
|
|
|
$.post('dhcp', $("#form_data").serialize(), function(data) {
|
|
var result = $.parseJSON(data);
|
|
|
|
switch(result.response){
|
|
case "OK":{
|
|
$('#message').html("Operación realizada correctamente").css("color","green").effect("highlight", {"color":"yellow"}, 1000);
|
|
setTimeout("$('#dialog-form').dialog('close')",1000);
|
|
break;
|
|
}
|
|
case "fail":{
|
|
$('#message').html("Se produjo un error").effect("highlight", {"color":"yellow"}, 1000);
|
|
break;
|
|
}
|
|
case "distinctPassword":{
|
|
$('#password2Tag').css("color","red");
|
|
$('#password2').effect("highlight", {"color":"yellow"}, 1000).focus();
|
|
$('#message').html("La repetición no coincide").effect("highlight", {"color":"yellow"}, 1000);
|
|
break;
|
|
}
|
|
default:{
|
|
$('#'+result.response+"Tag").css("color","red");
|
|
$('#'+result.response).effect("highlight", {"color":"yellow"}, 1000).focus();
|
|
$('#message').html("Hay campos vacíos o incorrectos").effect("slide");
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
return false;
|
|
}
|
|
|
|
</script>
|
|
|
|
<form id="form_data" onSubmit="return send();">
|
|
<input type="hidden" id="action" name="action"/>
|
|
<input type="hidden" id="id" name="id"/>
|
|
<p><span id="subnetMaskTag">Subnet Mask</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="broadcastAddressTag">Broadcast Address</span><br><input type="text" id="nif" name="nif"/></p>
|
|
<p><span id="routersTag">Routers</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="domainNameserversTag">Domain Name Servers</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="domainNameTag">Domain Name</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="ntpServersTag">NTP Servers</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="logServersTag">Log Servers</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="netbiosNameServersTag">Netbios Name Servers</span><br><input type="text" id="name" name="name"/></p>
|
|
<p><span id="netbiosNodeTypeTag">Netbios Node Type</span><br><input type="text" id="name" name="name"/></p>
|
|
<div id="message" style="text-align:center; font-weight:bold; color:red; padding:3px; "></div>
|
|
<div style="text-align:center;"><button id="saveButton" type="submit" style="width:100px;">Guardar</button> <button type="button" id="cancelButton" style="width:100px;">Cancelar</button></div>
|
|
</form>
|