Proyecto

General

Perfil

« Anterior | Siguiente » 

Revisión 220

Ya inserta/modifica/borra workstations

Ver diferencias:

controlies/trunk/applications/controlies/modules/Hosts.py
def getTriplets(self):
triplets = self.ldap.search("ou=Netgroup","cn="+self.type_host+"",["nisNetgroupTriple"])
print triplets
triplets = triplets [0][0][1]["nisNetgroupTriple"]
return triplets
controlies/trunk/applications/controlies/views/layout_form_hosts.html
<form id="form_data" onSubmit="return send();">
<input type="hidden" id="action" name="action"/>
{{block form_table}}
<input type="hidden" id="type_host" name="type_host" value="ltsp"/>
<input type="hidden" id="type_host" name="type_host"/>
<p><span id="nameTag">Nombre del equipo:</span><br><input type="text" id="name" name="name" maxlength="20"/></p>
<p><span id="ipTag">Ip</span><br><input type="text" id="ip" name="ip" maxlength="15"/></p>
<p><span id="macTag">MAC</span><br><input type="text" id="mac" name="mac" maxlength="17"/></p>
{{end}}
<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>&nbsp;&nbsp;<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>
controlies/trunk/applications/controlies/views/hosts/form_thinclient.html
{{extend 'layout_form_hosts.html'}}
{{block form_table}}
<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>
{{end}}
controlies/trunk/applications/controlies/views/hosts/thinclients.html
{{extend 'layout_hosts.html'}}
{{block camposgrid}}
colNames:['Nombre','MAC','Grupo'],
colModel:[
{name:'cn',index:'cn', width:80, align:"center"},
{name:'macAddress',index:'dhcpHWAddress', width:60, align:"center"},
{name:'groupName',index:'groupName', width:60, align:"center"}
],
postData:{type:'thinclient'},
caption:"Clientes ligeros",
{{end}}
{{block edit_form}}
jQuery("#dialog-form").load("form_thinclient.html", function() {
getThinClientGroups(group);
{{end}}
{{block edit2_form}}
jQuery.post('call/json/getHostData',{ cn: hid,group:group,type:'thinclient' }, function(result) {
jQuery("#form_data #name").val(result.response['cn']);
jQuery("#form_data #mac").val(result.response['mac']);
{{end}}
{{block edit3_form}}
title: "Modificar Cliente ligero"
{{end}}
{{block add_host}}
title: "Añadir cliente ligero"
{{end}}
{{block delete_host}}
jQuery.post("call/json/delete",{cn:cn,action:'delete',group:grupo,type:'thinclient'}, function(data){
{{end}}
controlies/trunk/applications/controlies/views/hosts/ltspservers.html.mio
{{extend 'layout.html'}}
<div id="tabla_clientes" class="centerGrid">
<table width="100%">
<tr>
<td style="width:2%"></td>
<td><table id="list" width="100%"></table></td>
<td style="width:2%"></td>
</tr>
</table>
<div id="pager" style=""></div>
<div id="filter" style="margin-left:30%;display:none">Search Invoices</div>
</div>
<div id="dialog-form"></div>
<div id="dialog-confirm" title="¿Borrar el registro seleccionado?" style="display:none;">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Este elemento quedará permanentemente eliminado. ¿Está seguro?</p>
</div>
<div id="dialog-alert" title="Atención" style="display:none;">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Para operar sobre un registro debe seleccionarlo previamente.</p>
</div>
controlies/trunk/applications/controlies/views/hosts/workstations.html
{{extend 'layout_hosts.html'}}
{{block camposgrid}}
postData:{type_host:'workstation-hosts'},
caption:"Workstations",
{{block vars_definition}}
var type_host = "workstation-hosts";
var name_host = "Workstation";
{{end}}
{{block edit2_form}}
jQuery.post('call/json/getHostData',{ cn:hid,type_host:'workstation-hosts' }, function(result) {
{{end}}
{{block edit3_form}}
title: "Modificar Workstation"
{{end}}
{{block add_host}}
title: "Añadir Workstation"
{{end}}
{{block delete_host}}
jQuery.post("call/json/delete",{cn:cn,action:'delete',type:'workstation-hosts'}, function(data){
{{end}}
controlies/trunk/applications/controlies/views/layout_hosts.html
<script type="text/javascript">
{{block vars_definition}}
var type_host = "ltsp-server-hosts";
var name_host = "Servidor de Aula";
{{end}}
jQuery(function() {
......
{name:'ipHostNumber',index:'ipHostNumber', width:60, align:"center"},
{name:'macAddress',index:'macAddress', width:60, align:"center"}
],
{{block camposgrid}}
postData:{type_host:'ltsp-server-hosts'},
caption:"Servidores de Aula (LTSP)",
{{end}}
postData:{type_host:type_host},
caption:name_host,
rowNum:25,
height:335,
width: 800,
......
autowidth: false,
viewrecords: true,
sortorder: "desc"
});
jQuery("#list").jqGrid('navGrid','#pager',{add:false,edit:false,del:false,search:false,refresh:false});
......
}
});
jQuery("#list").jqGrid('filterToolbar');
jQuery("#list").jqGrid('filterToolbar');
}
function rowSelected(){
......
jQuery("#dialog-form").load("form_ltspserver.html", function() {
jQuery("#form_data #action").val("modify");
jQuery("#form_data #name").attr("readonly","true");
jQuery("#form_data #name").css("background-color","#DDD");
{{block edit2_form}}
jQuery.post('call/json/getHostData',{ cn:hid,type_host:'ltsp-server-hosts' }, function(result) {
{{end}}
jQuery("#form_data #name").css("background-color","#DDD");
jQuery.post('call/json/getHostData',{ cn:hid,type_host:type_host }, function(result) {
jQuery("#form_data #name").val(result.response['cn']);
jQuery("#form_data #ip").val(result.response['ip']);
jQuery("#form_data #mac").val(result.response['mac']);
jQuery("#form_data #type_host").val(type_host);
x = (jQuery(window).width()-300)/2;
y = (jQuery(window).height()-500)/2;
......
jQuery("#dialog-form").dialog({
resizable: false,
modal: true,
width: 300,
{{block edit3_form}}
title: "Modificar Servidor de aula"
{{end}}
width: 300,
title: "Modificar "+name_host
}).dialog('option', 'position', [x, y]);
});
});
......
jQuery("#dialog-form").html("");
jQuery("#dialog-form").load("form_ltspserver.html", function() {
jQuery("#form_data #action").val("add");
jQuery("#form_data #type_host").val(type_host);
jQuery("#form_data #messageForm").html("Todos los campos son obligatorios");
});
......
resizable: false,
position: top,
modal: true,
{{block add_host}}
title: "Añadir Servidor de Aula (ltsp)"
{{end}}
title: "Añadir "+name_host
}).dialog('option', 'position', [x, y]);
}
......
modal: true,
buttons: {
"Borrar": function() {
{{block delete_host}}
jQuery.post("call/json/delete",{cn:cn,action:'delete',type_host:'ltsp-server-hosts'}, function(data){
{{end}}
jQuery.post("call/json/delete",{cn:cn,action:'delete',type_host:type_host}, function(data){
jQuery("#dialog-confirm").dialog( "close" );
jQuery("#list").trigger("reloadGrid");
});

Exportar a: Unified diff