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
5245fc8e
Commit
5245fc8e
authored
Feb 20, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listar directorios
parent
6f45d711
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
5 deletions
+48
-5
views.py
administration/views.py
+5
-2
L2ASCL_data.html
reports/templates/L2ASCL_data.html
+23
-0
Reports.html
reports/templates/Reports.html
+4
-1
urls.py
reports/urls.py
+1
-1
views.py
reports/views.py
+15
-1
No files found.
administration/views.py
View file @
5245fc8e
...
@@ -3,7 +3,7 @@ from django.contrib.auth.models import User
...
@@ -3,7 +3,7 @@ from django.contrib.auth.models import User
from
django.shortcuts
import
render
,
redirect
from
django.shortcuts
import
render
,
redirect
import
json
import
json
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
PIL
import
Image
# Create your views here.
# Create your views here.
def
Request
(
request
):
def
Request
(
request
):
...
@@ -26,6 +26,7 @@ def Request (request):
...
@@ -26,6 +26,7 @@ def Request (request):
return
redirect
(
'../'
)
return
redirect
(
'../'
)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
def
update_user
(
request
):
def
update_user
(
request
):
"""
is_active = False
is_active = False
is_staff = False
is_staff = False
is_superuser = False
is_superuser = False
...
@@ -44,4 +45,6 @@ def update_user(request):
...
@@ -44,4 +45,6 @@ def update_user(request):
user.save()
user.save()
messages.success(request, 'the user was updated')
messages.success(request, 'the user was updated')
return
HttpResponseRedirect
(
'../'
)
return HttpResponseRedirect('../')
\ No newline at end of file
"""
imagen
=
Image
.
open
(
""
)
\ No newline at end of file
reports/templates/L2ASCL_data.html
View file @
5245fc8e
...
@@ -126,6 +126,28 @@
...
@@ -126,6 +126,28 @@
</span>
</span>
</a>
</a>
</li>
</li>
<li
class=
"treeview"
>
<a
href=
"#"
>
<i
class=
"fa fa-file-archive-o"
></i>
<span>
Report
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
<ul
class=
"treeview-menu sidebar-form"
>
{% for folder in folders %}
<li>
<a
class=
"treeview "
href=
"{{ folder }}_sclData"
>
<i
class=
"fa fa-pie-chart"
></i>
<span>
{{ folder }}
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
{% endfor %}
</ul>
</li>
<li
class=
"treeview"
>
<li
class=
"treeview"
>
<a
href=
"#"
>
<a
href=
"#"
>
<i
class=
"fa fa-area-chart"
></i>
<i
class=
"fa fa-area-chart"
></i>
...
@@ -243,6 +265,7 @@
...
@@ -243,6 +265,7 @@
<!-- 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>
<!-- Content Wrapper. Contains page content -->
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<!-- Main content -->
<section
class=
"content"
>
<section
class=
"content"
>
...
...
reports/templates/Reports.html
View file @
5245fc8e
...
@@ -100,6 +100,7 @@
...
@@ -100,6 +100,7 @@
</ul>
</ul>
{% endblock %}
{% endblock %}
{% block sidebar %}
{% block sidebar %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<br>
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
...
@@ -165,7 +166,9 @@
...
@@ -165,7 +166,9 @@
<div
id=
"action_buttons{{ product.purchase_id }}"
{%
if
product
.
progress
!=
100
%}
<div
id=
"action_buttons{{ product.purchase_id }}"
{%
if
product
.
progress
!=
100
%}
class=
"hidden"
{%
endif
%}
>
class=
"hidden"
{%
endif
%}
>
<a
title=
"View Report"
<a
title=
"View Report"
href=
"../reports/T15QZD_sclData/{{ product.purchase_id }}"
{%
if
product
.
initial_folder
%}
href=
"../reports/{{ product.purchase_id }}/{{ product.initial_folder }}_sclData"
{%
endif
%}
class=
"btn btn-success"
>
class=
"btn btn-success"
>
<i
class=
"fa fa-eye"
></i>
<i
class=
"fa fa-eye"
></i>
</a>
</a>
...
...
reports/urls.py
View file @
5245fc8e
...
@@ -5,7 +5,7 @@ from reports import views
...
@@ -5,7 +5,7 @@ from reports import views
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^(?P<
report>[\w\-]+)/(?P<purchase_id>(\d+)
)$'
,
views
.
report_L2ASCL
,
name
=
'report'
),
url
(
r'^(?P<
purchase_id>(\d+))/(?P<report>[\w\-]+
)$'
,
views
.
report_L2ASCL
,
name
=
'report'
),
url
(
r'^$'
,
views
.
Reports
,
name
=
'reports'
),
url
(
r'^$'
,
views
.
Reports
,
name
=
'reports'
),
url
(
r'^ws/process_progress$'
,
views
.
wsProcessProgress
,
name
=
'wsProcessProgress'
),
url
(
r'^ws/process_progress$'
,
views
.
wsProcessProgress
,
name
=
'wsProcessProgress'
),
...
...
reports/views.py
View file @
5245fc8e
...
@@ -30,8 +30,12 @@ USERS_PATH = config['PATHS']['PATH_USERS']
...
@@ -30,8 +30,12 @@ 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/"
absolute_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
purchase_id
+
"/out"
folders
=
os
.
listdir
(
path
=
absolute_path
)
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
()
...
@@ -78,7 +82,7 @@ def report_L2ASCL(request, report, purchase_id):
...
@@ -78,7 +82,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"
:
report
,
"IMAGE_PATH"
:
image_path
,
'dafaultLabel'
:
defaultLabel
,
'defaultDataSet'
:
defaultDataset
})
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
})
# -------------------------------------------------------------------------------def Reports(request):
# -------------------------------------------------------------------------------def Reports(request):
...
@@ -121,6 +125,11 @@ def Reports(request):
...
@@ -121,6 +125,11 @@ def Reports(request):
else
:
else
:
final_size
=
str
(
round
(
size
,
2
))
+
" MB"
final_size
=
str
(
round
(
size
,
2
))
+
" MB"
absolute_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/out"
folders
=
os
.
listdir
(
path
=
absolute_path
)
for
folder
in
folders
:
initial_folder
=
folder
productList
.
append
({
productList
.
append
({
"process"
:
producto
[
'search__process_id__name'
],
"process"
:
producto
[
'search__process_id__name'
],
"purchase_date"
:
producto
[
'aggreg_date'
],
"purchase_date"
:
producto
[
'aggreg_date'
],
...
@@ -131,11 +140,16 @@ def Reports(request):
...
@@ -131,11 +140,16 @@ def Reports(request):
"purchase_id"
:
producto
[
'id'
],
"purchase_id"
:
producto
[
'id'
],
"progress"
:
progress
,
"progress"
:
progress
,
"log_info"
:
log
,
"log_info"
:
log
,
"initial_folder"
:
initial_folder
,
})
})
size
=
0
size
=
0
final_size
=
0
final_size
=
0
log_info
=
""
log_info
=
""
progress
=
0
progress
=
0
initial_folder
=
""
##############################################
##############################################
# paginacion #
# paginacion #
##############################################
##############################################
...
...
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