Commit def6262a authored by Ulises Morales Ramírez's avatar Ulises Morales Ramírez

Merge branch 'log_display' into 'dev'

- agregado el boton de paypal en la vista "cart"

See merge request !10
parents 7b7c95ba 54d1f7a5
......@@ -115,7 +115,7 @@
<br>
<ul class="sidebar-menu" data-widget="tree">
<li>
<a class="treeview " href="{{ BASE_URL }}/catalog">
<a class="treeview " href="../../catalog">
<i class="fa fa-map"></i>
<span>Home</span>
<span class="pull-right-container">
......@@ -222,10 +222,10 @@
{% endfor %}
<input type='hidden' name='cancel_return'
value='{{BASE_URL}}/reports'>
value='../reports'>
<input type='hidden' name='return'
value='{{BASE_URL}}/catalog/cart'>
<input type="hidden" name="notify_url" value="{{BASE_URL}}/catalog/ipn">
value='../catalog/cart'>
<input type="hidden" name="notify_url" value="../catalog/ipn">
<input type="image"
src="https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
border="0" name="submit"
......
......@@ -483,7 +483,7 @@ def showCart(request):
total_products += 1
return render(request, 'show_cart.html',
{'product_list': prod_list, 'total_price': total_price, 'total_products': total_products,'BASE_URL': BASE_URL})
{'product_list': prod_list, 'total_price': total_price, 'total_products': total_products})
# -------------------------------------
......@@ -516,7 +516,7 @@ def Pay(request):
if not os.path.exists(userdir):
os.makedirs(userdir)
search_dir = userdir + "/" + str(values['search_id'])
search_dir = userdir + "/" + str(values['id'])
if not os.path.exists(search_dir):
os.makedirs(search_dir)
......
{
"PATHS": {
"PATH_GEOSENTINEL": "/home/david/centroGEO/repsat/Geosentinel",
"PATH_NAS": "/home/david/NAS/",
"PATH_USERS" : "/home/david/NAS/repsat_test_dev/"
"PATH_GEOSENTINEL": "/home/ulises/centroGEO/repsat/Geosentinel",
"PATH_NAS": "/home/ulises/NAS/",
"PATH_USERS" : "/home/ulises/NAS/repsat_test_dev/"
},
"API_SENTINEL": {
"SENTINEL_USER" : "emmhp",
......
......@@ -138,7 +138,8 @@
<th>Start Date</th>
<th>End Date</th>
<th>Clouds %</th>
<th>Size</th>
<th>Progress %</th>
<th>Estimated Size</th>
<th>Actions</th>
</thead>
<tbody>
......@@ -149,8 +150,26 @@
<td>{{product.startDate}}</td>
<td>{{product.endDate}}</td>
<td>{{product.clouds}} %</td>
<td class="text-center">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{{product.progress}}"
aria-valuemin="0"
aria-valuemax="100" style="width:{{product.progress}}%">
<p class="text-center" style="color: #0a0a0a">{{product.progress}} % </p>
</div>
</div>
</td>
<td>{{product.size}} MB</td>
<td><a href="{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}" class="btn btn-success"><i class="fa fa-eye"></i></a></td>
<td class="text-center">
<a href="{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}"
class="btn btn-success">
<i class="fa fa-eye"></i>
</a>
<a href="{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}"
class="btn btn-info">
<i class="fa fa-file-archive-o"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
......
......@@ -32,13 +32,6 @@ USERS_PATH = config['PATHS']['PATH_USERS']
def report_L2ASCL(request, report,purchase_id):
#image_path =USERS_PATH + request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/"
image_path =request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/"
print(image_path)
# os.system(
# "L2ASCL_AreaProcessing.sh " + search_dir + "/ 1 > " + search_dir + "/L2ASCL_AreaProcessing.log") ###ejecuta el proceso
#
with open(USERS_PATH + request.user.email+"/"+purchase_id+"/" + report + ".json") as f:
json_data = OrderedDict(json.load(f))
graphData = dict()
......@@ -51,7 +44,7 @@ def report_L2ASCL(request, report,purchase_id):
labels = set()
for d in json_data:
labels |= set(json_data[d].keys())
print(labels)
labels.remove('date')
labelNames = ["No Data", "Saturated", "Shadows", "Cloud Shadows", "Vegetation", "Not-Vegetated", "Whater",
......@@ -83,9 +76,25 @@ def report_L2ASCL(request, report,purchase_id):
def Reports(request):
progress = 0
productList=[]
product_list = Purchase.objects.values('id','productList','aggreg_date','search__clouds' ,'search__startDate', 'search__endDate','search__process_id__name').filter(user_id=request.user.id, purchased=1)
for producto in product_list:
log_info = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/L2ASCL_AreaProcessing.log"
#####################################################
# 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
size = 0
for p in json.loads(producto['productList']):
size = size + float(p['info']['size'][:-3])
......@@ -97,5 +106,7 @@ def Reports(request):
"clouds": producto['search__clouds'],
"size": size,
"purchase_id": producto['id'],
"progress": progress,
})
return render(request, 'Reports.html', {"productList": productList})
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