From 1f9b67681eee7ae37a4d1261561fe618f1e8dc4f Mon Sep 17 00:00:00 2001 From: Sungjin Lee Date: Mon, 30 Sep 2024 02:26:01 +0000 Subject: [PATCH] Dashboard UI design update - Added a sidebar and moved the navigation dropdown menu to the sidebar - Added titles to each page - Updated table design - Changed button colors ISSUE-ID: AIMLFW-162 Change-Id: Ic1b3244fa6ce0f2009cc9bafd200f96c416cfe0a Signed-off-by: Sungjin Lee --- src/App.css | 57 +++++++++++++++++++++---- src/components/button/theme-toggle-button.js | 2 +- src/components/home/HomePage.js | 11 +++++ src/components/home/pipelines/UploadPipeline.js | 6 ++- src/components/home/status/ListFeatureGroup.js | 8 ++-- src/components/home/status/StatusPageRows.js | 15 ++++--- src/components/index.js | 1 + src/components/navigation/navigation-bar.css | 19 +++++---- src/components/navigation/navigation-bar.js | 5 --- src/components/sidebar/index.js | 1 + src/components/sidebar/sidebar.css | 32 ++++++++++++++ src/components/sidebar/sidebar.js | 24 +++++++++++ 12 files changed, 148 insertions(+), 33 deletions(-) create mode 100644 src/components/sidebar/index.js create mode 100644 src/components/sidebar/sidebar.css create mode 100644 src/components/sidebar/sidebar.js diff --git a/src/App.css b/src/App.css index 15dd0a6..5efc4c2 100644 --- a/src/App.css +++ b/src/App.css @@ -20,23 +20,56 @@ text-align: initial; } +.content { + background-color: #edf2f5; + flex-grow: 1; + height: calc(100vh - 100px); + padding-left: calc(var(--bs-gutter-x)* 1.5) !important; + padding-right: calc(var(--bs-gutter-x)* 1.5) !important; +} + +.table-responsive { + background-color: white; + padding: 30px; + margin-top: 20px; + border-radius: 20px; + max-height: calc(100vh - 310px); +} + +.table { + margin: 0 !important; +} + +.table > thead > tr th:first-child { + border-top-left-radius: 30px; + border-bottom-left-radius: 30px; +} + +.table > thead > tr th:last-child { + border-top-right-radius: 30px; + border-bottom-right-radius: 30px; +} + .table > thead > tr > th { - background-color: rgb(41, 107, 250); + background-color: #f3f7fd; text-align: center; - outline-style: initial; - border-bottom-width: thick; - color: white; - /*font-family: "Times New Roman", Times, serif;*/ + border: none; + color: #333; + font-weight: bold; + padding: 12px; } .table td { text-align: center; - vertical-align: baseline; + vertical-align: middle; + padding: 1em 1em !important; + color: #333; + font-size: 14px; } .status-buttons { color: rgb(94, 83, 83); - background-color: #4caf50; + background-color: #6282F6; } .create-tab { @@ -106,8 +139,16 @@ body[data-bs-theme='dark'] .App { color: var(--bs-body-color); } +body[data-bs-theme='dark'] .content { + background-color: #1a1a1a; +} + +body[data-bs-theme='dark'] .table-responsive { + background-color: var(--bs-body-bg); +} + body[data-bs-theme='dark'] .table > thead > tr > th { - background-color: var(--bs-table-bg); + background-color: #1a1a1a; color: var(--bs-table-color); } diff --git a/src/components/button/theme-toggle-button.js b/src/components/button/theme-toggle-button.js index d1c65c4..195d16f 100644 --- a/src/components/button/theme-toggle-button.js +++ b/src/components/button/theme-toggle-button.js @@ -2,7 +2,7 @@ import { Button } from 'react-bootstrap'; export const ThemeToggleButton = ({ theme, toggleTheme }) => { return ( - ); diff --git a/src/components/home/HomePage.js b/src/components/home/HomePage.js index 9921e3b..8b2db80 100644 --- a/src/components/home/HomePage.js +++ b/src/components/home/HomePage.js @@ -17,6 +17,7 @@ // ================================================================================== import React from 'react'; +import { Container, Row, Col } from 'react-bootstrap'; import CreateTrainingJob from './create/CreateTrainingJob'; import StatusPageRows from './status/StatusPageRows'; import UploadPipelineForm from './pipelines/UploadPipeline'; @@ -24,6 +25,7 @@ import CreateFeatureGroup from './create/CreateFeatureGroup'; import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import ListFeatureGroup from './status/ListFeatureGroup'; import { NavigationBar } from '../navigation'; +import { Sidebar } from '../sidebar'; import { debug_var } from '../../states'; var DEBUG = debug_var === 'true'; @@ -39,6 +41,12 @@ class HomePage extends React.Component { <> + + + + + + } /> @@ -47,6 +55,9 @@ class HomePage extends React.Component { } /> } /> + + + ); diff --git a/src/components/home/pipelines/UploadPipeline.js b/src/components/home/pipelines/UploadPipeline.js index db20d2d..c82aee9 100644 --- a/src/components/home/pipelines/UploadPipeline.js +++ b/src/components/home/pipelines/UploadPipeline.js @@ -133,6 +133,8 @@ class UploadPipelineForm extends React.Component { render() { return ( <> +

Training Function

+
-
@@ -157,7 +159,7 @@ class UploadPipelineForm extends React.Component { - +
diff --git a/src/components/home/status/ListFeatureGroup.js b/src/components/home/status/ListFeatureGroup.js index f9eec18..f02123f 100644 --- a/src/components/home/status/ListFeatureGroup.js +++ b/src/components/home/status/ListFeatureGroup.js @@ -164,13 +164,15 @@ const ListFeatureGroup = props => { ); return ( <> - {' '} - {' '} - + {headerGroups.map(headerGroup => ( diff --git a/src/components/home/status/StatusPageRows.js b/src/components/home/status/StatusPageRows.js index 6c13d72..a1df12b 100644 --- a/src/components/home/status/StatusPageRows.js +++ b/src/components/home/status/StatusPageRows.js @@ -184,7 +184,8 @@ const StatusPageRows = props => { Cell: ({ row }) => { return ( {' '} - {' '} - {' '} - {' '} - + {headerGroups.map(headerGroup => ( diff --git a/src/components/index.js b/src/components/index.js index df7d721..d2d7b19 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,5 +1,6 @@ export * from './button'; export * from './navigation'; +export * from './sidebar'; export * from './checkbox'; export * from './popup'; export * from './steps-state'; diff --git a/src/components/navigation/navigation-bar.css b/src/components/navigation/navigation-bar.css index 4a85961..7536f87 100644 --- a/src/components/navigation/navigation-bar.css +++ b/src/components/navigation/navigation-bar.css @@ -16,7 +16,16 @@ ================================================================================== */ .nav-bar { - margin-bottom: 5px; + padding: 30px 0px !important; +} + +.nav-bar .container { + max-width: calc(100vw - 120px); + font-weight: bold; +} + +.nav-bar .container a{ + color: black; } .nav-drop-down { @@ -27,13 +36,7 @@ width: 130px; } -body[data-bs-theme='light'] .custom-navbar { - background-color: rgb(41, 107, 250); - color: white; -} - -body[data-bs-theme='dark'] .custom-navbar { - background-color: #1a1a1a; +body[data-bs-theme='dark'] .nav-bar .container a { color: white; } diff --git a/src/components/navigation/navigation-bar.js b/src/components/navigation/navigation-bar.js index 27058c4..2042766 100644 --- a/src/components/navigation/navigation-bar.js +++ b/src/components/navigation/navigation-bar.js @@ -13,11 +13,6 @@ export const NavigationBar = () => { AI/ML Management Dashboard diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js new file mode 100644 index 0000000..b2ba9a4 --- /dev/null +++ b/src/components/sidebar/index.js @@ -0,0 +1 @@ +export * from './sidebar'; diff --git a/src/components/sidebar/sidebar.css b/src/components/sidebar/sidebar.css new file mode 100644 index 0000000..02f10cf --- /dev/null +++ b/src/components/sidebar/sidebar.css @@ -0,0 +1,32 @@ +.sidebar-link { + display: block; + padding: 20px; + margin-bottom: 20px; + color: black; + text-decoration: none; + font-weight: bold; +} + +.sidebar-link:hover { + background-color: #ddd; + border-radius: 5px; +} + +.active { + background-color: #6282f6 !important; + color: white; + border-radius: 5px; +} + +body[data-bs-theme='dark'] .sidebar-link { + color: white; +} + +body[data-bs-theme='dark'] .sidebar-link:hover { + background-color: #1a1a1a; + color: white; +} + +body[data-bs-theme='dark'] .active { + background-color: #42434e !important; +} diff --git a/src/components/sidebar/sidebar.js b/src/components/sidebar/sidebar.js new file mode 100644 index 0000000..5c0c091 --- /dev/null +++ b/src/components/sidebar/sidebar.js @@ -0,0 +1,24 @@ +import React from 'react'; +import { Row, Col } from 'react-bootstrap'; +import 'bootstrap-icons/font/bootstrap-icons.css'; +import './sidebar.css'; + +export const Sidebar = () => { + const isActive = (path) => location.pathname === path ? 'active' : ''; + + return ( + + + + Training Jobs + + + Training Function + + + Feature Group + + + + ); +}; \ No newline at end of file -- 2.16.6