Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrey Yemelyanov
noc
Commits
5e8e7db5
Commit
5e8e7db5
authored
Apr 02, 2019
by
MaksimSmile13
Committed by
Andrey Vertiprahov
Jul 12, 2019
Browse files
Add full address on map
parent
4eb26dd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
services/card/cards/monmap.py
View file @
5e8e7db5
...
...
@@ -2,7 +2,7 @@
# ---------------------------------------------------------------------
# MonMap
# ---------------------------------------------------------------------
# Copyright (C) 2007-201
7
The NOC Project
# Copyright (C) 2007-201
9
The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
...
...
@@ -149,7 +149,8 @@ class MonMapCard(BaseCard):
for
container
,
mol
in
itertools
.
groupby
(
moss
.
values_list
(
"id"
,
"name"
,
"container"
).
order_by
(
"container"
),
key
=
lambda
o
:
o
[
2
]
):
name
,
data
=
containers
.
get
(
container
,
(
""
,
{
"geopoint"
:
{}}))
name
=
Object
.
get_by_id
(
container
).
get_address_text
()
d
,
data
=
containers
.
get
(
container
,
(
""
,
{
"geopoint"
:
{}}))
x
=
data
[
"geopoint"
].
get
(
"x"
)
y
=
data
[
"geopoint"
].
get
(
"y"
)
ss
=
{
"objects"
:
[],
"total"
:
0
,
"error"
:
0
,
"warning"
:
0
,
"good"
:
0
,
"maintenance"
:
0
}
...
...
services/web/apps/inv/inv/plugins/map.py
View file @
5e8e7db5
...
...
@@ -2,7 +2,7 @@
# ---------------------------------------------------------------------
# inv.inv map plugin
# ---------------------------------------------------------------------
# Copyright (C) 2007-201
8
The NOC Project
# Copyright (C) 2007-201
9
The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
...
...
@@ -35,7 +35,7 @@ class MapPlugin(InvPlugin):
self
.
add_view
(
"api_plugin_%s_get_layer"
%
self
.
name
,
self
.
api_get_layer
,
url
=
"^plugin/%s/layers/(?P<layer>\S+)/$"
%
self
.
name
,
url
=
r
"^plugin/%s/layers/(?P<layer>\S+)/$"
%
self
.
name
,
method
=
[
"GET"
],
)
self
.
add_view
(
...
...
@@ -150,7 +150,7 @@ class MapPlugin(InvPlugin):
o
=
self
.
app
.
get_object_or_404
(
Object
,
id
=
id
)
for
mo
in
ManagedObject
.
objects
.
filter
(
container
=
id
)[:
10
]:
mos
[
mo
.
id
]
=
{
"moname"
:
mo
.
name
}
return
{
"id"
:
str
(
o
.
id
),
"name"
:
o
.
name
,
"model"
:
o
.
model
.
name
,
"moname"
:
mos
}
return
{
"id"
:
str
(
o
.
id
),
"name"
:
o
.
get_address_text
()
,
"model"
:
o
.
model
.
name
,
"moname"
:
mos
}
def
get_conduits_layer
(
self
,
layer
,
x0
,
y0
,
x1
,
y1
,
srid
):
line
=
Layer
.
get_by_code
(
"conduits"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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