Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
ybbond2019 committed Feb 5, 2020
1 parent 438b43e commit 89567de
Showing 1 changed file with 84 additions and 64 deletions.
148 changes: 84 additions & 64 deletions src/universal/LogsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,68 +1,88 @@
import React from 'react'
import { Icon, Label, Menu, Table } from 'semantic-ui-react'
import React, { useState } from 'react'
import { Icon, Label, Menu, Table, Input, Button } from 'semantic-ui-react'

const LogsTable = () => (
<Table celled>
<Table.Header>
<Table.Row>
<Table.HeaderCell>scenarioId </Table.HeaderCell>
<Table.HeaderCell>carBuild </Table.HeaderCell>
<Table.HeaderCell>startTime </Table.HeaderCell>
<Table.HeaderCell>runningTime / maxRunningTime </Table.HeaderCell>
<Table.HeaderCell>numberOfStops / maxNumberOfStops </Table.HeaderCell>
<Table.HeaderCell>hasCollision </Table.HeaderCell>
<Table.HeaderCell>doesScenarioPass </Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
</Table.Body>
const LogsTable = () => {

const [scenarioId, setScenarioId] = useState('')
const [carBuild, setCarBuild] = useState('')

console.log(scenarioId, carBuild)
return (
<div>
<Button onClick={() => {
setCarBuild('');
setScenarioId('');
}}>Clean</Button>
<Table celled>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
scenarioId
<br />
<Input value={scenarioId} onChange={(e) => setScenarioId(e.target.value)} focus placeholder='Search...' />
</Table.HeaderCell>
<Table.HeaderCell>
carBuild
<Input value={carBuild} onChange={(e) => setCarBuild(e.target.value)} focus placeholder='Search...' />
</Table.HeaderCell>
<Table.HeaderCell>startTime </Table.HeaderCell>
<Table.HeaderCell>runningTime / maxRunningTime </Table.HeaderCell>
<Table.HeaderCell>numberOfStops / maxNumberOfStops </Table.HeaderCell>
<Table.HeaderCell>hasCollision </Table.HeaderCell>
<Table.HeaderCell>doesScenarioPass </Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
</Table.Body>

<Table.Footer>
<Table.Row>
<Table.HeaderCell colSpan='7'>
<Menu floated='right' pagination>
<Menu.Item as='a' icon>
<Icon name='chevron left' />
</Menu.Item>
<Menu.Item as='a'>1</Menu.Item>
<Menu.Item as='a'>2</Menu.Item>
<Menu.Item as='a'>3</Menu.Item>
<Menu.Item as='a'>4</Menu.Item>
<Menu.Item as='a' icon>
<Icon name='chevron right' />
</Menu.Item>
</Menu>
</Table.HeaderCell>
</Table.Row>
</Table.Footer>
</Table>
</div>)
}

<Table.Footer>
<Table.Row>
<Table.HeaderCell colSpan='7'>
<Menu floated='right' pagination>
<Menu.Item as='a' icon>
<Icon name='chevron left' />
</Menu.Item>
<Menu.Item as='a'>1</Menu.Item>
<Menu.Item as='a'>2</Menu.Item>
<Menu.Item as='a'>3</Menu.Item>
<Menu.Item as='a'>4</Menu.Item>
<Menu.Item as='a' icon>
<Icon name='chevron right' />
</Menu.Item>
</Menu>
</Table.HeaderCell>
</Table.Row>
</Table.Footer>
</Table>
)

export default LogsTable

0 comments on commit 89567de

Please sign in to comment.