Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI update insights, gateway, Fix mdc-select with helper text, Fix logs controls UI, Update language

Done0ab1a82e330
diff --git a/deployment/manager/shared/locales/en/or.json b/deployment/manager/shared/locales/en/or.json
index acec64c15..7191864ab 100644
--- a/deployment/manager/shared/locales/en/or.json
+++ b/deployment/manager/shared/locales/en/or.json
@@ -210,6 +210,7 @@
"HUMIDITY": "%.1f"
},
"gatewayConnection": "Manager interconnect",
+ "connectionDetails": "CONNECTION DETAILS",
"secured": "Secured",
"clientSecret": "Client secret",
"clientId": "Client ID",
@@ -275,8 +276,8 @@
},
"noChildAssets": "No child assets",
"account": "Account",
- "editAttribute": "Edit attribute",
- "editDelta": "Edit delta",
- "editCurrentValue": "Edit current value",
+ "editAttribute": "Change attribute",
+ "editDelta": "Delta",
+ "editCurrentValue": "Decimals",
"decimals": "Decimals"
}
diff --git a/deployment/manager/shared/locales/nl/or.json b/deployment/manager/shared/locales/nl/or.json
index 3221d8770..830bb2635 100644
--- a/deployment/manager/shared/locales/nl/or.json
+++ b/deployment/manager/shared/locales/nl/or.json
@@ -84,6 +84,7 @@
"cancel": "Annuleren",
"createdOn": "Aangemaakt op",
"createdOnWithDate": "Aangemaakt op: {{-date, LLLL}}",
+ "updatedWithDate": "Bijgewerkt op: {{-date, LLLL}}",
"accessPublicRead": "Publiek",
"type": "Type",
"path": "Pad",
@@ -179,7 +180,7 @@
"logs": "Logs",
"addRemoveAttributes": "Attributen toevoegen/verwijderen",
"email": "Email",
- "push-notification":"Push notificatie",
+ "push-notification": "Push notificatie",
"subject": "Onderwerp",
"openWebsiteUrl": "Te openen website adres",
"openInBrowser": "Openen in browser (voor externe websites)",
@@ -209,6 +210,7 @@
"HUMIDITY": "%.1f"
},
"gatewayConnection": "Manager interconnect",
+ "connectionDetails": "CONNECTIE DETAILS",
"secured": "Beveiligd",
"clientSecret": "Client wachtwoord",
"clientId": "Client ID",
@@ -216,6 +218,7 @@
"port": "Poort",
"host": "Hostname",
"errorOccurred": "Er is een fout opgetreden",
+ "sendFailed": "Verzenden mislukt",
"managerError": {
"MANAGER_FAILED_TO_LOAD": "Manager kan niet geladen worden (bekijk de console logs)",
"KEYCLOAK_FAILED_TO_LOAD": "Keycloak kan niet geladen worden (bekijk de console logs)",
@@ -225,6 +228,56 @@
"TRANSLATION_ERROR": "Vertalingen fout (bekijk de console logs)"
},
"couldNotRetrieveAttribute": "Kan de gegevens voor dit attribuut niet ophalen",
+ "pressEnterToSend": "Enter om te verzenden",
+ "sending": "Wordt verzonden",
"submit": "Verzenden",
- "password": "Wachtwoord"
+ "password": "Wachtwoord",
+ "units": {
+ "CELSIUS": "°C",
+ "FAHRENHEIT": "°F",
+ "HOURS": "uur",
+ "MINUTES": "min",
+ "SECONDS": "s",
+ "MILLISECONDS": "ms",
+ "SPEED_KNOTS": "kn",
+ "SPEED_KMPH": "km/u",
+ "SPEED_MIPH": "mi/u",
+ "SPEED_MPS": "m/s",
+ "DECIBELS": "dB",
+ "DISTANCE_KM": "km",
+ "DISTANCE_MI": "mi",
+ "DISTANCE_M": "m",
+ "DISTANCE_CM": "cm",
+ "DISTANCE_MM": "mm",
+ "FLOW_LPM": "L/m",
+ "EUR_PER_KWH": "€/kWh",
+ "EUR_PER_MONTH": "€/month",
+ "GBP_PER_KWH": "£/kWh",
+ "GBP_PER_MONTH": "£/month",
+ "EUR": "€",
+ "GBP": "£",
+ "POWER_KW": "kW",
+ "POWER_W": "W",
+ "POWER_KWP": "kWp",
+ "POWER_PER_SQUARE_M": "W/m²",
+ "ENERGY_KWH": "kWh",
+ "KG_CARBON_PER_KWH": "kg CO₂/kWh",
+ "MASS_KG": "kg",
+ "ANGLE_DEGREES": "°",
+ "ANGLE_RADIANS": "rad",
+ "PERCENTAGE": "%",
+ "DENSITY_KG_M3": "kg/m³",
+ "DENSITY_UG_M3": "µg/m³",
+ "ON_OFF": "Aan/Uit",
+ "PRESSED_RELEASED": "Ingedrukt/Losgelaten",
+ "COUNT_PER_HOUR": "/u",
+ "COUNT_PER_MINUTE": "/min",
+ "COUNT_PER_SECOND": "/s"
+ },
+ "noChildAssets": "Geen onderliggende assets",
+ "account": "Account",
+ "editAttribute": "Attribuut kiezen",
+ "editDelta": "Delta",
+ "editCurrentValue": "Decimalen",
+ "decimals": "Decimalen"
}
diff --git a/ui/app/or-app/src/pages/page-gateway.ts b/ui/app/or-app/src/pages/page-gateway.ts
index fa1845189..d9be39be4 100644
--- a/ui/app/or-app/src/pages/page-gateway.ts
+++ b/ui/app/or-app/src/pages/page-gateway.ts
@@ -33,28 +33,43 @@ class PageGateway<S extends AppStateKeyed> extends Page<S> {
--or-panel-heading-margin: 0 0 5px 10px;
--or-panel-background-color: var(--or-app-color1, ${unsafeCSS(DefaultColor1)});
- --or-panel-heading-font-size: large;
+ --or-panel-heading-font-size: 14px;
+ --or-panel-padding: 14px;
}
- @media only screen and (max-width: 1080px){
- or-panel {
- margin: 0;
- }
+ #wrapper {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ overflow: auto;
+ }
+
+ #title {
+ margin: 20px auto 0;
+ font-size: 18px;
+ font-weight: bold;
+ max-width: 1000px;
+ min-width: 600px;
+ }
+
+ #title > or-icon {
+ margin-right: 10px;
+ margin-left: 14px;
}
or-panel {
position: relative;
max-width: 1000px;
min-width: 600px;
- margin-top: 40px;
+ margin: 20px auto;
}
#status {
position: absolute;
top: 15px;
right: 25px;
- font-weight: bold;
-
+ font-weight: bold;
}
#fields {
@@ -75,6 +90,22 @@ class PageGateway<S extends AppStateKeyed> extends Page<S> {
#buttons > or-input {
margin: 10px;
}
+
+ @media only screen and (max-width: 780px){
+ :host {
+ --or-panel-border-radius: 0;
+ }
+ or-panel {
+ width: 100%;
+ min-width: auto;
+ margin: 0;
+ }
+
+ #title {
+ width: 100%;
+ min-width: auto;
+ }
+ }
`;
}
@@ -142,25 +173,30 @@ class PageGateway<S extends AppStateKeyed> extends Page<S> {
const connection = this._connection;
return html`
- <or-panel ?disabled="${this._loading}" .heading="${i18next.t("gatewayConnection") + " (" + this.realm + ")"}">
- <div id="status">
- ${this._connectionStatus}
- </div>
- <div id="fields">
- <or-input .label="${i18next.t("host")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.host : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("host", e.detail.value)}"></or-input>
- <or-input .label="${i18next.t("port")}" .type="${InputType.NUMBER}" ?disabled="${this._loading || this._readonly}" min="1" max="65536" step="1" .value="${connection ? connection.port : undefined}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("port", e.detail.value)}"></or-input>
- <or-input .label="${i18next.t("realm")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.realm : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("realm", e.detail.value)}"></or-input>
- <or-input .label="${i18next.t("clientId")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.clientId : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("clientId", e.detail.value)}"></or-input>
- <or-input .label="${i18next.t("clientSecret")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.clientSecret : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("clientSecret", e.detail.value)}"></or-input>
- <or-input .label="${i18next.t("secured")}" .type="${InputType.SWITCH}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.secured : false}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("secured", e.detail.value)}"></or-input>
- <or-input .label="${i18next.t("disabled")}" .type="${InputType.SWITCH}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.disabled : false}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("disabled", e.detail.value)}"></or-input>
- </div>
- <div id="buttons">
- <or-input .label="${i18next.t("reset")}" ?disabled="${!this._dirty || this._loading || this._readonly}" .type="${InputType.BUTTON}" raised @click="${() => this._reset()}"></or-input>
- <or-input .label="${i18next.t("delete")}" ?disabled="${this._loading || this._readonly}" .type="${InputType.BUTTON}" raised @click="${() => this._delete()}"></or-input>
- <or-input .label="${i18next.t("save")}" ?disabled="${!this._dirty || this._loading || this._readonly}" .type="${InputType.BUTTON}" raised @click="${() => this._save()}"></or-input>
+ <div id="wrapper">
+ <div id="title">
+ <or-icon icon="cloud"></or-icon>${i18next.t("gatewayConnection")}
</div>
- </or-panel>
+ <or-panel ?disabled="${this._loading}" .heading="${i18next.t("connectionDetails")}">
+ <div id="status">
+ ${this._connectionStatus}
+ </div>
+ <div id="fields">
+ <or-input .label="${i18next.t("host")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.host : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("host", e.detail.value)}"></or-input>
+ <or-input .label="${i18next.t("port")}" .type="${InputType.NUMBER}" ?disabled="${this._loading || this._readonly}" min="1" max="65536" step="1" .value="${connection ? connection.port : undefined}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("port", e.detail.value)}"></or-input>
+ <or-input .label="${i18next.t("realm")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.realm : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("realm", e.detail.value)}"></or-input>
+ <or-input .label="${i18next.t("clientId")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.clientId : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("clientId", e.detail.value)}"></or-input>
+ <or-input .label="${i18next.t("clientSecret")}" .type="${InputType.TEXT}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.clientSecret : ""}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("clientSecret", e.detail.value)}"></or-input>
+ <or-input .label="${i18next.t("secured")}" .type="${InputType.SWITCH}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.secured : false}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("secured", e.detail.value)}"></or-input>
+ <or-input .label="${i18next.t("disabled")}" .type="${InputType.SWITCH}" ?disabled="${this._loading || this._readonly}" .value="${connection ? connection.disabled : false}" @or-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("disabled", e.detail.value)}"></or-input>
+ </div>
+ <div id="buttons">
+ <or-input .label="${i18next.t("reset")}" ?disabled="${!this._dirty || this._loading || this._readonly}" .type="${InputType.BUTTON}" raised @click="${() => this._reset()}"></or-input>
+ <or-input .label="${i18next.t("delete")}" ?disabled="${this._loading || this._readonly}" .type="${InputType.BUTTON}" raised @click="${() => this._delete()}"></or-input>
+ <or-input .label="${i18next.t("save")}" ?disabled="${!this._dirty || this._loading || this._readonly}" .type="${InputType.BUTTON}" raised @click="${() => this._save()}"></or-input>
+ </div>
+ </or-panel>
+ </div>
`;
}
diff --git a/ui/app/or-app/src/pages/page-insights.ts b/ui/app/or-app/src/pages/page-insights.ts
index d29ed7c63..c91692267 100644
--- a/ui/app/or-app/src/pages/page-insights.ts
+++ b/ui/app/or-app/src/pages/page-insights.ts
@@ -4,6 +4,7 @@ import {DataViewerConfig} from "@openremote/or-data-viewer";
import {DefaultBoxShadow} from "@openremote/core";
import {AppStateKeyed, Page} from "../index";
import {EnhancedStore} from "@reduxjs/toolkit";
+import i18next from "i18next";
export function pageInsightsProvider<S extends AppStateKeyed>(store: EnhancedStore<S>, config?:DataViewerConfig) {
return {
@@ -25,34 +26,45 @@ class PageInsights<S extends AppStateKeyed> extends Page<S> {
static get styles() {
// language=CSS
return css`
- or-asset-tree {
- align-items: stretch;
- z-index: 1;
- }
-
.hideMobile {
display: none;
}
+
+ #wrapper {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ overflow: auto;
+ }
- or-asset-viewer {
- align-items: stretch;
- z-index: 0;
+ #title {
+ margin: 20px auto 0;
+ padding: 0;
+ font-size: 18px;
+ font-weight: bold;
+ width: 100%;
+ max-width: 1360px;
+ }
+
+ or-data-viewer {
+ width: 100%;
+ max-width: 1400px;
+ margin: 0 auto;
+ }
+
+ #title > or-icon {
+ margin-right: 10px;
+ margin-left: 14px;
}
@media only screen and (min-width: 768px){
- or-asset-tree {
- width: 300px;
- min-width: 300px;
- box-shadow: ${unsafeCSS(DefaultBoxShadow)}
- }
-
.hideMobile {
display: flex;
}
-
- or-asset-viewer,
- or-asset-viewer.hideMobile {
- display: initial;
+
+ #title {
+ padding: 0 20px;
}
}
`;
@@ -70,7 +82,12 @@ class PageInsights<S extends AppStateKeyed> extends Page<S> {
protected render(): TemplateResult | void {
return html`
- <or-data-viewer></or-data-viewer>
+ <div id="wrapper">
+ <div id="title">
+ <or-icon icon="chart-areaspline"></or-icon>${i18next.t("insights")}
+ </div>
+ <or-data-viewer></or-data-viewer>
+ </div>
`;
}
diff --git a/ui/component/or-asset-viewer/src/style.ts b/ui/component/or-asset-viewer/src/style.ts
index af3574115..9f8e78390 100644
--- a/ui/component/or-asset-viewer/src/style.ts
+++ b/ui/component/or-asset-viewer/src/style.ts
@@ -27,7 +27,6 @@ export const style = css`
width: 100%;
display: flex;
flex-direction: column;
-
overflow: auto;
}
@@ -54,7 +53,6 @@ export const style = css`
}
}
-
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
@@ -147,7 +145,6 @@ export const style = css`
margin: 10px 0;
width: 100%;
flex: 0 0 auto;
- min-height: 50px;
}
.field > * {
diff --git a/ui/component/or-attribute-card/src/index.ts b/ui/component/or-attribute-card/src/index.ts
index f54d78041..6505ba77c 100644
--- a/ui/component/or-attribute-card/src/index.ts
+++ b/ui/component/or-attribute-card/src/index.ts
@@ -55,7 +55,6 @@ const style = css`
display: flex;
align-items: center;
margin: -15px -15px 0 0; /* compensate for the click-space of the plusminus button */
- text-transform: uppercase;
font-weight: bolder;
line-height: 1em;
color: var(--internal-or-asset-viewer-title-text-color);
@@ -64,6 +63,7 @@ const style = css`
.panel-title-text {
flex: 1;
+ text-transform: uppercase;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
diff --git a/ui/component/or-data-viewer/src/style.ts b/ui/component/or-data-viewer/src/style.ts
index f2681a239..f1793e76f 100644
--- a/ui/component/or-data-viewer/src/style.ts
+++ b/ui/component/or-data-viewer/src/style.ts
@@ -22,18 +22,8 @@ export const style = css`
display: none;
}
- #wrapper {
- height: 100%;
- width: 100%;
- display: flex;
- flex-direction: column;
-
- overflow: auto;
- }
-
#container {
width: 100%;
- max-width: 1400px;
box-sizing: border-box;
display: grid;
margin: auto;
diff --git a/ui/component/or-input/src/index.ts b/ui/component/or-input/src/index.ts
index 740f9353d..ed7ca6f40 100644
--- a/ui/component/or-input/src/index.ts
+++ b/ui/component/or-input/src/index.ts
@@ -170,8 +170,19 @@ const style = css`
white-space: nowrap;
}
- .mdc-select {
+ .mdc-select:not(.mdc-list) {
white-space: nowrap;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label {
+ color: var(--mdc-theme-primary);
+ }
+
+ .mdc-select-helper-text {
+ white-space: normal;
+ color: rgba(0, 0, 0, 0.6);
}
.mdc-icon-button {
@@ -526,8 +537,8 @@ export class OrInput extends LitElement {
${hasHelper ? html`
<p id="component-helper-text" class="mdc-select-helper-text ${classMap(helperClasses)}" aria-hidden="true">
${showValidationMessage ? this.validationMessage : this.helperText}
- </div>
</p>` : ``}
+ </div>
`;
case InputType.BUTTON_TOGGLE:
return html`
diff --git a/ui/component/or-log-viewer/src/index.ts b/ui/component/or-log-viewer/src/index.ts
index 724dd32a7..02d84e383 100644
--- a/ui/component/or-log-viewer/src/index.ts
+++ b/ui/component/or-log-viewer/src/index.ts
@@ -93,6 +93,7 @@ const style = css`
margin-right: 40px;
}
+/* min-width of selects is 200px somehow
#period-select {
width: 90px;
}
@@ -104,6 +105,7 @@ const style = css`
#limit-select {
width: 80px;
}
+*/
#log-controls, #ending-controls, #page-controls {
display: flex;
@@ -298,8 +300,8 @@ export class OrLogViewer extends translate(i18next)(LitElement) {
true
)}
<or-input ?hidden="${hideFilter}" .type="${InputType.TEXT}" outlined ?disabled="${disabled}" icontrailing="magnify" .label="${i18next.t("subCategoryFilters")}" .value="${this.filter}" @or-input-changed="${(evt: OrInputChangedEvent) => this._onFilterChanged(evt.detail.value)}"></or-input>
- <or-input ?hidden="${hideLevel}" .type="${InputType.SELECT}" id="level-select" outlined ?disabled="${disabled}" .label="${i18next.t("level")}" @or-input-changed="${(evt: OrInputChangedEvent) => this._onLevelChanged(evt.detail.value)}" .value="${this.level}" .options="${this._getLevelOptions()}"></or-input>
- <or-input .type="${ InputType.SELECT}" id="limit-select" outlined ?disabled="${disabled}" .label="${i18next.t("limit")}" @or-input-changed="${(evt: OrInputChangedEvent) => this._onLimitChanged(evt.detail.value)}" .value="${this.limit}" .options="${this._getLimitOptions()}"></or-input>
+ <or-input ?hidden="${hideLevel}" .type="${InputType.SELECT}" id="level-select" ?disabled="${disabled}" .label="${i18next.t("level")}" @or-input-changed="${(evt: OrInputChangedEvent) => this._onLevelChanged(evt.detail.value)}" .value="${this.level}" .options="${this._getLevelOptions()}"></or-input>
+ <or-input .type="${ InputType.SELECT}" id="limit-select" ?disabled="${disabled}" .label="${i18next.t("limit")}" @or-input-changed="${(evt: OrInputChangedEvent) => this._onLimitChanged(evt.detail.value)}" .value="${this.limit}" .options="${this._getLimitOptions()}"></or-input>
</div>
<div id="page-controls" ?hidden="${isLive || !this._pageCount || !this._data || this._data.length === 0}">
<or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive || this._currentPage === 1}" icon="chevron-left" @click="${() => this._updatePage(false)}"></or-input>
@@ -308,10 +310,10 @@ export class OrLogViewer extends translate(i18next)(LitElement) {
</div>
<div id="time-controls">
<or-input id="live-button" .type="${InputType.CHECKBOX}" ?disabled="${disabled}" .label="${i18next.t("live")}" @or-input-changed="${(evt: OrInputChangedEvent) => this._onLiveChanged(evt.detail.value)}" .value="${this.live}"></or-input>
- <or-input .type="${InputType.SELECT}" id="period-select" outlined ?disabled="${disabled || isLive}" .label="${i18next.t("period")}" @or-input-changed="${(evt: OrInputChangedEvent) => this.interval = evt.detail.value}" .value="${this.interval}" .options="${this._getIntervalOptions()}"></or-input>
+ <or-input .type="${InputType.SELECT}" id="period-select" ?disabled="${disabled || isLive}" .label="${i18next.t("period")}" @or-input-changed="${(evt: OrInputChangedEvent) => this.interval = evt.detail.value}" .value="${this.interval}" .options="${this._getIntervalOptions()}"></or-input>
<div id="ending-controls">
<or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive}" icon="chevron-left" @click="${() => this.timestamp = this._calculateTimestamp(this.timestamp!, false)}"></or-input>
- <or-input id="ending-date" outlined .type="${InputType.DATETIME}" ?disabled="${disabled || isLive}" label="${i18next.t("ending")}" .value="${this.timestamp}" @or-input-changed="${(evt: OrInputChangedEvent) => this.timestamp = this._calculateTimestamp(moment(evt.detail.value as string).toDate())}"></or-input>
+ <or-input id="ending-date" .type="${InputType.DATETIME}" ?disabled="${disabled || isLive}" label="${i18next.t("ending")}" .value="${this.timestamp}" @or-input-changed="${(evt: OrInputChangedEvent) => this.timestamp = this._calculateTimestamp(moment(evt.detail.value as string).toDate())}"></or-input>
<or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive}" icon="chevron-right" @click="${() => this.timestamp = this._calculateTimestamp(this.timestamp!, true)}"></or-input>
<or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive}" icon="chevron-double-right" @click="${() => this.timestamp = this._calculateTimestamp(new Date())}"></or-input>
</div>