+
= (props) => {
{...props}
>
= (props) => {
// and change 'job' key to 'session'
location.pathname.split('/')[1] === 'session' ? 'job' : '',
]}
- items={
- // TODO: add plugin menu
- currentUserRole === 'superadmin'
- ? [
- ...generalMenu,
- {
- type: 'group',
- label: (
-
- {!props.collapsed && (
-
- {t('webui.menu.Administration')}
-
- )}
-
- ),
- children: [...adminMenu, ...superAdminMenu],
- },
- ]
- : currentUserRole === 'admin'
- ? [
- ...generalMenu,
- {
- type: 'group',
- label: (
-
- {!props.collapsed && (
-
- {t('webui.menu.Administration')}
-
- )}
-
- ),
- children: [...adminMenu],
- },
- ]
- : [...generalMenu]
- }
- /**
- * Etc menu
- */
- // {
- // label: '404',
- // icon: ,
- // key: '404',
- // },
- // ]}
- onClick={({ key, keyPath }) => {
- webuiNavigate('/' + keyPath.join('/'));
- }}
+ items={generalMenu}
/>
+ {(currentUserRole === 'superadmin' || currentUserRole === 'admin') && (
+
+
+ {!props.collapsed && (
+
+ {t('webui.menu.Administration')}
+
+ )}
+
+ ),
+ children: [...adminMenu, ...superAdminMenu],
+ },
+ ]
+ : currentUserRole === 'admin'
+ ? [
+ {
+ type: 'group',
+ label: (
+
+ {!props.collapsed && (
+
+ {t('webui.menu.Administration')}
+
+ )}
+
+ ),
+ children: [...adminMenu],
+ },
+ ]
+ : []
+ }
+ />
+
+ )}
);
};
-export default WebUISider;
+
+const WebUISiderWithCustomTheme: React.FC
= (props) => {
+ const themeConfig = useCustomThemeConfig();
+ const config = useContext(ConfigProvider.ConfigContext);
+ const isParentDark = config.theme?.algorithm === theme.darkAlgorithm;
+
+ const shouldReverse =
+ (isParentDark && themeConfig.sider?.theme === 'light') ||
+ (!isParentDark && themeConfig.sider?.theme === 'dark');
+
+ return shouldReverse ? (
+
+
+
+ ) : (
+
+ );
+};
+
+export default WebUISiderWithCustomTheme;
diff --git a/resources/theme.json b/resources/theme.json
index 252f4e58df..1b2c28a8b9 100644
--- a/resources/theme.json
+++ b/resources/theme.json
@@ -5,7 +5,9 @@
"fontFamily": "'Ubuntu', Roboto, sans-serif",
"colorPrimary": "#FF7A00",
"colorLink": "#FF7A00",
- "colorText": "#141414"
+ "colorText": "#141414",
+ "colorInfo": "#028DF2",
+ "colorError": "#FF4D4F"
},
"components": {
"Tag": {
@@ -18,6 +20,9 @@
"lightSiderBg": "#FFF",
"siderBg": "#141414",
"headerBg": "#FF9729"
+ },
+ "Divider": {
+ "colorSplit": "#D9D9D9"
}
}
},
@@ -26,7 +31,9 @@
"fontFamily": "'Ubuntu', Roboto, sans-serif",
"colorPrimary": "#DC6B03",
"colorLink": "#DC6B03",
- "colorText": "#FFF"
+ "colorText": "#FFF",
+ "colorInfo": "#009BDD",
+ "colorError": "#DC4446"
},
"components": {
"Tag": {
@@ -43,21 +50,17 @@
}
},
"logo": {
- "src": "/manifest/backend.ai-text.svg",
- "srcCollapsed": "/manifest/backend.ai-brand-simple.svg",
- "srcDark": "/manifest/backend.ai-text-bgdark.svg",
- "srcCollapsedDark": "/manifest/backend.ai-brand-simple-bgdark.svg",
+ "src": "/manifest/backend.ai-webui-white.svg",
+ "srcCollapsed": "/manifest/backend.ai-brand-simple-white.svg",
+ "srcDark": "/manifest/backend.ai-webui-black.svg",
+ "srcCollapsedDark": "/manifest/backend.ai-brand-simple-black.svg",
"logoTitle": "WebUI",
"logoTitleCollapsed": "WebUI",
"alt": "Backend.AI Logo",
"href": "/summary",
- "size": {
- "width": 191,
- "height": 32
- },
"sizeCollapsed": {
- "width": 48,
- "height": 32
+ "width": 34,
+ "height": 34
}
},
"sider": {