Skip to content

Commit

Permalink
Merge branch 'dev' into lacchain
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier506 committed Apr 27, 2021
2 parents 1e882bd + f5f2001 commit 4295c15
Show file tree
Hide file tree
Showing 16 changed files with 548 additions and 229 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push-lacchain-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
# Webapp
PORT: '80'
REACT_APP_TTILE: 'LACChain Network Dashboard'
REACT_APP_TITLE: 'LACChain Network Dashboard'
REACT_APP_DEFAULT_PRODUCER_LOGO: 'https://latamlink.io/images/latamlink_logo-header.svg'
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
INGRESS_GRAPHQL_HOST: dashboard-graphql.latamlink.io
# Webapp
PORT: '80'
REACT_APP_TTILE: 'LACChain Network Dashboard'
REACT_APP_TITLE: 'LACChain Network Dashboard'
REACT_APP_DEFAULT_PRODUCER_LOGO: 'https://latamlink.io/images/latamlink_logo-header.svg'
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-master-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
# Webapp
PORT: "80"
REACT_APP_TTILE: "EOS Mainnet Network Dashboard"
REACT_APP_TITLE: "EOS Mainnet Network Dashboard"
REACT_APP_DEFAULT_PRODUCER_LOGO: "https://bloks.io/img/eosio.png"
REACT_APP_EOS_RATE_LINK: "https://eosrate.io"
REACT_APP_USE_REWARDS: "true"
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
INGRESS_GRAPHQL_HOST: graphql-mainnet.eosio.cr
# Webapp
PORT: "80"
REACT_APP_TTILE: "EOS Mainnet Network Dashboard"
REACT_APP_TITLE: "EOS Mainnet Network Dashboard"
REACT_APP_DEFAULT_PRODUCER_LOGO: "https://bloks.io/img/eosio.png"
REACT_APP_EOS_RATE_LINK: "https://eosrate.io"
REACT_APP_USE_REWARDS: "true"
Expand Down
1 change: 1 addition & 0 deletions hapi/src/services/state-history-plugin.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const handleBlocksResult = async data => {
this_block: data.this_block,
prev_block: data.prev_block
}

await saveBlockHistory({
producer: block.producer,
schedule_version: block.schedule_version,
Expand Down
14 changes: 14 additions & 0 deletions hasura/metadata/tables.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
- table:
schema: public
name: block_history
select_permissions:
- role: guest
permission:
columns:
- id
- block_id
- block_num
- transactions_length
- timestamp
- created_at
- updated_at
- producer
- schedule_version
filter: {}
- table:
schema: public
name: block_history_by_producer_type
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/configmap-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
data:
# webapp
PORT: "${PORT}"
REACT_APP_TTILE: "${REACT_APP_TTILE}"
REACT_APP_TITLE: "${REACT_APP_TITLE}"
REACT_APP_DEFAULT_PRODUCER_LOGO: "${REACT_APP_DEFAULT_PRODUCER_LOGO}"
REACT_APP_EOS_RATE_LINK: "${REACT_APP_EOS_RATE_LINK}"
REACT_APP_USE_REWARDS: "${REACT_APP_USE_REWARDS}"
Expand Down
37 changes: 35 additions & 2 deletions webapp/src/components/TransactionsLineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { makeStyles } from '@material-ui/styles'
import { useTheme } from '@material-ui/core/styles'
import Divider from '@material-ui/core/Divider'
import { useTranslation } from 'react-i18next'
import Skeleton from '@material-ui/lab/Skeleton'
import PropTypes from 'prop-types'
import {
LineChart,
Expand All @@ -24,9 +25,38 @@ const useStyles = makeStyles((theme) => ({
},
description: {
fontWeight: 'normal'
},
graphSkeleton: {
width: '100%',
margin: theme.spacing(1),
'& .MuiSkeleton-rect': {
width: '100%',
height: 300
},
'& .MuiBox-root': {
display: 'flex',
justifyContent: 'center',
'& .MuiSkeleton-text': {
margin: theme.spacing(0, 1)
}
}
}
}))

const GraphSkeleton = () => {
const classes = useStyles()

return (
<Box className={classes.graphSkeleton}>
<Skeleton variant="rect" />
<Box>
<Skeleton width="30%" />
<Skeleton width="30%" />
</Box>
</Box>
)
}

const CustomTooltip = ({ active, payload }) => {
const classes = useStyles()
const { t } = useTranslation('transactionsChartComponent')
Expand Down Expand Up @@ -72,10 +102,12 @@ CustomTooltip.propTypes = {
payload: PropTypes.array
}

const TransactionsChart = ({ data }) => {
const TransactionsChart = ({ data, loading }) => {
const theme = useTheme()
const { t } = useTranslation('transactionsChartComponent')

if (loading) return <GraphSkeleton />

return (
<ResponsiveContainer width="100%" maxHeight={300} aspect={1.6}>
<LineChart
Expand Down Expand Up @@ -113,7 +145,8 @@ const TransactionsChart = ({ data }) => {
}

TransactionsChart.propTypes = {
data: PropTypes.array
data: PropTypes.array,
loading: PropTypes.bool
}

export default TransactionsChart
1 change: 1 addition & 0 deletions webapp/src/gql/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './producer.gql'
export * from './setting.gql'
export * from './transaction.gql'
14 changes: 14 additions & 0 deletions webapp/src/gql/transaction.gql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import gql from 'graphql-tag'

export const TRANSACTION_QUERY = gql`
query($date: timestamptz) {
blockHistory: block_history(
where: { timestamp: { _gte: $date } }
order_by: { block_num: desc }
) {
block_id
block_num
transactions_length
}
}
`
9 changes: 8 additions & 1 deletion webapp/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@
"transPerSecond": "Transactions Per Second",
"transPerBlock": "Transactions Per Block",
"transactions": "Transactions",
"transactionsHistory": "Transactions History"
"transactionsHistory": "Transactions History",
"timeFrame": "Time frame",
"pause": "Pause",
"play": "Play",
"Last Hour": "Last Hour",
"Last Day": "Last Day",
"Last Week": "Last Week",
"Last Year": "Last Year"
},
"networkInfoRoute": {
"chainId": "Chain Id",
Expand Down
9 changes: 8 additions & 1 deletion webapp/src/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@
"bpSchedule": "Programa de Productor de Bloque",
"transPerSecond": "Transacciones por Segundo",
"transPerBlock": "Transacciones por Bloque",
"transactionsHistory": "Historial de transacciones"
"transactionsHistory": "Historial de transacciones",
"timeFrame": "Periodo de tiempo",
"pause": "Pausa",
"play": "Play",
"Last Hour": "Última Hora",
"Last Day": "Última Día",
"Last Week": "Última Semana",
"Last Year": "Último Año"
},
"networkInfoRoute": {
"chainId": "Identificador de la cadena",
Expand Down
Loading

0 comments on commit 4295c15

Please sign in to comment.