diff --git a/ui/src/pages/home/index.tsx b/ui/src/pages/home/index.tsx index d55fecf2a1..d5123e22fc 100644 --- a/ui/src/pages/home/index.tsx +++ b/ui/src/pages/home/index.tsx @@ -17,61 +17,65 @@ * under the License. */ -import React, {useState, useEffect} from 'react'; -import {Typography, Divider, BackTop, Spin} from 'antd'; -const {Title, Paragraph, Text} = Typography; -import {getHardwareInfo} from 'Src/api/api'; - -export default function Home(params: any) { - const [hardwareData , setHardwareData] = useState({}); - const getConfigData = function(){ - getHardwareInfo().then(res=>{ - if (res && res.msg === 'success') { - setHardwareData(res.data); - } - }) - .catch(err=>{ - setHardwareData({ - VersionInfo:{}, - HarewareInfo:{}, - }); - }); - }; - function getItems(data, flag){ - let arr = []; - for (const i in data) { - if (flag) { - arr.push( -
- ) - } else { - arr.push( -{i + ' : ' + data[i]}
- ) - } - } - return arr; - } - function createMarkup(key,data) { - return {__html:key + ' : ' + String(data)}; - } - useEffect(() => { - getConfigData(); - }, []); - return( -{i + ' : ' + dt}
+ ) + } + } + return arr; + } + function createMarkup(key,data) { + return {__html:key + ' : ' + String(data)}; + } + useEffect(() => { + getConfigData(); + }, []); + return( +