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
213f5e9b
Commit
213f5e9b
authored
Nov 15, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
descripcion reportes
parent
d2a5fcb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
32 deletions
+60
-32
Reports_scripts.js
reports/static/reports/js/Reports_scripts.js
+10
-1
Reports.html
reports/templates/Reports.html
+33
-29
views.py
reports/views.py
+17
-2
No files found.
reports/static/reports/js/Reports_scripts.js
View file @
213f5e9b
...
@@ -27,6 +27,7 @@ function refresh() {
...
@@ -27,6 +27,7 @@ function refresh() {
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
.
each
(
data
,
function
(
key
,
val
)
{
$
.
each
(
data
,
function
(
key
,
val
)
{
//~ console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
//~ console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
console
.
log
(
val
.
scl_data
);
if
(
val
.
progress
!=
100
)
{
if
(
val
.
progress
!=
100
)
{
$
(
'#progress_bar'
+
val
.
purchase_id
).
attr
(
"aria-valuenow"
,
val
.
progress
);
$
(
'#progress_bar'
+
val
.
purchase_id
).
attr
(
"aria-valuenow"
,
val
.
progress
);
$
(
'#progress_bar'
+
val
.
purchase_id
).
attr
(
'style'
,
'width:'
+
val
.
progress
+
'%'
);
$
(
'#progress_bar'
+
val
.
purchase_id
).
attr
(
'style'
,
'width:'
+
val
.
progress
+
'%'
);
...
@@ -47,7 +48,15 @@ function refresh() {
...
@@ -47,7 +48,15 @@ function refresh() {
$
(
'#view_report'
+
val
.
purchase_id
).
removeAttr
(
"disabled"
);
$
(
'#view_report'
+
val
.
purchase_id
).
removeAttr
(
"disabled"
);
$
(
'#view_report'
+
val
.
purchase_id
).
attr
(
"href"
,
"../reports/T15QZD_sclData/"
+
val
.
purchase_id
);
$
(
'#view_report'
+
val
.
purchase_id
).
attr
(
"href"
,
"../reports/T15QZD_sclData/"
+
val
.
purchase_id
);
$
(
'#main_progess'
+
val
.
purchase_id
).
attr
(
"class"
,
"hidden"
);
$
(
'#main_progess'
+
val
.
purchase_id
).
attr
(
"class"
,
"hidden"
);
$
(
'#action_buttons'
+
val
.
purchase_id
).
removeClass
(
"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"
);
}
}
}
});
});
}
}
...
...
reports/templates/Reports.html
View file @
213f5e9b
...
@@ -189,6 +189,7 @@
...
@@ -189,6 +189,7 @@
<a
href=
"#"
id=
"title{{ product.purchase_id }}"
data-toggle=
"popover"
<a
href=
"#"
id=
"title{{ product.purchase_id }}"
data-toggle=
"popover"
data-trigger=
"hover"
data-trigger=
"hover"
data-content=
"
data-content=
"
{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
onclick=
"showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"
>
{{ product.search_name }}
</a>
onclick=
"showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"
>
{{ product.search_name }}
</a>
...
@@ -224,38 +225,41 @@
...
@@ -224,38 +225,41 @@
</p>
</p>
</div>
</div>
</div>
</div>
<div
id=
"action_buttons{{ product.purchase_id }}"
{%
if
product
.
progress
!=
100
%}
<div
id=
"action_buttons{{ product.purchase_id }}"
class=
"hidden"
{%
endif
%}
>
{%
if
product
.
progress
!=
100
%}
<a
title=
"View Report"
class=
"hidden"
{%
endif
%}
>
{%
if
product
.
initial_folder
%}
<a
title=
"View Report"
href=
"../reports/{{ product.purchase_id }}"
{%
if
product
.
initial_folder
%}
{%
endif
%}
href=
"../reports/{{ product.purchase_id }}"
class=
"btn btn-success btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
>
{%
endif
%}
<i
class=
"fa fa-eye"
></i>
class=
"btn btn-success btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
>
</a>
<i
class=
"fa fa-eye"
></i>
<a
title=
"Download zip"
{%
if
product
.
progress =
=
100
%}
</a>
href=
"../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
<a
title=
"Download zip"
{%
if
product
.
progress =
=
100
%}
{%
else
%}
href=
"../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
href=
"#"
{%
else
%}
{%
endif
%}
href=
"#"
class=
"btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
>
{%
endif
%}
<i
class=
"fa fa-file-zip-o"
></i>
class=
"btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
>
</a>
<i
class=
"fa fa-file-zip-o"
></i>
<a
title=
"Download PDF"
{%
if
product
.
progress =
=
100
%}
</a>
href=
"{% url 'PDF' product.purchase_id %}"
<a
title=
"Download PDF"
{%
if
product
.
progress =
=
100
%}
{%
else
%}
href=
"{% url 'PDF' product.purchase_id %}"
href=
"#"
{%
else
%}
{%
endif
%}
href=
"#"
class=
"btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
{%
endif
%}
target=
"_blank"
class=
"btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
download=
"{{ product.search_name }} ({{ product.purchase_date }}).pdf"
>
target=
"_blank"
<i
class=
"fa fa-file-pdf-o"
></i>
download=
"{{ product.search_name }} ({{ product.purchase_date }}).pdf"
>
</a>
<i
class=
"fa fa-file-pdf-o"
></i>
<!--a title="View Log" href="#" class="btn btn-info"
</a>
<!--a title="View Log" href="#" class="btn btn-info"
onclick="openmodal('{{ product.log_info }}')">
onclick="openmodal('{{ product.log_info }}')">
<i class="fa fa-file-text"></i>
<i class="fa fa-file-text"></i>
</a-->
</a-->
</div>
</div>
<span
id=
"no_data{{ product.purchase_id }}"
class=
"hidden"
>
No Data
</span>
</td>
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
...
...
reports/views.py
View file @
213f5e9b
...
@@ -108,12 +108,12 @@ def report_L2ASCL(request, purchase_id):
...
@@ -108,12 +108,12 @@ def report_L2ASCL(request, purchase_id):
for
producto
in
product_list
:
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
(
productList
.
append
(
producto
[
'id'
],
producto
[
'id'
],
)
)
print
(
product
_l
ist
)
print
(
product
L
ist
)
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
...
@@ -132,6 +132,7 @@ def Reports(request):
...
@@ -132,6 +132,7 @@ def Reports(request):
size
=
0
size
=
0
folders
=
[]
folders
=
[]
zip
=
""
zip
=
""
Data
=
False
;
if
(
request
.
user
.
username
==
"demo"
):
if
(
request
.
user
.
username
==
"demo"
):
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
...
@@ -216,6 +217,10 @@ def Reports(request):
...
@@ -216,6 +217,10 @@ def Reports(request):
for
file
in
os
.
listdir
(
zip_path
):
for
file
in
os
.
listdir
(
zip_path
):
if
file
.
endswith
(
".zip"
):
if
file
.
endswith
(
".zip"
):
zip
=
zip_path
+
"/"
+
file
zip
=
zip_path
+
"/"
+
file
if
os
.
path
.
getsize
(
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/scl_data.json"
)
>
3
:
Data
=
True
productList
.
append
({
productList
.
append
({
"search_name"
:
producto
[
'name'
],
"search_name"
:
producto
[
'name'
],
"description"
:
producto
[
'description'
],
"description"
:
producto
[
'description'
],
...
@@ -232,6 +237,7 @@ def Reports(request):
...
@@ -232,6 +237,7 @@ def Reports(request):
"zip"
:
zip
,
"zip"
:
zip
,
"polygon"
:
polygon
[
'wkt'
],
"polygon"
:
polygon
[
'wkt'
],
"is_public"
:
producto
[
'is_public'
],
"is_public"
:
producto
[
'is_public'
],
"scl_data"
:
Data
,
})
})
size
=
0
size
=
0
final_size
=
0
final_size
=
0
...
@@ -247,6 +253,7 @@ def Reports(request):
...
@@ -247,6 +253,7 @@ def Reports(request):
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
def
wsProcessProgress
(
request
):
def
wsProcessProgress
(
request
):
if
request
.
is_ajax
():
if
request
.
is_ajax
():
Data
=
False
;
progress
=
0
progress
=
0
productList2
=
[]
productList2
=
[]
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'user__email'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'user__email'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
...
@@ -295,10 +302,16 @@ def wsProcessProgress(request):
...
@@ -295,10 +302,16 @@ def wsProcessProgress(request):
# item.progress = progress
# item.progress = progress
# item.save()
# item.save()
if
os
.
path
.
getsize
(
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/scl_data.json"
)
>
3
:
Data
=
True
productList2
.
append
({
productList2
.
append
({
"purchase_id"
:
producto
[
'id'
],
"purchase_id"
:
producto
[
'id'
],
"progress"
:
progress
,
"progress"
:
progress
,
"progress_text"
:
progress_text
,
"progress_text"
:
progress_text
,
"scl_data"
:
Data
,
})
})
progress
=
0
progress
=
0
...
@@ -312,6 +325,8 @@ def wsProcessProgress(request):
...
@@ -312,6 +325,8 @@ def wsProcessProgress(request):
# "purchase_id": producto['id'],
# "purchase_id": producto['id'],
# "progress": producto['progress'],
# "progress": producto['progress'],
# })
# })
print
(
productList2
)
return
HttpResponse
(
json
.
dumps
(
productList2
))
return
HttpResponse
(
json
.
dumps
(
productList2
))
else
:
else
:
print
(
"Error Http404"
)
print
(
"Error Http404"
)
...
...
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