-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from tapis-project/task/TUI-365--ML-Hub-dashb…
…oard TUI 365 Dashboard for ML Hub
- Loading branch information
Showing
15 changed files
with
243 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.card-container { | ||
margin-top: 8px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.card { | ||
width: 25em; | ||
margin-right: 1em; | ||
margin-bottom: 1em; | ||
} | ||
|
||
.card-header { | ||
display: flex; | ||
justify-content: baseline; | ||
div { | ||
display: flex; | ||
justify-content: center; | ||
align-content: center; | ||
flex-direction: column; | ||
} | ||
} | ||
|
||
.card-footer { | ||
display: flex; | ||
justify-content: space-between; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { Icon } from 'tapis-ui/_common'; | ||
import { | ||
Card, | ||
CardHeader, | ||
CardBody, | ||
CardTitle, | ||
CardFooter, | ||
CardText, | ||
} from 'reactstrap'; | ||
import styles from './Dashboard.module.scss'; | ||
|
||
type DashboardCardProps = { | ||
icon: string; | ||
link: string; | ||
name: string; | ||
text: string; | ||
}; | ||
|
||
const DashboardCard: React.FC<DashboardCardProps> = ({ | ||
icon, | ||
link, | ||
name, | ||
text, | ||
}) => { | ||
return ( | ||
<Card className={styles.card}> | ||
<CardHeader> | ||
<div className={styles['card-header']}> | ||
<div> | ||
<Icon name={icon} className="dashboard__card-icon" /> | ||
</div> | ||
<div>{name}</div> | ||
</div> | ||
</CardHeader> | ||
<CardBody> | ||
<CardTitle tag="h5"></CardTitle> | ||
<CardText>{text}</CardText> | ||
</CardBody> | ||
<CardFooter className={styles['card-footer']}> | ||
<Link to={link}>Go to {name}</Link> | ||
<Icon name="push-right" /> | ||
</CardFooter> | ||
</Card> | ||
); | ||
}; | ||
|
||
const Dashboard: React.FC = () => { | ||
return ( | ||
<div id="dashboard"> | ||
<div id="dashboard-cards" className={styles['card-container']}> | ||
<DashboardCard | ||
icon="simulation" | ||
name="Models Hub" | ||
text="View available ML models" | ||
link="/ml-hub/models" | ||
/> | ||
<DashboardCard | ||
icon="search-folder" | ||
name="Datasets Hub" | ||
text="View available Datasets" | ||
link="/ml-hub/datasets" | ||
/> | ||
<DashboardCard | ||
icon="multiple-coversation" | ||
name="Inference Server" | ||
text="View available inference server for ML models" | ||
link="/ml-hub/inference" | ||
/> | ||
<DashboardCard | ||
icon="data-processing" | ||
name="Training Engine" | ||
text="View ML model training jobs" | ||
link="/ml-hub/training" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Dashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Dashboard } from './Dashboard'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.breadcrumbs { | ||
text-transform: none; | ||
font-size: 1em; | ||
line-height: 1.8em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { Router } from '../_Router'; | ||
import { | ||
PageLayout, | ||
LayoutBody, | ||
LayoutHeader, | ||
Breadcrumbs, | ||
} from 'tapis-ui/_common'; | ||
import { useLocation } from 'react-router'; | ||
import breadcrumbsFromPathname from 'tapis-ui/_common/Breadcrumbs/breadcrumbsFromPathname'; | ||
import styles from './Layout.module.scss'; | ||
import { Menu } from '../_components'; | ||
|
||
const Layout: React.FC = () => { | ||
const { pathname } = useLocation(); | ||
const crumbs = breadcrumbsFromPathname(pathname).splice(1); | ||
const header = ( | ||
<div> | ||
<LayoutHeader> | ||
<div className={styles.breadcrumbs}> | ||
<Breadcrumbs | ||
breadcrumbs={[{ text: 'ML Hub', to: '/ml-hub' }, ...crumbs]} | ||
truncate={false} | ||
/> | ||
</div> | ||
</LayoutHeader> | ||
<Menu /> | ||
</div> | ||
); | ||
|
||
const body = ( | ||
<LayoutBody> | ||
<Router /> | ||
</LayoutBody> | ||
); | ||
|
||
return <PageLayout top={header} right={body} />; | ||
}; | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default } from './Layout'; | ||
// export { Router as default } from './Router'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { Route, useRouteMatch, Switch } from 'react-router-dom'; | ||
import { Dashboard } from '../Dashboard'; | ||
|
||
const Router: React.FC = () => { | ||
const { path } = useRouteMatch(); | ||
return ( | ||
<Switch> | ||
<Route path={`${path}`} exact> | ||
<Dashboard /> | ||
</Route> | ||
</Switch> | ||
); | ||
}; | ||
|
||
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Router } from './Router'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.nav-item { | ||
margin-right: 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { Navbar, Nav, NavItem, Collapse, Button } from 'reactstrap'; | ||
import { Link } from 'react-router-dom'; | ||
import { Icon } from 'tapis-ui/_common'; | ||
import styles from './Menu.module.scss'; | ||
|
||
const Menu: React.FC = () => { | ||
return ( | ||
<Navbar color="light" light expand={true}> | ||
<Collapse isOpen={true} navbar> | ||
<Nav className="me-auto" navbar> | ||
<NavItem className={styles['nav-item']}> | ||
<Link to="/ml-hub"> | ||
<Button> | ||
<Icon name="dashboard"></Icon> Dashboard | ||
</Button> | ||
</Link> | ||
</NavItem> | ||
<NavItem className={styles['nav-item']}> | ||
<Link to="/ml-hub/models"> | ||
<Button> | ||
<Icon name="simulation"></Icon> Models | ||
</Button> | ||
</Link> | ||
</NavItem> | ||
<NavItem className={styles['nav-item']}> | ||
<Link to="/ml-hub/datasets"> | ||
<Button> | ||
<Icon name="search-folder"></Icon> Datasets | ||
</Button> | ||
</Link> | ||
</NavItem> | ||
<NavItem className={styles['nav-item']}> | ||
<Link to="/ml-hub/inference"> | ||
<Button> | ||
<Icon name="multiple-coversation"></Icon> Inference | ||
</Button> | ||
</Link> | ||
</NavItem> | ||
<NavItem className={styles['nav-item']}> | ||
<Link to="/ml-hub/training"> | ||
<Button> | ||
<Icon name="data-processing"></Icon> Training | ||
</Button> | ||
</Link> | ||
</NavItem> | ||
</Nav> | ||
</Collapse> | ||
</Navbar> | ||
); | ||
}; | ||
|
||
export default Menu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Menu } from './Menu'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Menu } from './Menu'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './_Layout'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters