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
11292932
Commit
11292932
authored
Feb 27, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard
parent
6a550913
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
8 deletions
+16
-8
dashboard.html
administration/templates/dashboard.html
+1
-1
views.py
administration/views.py
+6
-4
models.py
catalog/models.py
+1
-0
dataRetrieval.js
catalog/static/catalog/js/dataRetrieval.js
+3
-2
map.html
catalog/templates/map.html
+1
-0
views.py
catalog/views.py
+4
-1
No files found.
administration/templates/dashboard.html
View file @
11292932
...
...
@@ -350,7 +350,7 @@
<tbody>
{% for search in search %}
<tr>
<td></td>
<td>
{{ search.search_name }}
</td>
<td>
{{ search.count }}
</td>
</tr>
{% endfor %}
...
...
administration/views.py
View file @
11292932
...
...
@@ -8,7 +8,6 @@ import json
from
django.http
import
HttpResponse
,
HttpResponseRedirect
,
HttpRequest
from
PIL
import
Image
# Create your views here.
from
catalog.models
import
Purchase
,
Search
...
...
@@ -41,9 +40,12 @@ def Dashboard(request):
if
month
[
'date'
]
==
date_name
:
month
[
'quantity'
]
=
date
[
1
]
Searches
=
Search
.
objects
.
values
(
'area'
)
.
annotate
(
count
=
Count
(
'area'
))
.
order_by
(
'-count'
)[:
5
]
return
render
(
request
,
'dashboard.html'
,
{
"Viewname"
:
"Dashboard"
,
"Usuarios"
:
usuarios
,
"Total_compras"
:
total
,
"Solicitud"
:
Request
,
"Descargando"
:
in_process
,
"dates"
:
month_lst
,
"search"
:
Searches
})
Searches
=
Search
.
objects
.
values
(
'search_name'
)
.
exclude
(
search_name
=
'Drawn polygon'
)
.
annotate
(
count
=
Count
(
'search_name'
))
.
order_by
(
'-count'
)[:
5
]
return
render
(
request
,
'dashboard.html'
,
{
"Viewname"
:
"Dashboard"
,
"Usuarios"
:
usuarios
,
"Total_compras"
:
total
,
"Solicitud"
:
Request
,
"Descargando"
:
in_process
,
"dates"
:
month_lst
,
"search"
:
Searches
})
# ----------------------------------------------------------
...
...
catalog/models.py
View file @
11292932
...
...
@@ -57,6 +57,7 @@ class Process(models.Model):
class
Search
(
models
.
Model
):
area
=
models
.
TextField
(
null
=
True
)
search_name
=
models
.
TextField
(
default
=
"Drawn polygon"
)
user
=
models
.
ForeignKey
(
User
,
on_delete
=
models
.
CASCADE
)
aggreg_date
=
models
.
DateTimeField
(
auto_now
=
True
)
# date of product aggregation
startDate
=
models
.
DateTimeField
(
verbose_name
=
'Start Date'
)
...
...
catalog/static/catalog/js/dataRetrieval.js
View file @
11292932
...
...
@@ -13,7 +13,7 @@ var polygonList;
var
makeRequest
=
function
(
value
)
{
var
pol_element
=
document
.
getElementById
(
'polygon-list'
);
console
.
log
(
"hola"
);
// city request to DB
// variable req_url in map.html
$
.
ajax
({
...
...
@@ -172,7 +172,7 @@ function drawPolygon(element) {
// draw coordsR
osmap
.
addPolygon
(
coords
);
}
})
})
;
}
function
erase_input
()
{
...
...
@@ -304,6 +304,7 @@ $('#ajax-input').focus(function () {
$
(
'#polygon-list'
).
click
(
function
()
{
$
(
'#option-list'
).
hide
();
OPT_LIST_IS_HIDDEN
=
true
;
$
(
'#search_name'
).
val
(
$
(
'#ajax-input'
).
val
());
// $('#ajax-input').value = $(this);
});
...
...
catalog/templates/map.html
View file @
11292932
...
...
@@ -139,6 +139,7 @@
<form
id=
'product-form'
role=
"form"
method=
"post"
>
{% csrf_token %}
<input
type=
"hidden"
id=
"user_name"
name=
"user_name"
value=
{{user.get_username}}
>
<input
type=
"text"
id=
"search_name"
name=
"search_name"
>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li
class=
"treeview"
>
<a
href=
"#"
>
...
...
catalog/views.py
View file @
11292932
...
...
@@ -85,6 +85,8 @@ def productList(request):
init_date
=
req
[
'start'
][
0
][:
10
]
end_date
=
req
[
'end'
][
0
][:
10
]
clouds
=
req
[
'cloudPercentage'
][
0
]
search_name
=
req
[
'search_name'
][
0
]
print
(
search_name
)
cloud_percentage
=
"[0 TO "
+
req
[
'cloudPercentage'
][
0
]
+
"]"
## ----- aqui llamada a api sentinel
...
...
@@ -142,7 +144,8 @@ def productList(request):
endDate
=
end_date
,
process
=
proceso
,
# Aquí pasar el objeto completo de Process Desbloqueo cambio de Sergio
clouds
=
clouds
,
area
=
area
area
=
area
,
search_name
=
search_name
,
)
listSearch
.
save
()
...
...
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