Revisión 95
Añadido por Francisco Damián Méndez Palma hace alrededor de 14 años
controlies/www/ltsp/form.html | ||
---|---|---|
<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('hosts', $("#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);
|
||
$("#list").trigger("reloadGrid");
|
||
break;
|
||
}
|
||
case "fail":{
|
||
$('#message').html("Se produjo un error").effect("highlight", {"color":"yellow"}, 1000);
|
||
break;
|
||
}
|
||
case "hostAlreadyExists":{
|
||
$('#nameTag').css("color","red");
|
||
$('#name').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe ese nombre de host").effect("slide");
|
||
break;
|
||
}
|
||
case "ipAlreadyExists":{
|
||
$('#ipTag').css("color","red");
|
||
$('#ip').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe un host con esa IP").effect("slide");
|
||
break;
|
||
}
|
||
case "macAlreadyExists":{
|
||
$('#macTag').css("color","red");
|
||
$('#mac').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe un host con esa MAC").effect("slide");
|
||
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;
|
||
}
|
||
|
||
function searchUsername(){
|
||
/*if($("#form_data #action").val()=="add")
|
||
$.post('users','action=searchUsername&name='+$("#form_data #name").val()+'&surname='+$("#form_data #surname").val(), function(data) {
|
||
var result = $.parseJSON(data);
|
||
$("#form_data #user").val(result.response);
|
||
});*/
|
||
}
|
||
</script>
|
||
|
||
<form id="form_data" onSubmit="return send();">
|
||
<input type="hidden" id="action" name="action"/>
|
||
<input type="hidden" id="type" name="type" value="ltsp"/>
|
||
<p><span id="nameTag">Nombre del equipo:</span><br><input type="text" id="name" name="name" onChange="searchUsername();"/></p>
|
||
<p><span id="ipTag">Ip</span><br><input type="text" id="ip" name="ip"/></p>
|
||
<p><span id="macTag">MAC</span><br><input type="text" id="mac" name="mac"/></p>
|
||
<p><span id="dominioTag">Dominio</span><br><input type="text" id="dominio" name="dominio"/></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>
|
||
<p style="padding-top:10px; text-align:center; font-size:10px;" id="messageForm"></p>
|
||
</form>
|
controlies/www/thinclients/form.html | ||
---|---|---|
<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('hosts', $("#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);
|
||
$("#list").trigger("reloadGrid");
|
||
break;
|
||
}
|
||
case "fail":{
|
||
$('#message').html("Se produjo un error").effect("highlight", {"color":"yellow"}, 1000);
|
||
break;
|
||
}
|
||
case "hostAlreadyExists":{
|
||
$('#nameTag').css("color","red");
|
||
$('#name').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe ese nombre de host").effect("slide");
|
||
break;
|
||
}
|
||
case "macAlreadyExists":{
|
||
$('#macTag').css("color","red");
|
||
$('#mac').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe un host con esa MAC").effect("slide");
|
||
break;
|
||
}
|
||
case "groupOverflow":{
|
||
$('#groupTag').css("color","red");
|
||
$('#group').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("El grupo escogido esta completo").effect("slide");
|
||
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;
|
||
}
|
||
|
||
function searchUsername(){
|
||
/*if($("#form_data #action").val()=="add")
|
||
$.post('users','action=searchUsername&name='+$("#form_data #name").val()+'&surname='+$("#form_data #surname").val(), function(data) {
|
||
var result = $.parseJSON(data);
|
||
$("#form_data #user").val(result.response);
|
||
});*/
|
||
}
|
||
|
||
|
||
|
||
</script>
|
||
|
||
<form id="form_data" onSubmit="return send();">
|
||
<input type="hidden" id="action" name="action"/>
|
||
<input type="hidden" id="type" name="type" value="thinclient"/>
|
||
|
||
<p><span id="groupTag">Grupo</span><br>
|
||
<select id="group" name="group">
|
||
<option value="none">Seleccione...</option>
|
||
</select>
|
||
</p>
|
||
|
||
<p><span id="nameTag">Nombre del equipo:</span><br><input type="text" id="name" name="name" onChange="searchUsername();"/></p>
|
||
<p><span id="macTag">MAC</span><br><input type="text" id="mac" name="mac"/></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>
|
||
<p style="padding-top:10px; text-align:center; font-size:10px;" id="messageForm"></p>
|
||
</form>
|
controlies/www/workstation/form.html | ||
---|---|---|
<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('hosts', $("#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);
|
||
$("#list").trigger("reloadGrid");
|
||
break;
|
||
}
|
||
case "fail":{
|
||
$('#message').html("Se produjo un error").effect("highlight", {"color":"yellow"}, 1000);
|
||
break;
|
||
}
|
||
case "hostAlreadyExists":{
|
||
$('#nameTag').css("color","red");
|
||
$('#name').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe ese nombre de host").effect("slide");
|
||
break;
|
||
}
|
||
case "ipAlreadyExists":{
|
||
$('#ipTag').css("color","red");
|
||
$('#ip').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe un host con esa IP").effect("slide");
|
||
break;
|
||
}
|
||
case "macAlreadyExists":{
|
||
$('#macTag').css("color","red");
|
||
$('#mac').effect("highlight", {"color":"yellow"}, 1000).focus();
|
||
$('#message').html("Ya existe un host con esa MAC").effect("slide");
|
||
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;
|
||
}
|
||
|
||
function searchUsername(){
|
||
/*if($("#form_data #action").val()=="add")
|
||
$.post('users','action=searchUsername&name='+$("#form_data #name").val()+'&surname='+$("#form_data #surname").val(), function(data) {
|
||
var result = $.parseJSON(data);
|
||
$("#form_data #user").val(result.response);
|
||
});*/
|
||
}
|
||
</script>
|
||
|
||
<form id="form_data" onSubmit="return send();">
|
||
<input type="hidden" id="action" name="action"/>
|
||
<input type="hidden" id="type" name="type" value="workstation"/>
|
||
<p><span id="nameTag">Nombre del equipo:</span><br><input type="text" id="name" name="name" onChange="searchUsername();"/></p>
|
||
<p><span id="ipTag">Ip</span><br><input type="text" id="ip" name="ip"/></p>
|
||
<p><span id="macTag">MAC</span><br><input type="text" id="mac" name="mac"/></p>
|
||
<p><span id="dominioTag">Dominio</span><br><input type="text" id="dominio" name="dominio"/></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>
|
||
<p style="padding-top:10px; text-align:center; font-size:10px;" id="messageForm"></p>
|
||
</form>
|
Exportar a: Unified diff
Formularios de mantenimientos ltsp,thinclients,workstations