Map update development
James, Here are the map updates I am working on. This is just the HTML and Java scripts.
Codecov Report
Merging #699 (1fe2252) into develop (7d32d6c) will decrease coverage by
0.10%. The diff coverage isn/a.
@@ Coverage Diff @@
## develop #699 +/- ##
===========================================
- Coverage 74.79% 74.69% -0.11%
===========================================
Files 40 41 +1
Lines 3861 3955 +94
===========================================
+ Hits 2888 2954 +66
- Misses 973 1001 +28
| Impacted Files | Coverage Δ | |
|---|---|---|
| simplemonitor/Monitors/network.py | 78.92% <0.00%> (-2.69%) |
:arrow_down: |
| simplemonitor/Alerters/__init__.py | 100.00% <0.00%> (ø) |
|
| simplemonitor/Monitors/__init__.py | 100.00% <0.00%> (ø) |
|
| simplemonitor/Alerters/sms77.py | 72.22% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 7d32d6c...1fe2252. Read the comment docs.
Added if/else statement at line 49 to choose the green or red pin depending if a site is up or down. If file.py can update the sites.js file to [lat, long, "up", "site_name"], then the map can show up or down. Next markercluster-src.js lines 812 through 822 need to be updated so that the markers used for clusters can be green if all the sites or up in a cluster or red when one of the sites is down.
Is this changing the HTML page to load the data from sites.js instead? Currently this is handled in the jinja template as it's rendered by the HTMLLogger: https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/status-template.html#L70-L74
{%- if map -%} var addressPoints = [ {% macro map_pin(entry) -%} [{{entry.gps[0]}}, {{entry.gps[1]}}, "{{entry.status}}", "{{entry.monitor_name}}"], {%- endmacro -%} {% for entry in fail_entries %} {{map_pin(entry)}} {% endfor -%} {% for entry in ok_entries %} {{map_pin(entry)}} {% endfor -%} {%- endif %} ];
I have been working on updating the sites.js instead. This was my first attempt at modifying the status-template.html.