Skip to content

Commit 88ca631

Browse files
Merge pull request #2 from clightning4j/metrics_view
Start to work on the metrics view.
2 parents eff643b + d6bfa68 commit 88ca631

41 files changed

Lines changed: 1936 additions & 230 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.local

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_REST_URL=http://localhost:7001

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Check build in production mode
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
name: Build app
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
- name: Setup Node.js
12+
uses: actions/setup-node@v2
13+
run: |
14+
npm install
15+
npm build

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
2+
*.idea
33
# dependencies
44
/node_modules
55
/.pnp

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/workspace.xml

Lines changed: 0 additions & 84 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# CONTRIBUTING
2+
3+
Contributions are very welcome. When contributing code, please follow these
4+
simple guidelines.
5+
6+
* Make happy Github actions.
7+
* Write properly formatted git commits (see below).
8+
* If you don't know where to start, look to the good first issue, or [open a discussion](https://github.com/clightning4j/JRPClightning/discussions)
9+
10+
Git commits
11+
-----------
12+
A properly formed git commit subject line should always be able to complete the
13+
following sentence:
14+
15+
If applied, this commit will _____
16+
17+
For example, the following message is well formed:
18+
19+
Add support for .gif files
20+
21+
In addition, it should be capitalized and *must not* include a period.
22+
23+
When it comes to formatting, here's a model git commit message[1]:
24+
25+
Capitalized, short (50 chars or less) summary
26+
27+
More detailed explanatory text, if necessary. Wrap it to about 72
28+
characters or so. In some contexts, the first line is treated as the
29+
subject of an email and the rest of the text as the body. The blank
30+
line separating the summary from the body is critical (unless you omit
31+
the body entirely); tools like rebase can get confused if you run the
32+
two together.
33+
34+
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
35+
or "Fixes bug." This convention matches up with commit messages generated
36+
by commands like git merge and git revert.
37+
38+
Further paragraphs come after blank lines.
39+
40+
- Bullet points are okay, too.
41+
42+
- Typically a hyphen or asterisk is used for the bullet, followed by a
43+
single space, with blank lines in between, but conventions vary here.
44+
45+
- Use a hanging indent.
46+
47+
---
48+
49+
[1]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

components/appbar/BasicAppBar.component.jsx

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@ import {
66
Container,
77
IconButton,
88
Toolbar,
9-
Typography
109
} from "@material-ui/core"
1110
import {Menu, Home, PieChart} from "@material-ui/icons"
1211
import theme from '../../theme/DarkTheme'
1312
import Loading from "../genericView/Loading.component"
13+
import Chip from "@material-ui/core/Chip";
14+
import Grid from "@material-ui/core/Grid";
15+
import {ViewName} from "../../pages";
16+
17+
const colorByNetwork = {
18+
"bitcoin": "f2a900",
19+
"testnet": "4d4d4e",
20+
"liquid": "009688",
21+
"litecoin": "",
22+
}
1423

1524
class BasicAppBar extends React.Component {
1625
constructor(props, context) {
@@ -35,26 +44,44 @@ class BasicAppBar extends React.Component {
3544
}
3645

3746
render() {
38-
const {child, value, nameNode, changeValue} = this.props
47+
const {child, value, mappingButton, network, changeValue} = this.props
48+
console.log(mappingButton);
3949
return (
4050
<Container maxWidth="xl">
4151
<AppBar position="sticky" style={{
4252
backgroundColor: theme.palette.background.paper
4353
}}>
4454
<Toolbar>
45-
<IconButton onClick={()=> console.log("Click on menu icon")} disabled={true} edge="start" color="inherit" aria-label="menu">
46-
<Menu />
47-
</IconButton>
48-
<Typography color="textSecondary" variant="h6">
49-
{nameNode}
50-
</Typography>
55+
<Grid justifyContent="space-between"
56+
alignItems="center"
57+
container
58+
>
59+
<Grid item>
60+
<IconButton onClick={() => console.log("Click on menu icon")} disabled={true}
61+
edge="start"
62+
color="inherit" aria-label="menu">
63+
<Menu/>
64+
</IconButton>
65+
</Grid>
66+
<Grid item>
67+
<Chip
68+
label={network}
69+
style={{
70+
background: "#" + colorByNetwork[network],
71+
}}
72+
/>
73+
</Grid>
74+
</Grid>
5175
</Toolbar>
5276
</AppBar>
53-
{this.state.ready ? child : <Loading />}
54-
<Box mb={theme.spacing(2)} />
77+
<Box m={theme.spacing(1)} mb={theme.spacing(2)}>
78+
{this.state.ready ? child : <Loading/>}
79+
</Box>
5580
<AppBar position="fixed" className="navigation-style"
56-
style={{ backgroundColor: theme.palette.background.paper,
57-
top: "auto", bottom: 0}}>
81+
style={{
82+
backgroundColor: theme.palette.background.paper,
83+
top: "auto", bottom: 0
84+
}}>
5885
<BottomNavigation
5986
value={value}
6087
onChange={(event, newValue) => {
@@ -63,8 +90,8 @@ class BasicAppBar extends React.Component {
6390
this.loadDom()
6491
}}
6592
>
66-
<BottomNavigationAction label="Home" value="home" icon={<Home/>} />
67-
<BottomNavigationAction disabled={true} label="Metrics" value="metrics" icon={<PieChart/>} />
93+
<BottomNavigationAction label="Home" value={ViewName.HOME} disabled={mappingButton[ViewName.HOME] === false} icon={<Home/>}/>
94+
<BottomNavigationAction label="Metrics" value={ViewName.METRICS} disabled={mappingButton[ViewName.METRICS] === false} icon={<PieChart/>}/>
6895
</BottomNavigation>
6996
</AppBar>
7097
</Container>

components/genericView/Loading.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function Loading({ size = 75 }) {
1010
spacing={0}
1111
direction="column"
1212
alignItems="center"
13-
justify="center"
13+
justifyContent="center"
1414
>
1515
<Grid item xs={3}>
1616
<ReactLoading type="bars"/>

components/genericView/Offline.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Offline({ size = 90 }: { size?: number }) {
77
spacing={0}
88
direction="column"
99
alignItems="center"
10-
justify="center"
10+
justifyContent="center"
1111
>
1212
<Grid item xs={3}>
1313
<Typography variant="h6" style={{ flex: 1 }}>

components/home/Home.component.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,18 @@ export default function HomeView({nodeInfo, show}: ParentProps) {
5656
mapAddress.set(addr.type, addr);
5757
}
5858

59-
60-
6159
return <Grid
6260
container
63-
style={{marginTop: "5em"}}
6461
direction="row"
65-
justify="center"
62+
justifyContent="center"
6663
alignItems="center"
6764
>
6865
<Card>
6966
<CardContent>
7067
<Grid
7168
container
7269
direction="row"
73-
justify="center"
70+
justifyContent="center"
7471
alignItems="center"
7572
>
7673
<Box component="span" m={1}>
@@ -91,7 +88,7 @@ export default function HomeView({nodeInfo, show}: ParentProps) {
9188
</Grid>
9289
<Grid container
9390
direction="row"
94-
justify="center"
91+
justifyContent="center"
9592
alignItems="center">
9693
<FormControl variant="outlined" style={{
9794
margin: theme.spacing(2),
@@ -121,7 +118,7 @@ export default function HomeView({nodeInfo, show}: ParentProps) {
121118
<Grid
122119
container
123120
direction="row"
124-
justify="center"
121+
justifyContent="center"
125122
alignItems="center"
126123
>
127124
<NodeTable show={show}/>

0 commit comments

Comments
 (0)