descripcion reportes

parent d2a5fcb6
......@@ -27,6 +27,7 @@ function refresh() {
success: function (data) {
$.each(data, function (key, val) {
//~ console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
console.log(val.scl_data);
if (val.progress != 100) {
$('#progress_bar' + val.purchase_id).attr("aria-valuenow", val.progress);
$('#progress_bar' + val.purchase_id).attr('style', 'width:' + val.progress + '%');
......@@ -47,7 +48,15 @@ function refresh() {
$('#view_report' + val.purchase_id).removeAttr("disabled");
$('#view_report' + val.purchase_id).attr("href", "../reports/T15QZD_sclData/" + val.purchase_id);
$('#main_progess' + val.purchase_id).attr("class", "hidden");
if (val.scl_data == true){
$('#action_buttons' + val.purchase_id).removeClass("hidden");
$('#no_data' + val.purchase_id).attr("class", "hidden");
}
if (val.scl_data == false){
$('#action_buttons' + val.purchase_id).attr("class", "hidden");
$('#no_data' + val.purchase_id).removeClass("hidden");
}
}
});
}
......
......@@ -189,6 +189,7 @@
<a href="#" id="title{{ product.purchase_id }}" data-toggle="popover"
data-trigger="hover"
data-content="
{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
onclick="showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"> {{ product.search_name }}</a>
......@@ -224,7 +225,8 @@
</p>
</div>
</div>
<div id="action_buttons{{ product.purchase_id }}" {% if product.progress != 100 %}
<div id="action_buttons{{ product.purchase_id }}"
{% if product.progress != 100 %}
class="hidden" {% endif %}>
<a title="View Report"
{% if product.initial_folder %}
......@@ -256,6 +258,8 @@
<i class="fa fa-file-text"></i>
</a-->
</div>
<span id="no_data{{ product.purchase_id }}" class="hidden">No Data</span>
</td>
</tr>
{% endfor %}
......
......@@ -108,12 +108,12 @@ def report_L2ASCL(request, purchase_id):
for producto in product_list:
if os.path.exists(USERS_PATH + email+'/'+str(producto['id'])+'/scl_data.json' ):
if os.path.exists(USERS_PATH + email+'/'+str(producto['id'])+'/scl_data.json' ) and os.path.getsize(USERS_PATH + email+'/'+str(producto['id'])+'/scl_data.json')>3:
productList.append(
producto['id'],
)
print (product_list)
print (productList)
return render(request, template, {"graphData": json.dumps(graphData),
"searchInfo": searchInfo, "IMAGE_PATH": image_path,
"SCL_PATH": SCL_path, 'dafaultLabel': defaultLabel,
......@@ -132,6 +132,7 @@ def Reports(request):
size = 0
folders = []
zip = ""
Data=False;
if(request.user.username == "demo"):
product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds',
......@@ -216,6 +217,10 @@ def Reports(request):
for file in os.listdir(zip_path):
if file.endswith(".zip"):
zip = zip_path + "/" + file
if os.path.getsize(USERS_PATH + producto['user__email'] + "/" + str(producto['id']) + "/scl_data.json") > 3:
Data = True
productList.append({
"search_name": producto['name'],
"description": producto['description'],
......@@ -232,6 +237,7 @@ def Reports(request):
"zip": zip,
"polygon": polygon['wkt'],
"is_public": producto['is_public'],
"scl_data": Data,
})
size = 0
final_size = 0
......@@ -247,6 +253,7 @@ def Reports(request):
# ------------------------------------------------------------------------
def wsProcessProgress(request):
if request.is_ajax():
Data=False;
progress = 0
productList2 = []
product_list = Purchase.objects.values('id', 'user__email', 'productList', 'aggreg_date', 'search__clouds',
......@@ -295,10 +302,16 @@ def wsProcessProgress(request):
# item.progress = progress
# item.save()
if os.path.getsize(USERS_PATH + producto['user__email'] + "/" + str(producto['id']) + "/scl_data.json") > 3:
Data = True
productList2.append({
"purchase_id": producto['id'],
"progress": progress,
"progress_text":progress_text,
"scl_data": Data,
})
progress = 0
......@@ -312,6 +325,8 @@ def wsProcessProgress(request):
# "purchase_id": producto['id'],
# "progress": producto['progress'],
# })
print (productList2)
return HttpResponse(json.dumps(productList2))
else:
print("Error Http404")
......
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