deploy: full sync to AGV work directory

This commit is contained in:
ywb
2026-05-18 01:30:33 +08:00
parent 6f876968a9
commit 171090a3d0
+6 -4
View File
@@ -128,10 +128,12 @@ createApp({
const res = await fetch(API + '/api/navigate/status') const res = await fetch(API + '/api/navigate/status')
if (res.ok) { if (res.ok) {
const data = await res.json() const data = await res.json()
this.nav2Available = data.nav2_available this.nav2Available = data.nav2_available || false
if (data.current_pos) { // API returns "current_position", normalize to our field
this.navCurrentPos = data.current_pos const cp = data.current_position || data.current_pos || null
console.log('[Setting] refresh nav:', data.nav2_available, 'current_pos:', data.current_pos ? data.current_pos.map(function(x){return x.toFixed(2)}) : null, 'mapLoaded:', this.mapLoaded, 'mapMeta:', this.mapMeta ? 'ok' : 'null') if (cp) {
this.navCurrentPos = cp
console.log('[Setting] nav2:', data.nav2_available, 'cp:', cp.map(function(x){return x.toFixed(2)}), 'mapLoaded:', this.mapLoaded, 'mapMeta:', this.mapMeta ? 'ok' : 'null')
} }
} }
} catch (e) {} } catch (e) {}