From 43b63e8eb979fa5f19bf57d1853ce05d957c21f7 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Wed, 30 Sep 2026 22:43:12 +0300 Subject: [PATCH] Accept shared B2 VPS 0.2.1 for equipment settings and commands --- .../src/workspaces/fleet/equipment/EquipmentSettings.tsx | 2 +- src/k1link/fleet/equipment_bootstrap.py | 1 + src/k1link/fleet/equipment_command_runtime.py | 1 + src/k1link/fleet/equipment_network.py | 9 +++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/control-station/src/workspaces/fleet/equipment/EquipmentSettings.tsx b/apps/control-station/src/workspaces/fleet/equipment/EquipmentSettings.tsx index ffb13c85..96957b3b 100644 --- a/apps/control-station/src/workspaces/fleet/equipment/EquipmentSettings.tsx +++ b/apps/control-station/src/workspaces/fleet/equipment/EquipmentSettings.tsx @@ -23,7 +23,7 @@ export function EquipmentSettings({device,model,hosts,telemetry,vehicles,profile useEffect(()=>{if(!networkPending)return;let active=true;let timer:ReturnType;async function poll(){try{const value=await equipmentRequest<{items:IndependentDevice[]}>('/instances');const current=value.items.find(d=>d.id===device.id);if(active&¤t)onObserved(current);}catch{/* Keep the pending operation visible; the VPS owns its bounded expiry. */}finally{if(active)timer=setTimeout(()=>void poll(),3000);}}timer=setTimeout(()=>void poll(),3000);return()=>{active=false;clearTimeout(timer);};},[device.id,networkPending,onObserved]); const observed=device.observed; const secondary=observed.configuration.servers.find(s=>s.slot===2); - const fullSettings=hosts.some(h=>h.state==='paired'&&h.vehicle_ids.includes(device.vehicle_id)&&['0.1.15','0.1.16','0.1.17','0.1.18','0.1.19','0.1.20','0.1.21','0.1.22','0.1.23','0.1.24','0.1.25','0.1.26','0.1.27','0.1.28','0.1.29','0.1.30','0.1.31','0.1.32','0.1.33','0.1.34','0.1.35','0.1.36','0.1.37','0.1.38','0.1.39','0.1.40','0.1.41','0.1.42','0.1.43'].includes(h.status?.version??'')&&h.status?.tracker.host===secondary?.host&&h.status?.tracker.port===secondary?.port); + const fullSettings=hosts.some(h=>h.state==='paired'&&h.vehicle_ids.includes(device.vehicle_id)&&['0.1.15','0.1.16','0.1.17','0.1.18','0.1.19','0.1.20','0.1.21','0.1.22','0.1.23','0.1.24','0.1.25','0.1.26','0.1.27','0.1.28','0.1.29','0.1.30','0.1.31','0.1.32','0.1.33','0.1.34','0.1.35','0.1.36','0.1.37','0.1.38','0.1.39','0.1.40','0.1.41','0.1.42','0.1.43','0.1.44','0.1.45','0.1.46','0.2.0','0.2.1'].includes(h.status?.version??'')&&h.status?.tracker.host===secondary?.host&&h.status?.tracker.port===secondary?.port); const supported=observed.supported_profile_fields??Object.keys(device.settings.parameters); const fields=model.fields.filter(f=>supported.includes(f.key)); const validation=policyError(settings,fields)||(selectSim&&settings.connectivity.strategy==='sim'&&!cellularSimCurrent(telemetry,settings.connectivity.sim_slot??1)?'Ожидаем свежие данные выбранной SIM перед отправкой настроек.':''); diff --git a/src/k1link/fleet/equipment_bootstrap.py b/src/k1link/fleet/equipment_bootstrap.py index 2bdba85c..93be4a9e 100644 --- a/src/k1link/fleet/equipment_bootstrap.py +++ b/src/k1link/fleet/equipment_bootstrap.py @@ -64,6 +64,7 @@ def apply(hosts, identifier, revision): "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ) or time.time() - host["last_sync_at"] > 30 ): diff --git a/src/k1link/fleet/equipment_command_runtime.py b/src/k1link/fleet/equipment_command_runtime.py index 5ea707b3..7420112e 100644 --- a/src/k1link/fleet/equipment_command_runtime.py +++ b/src/k1link/fleet/equipment_command_runtime.py @@ -79,6 +79,7 @@ def enqueue(hosts, identifier, request_id, preset_id): "0.1.45", "0.1.46", "0.2.0", + "0.2.1", }: raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.") count = db.execute( diff --git a/src/k1link/fleet/equipment_network.py b/src/k1link/fleet/equipment_network.py index 25528116..ed653e3b 100644 --- a/src/k1link/fleet/equipment_network.py +++ b/src/k1link/fleet/equipment_network.py @@ -250,6 +250,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ) ) automatic_access = None @@ -327,6 +328,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", }: raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.") if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in { @@ -354,6 +356,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", }: raise EquipmentError("Для смены SIM установите актуальный VPS Host.") else: @@ -406,6 +409,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ), "request-position": ( "0.1.8", @@ -448,6 +452,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ), "pulse-output": ( "0.1.9", @@ -489,6 +494,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ), "set-output": ( "0.1.10", @@ -529,6 +535,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ), } if source.get("status", {}).get("version") not in versions[command["kind"]]: @@ -579,6 +586,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", ) for h in (source, target) ): @@ -667,6 +675,7 @@ def start( "0.1.45", "0.1.46", "0.2.0", + "0.2.1", } if durable_delivery: lifetime = (