Commit 8b6ab504 authored by Irving Sánchez's avatar Irving Sánchez

Añadida información de la búsqueda en la vista del reporte. Añadido path de thumbnails

parent 3c06f7fb
...@@ -265,6 +265,8 @@ ...@@ -265,6 +265,8 @@
<!-- Main content --> <!-- Main content -->
<div id="reportPage" class="wrapper" style="background-color: #ecf0f5"> <div id="reportPage" class="wrapper" style="background-color: #ecf0f5">
<div class="text-center"><h1>{{ report_name }}</h1></div> <div class="text-center"><h1>{{ report_name }}</h1></div>
<h4 style='margin:20px'>Platform: {{platform}} <br> Product level: {{productLevel}} <br> Start date: {{startDate}} <br>End date: {{endDate}} <br> Clouds: {{clouds}} </h4>
<!-- Content Wrapper. Contains page content --> <!-- Content Wrapper. Contains page content -->
<!-- Main content --> <!-- Main content -->
...@@ -275,7 +277,7 @@ ...@@ -275,7 +277,7 @@
<div class="box box-primary"> <div class="box box-primary">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"> {{ title }} SCL Image Classification Data(Km²)</h3> <h3 class="box-title"> {{ title }} SCL Image Classification Data(Km²)</h3>
<div class="box-tools pull-right"> <div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i <button type="button" class="btn btn-box-tool" data-widget="collapse"><i
class="fa fa-minus"></i> class="fa fa-minus"></i>
......
...@@ -32,10 +32,26 @@ USERS_PATH = config['PATHS']['PATH_USERS'] ...@@ -32,10 +32,26 @@ USERS_PATH = config['PATHS']['PATH_USERS']
def report_L2ASCL(request, report, purchase_id): def report_L2ASCL(request, report, purchase_id):
# image_path =USERS_PATH + request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/" # image_path =USERS_PATH + request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/"
image_path = request.user.email + "/" + purchase_id + "/" + "out/T15QZD/TCI/" reporteDir = report.replace('_sclData','')
image_path = request.user.email + "/" + purchase_id + "/" + "out/"+reporteDir+"/TCI/thumbnails/"
#image_path = request.user.email + "/" + purchase_id + "/" + "out/T15QZD/TCI/"
absolute_path = USERS_PATH + request.user.email + "/" + purchase_id + "/out" absolute_path = USERS_PATH + request.user.email + "/" + purchase_id + "/out"
folders = os.listdir(path=absolute_path) folders = os.listdir(path=absolute_path)
#print("lee findproducts")
#print(request)
#print(report)
#reporteDir = str('holaaa') # report.replace('_sclData','')
#print(reporte)
#reporte.replace("_sclData","")
with open(USERS_PATH + request.user.email + "/" + purchase_id + "/findProducts.json") as p:
dataProduct = json.load(p)
print(dataProduct['startDate'])
startDate = str(dataProduct['startDate'])[:4] +'-'+ str(dataProduct['startDate'])[4:6]+'-'+ str(dataProduct['startDate'])[6:8]
endDate = str(dataProduct['endDate'])[:4] +'-'+ str(dataProduct['endDate'])[4:6]+'-'+ str(dataProduct['endDate'])[6:8]
with open(USERS_PATH + request.user.email + "/" + purchase_id + "/" + report + ".json") as f: with open(USERS_PATH + request.user.email + "/" + purchase_id + "/" + report + ".json") as f:
json_data = OrderedDict(json.load(f)) json_data = OrderedDict(json.load(f))
graphData = dict() graphData = dict()
...@@ -84,7 +100,7 @@ def report_L2ASCL(request, report, purchase_id): ...@@ -84,7 +100,7 @@ def report_L2ASCL(request, report, purchase_id):
# graphData['options']['maintainAspectRatio']=False # graphData['options']['maintainAspectRatio']=False
# print(json.dumps(graphData).encode("utf-8")) # print(json.dumps(graphData).encode("utf-8"))
return render(request, 'L2ASCL_data.html', {"graphData": json.dumps(graphData), "report_name": "SCL Image Classification Data(Km²)", "IMAGE_PATH": image_path, 'dafaultLabel': defaultLabel, 'defaultDataSet': defaultDataset, "folders" : folders }) return render(request, 'L2ASCL_data.html', {"graphData": json.dumps(graphData),"name":"foo", "report_name": "SCL Image Classification Data(Km²)", "startDate": startDate,"endDate": endDate,"clouds": dataProduct['clouds'], "platform": dataProduct['platform'],"productLevel": dataProduct['productLevel'] ,"IMAGE_PATH": image_path, 'dafaultLabel': defaultLabel, 'defaultDataSet': defaultDataset, "folders" : folders })
# -------------------------------------------------------------------------------def Reports(request): # -------------------------------------------------------------------------------def Reports(request):
...@@ -128,10 +144,14 @@ def Reports(request): ...@@ -128,10 +144,14 @@ def Reports(request):
else: else:
final_size = str(round(size, 2)) + " MB" final_size = str(round(size, 2)) + " MB"
initial_folder = "."
absolute_path = USERS_PATH + request.user.email + "/" +str(producto['id'])+ "/out" absolute_path = USERS_PATH + request.user.email + "/" +str(producto['id'])+ "/out"
folders = os.listdir(path=absolute_path) if not os.path.exists(absolute_path):
for folder in folders: print("folder out noes not exists")
initial_folder=folder else:
folders = os.listdir(path=absolute_path)
for folder in folders:
initial_folder=folder
productList.append({ productList.append({
"process": producto['search__process_id__name'], "process": producto['search__process_id__name'],
......
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