mirror of
https://github.com/smittix/intercept.git
synced 2026-07-24 00:48:11 -07:00
Unify satellite navigation to dashboard
This commit is contained in:
@@ -478,12 +478,15 @@ def login():
|
|||||||
|
|
||||||
return render_template('login.html', version=VERSION)
|
return render_template('login.html', version=VERSION)
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index() -> str:
|
def index() -> str:
|
||||||
tools = {
|
if request.args.get('mode') == 'satellite':
|
||||||
'rtl_fm': check_tool('rtl_fm'),
|
return redirect(url_for('satellite.dashboard'))
|
||||||
'multimon': check_tool('multimon-ng'),
|
|
||||||
'rtl_433': check_tool('rtl_433'),
|
tools = {
|
||||||
|
'rtl_fm': check_tool('rtl_fm'),
|
||||||
|
'multimon': check_tool('multimon-ng'),
|
||||||
|
'rtl_433': check_tool('rtl_433'),
|
||||||
'rtlamr': check_tool('rtlamr')
|
'rtlamr': check_tool('rtlamr')
|
||||||
}
|
}
|
||||||
devices = [d.to_dict() for d in SDRFactory.detect_devices()]
|
devices = [d.to_dict() for d in SDRFactory.detect_devices()]
|
||||||
|
|||||||
@@ -3604,6 +3604,10 @@
|
|||||||
|
|
||||||
// Mode selection from welcome page
|
// Mode selection from welcome page
|
||||||
function selectMode(mode) {
|
function selectMode(mode) {
|
||||||
|
if (mode === 'satellite') {
|
||||||
|
window.location.href = '/satellite/dashboard';
|
||||||
|
return;
|
||||||
|
}
|
||||||
selectedStartMode = mode;
|
selectedStartMode = mode;
|
||||||
const welcome = document.getElementById('welcomePage');
|
const welcome = document.getElementById('welcomePage');
|
||||||
welcome.classList.add('fade-out');
|
welcome.classList.add('fade-out');
|
||||||
@@ -3664,6 +3668,10 @@
|
|||||||
function applyModeFromQuery() {
|
function applyModeFromQuery() {
|
||||||
const mode = getModeFromQuery();
|
const mode = getModeFromQuery();
|
||||||
if (!mode) return;
|
if (!mode) return;
|
||||||
|
if (mode === 'satellite') {
|
||||||
|
window.location.replace('/satellite/dashboard');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const accepted = localStorage.getItem('disclaimerAccepted') === 'true';
|
const accepted = localStorage.getItem('disclaimerAccepted') === 'true';
|
||||||
if (accepted) {
|
if (accepted) {
|
||||||
const welcome = document.getElementById('welcomePage');
|
const welcome = document.getElementById('welcomePage');
|
||||||
@@ -4395,6 +4403,10 @@
|
|||||||
const switchStartMs = performance.now();
|
const switchStartMs = performance.now();
|
||||||
const previousMode = currentMode;
|
const previousMode = currentMode;
|
||||||
if (mode === 'listening') mode = 'waterfall';
|
if (mode === 'listening') mode = 'waterfall';
|
||||||
|
if (mode === 'satellite') {
|
||||||
|
window.location.href = '/satellite/dashboard';
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!validModes.has(mode)) mode = 'pager';
|
if (!validModes.has(mode)) mode = 'pager';
|
||||||
const styleReadyPromise = (typeof window.ensureModeStyles === 'function')
|
const styleReadyPromise = (typeof window.ensureModeStyles === 'function')
|
||||||
? Promise.resolve(window.ensureModeStyles(mode)).catch((err) => {
|
? Promise.resolve(window.ensureModeStyles(mode)).catch((err) => {
|
||||||
|
|||||||
@@ -16,7 +16,12 @@
|
|||||||
|
|
||||||
{% macro mode_item(mode, label, icon_svg, href=None) -%}
|
{% macro mode_item(mode, label, icon_svg, href=None) -%}
|
||||||
{%- set is_active = 'active' if active_mode == mode else '' -%}
|
{%- set is_active = 'active' if active_mode == mode else '' -%}
|
||||||
{%- if href %}
|
{%- if mode == 'satellite' %}
|
||||||
|
<a href="/satellite/dashboard" class="mode-nav-btn {{ is_active }}" style="text-decoration: none;" data-mode="{{ mode }}" data-mode-label="{{ label }}" aria-label="{{ label }} mode">
|
||||||
|
<span class="nav-icon icon">{{ icon_svg | safe }}</span>
|
||||||
|
<span class="nav-label">{{ label }}</span>
|
||||||
|
</a>
|
||||||
|
{%- elif href %}
|
||||||
<a href="{{ href }}" class="mode-nav-btn {{ is_active }}" style="text-decoration: none;" data-mode="{{ mode }}" data-mode-label="{{ label }}" aria-label="{{ label }} mode">
|
<a href="{{ href }}" class="mode-nav-btn {{ is_active }}" style="text-decoration: none;" data-mode="{{ mode }}" data-mode-label="{{ label }}" aria-label="{{ label }} mode">
|
||||||
<span class="nav-icon icon">{{ icon_svg | safe }}</span>
|
<span class="nav-icon icon">{{ icon_svg | safe }}</span>
|
||||||
<span class="nav-label">{{ label }}</span>
|
<span class="nav-label">{{ label }}</span>
|
||||||
@@ -36,7 +41,11 @@
|
|||||||
|
|
||||||
{% macro mobile_item(mode, label, icon_svg, href=None) -%}
|
{% macro mobile_item(mode, label, icon_svg, href=None) -%}
|
||||||
{%- set is_active = 'active' if active_mode == mode else '' -%}
|
{%- set is_active = 'active' if active_mode == mode else '' -%}
|
||||||
{%- if href %}
|
{%- if mode == 'satellite' %}
|
||||||
|
<a href="/satellite/dashboard" class="mobile-nav-btn {{ is_active }}" style="text-decoration: none;" data-mode="{{ mode }}" data-mode-label="{{ label }}" aria-label="{{ label }} mode">
|
||||||
|
<span class="icon icon--sm">{{ icon_svg | safe }}</span> {{ label }}
|
||||||
|
</a>
|
||||||
|
{%- elif href %}
|
||||||
<a href="{{ href }}" class="mobile-nav-btn {{ is_active }}" style="text-decoration: none;" data-mode="{{ mode }}" data-mode-label="{{ label }}" aria-label="{{ label }} mode">
|
<a href="{{ href }}" class="mobile-nav-btn {{ is_active }}" style="text-decoration: none;" data-mode="{{ mode }}" data-mode-label="{{ label }}" aria-label="{{ label }} mode">
|
||||||
<span class="icon icon--sm">{{ icon_svg | safe }}</span> {{ label }}
|
<span class="icon icon--sm">{{ icon_svg | safe }}</span> {{ label }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user