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
9d5a11c3
Commit
9d5a11c3
authored
May 09, 2019
by
Irving David
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cambia el mensaje de la barra de progreso de acuerdo al log
parent
6f3bcc74
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
Reports_scripts.js
reports/static/reports/js/Reports_scripts.js
+3
-2
Reports.html
reports/templates/Reports.html
+2
-2
views.py
reports/views.py
+23
-2
No files found.
reports/static/reports/js/Reports_scripts.js
View file @
9d5a11c3
...
@@ -25,9 +25,8 @@ function refresh() {
...
@@ -25,9 +25,8 @@ function refresh() {
dataType
:
"json"
,
dataType
:
"json"
,
url
:
'../reports/ws/process_progress'
,
url
:
'../reports/ws/process_progress'
,
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);
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
+
'%'
);
...
@@ -37,6 +36,8 @@ function refresh() {
...
@@ -37,6 +36,8 @@ function refresh() {
$
(
'#action_buttons'
+
val
.
purchase_id
).
attr
(
"class"
,
"hidden"
);
$
(
'#action_buttons'
+
val
.
purchase_id
).
attr
(
"class"
,
"hidden"
);
$
(
'#main_progess'
+
val
.
purchase_id
).
removeClass
(
"hidden"
);
$
(
'#main_progess'
+
val
.
purchase_id
).
removeClass
(
"hidden"
);
$
(
'#main_progess'
+
val
.
purchase_id
).
attr
(
"class"
,
"progress"
);
$
(
'#main_progess'
+
val
.
purchase_id
).
attr
(
"class"
,
"progress"
);
$
(
'#textprogress'
+
val
.
purchase_id
).
empty
();
$
(
'#textprogress'
+
val
.
purchase_id
).
append
(
val
.
progress_text
);
}
}
else
{
else
{
//$('#progress_bar' + val.purchase_id).attr("class", "progress-bar progress-bar-success progress-bar-striped");
//$('#progress_bar' + val.purchase_id).attr("class", "progress-bar progress-bar-success progress-bar-striped");
...
...
reports/templates/Reports.html
View file @
9d5a11c3
...
@@ -215,8 +215,8 @@
...
@@ -215,8 +215,8 @@
class=
"progress-bar progress-bar-warning progress-bar-striped active"
class=
"progress-bar progress-bar-warning progress-bar-striped active"
aria-valuemin=
"0"
aria-valuemax=
"100"
aria-valuemin=
"0"
aria-valuemax=
"100"
style=
"width:{{ product.progress }}%"
>
style=
"width:{{ product.progress }}%"
>
<p
style=
"color: #0a0a0a"
>
<p
id=
"textprogress{{ product.purchase_id }}"
style=
"color: #0a0a0a"
>
Downloading
Downloading
...
</p>
</p>
</div>
</div>
</div>
</div>
...
...
reports/views.py
View file @
9d5a11c3
...
@@ -210,6 +210,7 @@ def Reports(request):
...
@@ -210,6 +210,7 @@ def Reports(request):
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
def
wsProcessProgress
(
request
):
def
wsProcessProgress
(
request
):
print
(
request
);
if
request
.
is_ajax
():
if
request
.
is_ajax
():
progress
=
0
progress
=
0
productList2
=
[]
productList2
=
[]
...
@@ -223,19 +224,37 @@ def wsProcessProgress(request):
...
@@ -223,19 +224,37 @@ def wsProcessProgress(request):
#####################################################
#####################################################
# progress bar #
# progress bar #
#####################################################
#####################################################
progress_text
=
""
if
os
.
stat
(
log_info
)
.
st_size
==
0
:
if
os
.
stat
(
log_info
)
.
st_size
==
0
:
progress
=
0
progress
=
0
else
:
else
:
if
'Linking Products...'
in
open
(
log_info
)
.
read
():
if
'Starting Process...'
in
open
(
log_info
)
.
read
():
progress
=
10
progress_text
=
'Processing...'
if
'Creating Shape file...'
in
open
(
log_info
)
.
read
():
progress
=
20
progress
=
20
progress_text
=
'Creating Shape file...'
if
'Linking Products...'
in
open
(
log_info
)
.
read
():
progress
=
30
progress_text
=
'Linking Products...'
if
'Merging Images...'
in
open
(
log_info
)
.
read
():
if
'Merging Images...'
in
open
(
log_info
)
.
read
():
progress
=
40
progress
=
40
if
'Deleting Images...'
in
open
(
log_info
)
.
read
():
progress_text
=
'Merging Images...'
if
'Applying Mask...'
in
open
(
log_info
)
.
read
():
progress
=
50
progress
=
50
progress_text
=
'Applying Mask...'
if
'Extracting SCL information...'
in
open
(
log_info
)
.
read
():
if
'Extracting SCL information...'
in
open
(
log_info
)
.
read
():
progress
=
60
progress
=
60
progress_text
=
'Extracting SCL information...'
if
'Spliting SCL image...'
in
open
(
log_info
)
.
read
():
progress
=
70
progress_text
=
'Spliting SCL image...'
if
'Creating Tiles...'
in
open
(
log_info
)
.
read
():
progress
=
90
progress_text
=
'Creating Tiles...'
if
'Finalizing...'
in
open
(
log_info
)
.
read
():
if
'Finalizing...'
in
open
(
log_info
)
.
read
():
progress
=
100
progress
=
100
progress_text
=
'Finalizing...'
# item = Purchase.objects.get(pk=producto['id'])
# item = Purchase.objects.get(pk=producto['id'])
# item.progress = progress
# item.progress = progress
...
@@ -244,6 +263,7 @@ def wsProcessProgress(request):
...
@@ -244,6 +263,7 @@ def wsProcessProgress(request):
productList2
.
append
({
productList2
.
append
({
"purchase_id"
:
producto
[
'id'
],
"purchase_id"
:
producto
[
'id'
],
"progress"
:
progress
,
"progress"
:
progress
,
"progress_text"
:
progress_text
,
})
})
progress
=
0
progress
=
0
...
@@ -258,6 +278,7 @@ def wsProcessProgress(request):
...
@@ -258,6 +278,7 @@ def wsProcessProgress(request):
# })
# })
return
HttpResponse
(
json
.
dumps
(
productList2
))
return
HttpResponse
(
json
.
dumps
(
productList2
))
else
:
else
:
print
(
"Error Http404"
)
raise
Http404
raise
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