ocearo-ui
Version:
Ocean Robot UI: 3D visualization dashboard for signalk
1 lines • 3.06 kB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13004,t=>{t.v({boats:[{name:"Default",modelPath:"default",capabilities:["navigation","rudder","sail","color"]},{name:"Optimist",modelPath:"optimist",capabilities:["navigation","ais"]},{name:"Sailboat",modelPath:"sailboat",capabilities:["navigation","ais"]},{name:"Ship",modelPath:"ship",capabilities:["navigation","ais"]},{name:"Windsurf",modelPath:"windsurf",capabilities:["navigation","ais"]}]})},83402,t=>{"use strict";var e=t.i(13004);let i=new class{constructor(){this.defaultConfig={signalkUrl:"http://localhost:3000",username:"",password:"",useAuthentication:!1,signalKUrlSet:!1,debugMode:!1,selectedBoat:"Default",primaryColor:null,metallicEffect:!1,aisLengthScalingFactor:.7,compassNorthUp:!1,hide3DCompass:!1,hideTrueWind:!1,showCustomUrls:!1,customExternalUrls:{},currentView:"default",theme:"dark",language:"en",distanceUnits:"nm",depthUnits:"m",speedUnits:"kn",temperatureUnits:"C",positionFormat:"DD",preferTrueValues:!0,preferredWindSpeedPath:"speedTrue",preferredWindDirectionPath:"directionTrue",preferredHeadingPath:"courseOverGroundTrue",debugWindOverride:!1,debugWindSpeed:10,debugWindDirection:0,debugShowAxes:!1,showSailTrimSliders:!0,showRigging:!0},this.configKey="ocearoConfig",this.inMemoryConfig={...this.defaultConfig},this.config=this.loadConfig()}isLocalStorageAvailable(){try{return"u">typeof localStorage}catch{return!1}}loadConfig(){if(this.isLocalStorageAvailable()){let t=localStorage.getItem(this.configKey);if(!t)return this.saveConfig(this.defaultConfig),{...this.defaultConfig};try{return JSON.parse(t)}catch(t){return console.error("Failed to parse stored configuration:",t),{...this.defaultConfig}}}return{...this.inMemoryConfig}}saveConfig(t){this.config={...this.config,...t},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.config}}get(t){return this.config[t]}set(t,e){this.config[t]=e,this.saveConfig(this.config)}resetConfig(){this.config={...this.defaultConfig},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.defaultConfig}}getAll(){return{...this.config}}getDefaultConfig(){return{...this.defaultConfig}}getSelectedBoat(){let t=this.config.selectedBoat;return t?this.getBoatsData().find(e=>e.name===t):[]}getBoatsData(){return e.default.boats}getComputedSignalKUrl(){return this.config.debugMode?"https://demo.signalk.org:443":`${window.location.protocol}//${window.location.hostname}${window.location.port?":"+window.location.port:""}`}getCurrentView(){return this.config.currentView||this.defaultConfig.currentView}setCurrentView(t){this.set("currentView",t)}};t.s(["default",0,i])},92989,(t,e,i)=>{e.exports=t.r(76562)},5445,t=>{"use strict";var e=t.i(71645),i=t.i(92989),o=t.i(83402);function a(){let t=(0,i.useRouter)();return(0,e.useEffect)(()=>{o.default.setCurrentView("settings"),t.replace("/")},[t]),null}t.s(["default",()=>a])}]);