Proyecto

General

Perfil

« Anterior | Siguiente » 

Revisión 171

Añadido por jredrejo hace casi 14 años

terminado de implementar todo lo que había con twisted

Ver diferencias:

controlies/branches/web2py/debian/changelog
controlies (0.3-1) unstable; urgency=low
* Terminado de implementar en web2py todo lo que había con twisted
-- José L. Redrejo Rodríguez <jredrejo@debian.org> Tue, 17 May 2011 13:08:40 +0200
controlies (0.2-2) unstable; urgency=low
* Cambios en la configuración de apache: directorio en vez de vhost
controlies/branches/web2py/applications/controlies/controllers/gestion.py
# coding: utf8
from applications.controlies.modules.Hosts import Hosts
@service.json
@auth.requires_login()
def servidores_aula():
......
def rayuela_profesores():
return dict()
@service.json
@service.json
@auth.requires_login()
def getLTSPServers():
return dict()
l=conecta()
h = Hosts (l,"","","","","")
response = h.getLTSPServers()
l.close()
return dict(response=response)
@service.json
@service.json
@auth.requires_login()
def getLTSPStatus():
return dict()
#esto no me gusta como está hecho
#tiene problemas de seguridad, lo comento de momento:
# f = open('/tmp/controlIES.ltpsSevers', 'r')
# computers = f.read().split(" ")
# computers.sort()
# f = open('/tmp/controlIES.ltpsTeachers', 'r')
# teachers = f.read().split(" ")
# teachers.sort()
teachers=()
computers=()
return dict(computers=computers,teachers=teachers)
def call():
"""
exposes services. for example:
controlies/branches/web2py/applications/controlies/views/layout.html
<!-- http://dev.w3.org/html5/markup/meta.name.html -->
<meta name="application-name" content="{{=request.application}}" />
<!-- Speaking of Google, don't forget to set your site up:
http://google.com/webmasters -->
<meta name="google-site-verification" content="" />
<!-- Mobile Viewport Fix
j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
device-width: Occupy full width of the screen in its current orientation
initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width
-->
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<!-- Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="{{=URL('static','favicon.ico')}}" type="image/x-icon">
<link rel="apple-touch-icon" href="{{=URL('static','favicon.png')}}">
controlies/branches/web2py/applications/controlies/views/gestion/servidores_aula.html
#selectableStudents li { margin: 3px 3px 3px 0; padding: 1px; float: left; width: 80px; height: 95px; font-size: 1px; text-align: center; cursor:pointer; }
</style>
{{response.files.append(URL('static','js/jdgrid/css/ui.jqgrid.css'))}}
{{response.files.append(URL('static','js/utils.js'))}}
{{extend 'layout.html'}}
<script>
......
});
function getLTSPServers(){
jQuery.post('call/json/getLTSPServers', function(result) {
$.each(result.response, function(i, l){
$('#selectable').append('<li class="ui-state-default" id="selectable-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div><img class="thumb-image" src="img/turnOff.png"/><div id="userName" style="font-size:11px;"></div></li>');
jQuery.post('call/json/getLTSPServers', function(result) {
jQuery.each(result.response, function(i, l){
jQuery('#selectable').append('<li class="ui-state-default" id="selectable-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div>{{=IMG(_src=URL(r=request,c="static",f="images/turnOff.png"),_class="thumb-image")}}<div id="userName" style="font-size:11px;"></div></li>');
});
getLTSPStatus();
});
}
function getLTSPStatus(){
jQuery.post('call/json/getLTSPStatus', function(result) {
jQuery.post('call/json/getLTSPStatus', function(result) {
$('#selectable li .thumb-image').attr('src','img/turnOff.png');
$('#selectable li #userName').html('');
jQuery('#selectable li .thumb-image').attr('src','{{=URL(r=request,c="static",f="images/turnOff.png")}}');
jQuery('#selectable li #userName').html('');
$.each(result.computers, function(i, l){
$('#selectable #selectable-'+l+' .thumb-image').attr('src','img/turnOn.png');
jQuery.each(result.computers, function(i, l){
jQuery('#selectable #selectable-'+l+' .thumb-image').attr('src','{{=URL(r=request,c="static",f="images/turnOn.png")}}');
});
$.each(result.teachers, function(i, l){
var teacher = l.split(".");
var computer = teacher[0].split("@");
$('#selectable #selectable-'+computer[1]+' #userName').html(computer[0]);
$('#selectable #selectable-'+computer[1]+' .thumb-image').attr('src','img/nobody.png');
jQuery('#selectable #selectable-'+computer[1]+' #userName').html(computer[0]);
jQuery('#selectable #selectable-'+computer[1]+' .thumb-image').attr('src','{{=URL(r=request,c="static",f="images/nobody.png")}}');
});
//getLTSPClients();
......
setTimeout("getLTSPStatus()",10000);
});
}
function getClassroomDetails(){
var selected = computersSelected();
if(selected.length==0 || selected.length>1){
modalAlert("Únicamente hay que seleccionar un equipo");
return false;
}else{
if( $("#selectable-"+selected[0]+" #userName").html()=="" ){
modalAlert("No hay datos que mostrar");
return false;
}
$("#messageLoading").show();
//$("#dialog-details").html("").css("display","none");;
$("#dialog-details").load("classroomServers/details.html", function() {
jQuery.post('call/json/getClassroomDetails',{classroom:selected[0],teacher:$("#selectable-"+selected[0]+" #userName")} function(result) {
$("#teacherName").html(result.teacher.name);
$.each(result.teacher.groups.departments, function(i, l){
$("#teacherDepartments").append(l+" ");
});
if(result.students.length>0){
$.each(result.students, function(i, l){
src = "img/nobody.png";
if(l.photo.photo!="")
src = "data:image/png;base64,"+l.photo.photo;
$('#selectableStudents').append('<li class="ui-state-default" id="selectableStudents-'+l.username+'"><div id="pcName" style="font-size:11px;">'+l.host+'</div><img class="thumb-image" src="'+src+'" style="width:64px; height:64px;"/><div id="userName" style="font-size:11px;">'+l.username+'</div></li>');
});
}else{
$("#dialog-details #selectableStudents").html("No hay alumnos detectados").css("text-align","center").css("font-weight","bold");
}
x = ($(window).width()-500)/2;
y = ($(window).height()-500)/2;
$("#messageLoading").hide();
$("#dialog-details").dialog({
resizable: false,
position: top,
modal: true,
width: 500,
title: "Detalles del aula: "+result.classroom
}).dialog('option', 'position', [x, y]);
});
});
}
}
</script>
<table width="100" cellspacing="12">
<tr>
<td style="vertical-align:top;">
<td style="vertical-align:top;" >
<div id="tabsActions">
<ul>
<li><a href="#tabs-1"><span id="actions">Acciones</span></a></li>
......
</table>
</div>
</div>
</td>
</td></tr>
</table>
<table width="100" cellspacing="12">
<tr>
<td>
<div id="tabsServers">
<ul>
<li><a href="#tabs-1"><span id="actions">Servidores</span></a></li>

Exportar a: Unified diff