mirror of
https://github.com/smittix/intercept.git
synced 2026-07-12 03:28:11 -07:00
Force local dashboard assets and quiet BT locate warnings
This commit is contained in:
@@ -100,11 +100,24 @@ def add_security_headers(response):
|
|||||||
def inject_offline_settings():
|
def inject_offline_settings():
|
||||||
"""Inject offline settings into all templates."""
|
"""Inject offline settings into all templates."""
|
||||||
from utils.database import get_setting
|
from utils.database import get_setting
|
||||||
|
|
||||||
|
# Privacy-first defaults: keep dashboard assets/fonts local to avoid
|
||||||
|
# third-party tracker/storage defenses in strict browsers.
|
||||||
|
assets_source = str(get_setting('offline.assets_source', 'local') or 'local').lower()
|
||||||
|
fonts_source = str(get_setting('offline.fonts_source', 'local') or 'local').lower()
|
||||||
|
if assets_source not in ('local', 'cdn'):
|
||||||
|
assets_source = 'local'
|
||||||
|
if fonts_source not in ('local', 'cdn'):
|
||||||
|
fonts_source = 'local'
|
||||||
|
# Force local delivery for core dashboard pages.
|
||||||
|
assets_source = 'local'
|
||||||
|
fonts_source = 'local'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'offline_settings': {
|
'offline_settings': {
|
||||||
'enabled': get_setting('offline.enabled', False),
|
'enabled': get_setting('offline.enabled', False),
|
||||||
'assets_source': get_setting('offline.assets_source', 'cdn'),
|
'assets_source': assets_source,
|
||||||
'fonts_source': get_setting('offline.fonts_source', 'cdn'),
|
'fonts_source': fonts_source,
|
||||||
'tile_provider': get_setting('offline.tile_provider', 'cartodb_dark_cyan'),
|
'tile_provider': get_setting('offline.tile_provider', 'cartodb_dark_cyan'),
|
||||||
'tile_server_url': get_setting('offline.tile_server_url', '')
|
'tile_server_url': get_setting('offline.tile_server_url', '')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ const BtLocate = (function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
eventSource.onerror = function() {
|
eventSource.onerror = function() {
|
||||||
console.warn('[BtLocate] SSE error, polling fallback active');
|
debugLog('[BtLocate] SSE error, polling fallback active');
|
||||||
if (eventSource && eventSource.readyState === EventSource.CLOSED) {
|
if (eventSource && eventSource.readyState === EventSource.CLOSED) {
|
||||||
eventSource = null;
|
eventSource = null;
|
||||||
}
|
}
|
||||||
@@ -645,7 +645,7 @@ const BtLocate = (function() {
|
|||||||
try {
|
try {
|
||||||
mapPointAdded = addMapMarker(d, { suppressFollow: options.suppressFollow === true });
|
mapPointAdded = addMapMarker(d, { suppressFollow: options.suppressFollow === true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn('[BtLocate] Map update skipped:', error);
|
debugLog('[BtLocate] Map update skipped:', error);
|
||||||
mapPointAdded = false;
|
mapPointAdded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1103,7 +1103,7 @@ const BtLocate = (function() {
|
|||||||
if (map.hasLayer(heatLayer)) {
|
if (map.hasLayer(heatLayer)) {
|
||||||
map.removeLayer(heatLayer);
|
map.removeLayer(heatLayer);
|
||||||
}
|
}
|
||||||
console.warn('[BtLocate] Heatmap redraw deferred:', error);
|
debugLog('[BtLocate] Heatmap redraw deferred:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user