Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
def6262a
Commit
def6262a
authored
Feb 11, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'log_display' into 'dev'
- agregado el boton de paypal en la vista "cart" See merge request
!10
parents
7b7c95ba
54d1f7a5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
19 deletions
+49
-19
show_cart.html
catalog/templates/show_cart.html
+4
-4
views.py
catalog/views.py
+2
-2
config.json
config/config.json
+3
-3
Reports.html
reports/templates/Reports.html
+21
-2
views.py
reports/views.py
+19
-8
No files found.
catalog/templates/show_cart.html
View file @
def6262a
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
<br>
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li>
<li>
<a
class=
"treeview "
href=
"
{{ BASE_URL }}
/catalog"
>
<a
class=
"treeview "
href=
"
../..
/catalog"
>
<i
class=
"fa fa-map"
></i>
<i
class=
"fa fa-map"
></i>
<span>
Home
</span>
<span>
Home
</span>
<span
class=
"pull-right-container"
>
<span
class=
"pull-right-container"
>
...
@@ -222,10 +222,10 @@
...
@@ -222,10 +222,10 @@
{% endfor %}
{% endfor %}
<input
type=
'hidden'
name=
'cancel_return'
<input
type=
'hidden'
name=
'cancel_return'
value=
'
{{BASE_URL}}
/reports'
>
value=
'
..
/reports'
>
<input
type=
'hidden'
name=
'return'
<input
type=
'hidden'
name=
'return'
value=
'
{{BASE_URL}}
/catalog/cart'
>
value=
'
..
/catalog/cart'
>
<input
type=
"hidden"
name=
"notify_url"
value=
"
{{BASE_URL}}
/catalog/ipn"
>
<input
type=
"hidden"
name=
"notify_url"
value=
"
..
/catalog/ipn"
>
<input
type=
"image"
<input
type=
"image"
src=
"https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
src=
"https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
border=
"0"
name=
"submit"
border=
"0"
name=
"submit"
...
...
catalog/views.py
View file @
def6262a
...
@@ -483,7 +483,7 @@ def showCart(request):
...
@@ -483,7 +483,7 @@ def showCart(request):
total_products
+=
1
total_products
+=
1
return
render
(
request
,
'show_cart.html'
,
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):
...
@@ -516,7 +516,7 @@ def Pay(request):
if
not
os
.
path
.
exists
(
userdir
):
if
not
os
.
path
.
exists
(
userdir
):
os
.
makedirs
(
userdir
)
os
.
makedirs
(
userdir
)
search_dir
=
userdir
+
"/"
+
str
(
values
[
'
search_
id'
])
search_dir
=
userdir
+
"/"
+
str
(
values
[
'id'
])
if
not
os
.
path
.
exists
(
search_dir
):
if
not
os
.
path
.
exists
(
search_dir
):
os
.
makedirs
(
search_dir
)
os
.
makedirs
(
search_dir
)
...
...
config/config.json
View file @
def6262a
{
{
"PATHS"
:
{
"PATHS"
:
{
"PATH_GEOSENTINEL"
:
"/home/
david
/centroGEO/repsat/Geosentinel"
,
"PATH_GEOSENTINEL"
:
"/home/
ulises
/centroGEO/repsat/Geosentinel"
,
"PATH_NAS"
:
"/home/
david
/NAS/"
,
"PATH_NAS"
:
"/home/
ulises
/NAS/"
,
"PATH_USERS"
:
"/home/
david
/NAS/repsat_test_dev/"
"PATH_USERS"
:
"/home/
ulises
/NAS/repsat_test_dev/"
},
},
"API_SENTINEL"
:
{
"API_SENTINEL"
:
{
"SENTINEL_USER"
:
"emmhp"
,
"SENTINEL_USER"
:
"emmhp"
,
...
...
reports/templates/Reports.html
View file @
def6262a
...
@@ -138,7 +138,8 @@
...
@@ -138,7 +138,8 @@
<th>
Start Date
</th>
<th>
Start Date
</th>
<th>
End Date
</th>
<th>
End Date
</th>
<th>
Clouds %
</th>
<th>
Clouds %
</th>
<th>
Size
</th>
<th>
Progress %
</th>
<th>
Estimated Size
</th>
<th>
Actions
</th>
<th>
Actions
</th>
</thead>
</thead>
<tbody>
<tbody>
...
@@ -149,8 +150,26 @@
...
@@ -149,8 +150,26 @@
<td>
{{product.startDate}}
</td>
<td>
{{product.startDate}}
</td>
<td>
{{product.endDate}}
</td>
<td>
{{product.endDate}}
</td>
<td>
{{product.clouds}} %
</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>
{{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>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</tbody>
...
...
reports/views.py
View file @
def6262a
...
@@ -32,13 +32,6 @@ USERS_PATH = config['PATHS']['PATH_USERS']
...
@@ -32,13 +32,6 @@ 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/"
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
:
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
()
...
@@ -51,7 +44,7 @@ def report_L2ASCL(request, report,purchase_id):
...
@@ -51,7 +44,7 @@ def report_L2ASCL(request, report,purchase_id):
labels
=
set
()
labels
=
set
()
for
d
in
json_data
:
for
d
in
json_data
:
labels
|=
set
(
json_data
[
d
]
.
keys
())
labels
|=
set
(
json_data
[
d
]
.
keys
())
print
(
labels
)
labels
.
remove
(
'date'
)
labels
.
remove
(
'date'
)
labelNames
=
[
"No Data"
,
"Saturated"
,
"Shadows"
,
"Cloud Shadows"
,
"Vegetation"
,
"Not-Vegetated"
,
"Whater"
,
labelNames
=
[
"No Data"
,
"Saturated"
,
"Shadows"
,
"Cloud Shadows"
,
"Vegetation"
,
"Not-Vegetated"
,
"Whater"
,
...
@@ -83,9 +76,25 @@ def report_L2ASCL(request, report,purchase_id):
...
@@ -83,9 +76,25 @@ def report_L2ASCL(request, report,purchase_id):
def
Reports
(
request
):
def
Reports
(
request
):
progress
=
0
productList
=
[]
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
)
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
:
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
size
=
0
for
p
in
json
.
loads
(
producto
[
'productList'
]):
for
p
in
json
.
loads
(
producto
[
'productList'
]):
size
=
size
+
float
(
p
[
'info'
][
'size'
][:
-
3
])
size
=
size
+
float
(
p
[
'info'
][
'size'
][:
-
3
])
...
@@ -97,5 +106,7 @@ def Reports(request):
...
@@ -97,5 +106,7 @@ def Reports(request):
"clouds"
:
producto
[
'search__clouds'
],
"clouds"
:
producto
[
'search__clouds'
],
"size"
:
size
,
"size"
:
size
,
"purchase_id"
:
producto
[
'id'
],
"purchase_id"
:
producto
[
'id'
],
"progress"
:
progress
,
})
})
return
render
(
request
,
'Reports.html'
,
{
"productList"
:
productList
})
return
render
(
request
,
'Reports.html'
,
{
"productList"
:
productList
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment