From 0ec7db8d3456937aecab36257ff85a8500fcc835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Sun, 6 Sep 2026 10:45:11 +0300 Subject: [PATCH] Move capture button left of search; always visible; disabled when server-disabled - capture-btn moved to first child of trace-topbar (before search input) - Button always visible: shows Start/Stop/Connect-to-server as before - When server capture is disabled: grayed-out Start Capture with tooltip via existing i18n key 'Capture is disabled ...' - No more hiding button when viewing saved session or when disabled - Bump 1.22.4, SW cache v35->v36 --- frontend/index.html | 42 +++++++++++++++++++---------------- frontend/sw.js | 2 +- pyproject.toml | 2 +- simtrace2_pysniff/__init__.py | 2 +- tests/test_pcap_import.py | 2 +- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 3f4424d..e0017b3 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -114,6 +114,7 @@ body { font: 14px/1.5 system-ui, sans-serif; background: var(--bg); color: var(- .trace-topbar button.stop:hover { background: var(--danger-hover); } .trace-topbar button.connect { background: var(--warn); color: #0f172a; } .trace-topbar button.connect:hover { background: var(--warn-hover); } +.trace-topbar button.disabled { background: var(--bg-input); color: var(--text-muted); cursor: not-allowed; opacity: 0.6; } .trace-main { display: flex; flex: 1; overflow: hidden; } .trace-left { flex: 1; display: flex; flex-direction: column; overflow: hidden; } @@ -280,15 +281,15 @@ body { font: 14px/1.5 system-ui, sans-serif; background: var(--bg); color: var(-
-
- - - - - -
+
+ + + + + +
@@ -2130,26 +2131,29 @@ async function stopCapture() { function updateCaptureButton() { const btn = el('capture-btn'); const newCapture = el('new-capture-btn'); - btn.classList.remove('stop', 'connect'); + btn.classList.remove('stop', 'connect', 'disabled'); const captureOff = STATE.captureMode === 'disabled' && STATE.serverAvailable; newCapture.style.display = captureOff ? 'none' : ''; - if (captureOff) { - btn.style.display = 'none'; - return; - } - if (STATE.sessionViewId && !STATE.captureActive) { - btn.style.display = 'none'; - return; - } btn.style.display = ''; if (!STATE.serverAvailable) { btn.textContent = t('Connect to server'); btn.classList.add('connect'); + btn.disabled = false; + btn.title = ''; + } else if (captureOff) { + btn.textContent = t('Start Capture'); + btn.classList.add('disabled'); + btn.disabled = true; + btn.title = t('Capture is disabled — only pre-captured traces (saved sessions / PCAP import) are available.'); } else if (STATE.captureActive) { btn.textContent = t('Stop Capture'); btn.classList.add('stop'); + btn.disabled = false; + btn.title = ''; } else { btn.textContent = t('Start Capture'); + btn.disabled = false; + btn.title = ''; } } @@ -2518,7 +2522,7 @@ function onFilterChange() { } // ──────────────────── Versioning ──────────────────── -const PWA_VERSION = '1.22.3'; +const PWA_VERSION = '1.22.4'; const MIN_SERVER_VERSION = '1.0.0'; function parseVersion(v) { diff --git a/frontend/sw.js b/frontend/sw.js index f157ed8..54f8515 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'simtrace-analyser-v35'; +const CACHE = 'simtrace-analyser-v36'; const PRECACHE = [ 'index.html', diff --git a/pyproject.toml b/pyproject.toml index b776388..066ba47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.backends._legacy:_Backend" [project] name = "simtrace2-pysniff" -version = "1.22.3" +version = "1.22.4" description = "Python-based sniffing tool for SIMtrace2 hardware (SIM card communication sniffer)" readme = {file = "README.md", content-type = "text/markdown"} license = {text = "GPL-2.0-or-later"} diff --git a/simtrace2_pysniff/__init__.py b/simtrace2_pysniff/__init__.py index ba9090d..9edbc99 100644 --- a/simtrace2_pysniff/__init__.py +++ b/simtrace2_pysniff/__init__.py @@ -6,7 +6,7 @@ from .gsmtap import GsmtapSender, GsmtapReceiver from .pcap import PcapWriter from .dump import FileDumper, format_message -__version__ = '1.22.3' +__version__ = '1.22.4' __all__ = [ 'SniffSession', 'DeviceDisconnected', diff --git a/tests/test_pcap_import.py b/tests/test_pcap_import.py index e03d1d0..d66f3b6 100644 --- a/tests/test_pcap_import.py +++ b/tests/test_pcap_import.py @@ -224,7 +224,7 @@ class TestImportEndpoint(unittest.TestCase): class TestVersion(unittest.TestCase): def test_package_version(self): from simtrace2_pysniff import __version__ - self.assertEqual(__version__, '1.22.3') + self.assertEqual(__version__, '1.22.4') def test_status_includes_version(self): import os