@openremote/or-app 1.8.0-snapshot.20250818141417 → 1.8.0-snapshot.20250818162953
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1 -1
- package/package.json +17 -17
package/lib/index.js
CHANGED
|
@@ -47,7 +47,7 @@ var __decorate=this&&this.__decorate||function(e,i,t,o){var r,n=arguments.length
|
|
|
47
47
|
or-header a > or-icon {
|
|
48
48
|
margin-right: 10px;
|
|
49
49
|
}
|
|
50
|
-
`}constructor(e){super(),this._initialised=!1,this._offline=!1,this._showOfflineFallback=!1,this._onEvent=e=>this._handleEvent(e),this._onVisibilityChanged=e=>this._handleVisibilityChange(e),this._store=e,b.DialogHostElement=this,E.DialogHostElement=this}getState(){return this._store.getState()}_handleVisibilityChange(e){var i;"visible"===document.visibilityState?(this._store.dispatch(O(!0)),(null==(i=h.console)?void 0:i.isMobile)&&this._offline&&this._startOfflineFallbackTimer(!0),h.reconnect()):this._store.dispatch(O(!1))}connectedCallback(){super.connectedCallback(),this._storeUnsubscribe=this._store.subscribe(()=>this.stateChanged(this.getState())),document.addEventListener("visibilitychange",this._onVisibilityChanged),this.stateChanged(this.getState())}disconnectedCallback(){this._storeUnsubscribe(),document.removeEventListener("visibilityChange",this._onVisibilityChanged),h.removeListener(this._onEvent),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e);let i=this.managerConfig?Object.assign(Object.assign({},DEFAULT_MANAGER_CONFIG),this.managerConfig):DEFAULT_MANAGER_CONFIG;i.realm||(i.realm=v.getQueryParameter("realm")),i.defaultLanguage||(i.defaultLanguage=v.getBrowserLanguage()),i.skipFallbackToBasicAuth=!0,i.basicLoginProvider=(e,i)=>this.doBasicLogin(e,i),console.info("Initialising the manager"),h.init(i).then(e=>__awaiter(this,void 0,void 0,function*(){if(e||h.error!==_.AUTH_FAILED||i.auth&&"KEYCLOAK"!==i.auth||(this.doAppConfigInit(),i.auth="BASIC",e=yield h.init(i)),e){let e;if(this.doAppConfigInit(),!this.appConfig){w("appError.noConfig",document.body),console.error("No AppConfig supplied");return}if(!this._config){w("appError.noConfig",document.body),console.error("No default AppConfig or realm specific config provided so cannot render");return}if(!this._store){w("appError.noReduxStore",document.body),console.error("No Redux store supplied");return}if(!this.appConfig.pages||0===Object.keys(this.appConfig.pages).length){w("appError.noPages",document.body),console.error("No page providers");return}let i=yield h.rest.api.RealmResource.getAccessible();this._realms=i.data,h.isSuperUser()&&(e=window.sessionStorage.getItem("realm"))&&!this._realms.some(i=>i.name===e)&&(e=void 0),this._store.dispatch(F(e||h.getRealm()||"master")),this._initialised=!0,h.addListener(this._onEvent)
|
|
50
|
+
`}constructor(e){super(),this._initialised=!1,this._offline=!1,this._showOfflineFallback=!1,this._onEvent=e=>this._handleEvent(e),this._onVisibilityChanged=e=>this._handleVisibilityChange(e),this._store=e,b.DialogHostElement=this,E.DialogHostElement=this}getState(){return this._store.getState()}_handleVisibilityChange(e){var i;"visible"===document.visibilityState?(this._store.dispatch(O(!0)),(null==(i=h.console)?void 0:i.isMobile)&&this._offline&&this._startOfflineFallbackTimer(!0),h.reconnect()):this._store.dispatch(O(!1))}connectedCallback(){super.connectedCallback(),this._storeUnsubscribe=this._store.subscribe(()=>this.stateChanged(this.getState())),document.addEventListener("visibilitychange",this._onVisibilityChanged),this.stateChanged(this.getState())}disconnectedCallback(){this._storeUnsubscribe(),document.removeEventListener("visibilityChange",this._onVisibilityChanged),h.removeListener(this._onEvent),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e);let i=this.managerConfig?Object.assign(Object.assign({},DEFAULT_MANAGER_CONFIG),this.managerConfig):DEFAULT_MANAGER_CONFIG;i.realm||(i.realm=v.getQueryParameter("realm")),i.defaultLanguage||(i.defaultLanguage=v.getBrowserLanguage()),i.skipFallbackToBasicAuth=!0,i.basicLoginProvider=(e,i)=>this.doBasicLogin(e,i),console.info("Initialising the manager"),h.init(i).then(e=>__awaiter(this,void 0,void 0,function*(){if(e||h.error!==_.AUTH_FAILED||i.auth&&"KEYCLOAK"!==i.auth||(this.doAppConfigInit(),i.auth="BASIC",e=yield h.init(i)),e){let e;if(this.doAppConfigInit(),!this.appConfig){w("appError.noConfig",document.body),console.error("No AppConfig supplied");return}if(!this._config){w("appError.noConfig",document.body),console.error("No default AppConfig or realm specific config provided so cannot render");return}if(!this._store){w("appError.noReduxStore",document.body),console.error("No Redux store supplied");return}if(!this.appConfig.pages||0===Object.keys(this.appConfig.pages).length){w("appError.noPages",document.body),console.error("No page providers");return}let i=yield h.rest.api.RealmResource.getAccessible();this._realms=i.data,h.isSuperUser()&&(e=window.sessionStorage.getItem("realm"))&&!this._realms.some(i=>i.name===e)&&(e=void 0),this._store.dispatch(F(e||h.getRealm()||"master")),this._initialised=!0,h.addListener(this._onEvent);let t=e=>{this._activeMenu=e};l.hooks({before:(e,i)=>{t(i?i.url.split("/")[0]:void 0),e()}}),this.appConfig.pages.forEach((e,i)=>{e.routes&&e.routes.forEach(i=>{l.on(i,i=>{this._store.dispatch(k({page:e.name,params:i.data}))})})}),this.appConfig.pages.length>0&&l.notFound(()=>{this._store.dispatch(k(this.appConfig.pages[0].name))}),l.resolve()}else w(h.isError?"managerError."+h.error:"")}))}updated(e){var i,t;if(super.updated(e),this._initialised&&(e.has("_page")||e.has("_offline")||e.has("_showOfflineFallback"))){if(this._mainElem){let o=this.appConfig.pages.find(e=>e.name===this._page),r=this._showOfflineFallback&&!(null==o?void 0:o.allowOffline),n=this._mainElem.querySelector("#offline-page");if(e.has("_page")&&o){let e=this._mainElem.firstElementChild;if(e){let i=o.pageCreator();r&&(i.style.setProperty("display","none"),i.setAttribute("loadedDuringOffline","true")),this._mainElem.replaceChild(i,e)}else this._mainElem.appendChild(o.pageCreator())}if(n&&!r){this._mainElem.removeChild(n);let e=this._mainElem.firstElementChild;null==e||e.style.removeProperty("display"),(null==e?void 0:e.onRefresh)&&e.onRefresh()}else if(!n&&r){let e=(null==(i=this.appConfig)?void 0:i.offlinePage)?this.appConfig.offlinePage.pageCreator():L(this._store).pageCreator();null==(t=this._mainElem.firstElementChild)||t.style.setProperty("display","none"),e.id="offline-page",this._mainElem.appendChild(e)}}this.updateWindowTitle()}}shouldUpdate(e){var i,t;if(e.has("_realm")&&(this._config=this._getConfig(),this._realm?(h.displayRealm=this._realm,window.sessionStorage.setItem("realm",this._realm)):window.sessionStorage.removeItem("realm")),e.has("_config")&&this._config){this._config.logo?this._config.logo=(null!=(i=h.managerUrl)?i:"")+this._config.logo:this._config.logo=DefaultLogo,this._config.logoMobile?this._config.logoMobile=(null!=(t=h.managerUrl)?t:"")+this._config.logoMobile:this._config.logoMobile=DefaultMobileLogo;let e=this._config&&this._config.favicon?(h.managerUrl||"")+this._config.favicon:DefaultFavIcon,o=document.querySelector("link[rel~='icon']");o||((o=document.createElement("link")).rel="icon",document.getElementsByTagName("head")[0].appendChild(o)),o.href=e}return this.updateWindowTitle(),super.shouldUpdate(e)}render(){let e;if(!this._initialised)return i`<or-mwc-dialog id="app-modal"></or-mwc-dialog>`;if(h.consoleAppConfig){let t=h.consoleAppConfig,o=t.primaryColor,r=t.secondaryColor;e=i`<style>:host {--or-console-primary-color:${o};--or-console-secondary-color:${r};}</style>`}return i`
|
|
51
51
|
${this._config.styles?"string"==typeof this._config.styles?i`<style>${this._config.styles}</style>`:this._config.styles.strings:""}
|
|
52
52
|
${e}
|
|
53
53
|
${this._config.header?i`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-app",
|
|
3
|
-
"version": "1.8.0-snapshot.
|
|
3
|
+
"version": "1.8.0-snapshot.20250818162953",
|
|
4
4
|
"description": "OpenRemote app template",
|
|
5
5
|
"author": "OpenRemote",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"modelBuild": "npx orutil build",
|
|
18
18
|
"modelWatch": "npx orutil watch",
|
|
19
19
|
"build": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rspack --mode production",
|
|
20
|
-
"test": "echo \"
|
|
20
|
+
"test": "echo \"No tests\" && exit 0",
|
|
21
21
|
"prepack": "npx tsc -b"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@lit/task": "^1.0.0",
|
|
25
|
-
"@openremote/core": "1.8.0-snapshot.
|
|
26
|
-
"@openremote/or-asset-tree": "1.8.0-snapshot.
|
|
27
|
-
"@openremote/or-asset-viewer": "1.8.0-snapshot.
|
|
28
|
-
"@openremote/or-attribute-input": "1.8.0-snapshot.
|
|
29
|
-
"@openremote/or-attribute-picker": "1.8.0-snapshot.
|
|
30
|
-
"@openremote/or-chart": "1.8.0-snapshot.
|
|
31
|
-
"@openremote/or-dashboard-builder": "1.8.0-snapshot.
|
|
32
|
-
"@openremote/or-gauge": "1.8.0-snapshot.
|
|
33
|
-
"@openremote/or-map": "1.8.0-snapshot.
|
|
34
|
-
"@openremote/or-mwc-components": "1.8.0-snapshot.
|
|
35
|
-
"@openremote/or-rules": "1.8.0-snapshot.
|
|
36
|
-
"@openremote/or-smart-notify": "1.8.0-snapshot.
|
|
37
|
-
"@openremote/or-timeline": "1.8.0-snapshot.
|
|
38
|
-
"@openremote/rest": "1.8.0-snapshot.
|
|
25
|
+
"@openremote/core": "1.8.0-snapshot.20250818162953",
|
|
26
|
+
"@openremote/or-asset-tree": "1.8.0-snapshot.20250818162953",
|
|
27
|
+
"@openremote/or-asset-viewer": "1.8.0-snapshot.20250818162953",
|
|
28
|
+
"@openremote/or-attribute-input": "1.8.0-snapshot.20250818162953",
|
|
29
|
+
"@openremote/or-attribute-picker": "1.8.0-snapshot.20250818162953",
|
|
30
|
+
"@openremote/or-chart": "1.8.0-snapshot.20250818162953",
|
|
31
|
+
"@openremote/or-dashboard-builder": "1.8.0-snapshot.20250818162953",
|
|
32
|
+
"@openremote/or-gauge": "1.8.0-snapshot.20250818162953",
|
|
33
|
+
"@openremote/or-map": "1.8.0-snapshot.20250818162953",
|
|
34
|
+
"@openremote/or-mwc-components": "1.8.0-snapshot.20250818162953",
|
|
35
|
+
"@openremote/or-rules": "1.8.0-snapshot.20250818162953",
|
|
36
|
+
"@openremote/or-smart-notify": "1.8.0-snapshot.20250818162953",
|
|
37
|
+
"@openremote/or-timeline": "1.8.0-snapshot.20250818162953",
|
|
38
|
+
"@openremote/rest": "1.8.0-snapshot.20250818162953",
|
|
39
39
|
"@reduxjs/toolkit": "^1.8.1",
|
|
40
40
|
"@webcomponents/webcomponentsjs": "^2.6.0",
|
|
41
41
|
"lit": "^2.0.2",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"pwa-helpers": "^0.9.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@openremote/util": "1.8.0-snapshot.
|
|
47
|
+
"@openremote/util": "1.8.0-snapshot.20250818162953"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|