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
8b6ab504
Commit
8b6ab504
authored
Feb 21, 2019
by
Irving Sánchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Añadida información de la búsqueda en la vista del reporte. Añadido path de thumbnails
parent
3c06f7fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
L2ASCL_data.html
reports/templates/L2ASCL_data.html
+3
-1
views.py
reports/views.py
+25
-5
No files found.
reports/templates/L2ASCL_data.html
View file @
8b6ab504
...
@@ -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 -->
...
...
reports/views.py
View file @
8b6ab504
...
@@ -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,7 +144,11 @@ def Reports(request):
...
@@ -128,7 +144,11 @@ 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"
if
not
os
.
path
.
exists
(
absolute_path
):
print
(
"folder out noes not exists"
)
else
:
folders
=
os
.
listdir
(
path
=
absolute_path
)
folders
=
os
.
listdir
(
path
=
absolute_path
)
for
folder
in
folders
:
for
folder
in
folders
:
initial_folder
=
folder
initial_folder
=
folder
...
...
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