Skip to content

armgit / core

Public Imported from GitHub
0

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

Add realm style config and fix for mobile or-header

Robin Dekkers24a201bd3476
diff --git a/ui/component/core/src/index.ts b/ui/component/core/src/index.ts
index addd25834..7ff30cbef 100644
--- a/ui/component/core/src/index.ts
+++ b/ui/component/core/src/index.ts
@@ -14,6 +14,7 @@ import {
} from "@openremote/model";
import * as Util from "./util";
import orIconSet from "./or-icon-set";
+import {TemplateResult} from "lit-element";
// Re-exports
export {Util};
@@ -87,6 +88,16 @@ export interface LoginOptions {
credentials?: Credentials;
}
+export interface RealmConfig {
+ colors?: TemplateResult;
+ logo?: HTMLTemplateElement | string;
+ logoMobile?: HTMLTemplateElement | string;
+ language?: string;
+}
+export interface RealmConfigs {
+ [key: string]: RealmConfig
+}
+
export interface ManagerConfig {
managerUrl: string;
keycloakUrl?: string;
@@ -103,6 +114,7 @@ export interface ManagerConfig {
loadDescriptors?: boolean;
loadTranslations?: string[];
translationsLoadPath?: string;
+ realmConfigs?: RealmConfigs;
configureTranslationsOptions?: (i18next: i18next.InitOptions) => void;
}
@@ -473,7 +485,7 @@ export class Manager implements EventProviderFactory {
if (normalisedConfig.clientId === undefined) {
normalisedConfig.clientId = "openremote";
}
-
+
return normalisedConfig;
}
@@ -549,7 +561,6 @@ export class Manager implements EventProviderFactory {
// if (success) {
// success = await this.doEventsSubscriptionInit();
// }
-
if (success) {
this._ready = true;
this._emitEvent(OREvent.READY);
@@ -604,7 +615,6 @@ export class Manager implements EventProviderFactory {
// Look for language preference in local storage
const language = await this.console.retrieveData("LANGUAGE");
-
const initOptions: i18next.InitOptions = {
lng: language,
fallbackLng: "en",
diff --git a/ui/component/or-header/src/style.ts b/ui/component/or-header/src/style.ts
index e8f63714d..574d931c5 100644
--- a/ui/component/or-header/src/style.ts
+++ b/ui/component/or-header/src/style.ts
@@ -51,10 +51,6 @@ export const style = css`
z-index: 9999999;
}
- slot {
- display: flex;
- }
-
.shadow {
-webkit-box-shadow: ${unsafeCSS(DefaultBoxShadowBottom)};
-moz-box-shadow: ${unsafeCSS(DefaultBoxShadowBottom)};
@@ -105,6 +101,10 @@ export const style = css`
display: none;
}
+ #desktop-right slot {
+ display: flex;
+ }
+
#mobile-bottom {
margin-top: 20px;
}
@@ -152,9 +152,9 @@ export const style = css`
line-height: var(--internal-or-header-height);
}
- /* Wide layout: when the viewport width is bigger than 640px, layout
+ /* Wide layout: when the viewport width is bigger than 780px, layout
changes to a wide layout. */
- @media (min-width: 640px) {
+ @media (min-width: 780px) {
#logo {
margin: var(--internal-or-header-logo-margin);