From 4383cd2e4eafbff4cb0253df4e3c4b3bd870b58e Mon Sep 17 00:00:00 2001 From: Hongyuan Ma Date: Mon, 18 Jun 2018 11:39:42 +0800 Subject: [PATCH] update basic-table --- front-end/src/page/status/index.jsx | 55 +-------------- front-end/src/util/basic-table/index.jsx | 90 ++++++++++++------------ 2 files changed, 48 insertions(+), 97 deletions(-) diff --git a/front-end/src/page/status/index.jsx b/front-end/src/page/status/index.jsx index 6067a78..ba3cccd 100644 --- a/front-end/src/page/status/index.jsx +++ b/front-end/src/page/status/index.jsx @@ -1,10 +1,6 @@ import React from 'react'; // import './index.css'; import ResultFilter from 'component/result-filter/index.jsx'; -import ClientBox from 'component/client-box/index.jsx'; -import Pagination from 'util/pagination/index.jsx'; -import RateBar from 'util/rate-bar/index.jsx'; -import TableList from 'util/table-list/index.jsx'; import BasicTable from 'util/basic-table/index.jsx'; import Record from 'service/record-service.jsx' import PGUtil from 'util/util.jsx' @@ -103,51 +99,6 @@ class Status extends React.Component { display: show }; - let listBody = this.state.list.map((machine, index) => { - let info = machine.machine_info[0]; - let info_str = info.os_name + ' ' + info.os_version + ' ' + info.comp_name + ' ' + info.comp_version; - let client_max = machine.client_max_num - return ( - - - - {info.alias} - - {info_str} - - -
- 1 - 2 - 4 -
- - - - {/**/} - {/*1-2*/} - {/*1-3*/} - {/*1-4*/} - {/*1-5*/} - - - - {machine.clients} - {/**/} - {/*1-2*/} - {/*1-3*/} - {/*1-4*/} - {/*1-5*/} - - - - {/*

{machine.mark}

*/} - - {new Date().toDateString()} - - ); - }); - return (

status page

@@ -161,9 +112,9 @@ class Status extends React.Component { - - {listBody} - + {/**/} + {/*{listBody}*/} + {/**/} {/**/} diff --git a/front-end/src/util/basic-table/index.jsx b/front-end/src/util/basic-table/index.jsx index 493528d..e26d3c6 100644 --- a/front-end/src/util/basic-table/index.jsx +++ b/front-end/src/util/basic-table/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Icon, Table, Menu, Message } from 'semantic-ui-react' +import {Icon, Table, Menu, Message} from 'semantic-ui-react' import './index.css'; // general basic table @@ -13,7 +13,42 @@ class BasicTable extends React.Component { render() { - let list = this.props.list + let _list = this.props.list + let listBody = _list.map((record, index) => { + let machine = record.machine_info[0]; + let system = machine.os_name + ' ' + machine.os_version + ' ' + machine.comp_name + ' ' + machine.comp_version; + let alias = machine.alias; + let branch = record.pg_info.pg_branch; + + let trend = record.trend + return ( + + + {/*alias*/} + {alias} + + {/*system*/} + {system} + + {/*branch*/} + {branch} + + {/*trending-data*/} + + {trend.improved} + + + {trend.quo} + + + {trend.regressive} + + + {/*date*/} + {new Date().toDateString()} + + ); + }); return ( @@ -22,68 +57,33 @@ class BasicTable extends React.Component { AliasSystemBranch - read only - read & write + TrendingDate - 1 client - 2 clients - 4 clients - - 1 client - 2 clients - 4 clients + improved + quo + regressive - {/**/} - {/*1 clients*/} - {/*2 clients*/} - {/*4 clients*/} - {/**/} + - - {/*alias*/} - Cabbage - - {/*system*/} - Ubuntu 16 x86_64 - - {/*branch*/} - REL9_6_STABLE - - {/*rw-data*/} - - - - - - - {/*rw-data*/} - - - - - - - {/*date*/} - {new Date().toDateString()} - + {listBody} - + 1 2 3 4 - + -- 2.39.5