Skip to content

Commit

Permalink
Fixed webapp map code to handle location lat or long being None, chan…
Browse files Browse the repository at this point in the history
…ged docker compose service restart and logging policies.
  • Loading branch information
dajtxx committed Jun 7, 2024
1 parent ab2b821 commit c58a997
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
51 changes: 44 additions & 7 deletions compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ services:

restapi:
image: broker/python-base
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
depends_on:
Expand All @@ -46,6 +50,11 @@ services:

website:
image: broker/mgmt-app
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
environment:
Expand All @@ -59,7 +68,11 @@ services:

ttn_webhook:
image: broker/python-base
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
profiles:
Expand All @@ -74,7 +87,11 @@ services:

ttn_processor:
image: broker/python-base
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
profiles:
Expand All @@ -93,7 +110,11 @@ services:

ttn_decoder:
image: broker/ttn_decoder
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
profiles:
Expand All @@ -106,7 +127,11 @@ services:

ydoc:
image: broker/python-base
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
profiles:
Expand All @@ -123,7 +148,11 @@ services:

wombat:
image: broker/python-base
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
profiles:
Expand All @@ -140,7 +169,11 @@ services:

lm:
image: broker/python-base
restart: "no"
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
depends_on:
Expand All @@ -155,6 +188,10 @@ services:

delivery:
image: broker/python-base
logging:
driver: local
options:
max-file: "3"
restart: unless-stopped
env_file:
- .env
Expand Down
2 changes: 1 addition & 1 deletion src/www/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def show_map():
# folium.Marker([-31.956194913619864, 115.85911692112582], popup="<i>Mt. Hood Meadows</i>", tooltip='click me').add_to(center_map)
data: List[LogicalDevice] = get_logical_devices(session.get('token'), include_properties=True)
for dev in data:
if dev.location is not None:
if dev.location is not None and dev.location.lat is not None and dev.location.long is not None:
color = 'blue'

if dev.last_seen is None:
Expand Down

0 comments on commit c58a997

Please sign in to comment.