From a5ad843da8ef997c9fd3c36bc2ea0aee87d9dbee Mon Sep 17 00:00:00 2001 From: afeenster Date: Fri, 2 Apr 2021 12:29:42 -0700 Subject: [PATCH] Simple improvements acknowledging comments. --- .../main/webapp/components/ModelNavigator.jsx | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/serving/central/src/main/webapp/components/ModelNavigator.jsx b/serving/central/src/main/webapp/components/ModelNavigator.jsx index c4a26426343..f5b43078c8b 100644 --- a/serving/central/src/main/webapp/components/ModelNavigator.jsx +++ b/serving/central/src/main/webapp/components/ModelNavigator.jsx @@ -98,7 +98,7 @@ export default function ModelNavigator(props) { const modelZooData = useFetch(URL); const [model, setModel] = useState(null); - const [modelList, setModelList] = useState([]); + const [modelList, setModelList] = useState(modelZooData); const [nameValue, setNameValue] = useState(''); const [applicationValue, setApplicationValue] = useState(''); const [versionValue, setVersionValue] = useState(''); @@ -190,7 +190,7 @@ export default function ModelNavigator(props) { - + @@ -199,16 +199,26 @@ export default function ModelNavigator(props) { defaultCollapseIcon={} defaultExpandIcon={} > - -
- {modelList.map(application => ( - console.log(application), - application.map((model) => ( - setModel(model)}> - - )) - ))} -
+ {nameValue != '' || versionValue!='' || applicationValue!='' + ?
+ { + modelList.map(application => ( + application.map((model) => ( + setModel(model)}> + + )) + ))} +
+ : + modelZooData.map((application) => ( + + {application.models.map((model) => ( + setModel(model)}> + + ))} + + )) + }