Revisión 119
Añadido por Francisco Damián Méndez Palma hace alrededor de 14 años
controlies/trunk/Plugins/Hosts.py | ||
---|---|---|
|
||
return { "groups":groups }
|
||
|
||
def getInternalGroups (self):
|
||
|
||
groups = []
|
||
search = self.ldap.search("cn=INTERNAL,cn=DHCP Config","cn=group*",["cn"])
|
||
|
||
for g in search:
|
||
groups.append (g[0][1]["cn"][0])
|
||
|
||
return { "groups":groups }
|
||
|
||
def getHostData(self):
|
||
#self.getUserGroups()
|
||
if self.type == "thinclient":
|
controlies/trunk/www/thinclients/form.html | ||
---|---|---|
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();">
|
controlies/trunk/www/workstation/form.html | ||
---|---|---|
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="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="ipTag">Ip</span><br><input type="text" id="ip" name="ip"/></p>
|
||
<p><span id="ipTag">Dirección 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>
|
||
<p><span id="dominioTag">Dominio</span><br><input type="text" id="dominio" name="dominio" value="santaeulalia"/></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>
|
controlies/trunk/www/workstation/index.html | ||
---|---|---|
}).dialog('open');
|
||
}
|
||
|
||
function getInternalGroups(selected) {
|
||
$.post('hosts','action=getInternalGroups', function(data) {
|
||
var result = $.parseJSON(data);
|
||
|
||
var selectGrupos = document.getElementById("group");
|
||
|
||
for (i=0;i<result.response.groups.length;i++) {
|
||
var optn = document.createElement("option");
|
||
optn.text = result.response.groups[i];
|
||
optn.value = result.response.groups[i];
|
||
if (selected==optn.text)
|
||
optn.selected = true;
|
||
selectGrupos.options.add (optn);
|
||
}
|
||
});
|
||
}
|
||
|
||
function addRecord(){
|
||
|
||
$("#dialog-form").html("");
|
||
$("#dialog-form").load("workstation/form.html", function() {
|
||
$("#form_data #action").val("add");
|
||
$("#form_data #messageForm").html("Todos los campos son obligatorios");
|
||
|
||
getInternalGroups();
|
||
|
||
x = ($(window).width()-250)/2;
|
||
y = ($(window).height()-400)/2;
|
||
|
||
$("#dialog-form").dialog({
|
||
resizable: false,
|
||
position: top,
|
||
modal: true,
|
||
title: "Añadir Workstation"
|
||
}).dialog('option', 'position', [x, y]);
|
||
});
|
||
|
||
x = ($(window).width()-250)/2;
|
||
y = ($(window).height()-400)/2;
|
||
|
||
$("#dialog-form").dialog({
|
||
resizable: false,
|
||
position: top,
|
||
modal: true,
|
||
title: "Añadir Workstation"
|
||
}).dialog('option', 'position', [x, y]);
|
||
}
|
||
|
||
</script>
|
controlies/trunk/MainLoop.py | ||
---|---|---|
elif request.args['action'][0] == "getThinclientGroups":
|
||
h = Hosts (l,"","","","","")
|
||
response = h.getThinclientGroups ()
|
||
return json.dumps({"response" : response})
|
||
return json.dumps({"response" : response})
|
||
|
||
elif request.args['action'][0] == "getInternalGroups":
|
||
h = Hosts (l,"","","","","")
|
||
response = h.getInternalGroups ()
|
||
return json.dumps({"response" : response})
|
||
|
||
|
||
elif request.args['action'][0] == "getLTSPServers":
|
||
h = Hosts (l,"","","","","")
|
||
response = h.getLTSPServers ()
|
Exportar a: Unified diff
Validando alta workstations