Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
23cae4a3
Commit
23cae4a3
authored
Dec 20, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.khansia.co.id/Nahrowi/oku-gis
parents
12c741c6
e4f629e3
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
336 additions
and
204 deletions
+336
-204
API/urls.py
API/urls.py
+2
-1
API/views.py
API/views.py
+39
-1
Application/views.py
Application/views.py
+37
-37
myauth/views.py
myauth/views.py
+8
-1
require.txt
require.txt
+29
-0
static/js/action.js
static/js/action.js
+4
-7
templates/includes/modal.html
templates/includes/modal.html
+0
-8
templates/includes/sidebar.html
templates/includes/sidebar.html
+217
-149
No files found.
API/urls.py
View file @
23cae4a3
...
@@ -98,6 +98,7 @@ urlpatterns = [
...
@@ -98,6 +98,7 @@ urlpatterns = [
path
(
'reloadpoint'
,
views
.
reload_point
,
name
=
'reloadpoint'
),
path
(
'reloadpoint'
,
views
.
reload_point
,
name
=
'reloadpoint'
),
path
(
'download_perbaikan_data'
,
views
.
download_perbaikan_data
),
path
(
'download_perbaikan_data'
,
views
.
download_perbaikan_data
),
path
(
'search_list_perbaikan'
,
views
.
search_list_perbaikan
)
path
(
'search_list_perbaikan'
,
views
.
search_list_perbaikan
),
path
(
'dataperbaikan'
,
views
.
data_perbaikan
),
]
]
\ No newline at end of file
API/views.py
View file @
23cae4a3
...
@@ -4323,3 +4323,41 @@ def reload_point(request):
...
@@ -4323,3 +4323,41 @@ def reload_point(request):
}
}
return
(
context
)
return
(
context
)
@
api_view
((
'GET'
,))
def
data_perbaikan
(
request
):
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
SELECT
gl.NAME,
tp.id_object,
tp.NAME,
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
"""
)
res_perbaikan
=
data_per
.
fetchall
()
res_all
=
[]
for
j
in
res_perbaikan
:
data_all
=
{
'name_perbaikan'
:
j
[
0
],
'id_object'
:
j
[
1
],
'name'
:
j
[
2
],
'type'
:
j
[
3
],
'tgl_perbaikan'
:
j
[
4
],
'anggaran'
:
j
[
5
],
'tgl_selesai'
:
j
[
6
],
'desa'
:
j
[
7
],
'kecamatan'
:
j
[
8
],
}
res_all
.
append
(
data_all
)
return
Response
(
res_all
)
\ No newline at end of file
Application/views.py
View file @
23cae4a3
...
@@ -467,40 +467,40 @@ class Dashboard(generic.TemplateView):
...
@@ -467,40 +467,40 @@ class Dashboard(generic.TemplateView):
# for i in gardu_listrik_res:
# for i in gardu_listrik_res:
# gardu_listrik_result.append(i[0])
# gardu_listrik_result.append(i[0])
with
conn
.
cursor
()
as
data_per
:
#
with conn.cursor() as data_per:
data_per
.
execute
(
"""
#
data_per.execute("""
SELECT
#
SELECT
gl.NAME,
#
gl.NAME,
tp.id_object,
#
tp.id_object,
tp.NAME,
#
tp.NAME,
tp.TYPE,
#
tp.TYPE,
tp.tgl_perbaikan,
#
tp.tgl_perbaikan,
tp.anggaran,
#
tp.anggaran,
tp.tgl_selesai,
#
tp.tgl_selesai,
gdl.desa,
#
gdl.desa,
gdc.kecamatan
#
gdc.kecamatan
FROM
#
FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
#
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id
#
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
#
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
#
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
"""
)
#
""")
res_perbaikan
=
data_per
.
fetchall
()
#
res_perbaikan = data_per.fetchall()
res_all
=
[]
#
res_all = []
for
j
in
res_perbaikan
:
#
for j in res_perbaikan:
data_all
=
{
#
data_all = {
'name_perbaikan'
:
j
[
0
],
#
'name_perbaikan':j[0],
'id_object'
:
j
[
1
],
#
'id_object':j[1],
'name'
:
j
[
2
],
#
'name':j[2],
'type'
:
j
[
3
],
#
'type':j[3],
'tgl_perbaikan'
:
j
[
4
],
#
'tgl_perbaikan':j[4],
'anggaran'
:
j
[
5
],
#
'anggaran':j[5],
'tgl_selesai'
:
j
[
6
],
#
'tgl_selesai':j[6],
'desa'
:
j
[
7
],
#
'desa':j[7],
'kecamatan'
:
j
[
8
],
#
'kecamatan':j[8],
}
#
}
res_all
.
append
(
data_all
)
#
res_all.append(data_all)
perm_group
=
[]
perm_group
=
[]
if
request
.
user
.
is_authenticated
:
if
request
.
user
.
is_authenticated
:
...
@@ -620,7 +620,7 @@ class Dashboard(generic.TemplateView):
...
@@ -620,7 +620,7 @@ class Dashboard(generic.TemplateView):
# 'cagar_budaya':cagar_budaya_result,
# 'cagar_budaya':cagar_budaya_result,
# 'gardu_listrik':gardu_listrik_result,
# 'gardu_listrik':gardu_listrik_result,
'global'
:
all
[
0
],
'global'
:
all
[
0
],
'res_all'
:
res_all
,
#
'res_all':res_all,
'thisUser'
:
user_data
,
'thisUser'
:
user_data
,
'perm_group'
:
perm_group
'perm_group'
:
perm_group
# 'user_res':user_res
# 'user_res':user_res
...
...
myauth/views.py
View file @
23cae4a3
...
@@ -470,10 +470,17 @@ def load_group_edit(request):
...
@@ -470,10 +470,17 @@ def load_group_edit(request):
}
}
resgroup
.
append
(
datas
)
resgroup
.
append
(
datas
)
print
(
datas
)
print
(
datas
)
group
=
Group
.
objects
.
get
(
name
=
datas
[
'name'
])
group_perm
=
[]
for
group_p
in
group
.
permissions
.
all
():
g
=
str
(
group_p
)
.
split
(
"| Can "
)[
1
]
.
replace
(
" "
,
"_"
)
group_perm
.
append
(
g
)
data
=
{
data
=
{
"info"
:
"success"
,
"info"
:
"success"
,
"code"
:
0
,
"code"
:
0
,
"data"
:
datas
,
"data"
:
datas
,
"perm_group"
:
group_perm
}
}
return
Response
(
data
)
return
Response
(
data
)
...
...
require.txt
0 → 100644
View file @
23cae4a3
asgiref==3.4.0
autopep8==1.5.7
click==8.0.1
colorama==0.4.4
dj-database-url==0.5.0
Django==3.2.4
django-utils-six==2.0
django-widget-tweaks==1.4.8
djangorestframework==3.12.4
Flask==2.0.1
gunicorn==20.1.0
importlib-metadata==4.8.1
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
Pillow==8.3.1
psycopg2==2.9.1
pycodestyle==2.7.0
python-decouple==3.4
pytz==2021.1
six==1.16.0
sqlparse==0.4.1
toml==0.10.2
typing==3.7.4.3
typing-extensions==3.10.0.0
Unipath==1.1
Werkzeug==2.0.1
whitenoise==5.2.0
zipp==3.5.0
static/js/action.js
View file @
23cae4a3
...
@@ -816,6 +816,7 @@ function loadgroupbyid(id) {
...
@@ -816,6 +816,7 @@ function loadgroupbyid(id) {
isObject
.
id
=
id
;
isObject
.
id
=
id
;
$
(
"
#idgroup
"
).
val
(
id
)
$
(
"
#idgroup
"
).
val
(
id
)
$
(
"
input[name='chekbox'][name='chekbox']
"
).
attr
(
'
checked
'
,
false
)
$
.
ajax
({
$
.
ajax
({
url
:
"
/loadgroup/
"
,
url
:
"
/loadgroup/
"
,
...
@@ -831,10 +832,10 @@ function loadgroupbyid(id) {
...
@@ -831,10 +832,10 @@ function loadgroupbyid(id) {
let
response
=
data
;
let
response
=
data
;
if
(
response
.
code
==
0
)
{
if
(
response
.
code
==
0
)
{
for
(
i
in
list_perm
)
{
for
(
i
in
data
.
perm_group
)
{
console
.
log
()
$
(
"
input[name='chekbox'][value=
"
+
data
.
perm_group
[
i
]
+
"
]
"
).
prop
(
'
checked
'
,
'
checked
'
)
$
(
"
input[name='chekbox'][value=
"
+
list_perm
[
i
]
+
"
]
"
).
prop
(
'
checked
'
,
'
checked
'
)
}
}
var
grup
=
response
.
data
;
var
grup
=
response
.
data
;
$
(
"
#ingroup
"
).
val
(
grup
.
name
);
$
(
"
#ingroup
"
).
val
(
grup
.
name
);
...
@@ -1763,9 +1764,5 @@ $(".send_pesan").click(function() {
...
@@ -1763,9 +1764,5 @@ $(".send_pesan").click(function() {
document
.
querySelector
(
"
#map-create-all > div.leaflet-control-container > div.leaflet-bottom.leaflet-right > div
"
).
html
(
`Powered by <a href="https://khansia.co.id" target="_blank">Khansia</a> with <a href="https://leafletjs.com" target="_blank">Leaflet</a>`
)
document
.
querySelector
(
"
#map-create-all > div.leaflet-control-container > div.leaflet-bottom.leaflet-right > div
"
).
html
(
`Powered by <a href="https://khansia.co.id" target="_blank">Khansia</a> with <a href="https://leafletjs.com" target="_blank">Leaflet</a>`
)
document
.
querySelector
(
"
#map-create-all > div.leaflet-control-container > div.leaflet-bottom.leaflet-right > div
"
).
css
(
"
right
"
,
"
50px
"
)
document
.
querySelector
(
"
#map-create-all > div.leaflet-control-container > div.leaflet-bottom.leaflet-right > div
"
).
css
(
"
right
"
,
"
50px
"
)
\ No newline at end of file
templates/includes/modal.html
View file @
23cae4a3
...
@@ -1094,14 +1094,6 @@
...
@@ -1094,14 +1094,6 @@
<div
class=
"tab-pane"
id=
"grouproleuser"
>
<div
class=
"tab-pane"
id=
"grouproleuser"
>
<table
class=
"table table-responsive datatable-show-all table-sm list_group"
id=
"list_group"
style=
"font-size : 8pt;padding:0px;border-top:0.5pt solid #EFEFEF;border-bottom:0.5pt solid #EFEFEF;margin-bottom: 10px;"
>
<table
class=
"table table-responsive datatable-show-all table-sm list_group"
id=
"list_group"
style=
"font-size : 8pt;padding:0px;border-top:0.5pt solid #EFEFEF;border-bottom:0.5pt solid #EFEFEF;margin-bottom: 10px;"
>
<div
style=
"position: absolute;right: 30px;font-size: 10pt;"
>
<a
class=
"btn side-bar-but"
id=
"download_perbaikan"
onclick=
"download_user_list('xlsx')"
style=
"z-index:9;"
>
<div>
<i
class=
"icon-download4"
></i><span>
Download
</span>
</div>
</a>
</div>
<div
style=
"position: absolute;left: 292px;font-size: 10pt;background: #2196F3;border-radius: 10px;"
>
<div
style=
"position: absolute;left: 292px;font-size: 10pt;background: #2196F3;border-radius: 10px;"
>
<a
class=
"btn side-bar-but"
id=
"add_group"
style=
"z-index:9;color:white;"
>
<a
class=
"btn side-bar-but"
id=
"add_group"
style=
"z-index:9;color:white;"
>
<div>
<div>
...
...
templates/includes/sidebar.html
View file @
23cae4a3
This diff is collapsed.
Click to expand it.
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