100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
UI updates: insights mobile, header style mobile
Robin Dekkers550143884715
diff --git a/ui/app/or-app/src/index.ts b/ui/app/or-app/src/index.tsindex ba7f6a03d..56829f634 100644--- a/ui/app/or-app/src/index.ts+++ b/ui/app/or-app/src/index.ts@@ -131,8 +131,7 @@ export function headerItemInsights<S extends AppStateKeyed, A extends AnyAction>return {icon: "chart-areaspline",href: "#!insights",- text: "insights",- hideMobile: true+ text: "insights"};}diff --git a/ui/app/or-app/src/or-header.ts b/ui/app/or-app/src/or-header.tsindex 4ce389cc6..082f6d17d 100644--- a/ui/app/or-app/src/or-header.ts+++ b/ui/app/or-app/src/or-header.ts@@ -133,6 +133,7 @@ class OrHeader extends LitElement {--or-icon-fill: var(--internal-or-header-drawer-text-color);--or-icon-height: calc(var(--internal-or-header-drawer-item-size) - 10px);--or-icon-width: calc(var(--internal-or-header-drawer-item-size) - 10px);+ overflow: hidden;}#drawer[opened] {@@ -259,7 +260,7 @@ class OrHeader extends LitElement {border-bottom: 4px solid var(--internal-or-header-selected-color);line-height: calc(var(--internal-or-header-height) - 4px);}-+#logo {margin: var(--internal-or-header-logo-margin);height: var(--internal-or-header-logo-height);@@ -269,13 +270,13 @@ class OrHeader extends LitElement {#logo-mobile {display: none;}-+#drawer {display: none;}#desktop-right {- display: block;+ display: flex;}#desktop-left ::slotted(*) {@@ -287,6 +288,14 @@ class OrHeader extends LitElement {line-height: calc(var(--internal-or-header-height) - 4px);}}++ @media (min-width: 1024px) {+++ #desktop-left .menu-item or-icon{+ display: inline-block;+ }+ }`;}diff --git a/ui/app/or-app/src/pages/page-mobile-geofences.ts b/ui/app/or-app/src/pages/page-mobile-geofences.tsindex 14467f3ba..dd1f65634 100644--- a/ui/app/or-app/src/pages/page-mobile-geofences.ts+++ b/ui/app/or-app/src/pages/page-mobile-geofences.ts@@ -1,5 +1,6 @@import {css, customElement, html, property} from "lit-element";import {AppStateKeyed, Page} from "../index";+import {NavigationControl} from "mapbox-gl";import {EnhancedStore} from "@reduxjs/toolkit";import manager from "@openremote/core";import { JsonRulesetDefinition } from "@openremote/model";@@ -22,6 +23,7 @@ export function pageMobileGeofencesProvider<S extends AppStateKeyed>(store: Enha};}const QUERY_VIEW = new URLSearchParams(window.location.search).get("view");+const APP_ICON_POSITION = new URLSearchParams(window.location.search).get("appIconPosition");@customElement("page-mobile-geofences")class PageMobileGeofences<S extends AppStateKeyed> extends Page<S> {@@ -67,11 +69,19 @@ class PageMobileGeofences<S extends AppStateKeyed> extends Page<S> {display: flex;flex-direction: row;text-decoration: none;- padding: 10px;+ padding: 20px;color: var(--or-app-color3);border-bottom: 1px solid var(--or-app-color3);;}+ h3, p {+ margin: 0;+ }++ h3 {+ color: var(--or-app-color4);+ }+.button {cursor: pointer;background-color: var(--or-app-color2);@@ -107,11 +117,55 @@ class PageMobileGeofences<S extends AppStateKeyed> extends Page<S> {z-index: 99999;}++ .marker-tooltip.bottom_left {+ top: auto;+ bottom: 0;+ right: auto;+ left: 0;+ }++ .marker-tooltip.bottom_right {+ top: auto;+ bottom: 0;+ right: 0;+ left: auto;+ }++ .marker-tooltip.top_left {+ top: 0;+ bottom: auto;+ right: auto;+ left: 0;+ }++ .marker-tooltip.top_right {+ top: 0;+ bottom: auto;+ right: 0;+ left: auto;+ }or-map-marker[active] {--or-map-marker-width: 60px;--or-map-marker-height: 60px;}+++++ @supports(padding:max(0px)) {+ body, .header, footer {+ padding-top: min(0vmin, env(safe-area-inset-top));+ padding-bottom: min(0vmin, env(safe-area-inset-bottom));+ }+ }+ .list-container,+ .header {+ padding-top: env(safe-area-inset-top); /* Apply safe area */+ padding-bottom: env(safe-area-inset-bottom);+ }+`;}@@ -165,6 +219,7 @@ class PageMobileGeofences<S extends AppStateKeyed> extends Page<S> {public config?: GeofencesConfig;protected render() {+ const controls = [new NavigationControl({showCompass: false, showZoom: false})];return html`${this.view === 'map' ? html`<div class="header">@@ -174,16 +229,16 @@ class PageMobileGeofences<S extends AppStateKeyed> extends Page<S> {<a class="d-flex location-button button" @click="${this.getLocation}"><or-icon icon="crosshairs-gps"></or-icon></a></div></div>- <or-map id="vector" class="or-map" type="VECTOR" style="height: 100%; width: 100%;">+ <or-map id="vector" class="or-map" .controls="${controls}" type="VECTOR" style="height: 100%; width: 100%;">${this.mapItems.map((marker: any) => {return html`<or-map-marker ?active="${JSON.stringify(this.activeItem) === JSON.stringify(marker) }" icon="information" .marker="${marker}" lat="${marker.predicate.lat}" lng="${marker.predicate.lng}"></or-map-marker>`})}</or-map>${this.activeItem ? html`- <a class="marker-tooltip" href="${this.createUrl(this.activeItem.notification.action)}">+ <a class="marker-tooltip ${manager.consoleAppConfig.appIconPosition ? manager.consoleAppConfig.appIconPosition.toLowerCase() : ""}" href="${this.createUrl(this.activeItem.notification.action)}"><div class="flex marker-tooltip-inner" >- <div style="flex-direction:row;" class="d-flex list-item">+ <div style="flex-direction:row;" class="d-flex"><div class="flex"><h3>${this.activeItem.notification.title}</h3><p>${this.activeItem.notification.body}</p>diff --git a/ui/app/or-app/src/pages/page-mobile-onboarding.ts b/ui/app/or-app/src/pages/page-mobile-onboarding.tsindex c3fccc3ea..5d9f0545b 100644--- a/ui/app/or-app/src/pages/page-mobile-onboarding.ts+++ b/ui/app/or-app/src/pages/page-mobile-onboarding.ts@@ -43,9 +43,9 @@ class PageMobileOnboarding<S extends AppStateKeyed> extends Page<S> {:host {flex: 1;width: 100%;- flex-direction: column;+ flex-direction: column;}-+.page-container {width: 100vw;height: 100vh;@@ -64,6 +64,8 @@ class PageMobileOnboarding<S extends AppStateKeyed> extends Page<S> {flex-direction: column;align-items: center;justify-content: center;+ text-align: center;+ padding: 20px;}.next-button {@@ -81,6 +83,9 @@ class PageMobileOnboarding<S extends AppStateKeyed> extends Page<S> {`;}+ @property()+ protected active: boolean = false;+get name(): string {return "mobile-onboarding";}@@ -93,6 +98,8 @@ class PageMobileOnboarding<S extends AppStateKeyed> extends Page<S> {super.connectedCallback();if (localStorage.getItem("completedOnboarding") !== null) {window.location.href = this.config.redirect;+ } else {+ this.active = true;}}@@ -106,31 +113,33 @@ class PageMobileOnboarding<S extends AppStateKeyed> extends Page<S> {public config?: OnboardingConfig;protected render() {- return html`- ${this.config.pages.map((page, index) => {- return html`- <div class="page-container ${this.pageIndex === index ? "active" :""}">- <div class="page-content">- ${page.type === "default" ? html`- <div><img src="${page.image}" /></div>- <h1>${page.title}</h1>- <p>${page.description}</p>- ` : ``}-- ${page.type === "bottom-image" ? html`- <h1>${page.title}</h1>- <p>${page.description}</p>- <div><img src="${page.image}" /></div>- ` : ``}+ if(this.active) {+ return html`+ ${this.config.pages.map((page, index) => {+ return html`+ <div class="page-container ${this.pageIndex === index ? "active" :""}">+ <div class="page-content">+ ${page.type === "default" ? html`+ <div><img src="${page.image}" /></div>+ <h1>${page.title}</h1>+ <p>${page.description}</p>+ ` : ``}++ ${page.type === "bottom-image" ? html`+ <h1>${page.title}</h1>+ <p>${page.description}</p>+ <div><img src="${page.image}" /></div>+ ` : ``}+ </div>++ <div class="next-button" @click="${() => this.nextPage(index)}">+ <or-icon icon="chevron-right"></or-icon>+ </div></div>-- <div class="next-button" @click="${() => this.nextPage(index)}">- <or-icon icon="chevron-right"></or-icon>- </div>- </div>- `- })}- `;+ `+ })}+ `;+ }}private async enableProviders() {diff --git a/ui/component/or-map/src/mapwidget.ts b/ui/component/or-map/src/mapwidget.tsindex d54e70f5e..7aa8a377b 100644--- a/ui/component/or-map/src/mapwidget.ts+++ b/ui/component/or-map/src/mapwidget.ts@@ -246,12 +246,13 @@ export class MapWidget {this._onMapClick(e.lngLat, true);});- // Add zoom and rotation controls to the map- this._mapGl.addControl(new NavigationControl());// Add custom controlsif (this._controls) {this._controls.forEach((control) => this._mapGl!.addControl(control));+ } else {+ // Add zoom and rotation controls to the map+ this._mapGl.addControl(new NavigationControl());}}