Update public source

This commit is contained in:
2026-11-15 16:11:27 +03:00
parent b50baedda4
commit f7d78c0ea6
6 changed files with 36 additions and 9 deletions
+7 -1
View File
@@ -12,6 +12,7 @@ from reports.utils import (
format_datetime as format_report_datetime, format_datetime as format_report_datetime,
) )
from reports.map_popups import build_standard_popup from reports.map_popups import build_standard_popup
from reports.map_service import get_map_style_url
def esc(value): def esc(value):
@@ -408,7 +409,7 @@ const map = new maplibregl.Map({
container: "map", container: "map",
style: style:
"http://127.0.0.1:8080/styles/server-map/style.json", __MAP_STYLE_URL__,
center: [ center: [
30.32, 30.32,
@@ -1181,6 +1182,11 @@ window.setTimeout(
marker_js, marker_js,
) )
map_html = map_html.replace(
"__MAP_STYLE_URL__",
json.dumps(get_map_style_url()),
)
return map_html return map_html
+2 -1
View File
@@ -16,6 +16,7 @@ from reports.template import (
page_end, page_end,
) )
from reports.map_popups import build_standard_popup from reports.map_popups import build_standard_popup
from reports.map_service import get_map_style_url
def esc(value): def esc(value):
return html.escape("" if value is None else str(value), quote=True) return html.escape("" if value is None else str(value), quote=True)
@@ -932,7 +933,7 @@ def render_map(geojson, context, title):
const map = new maplibregl.Map({{ const map = new maplibregl.Map({{
container: "access-point-history-map", container: "access-point-history-map",
style: "http://127.0.0.1:8080/styles/server-map/style.json", style: {json.dumps(get_map_style_url())},
center: [30.32, 59.93], center: [30.32, 59.93],
zoom: 5 zoom: 5
}}); }});
+11
View File
@@ -0,0 +1,11 @@
"""
Centralized map service configuration.
"""
MAP_STYLE_URL = (
"http://127.0.0.1:8080/styles/server-map/style.json"
)
def get_map_style_url():
return MAP_STYLE_URL
+2 -5
View File
@@ -15,10 +15,7 @@ from reports.utils import (
format_datetime as format_report_datetime, format_datetime as format_report_datetime,
) )
from reports.map_popups import build_standard_popup from reports.map_popups import build_standard_popup
from reports.map_service import get_map_style_url
MAP_STYLE_URL = (
"http://127.0.0.1:8080/styles/server-map/style.json"
)
# ============================================================ # ============================================================
@@ -2020,7 +2017,7 @@ def render_search_page(
) )
).replace( ).replace(
"{map_style}", "{map_style}",
MAP_STYLE_URL json.dumps(get_map_style_url())
) )
html += page_end() html += page_end()
+7 -1
View File
@@ -39,6 +39,7 @@ from reports.template import (
ReportContext, ReportContext,
) )
from reports.map_popups import build_standard_popup from reports.map_popups import build_standard_popup
from reports.map_service import get_map_style_url
# ============================================================ # ============================================================
# Helpers # Helpers
@@ -865,7 +866,7 @@ const map = new maplibregl.Map({
style: style:
"http://127.0.0.1:8080/styles/server-map/style.json", __MAP_STYLE_URL__,
center: [ center: [
@@ -2672,6 +2673,11 @@ Session folder:
html += page_end() html += page_end()
html = html.replace(
"__MAP_STYLE_URL__",
json.dumps(get_map_style_url()),
)
return html return html
+7 -1
View File
@@ -7,6 +7,7 @@ from reports.access_points import (
load_access_points, load_access_points,
) )
from reports.map_popups import build_standard_popup from reports.map_popups import build_standard_popup
from reports.map_service import get_map_style_url
from reports.template import ( from reports.template import (
ReportContext, ReportContext,
card, card,
@@ -216,7 +217,7 @@ const map = new maplibregl.Map({
container: "map", container: "map",
style: style:
"http://127.0.0.1:8080/styles/server-map/style.json", __MAP_STYLE_URL__,
center: [ center: [
30.32, 30.32,
@@ -671,6 +672,11 @@ window.setTimeout(
marker_js, marker_js,
) )
map_html = map_html.replace(
"__MAP_STYLE_URL__",
json.dumps(get_map_style_url()),
)
return map_html return map_html