Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 16ee740

Browse files
author
noah
committed
Add the activities view
1 parent 21de3b2 commit 16ee740

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

ui/src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Repo from "./views/repo"
1010
import Deployment from "./views/deployment"
1111
import Settings from "./views/settings"
1212
import Members from "./views/members"
13+
import Activities from "./views/Activities"
1314

1415
function App(): JSX.Element {
1516
return (
@@ -31,6 +32,9 @@ function App(): JSX.Element {
3132
<Route path="/members">
3233
<Members />
3334
</Route>
35+
<Route path="/activities">
36+
<Activities />
37+
</Route>
3438
<Route path="/">
3539
<Home />
3640
</Route>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Form, DatePicker, Button, Switch } from "antd"
2+
import moment from "moment"
3+
4+
interface SearchActivitiesProps {
5+
onChangePeriod(start: moment.Moment, end: moment.Moment): void
6+
onClickSearch(): void
7+
}
8+
9+
export default function SearchActivities(props: SearchActivitiesProps): JSX.Element {
10+
return (
11+
<Form
12+
layout="inline"
13+
>
14+
<Form.Item label="Period" required>
15+
<DatePicker.RangePicker
16+
format="YYYY-MM-DD HH:mm"
17+
showTime={{
18+
showSecond: false,
19+
defaultValue: [moment().hour(0).minute(0), moment().hour(23).minute(59)],
20+
}}
21+
onChange={(_, dateStrings) => props.onChangePeriod(moment(dateStrings[0]), moment(dateStrings[1])) }
22+
/>
23+
</Form.Item>
24+
<Form.Item label="Production">
25+
<Switch size="small" />
26+
</Form.Item>
27+
<Form.Item >
28+
<Button type="primary" onClick={props.onClickSearch}>Search</Button>
29+
</Form.Item>
30+
</Form>
31+
)
32+
}

ui/src/views/Activities.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Helmet } from "react-helmet"
2+
3+
import Main from "./Main"
4+
import SearchActivities from "../components/SearchActivities"
5+
import ActivityLogs from "../components/ActivityLogs"
6+
import Pagination from "../components/Pagination"
7+
8+
export default function Activities(): JSX.Element {
9+
return (
10+
<Main>
11+
<Helmet>
12+
<title>Activities</title>
13+
</Helmet>
14+
<h1>Activities</h1>
15+
<div style={{marginTop: 30}}>
16+
<h2>Search</h2>
17+
<SearchActivities
18+
onChangePeriod={() => console.log("period")}
19+
onClickSearch={() => console.log("search")}
20+
/>
21+
</div>
22+
<div style={{marginTop: 30}}>
23+
<ActivityLogs deployments={[]}/>
24+
</div>
25+
<div style={{marginTop: 30, textAlign: "center"}}>
26+
<Pagination page={0} isLast={true} onClickPrev={() => {console.log('')}} onClickNext={() => {console.log('')}} />
27+
</div>
28+
</Main>
29+
)
30+
}

0 commit comments

Comments
 (0)