diff --git a/app/vmui/packages/vmui/README.md b/app/vmui/packages/vmui/README.md
index 55328dc46..35bb4ad39 100644
--- a/app/vmui/packages/vmui/README.md
+++ b/app/vmui/packages/vmui/README.md
@@ -60,7 +60,7 @@ VMUI can be used to paste into other applications
| Name | Default | Description |
|:------------------------|:-----------:|--------------------------------------------------------------------------------------:|
| serverURL | domain name | Can't be changed from the UI |
-| inputTenantID | - | If the flag is present, the "Tenant ID" field is displayed |
+| useTenantID | - | If the flag is present, the "Tenant ID" select is displayed |
| headerStyles.background | `#FFFFFF` | Header background color |
| headerStyles.color | `#3F51B5` | Header font color |
| palette.primary | `#3F51B5` | used to represent primary interface elements for a user |
@@ -74,7 +74,7 @@ VMUI can be used to paste into other applications
```json
{
"serverURL": "http://localhost:8428",
- "inputTenantID": "true",
+ "useTenantID": true,
"headerStyles": {
"background": "#FFFFFF",
"color": "#538DE8"
@@ -93,7 +93,7 @@ VMUI can be used to paste into other applications
#### HTML example:
```html
-
+
```
diff --git a/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/GlobalSettings.tsx b/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/GlobalSettings.tsx
index 2037c9120..653a1dc57 100644
--- a/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/GlobalSettings.tsx
+++ b/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/GlobalSettings.tsx
@@ -100,9 +100,11 @@ const GlobalSettings: FC<{showTitle?: boolean}> = ({ showTitle }) => {
onChange={setTimezone}
/>
-
-
-
+ {!appModeEnable && (
+
+
+
+ )}
{
+ const { useTenantID } = getAppModeParams();
const { serverUrl } = useAppState();
const [isLoading, setIsLoading] = useState(false);
@@ -13,6 +15,7 @@ export const useFetchAccountIds = () => {
const fetchUrl = useMemo(() => getAccountIds(serverUrl), [serverUrl]);
useEffect(() => {
+ if (!useTenantID) return;
const fetchData = async () => {
setIsLoading(true);
try {
diff --git a/app/vmui/packages/vmui/src/components/Layout/Header/HeaderNav/NavSubItem.tsx b/app/vmui/packages/vmui/src/components/Layout/Header/HeaderNav/NavSubItem.tsx
index f66d6d9ed..19928b3fb 100644
--- a/app/vmui/packages/vmui/src/components/Layout/Header/HeaderNav/NavSubItem.tsx
+++ b/app/vmui/packages/vmui/src/components/Layout/Header/HeaderNav/NavSubItem.tsx
@@ -102,6 +102,7 @@ const NavSubItem: FC = ({
activeMenu={activeMenu}
value={sm.value}
label={sm.label || ""}
+ color={color}
/>
))}
diff --git a/app/vmui/packages/vmui/src/components/Main/ThemeProvider/ThemeProvider.ts b/app/vmui/packages/vmui/src/components/Main/ThemeProvider/ThemeProvider.ts
index b7ec42ba6..75d8be6ca 100644
--- a/app/vmui/packages/vmui/src/components/Main/ThemeProvider/ThemeProvider.ts
+++ b/app/vmui/packages/vmui/src/components/Main/ThemeProvider/ThemeProvider.ts
@@ -1,7 +1,7 @@
import { FC, useEffect, useState } from "preact/compat";
import { getContrastColor } from "../../../utils/color";
import { getCssVariable, isSystemDark, setCssVariable } from "../../../utils/theme";
-import { AppParams, getAppModeParams } from "../../../utils/app-mode";
+import { AppParams, getAppModeEnable, getAppModeParams } from "../../../utils/app-mode";
import { getFromStorage } from "../../../utils/storage";
import { darkPalette, lightPalette } from "../../../constants/palette";
import { Theme } from "../../../types";
@@ -23,6 +23,7 @@ const colorVariables = [
export const ThemeProvider: FC = ({ onLoaded }) => {
+ const appModeEnable = getAppModeEnable();
const { palette: paletteAppMode = {} } = getAppModeParams();
const { theme } = useAppState();
const isDarkTheme = useSystemTheme();
@@ -71,6 +72,8 @@ export const ThemeProvider: FC = ({ onLoaded }) => {
setCssVariable(variable, value);
});
setContrastText();
+
+ if (appModeEnable) setAppModePalette();
};
const updatePalette = () => {
@@ -86,13 +89,18 @@ export const ThemeProvider: FC = ({ onLoaded }) => {
};
useEffect(() => {
- setAppModePalette();
setScrollbarSize();
setTheme();
}, [palette]);
useEffect(updatePalette, [theme, isDarkTheme]);
+ useEffect(() => {
+ if (appModeEnable) {
+ dispatch({ type: "SET_THEME", payload: Theme.light });
+ }
+ }, []);
+
return null;
};
diff --git a/app/vmui/packages/vmui/src/utils/app-mode.ts b/app/vmui/packages/vmui/src/utils/app-mode.ts
index 38fb77afa..c4debdc52 100644
--- a/app/vmui/packages/vmui/src/utils/app-mode.ts
+++ b/app/vmui/packages/vmui/src/utils/app-mode.ts
@@ -1,6 +1,6 @@
export interface AppParams {
serverURL?: string
- inputTenantID?: boolean
+ useTenantID?: boolean
headerStyles?: {
background?: string
color?: string