cambio de tipo de tabla, filtro de busqueda, paginación

parent d8aaa25e
......@@ -9,7 +9,9 @@ function refresh() {
dataType: "json",
url: '../reports/ws/process_progress',
success: function (data) {
$.each(data, function (key, val) {
console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
if (val.progress != 100) {
$('#progress_bar' + val.purchase_id).attr("aria-valuenow", val.progress);
$('#progress_bar' + val.purchase_id).attr('style', 'width:' + val.progress + '%');
......@@ -43,54 +45,52 @@ $(function () {
$(document).ready(function () {
$('#example').DataTable
({
language:
$('#example').DataTable
({
language:
{
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate":
{
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate":
{
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria":
{
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
responsive:
"oAria":
{
details:
{
type: 'column',
target: 'tr'
}
},
columnDefs:
[{
className: 'control',
orderable: false,
targets: 0
}],
order: [1, 'asc']
});
});
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
},
responsive:
{
details:
{
type: 'column',
target: 'tr'
}
},
columnDefs:
[{
className: 'control',
orderable: false,
targets: 0
}],
order: [1, 'asc']
});
});
$(function () {
......
......@@ -96,16 +96,19 @@ def Reports(request):
#####################################################
# progress bar #
#####################################################
if 'Linking Products...' in open(log_info).read():
progress = 20
if 'Merging Images...' in open(log_info).read():
progress = 40
if 'Deleting Images...' in open(log_info).read():
progress = 50
if 'Extracting SCL information...' in open(log_info).read():
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
if os.stat(log_info).st_size == 0:
progress = 0
else:
if 'Linking Products...' in open(log_info).read():
progress = 20
if 'Merging Images...' in open(log_info).read():
progress = 40
if 'Deleting Images...' in open(log_info).read():
progress = 50
if 'Extracting SCL information...' in open(log_info).read():
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
with open(log_info, 'r') as myfile:
log = myfile.read().replace('\n', '')
......@@ -129,7 +132,10 @@ def Reports(request):
"progress": progress,
"log_info": log,
})
size = 0
final_size = 0
log_info = ""
progress = 0
##############################################
# paginacion #
##############################################
......@@ -154,21 +160,28 @@ def wsProcessProgress(request):
#####################################################
# progress bar #
#####################################################
if 'Linking Products...' in open(log_info).read():
progress = 20
if 'Merging Images...' in open(log_info).read():
progress = 40
if 'Deleting Images...' in open(log_info).read():
progress = 50
if 'Extracting SCL information...' in open(log_info).read():
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
if os.stat(log_info).st_size == 0:
progress = 0
else:
if 'Linking Products...' in open(log_info).read():
progress = 20
if 'Merging Images...' in open(log_info).read():
progress = 40
if 'Deleting Images...' in open(log_info).read():
progress = 50
if 'Extracting SCL information...' in open(log_info).read():
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
productList2.append({
"purchase_id": producto['id'],
"progress": progress,
})
progress = 0
log_info = ""
return HttpResponse(json.dumps(productList2))
else:
raise Http404
......
......@@ -2,114 +2,115 @@
{% load static %}
{% block headMedia %}
<link rel="stylesheet" href="{% static 'catalog/css/login.css'%}" type="text/css">
<link rel="stylesheet" href="{% static 'catalog/css/login.css' %}" type="text/css">
{% endblock %}
{% block budy %}
<div class="visible-lg-block visible-md-block">
<video id="bgvid" playsinline autoplay muted loop poster="{% static 'images/poster.jpg'%}" >
<!-- WCAG general accessibility recommendation is that media such as background video play through only once. Loop turned on for the purposes of illustration; if removed, the end of the video will fade in the same way created by pressing the "Pause" button -->
<source src="{% static 'catalog/images/background.mp4'%}" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="{% static 'catalog/images/background.ogv'%}" type='video/ogg; codecs="theora, vorbis"' />
<source src="{% static 'catalog/images/background.webm'%}" type='video/webm; codecs="vp8, vorbis"' />
</video>
</div>
<div class="login-box">
<!-- /.login-logo -->
<div class="login-box-body">
<div class="login-logo">
<div class="visible-lg-block visible-md-block">
<video id="bgvid" playsinline autoplay muted loop poster="{% static 'images/poster.jpg' %}">
<!-- WCAG general accessibility recommendation is that media such as background video play through only once. Loop turned on for the purposes of illustration; if removed, the end of the video will fade in the same way created by pressing the "Pause" button -->
<source src="{% static 'catalog/images/background.mp4' %}"
type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'/>
<source src="{% static 'catalog/images/background.ogv' %}" type='video/ogg; codecs="theora, vorbis"'/>
<source src="{% static 'catalog/images/background.webm' %}" type='video/webm; codecs="vp8, vorbis"'/>
</video>
</div>
<div class="login-box">
<!-- /.login-logo -->
<div class="login-box-body">
<div class="login-logo">
<img src="{% static 'catalog/images/geoint_med.png' %}" width="256px"/>
<br>
<b><span>Rep</span>Sat</b>
</div>
<p class="login-box-msg">
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed, please login with an account that has access.</p>
{% else %}
<p>Favor de firmarse para tener acceso.</p>
{% endif %}
{% endif %}
</p>
<form role="form" method="post" action="{% url 'login' %}">
{% csrf_token %}
<div class="form-group has-feedback">
<!-- <input type="text" class="form-control" placeholder="username">-->
<input class="form-control" placeholder="nombre de usuario" name="{{ form.username.name }}" type="{{ form.username.class.name}}" id="{{ form.username.auto_id }}" autofocus>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<!-- <input type="password" class="form-control" placeholder="assword">-->
<input class="form-control" placeholder="contraseña" name="{{ form.password.name }}" type="password" id="{{ form.password.auto_id }}" autofocus>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<!-- /.col -->
<div class="col-xs-12">
<button type="submit" class="btn btn-primary btn-block btn-flat btnGeo">Login</button>
</div>
<!-- /.col -->
</div>
</form>
<br>
<a href="#">I forgot my password</a><br>
<a href="register.html" class="text-center">Register a new membership</a>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<div class="row geointInfo" >
<div class="col-md-12">
<a href="http://www.centrogeo.org.mx/">© 2018 Centro de Investigación en Ciencias de Información Geoespacial</a>
</div>
</div>
<br>
<b><span>Rep</span>Sat</b>
</div>
<p class="login-box-msg">
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed, please login with an account that has
access.</p>
{% else %}
<p>Favor de firmarse para tener acceso.</p>
{% endif %}
{% endif %}
</p>
<form role="form" method="post" action="{% url 'login' %}">
{% csrf_token %}
<div class="form-group has-feedback">
<!-- <input type="text" class="form-control" placeholder="username">-->
<input class="form-control" placeholder="nombre de usuario" name="{{ form.username.name }}"
type="{{ form.username.class.name }}" id="{{ form.username.auto_id }}" autofocus>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<!-- <input type="password" class="form-control" placeholder="assword">-->
<input class="form-control" placeholder="contraseña" name="{{ form.password.name }}" type="password"
id="{{ form.password.auto_id }}" autofocus>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<!-- /.col -->
<div class="col-xs-12">
<button type="submit" class="btn btn-primary btn-block btn-flat btnGeo">Login</button>
</div>
<!-- /.col -->
</div>
</form>
<br>
<a href="#">I forgot my password</a><br>
<a href="register.html" class="text-center">Register a new membership</a>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<div class="row geointInfo">
<div class="col-md-12">
<a href="http://www.centrogeo.org.mx/">© 2018 Centro de Investigación en Ciencias de Información
Geoespacial</a>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
var vid = document.getElementById("bgvid");
<script>
var vid = document.getElementById("bgvid");
if (window.matchMedia('(prefers-reduced-motion)').matches)
{
vid.removeAttribute("autoplay");
vid.pause();
pauseButton.innerHTML = "Paused";
}
if (window.matchMedia('(prefers-reduced-motion)').matches) {
vid.removeAttribute("autoplay");
vid.pause();
pauseButton.innerHTML = "Paused";
}
function vidFade()
{
vid.classList.add("stopfade");
}
function vidFade() {
vid.classList.add("stopfade");
}
vid.addEventListener('ended', function()
{
// only functional if "loop" is removed
vid.pause();
// to capture IE10
vidFade();
});
vid.addEventListener('ended', function () {
// only functional if "loop" is removed
vid.pause();
// to capture IE10
vidFade();
});
</script>
</script>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment