-
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.
Task/t UI 366 ml hub 100 models (#376)
* changed ML Hub icon on dashboard * Create models landing page - show top 100 models with ID, pipeline_tag, downloads, and last_modified fields * Run prettier and lint * Move icon above link * Match models icon, add ellipsis if name is too long * Match models icon, add ellipsis if name is too long, italicize None if no pipeline_tag --------- Co-authored-by: dhannywi <[email protected]>
- Loading branch information
1 parent
335176b
commit 3cad630
Showing
10 changed files
with
84 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,3 @@ | ||
.model-name-column { | ||
text-overflow: ellipsis; | ||
} |
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,47 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { Models as ModelsModule } from '@tapis/tapis-typescript'; | ||
import { useList } from 'tapis-hooks/ml-hub/models'; | ||
import { Icon } from 'tapis-ui/_common'; | ||
import { QueryWrapper } from 'tapis-ui/_wrappers'; | ||
import { Table } from 'reactstrap'; | ||
import styles from './Models.module.scss'; | ||
|
||
const Models: React.FC = () => { | ||
const { data, isLoading, error } = useList(); | ||
const models: ModelsModule.ModelShortInfo = data?.result ?? {}; | ||
|
||
return ( | ||
<QueryWrapper isLoading={isLoading} error={error}> | ||
<Table responsive striped> | ||
<thead> | ||
<tr> | ||
<th>Model ID</th> | ||
<th>Task</th> | ||
<th>Downloads</th> | ||
<th>Last Modified</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{Object.entries(models).map((model) => ( | ||
<tr> | ||
<td className={`${styles['model-name-column']}`}> | ||
<Icon name="simulation" /> | ||
<span> | ||
<Link to={`/ml-hub/models/${model[0]}`}> {model[0]} </Link> | ||
</span> | ||
</td> | ||
<td> | ||
{model[1].pipeline_tag ? model[1].pipeline_tag : <i>None</i>} | ||
</td> | ||
<td>{model[1].downloads}</td> | ||
<td>{model[1].last_modified}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
</QueryWrapper> | ||
); | ||
}; | ||
|
||
export default Models; |
Empty file.
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,8 @@ | ||
import React from 'react'; | ||
import { Router } from '../_Router'; | ||
|
||
const Layout: React.FC = () => { | ||
return <Router />; | ||
}; | ||
|
||
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 @@ | ||
export { default as Layout } 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { Route, useRouteMatch, Switch } from 'react-router-dom'; | ||
|
||
import { default as Models } from '../Models'; | ||
|
||
const Router: React.FC = () => { | ||
const { path } = useRouteMatch(); | ||
return ( | ||
<Switch> | ||
<Route path={path} exact> | ||
<Models /> | ||
</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 @@ | ||
export { default as Models } from './Models'; |
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