Skip to content

Commit

Permalink
Merge pull request #1299 from edenia/dev
Browse files Browse the repository at this point in the history
Production Release
  • Loading branch information
xavier506 committed Sep 12, 2023
2 parents d0d3cb5 + eab9ab9 commit 154857b
Show file tree
Hide file tree
Showing 22 changed files with 273 additions and 249 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy-jungle-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
REACT_APP_SYNC_TOLERANCE_INTERVAL: 180000
REACT_APP_TOKEN_SYMBOL: 'EOS'
REACT_APP_NETWORK_URL: '[{"label":"EOS","value":"https://eos.antelope.tools","mainnet":true,"pair":"eos","icon":"eos","order":5},{"label":"Proton","value":"https://proton.antelope.tools","mainnet":true,"pair":"proton","icon":"proton","order":3},{"label":"WAX","value":"https://wax.antelope.tools","mainnet":true,"pair":"wax","icon":"wax","order":4},{"label":"Telos","value":"https://telos.antelope.tools","mainnet":true,"pair":"telos","icon":"telos","order":1},{"label":"Libre","value":"https://libre.antelope.tools","mainnet":true,"pair":"libre","icon":"libre","order":2},{"label":"LACChain EOSIO","value":"https://lacchain.antelope.tools","mainnet":true,"pair":null,"icon":"lacchain","order":6},{"label":"Jungle4 Testnet","value":"https://jungle.antelope.tools","mainnet":false,"pair":"eos","icon":"jungle","order":5},{"label":"Proton Testnet","value":"https://proton-testnet.antelope.tools","mainnet":false,"pair":"proton","icon":"proton","order":3},{"label":"WAX Testnet","value":"https://wax-testnet.antelope.tools","mainnet":false,"pair":"wax","icon":"wax","order":4},{"label":"Telos Testnet","value":"https://telos-testnet.antelope.tools","mainnet":false,"pair":"telos","icon":"telos","order":1},{"label":"Libre Testnet","value":"https://libre-testnet.antelope.tools","mainnet":false,"pair":"libre","icon":"libre","order":2},{"label":"Ultra Testnet","value":"https://ultra-testnet.antelope.tools","mainnet":false,"pair":"ultra","icon":"ultra","order":6}]'
REACT_APP_DISABLED_MENU_ITEMS: '["/missed-blocks","/block-distribution","/cpu-benchmark","/stress-test","/evm","/evm-rpc-endpoints"]'
REACT_APP_DISABLED_MENU_ITEMS: '["/missed-blocks","/block-distribution","/stress-test","/evm","/evm-rpc-endpoints"]'
REACT_APP_BLOCK_EXPLORER_URL: 'https://jungle4.eosq.eosnation.io/tx/(transaction)'
REACT_APP_STATE_HISTORY_ENABLED: 'false'
REACT_APP_GOOGLE_ANALITIC_PAGE_ID: 'G-E6Y0EC9FT8'
Expand Down Expand Up @@ -83,6 +83,7 @@ jobs:
HAPI_EOS_BASE_ACCOUNT: ${{ secrets.HAPI_EOS_BASE_ACCOUNT }}
HAPI_EOS_BASE_ACCOUNT_PASSWORD: ${{ secrets.HAPI_EOS_BASE_ACCOUNT_PASSWORD }}
HAPI_EOS_MECHANICS_ACCOUNT: ${{ secrets.HAPI_EOS_MECHANICS_ACCOUNT }}
HAPI_EOS_MECHANICS_CUSTOM_PERMISSION: 'benchmark'
HAPI_EOS_MECHANICS_PASSWORD: ${{ secrets.HAPI_EOS_MECHANICS_PASSWORD }}
HAPI_EOS_WALLET_URL: http://dashboard-wallet:8888
HAPI_EOS_BP_JSON_ON_CHAIN: false
Expand Down
4 changes: 4 additions & 0 deletions webapp/public/sitemap.jungle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<loc>https://jungle.antelope.tools/undiscoverable-bps</loc>
<lastmod>2023-09-07</lastmod>
</url>
<url>
<loc>https://jungle.antelope.tools/cpu-benchmark</loc>
<lastmod>2023-09-10</lastmod>
</url>
<url>
<loc>https://jungle.antelope.tools/ricardian-contract</loc>
<lastmod>2023-09-07</lastmod>
Expand Down
4 changes: 4 additions & 0 deletions webapp/public/sitemap.proton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<loc>https://proton.antelope.tools/nodes-distribution</loc>
<lastmod>2023-09-07</lastmod>
</url>
<url>
<loc>https://proton.antelope.tools/cpu-benchmark</loc>
<lastmod>2023-09-07</lastmod>
</url>
<url>
<loc>https://proton.antelope.tools/ricardian-contract</loc>
<lastmod>2023-09-07</lastmod>
Expand Down
8 changes: 5 additions & 3 deletions webapp/src/components/CopyToClipboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from './styles'

const useStyles = makeStyles(styles)

const CopyToClipboard = ({ text }) => {
const CopyToClipboard = ({ text, helperText }) => {
const classes = useStyles()
const { t } = useTranslation('copyToClipboardComponent')
const [status, setStatus] = useState('copyToClipboard')
Expand All @@ -21,17 +21,19 @@ const CopyToClipboard = ({ text }) => {

return (
<Tooltip
title={t(status)}
title={helperText ?? t(status)}
arrow
onMouseLeave={() => {
setStatus('copyToClipboard')
}}
arrow
classes={{ popper: classes.tooltip }}
>
<Button
size="small"
variant="outlined"
color="primary"
onClick={copyText}
disabled={!text}
className={classes.icon}
startIcon={<FileCopyOutlinedIcon />}
>
Expand Down
7 changes: 7 additions & 0 deletions webapp/src/components/CopyToClipboard/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ export default (theme) => ({
alignSelf: 'center',
marginBottom: `${theme.spacing(2)} !important`,
},
tooltip: {
maxWidth: '150px',
textAlign: 'center',
'& .MuiTooltip-tooltip': {
fontSize: '0.8em !important',
},
},
})
70 changes: 8 additions & 62 deletions webapp/src/components/EndpointsTable/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { useState } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { useTranslation } from 'react-i18next'
import { makeStyles } from '@mui/styles'
import Button from '@mui/material/Button'
import Table from '@mui/material/Table'
import TableBody from '@mui/material/TableBody'
import TableCell from '@mui/material/TableCell'
Expand All @@ -11,35 +10,22 @@ import TableHead from '@mui/material/TableHead'
import TableRow from '@mui/material/TableRow'
import Typography from '@mui/material/Typography'
import { Tooltip as MUITooltip } from '@mui/material'
import ListAltIcon from '@mui/icons-material/ListAlt'
import { Link as RouterLink } from 'react-router-dom'
import Link from '@mui/material/Link'
import QueryStatsIcon from '@mui/icons-material/QueryStats'

import CopyToClipboard from '../CopyToClipboard'
import HealthCheck from '../HealthCheck'
import HealthCheckInfo from 'components/HealthCheck/HealthCheckInfo'
import HealthCheckInfo from '../HealthCheck/HealthCheckInfo'
import { getStatus } from 'utils'

import styles from './styles'
import Tooltip from '../Tooltip'
import EndpointsTextList from '../EndpointsTextList'

const useStyles = makeStyles(styles)

const EndpointsTable = ({ producers }) => {
const EndpointsTable = ({ producers, textLists }) => {
const classes = useStyles()
const { t } = useTranslation('endpointsListRoute')
const [anchorEl, setAnchorEl] = useState(null)
const [type, setType] = useState('')

const handlePopoverOpen = (target, type) => {
setAnchorEl(target)
setType(type)
}

const handlePopoverClose = () => {
setAnchorEl(null)
}

const CellList = ({ producer, endpointType }) => {
return (
Expand All @@ -65,17 +51,6 @@ const EndpointsTable = ({ producers }) => {

return (
<>
<Tooltip
anchorEl={anchorEl}
open={anchorEl !== null}
onClose={handlePopoverClose}
anchorOrigin={{
vertical: 'top',
horizontal: 'left',
}}
>
<EndpointsTextList type={type} />
</Tooltip>
<TableContainer>
<Table>
<TableHead>
Expand All @@ -84,49 +59,19 @@ const EndpointsTable = ({ producers }) => {
<TableCell>
<div className={classes.titleCell}>
{t('api')}
<Button
size="small"
variant="outlined"
color="primary"
startIcon={<ListAltIcon />}
onClick={(e) => {
handlePopoverOpen(e.target, 'api')
}}
>
{t('showList')}
</Button>
<CopyToClipboard text={textLists?.api} helperText={t('copyToClipboard')} />
</div>
</TableCell>
<TableCell>
<div className={classes.titleCell}>
{t('ssl')}
<Button
size="small"
variant="outlined"
color="primary"
startIcon={<ListAltIcon />}
onClick={(e) => {
handlePopoverOpen(e.target, 'ssl')
}}
>
{t('showList')}
</Button>
<CopyToClipboard text={textLists?.ssl} helperText={t('copyToClipboard')} />
</div>
</TableCell>
<TableCell>
<div className={classes.titleCell}>
{t('p2p')}
<Button
size="small"
variant="outlined"
color="primary"
startIcon={<ListAltIcon />}
onClick={(e) => {
handlePopoverOpen(e.target, 'p2p')
}}
>
{t('showList')}
</Button>
<CopyToClipboard text={textLists?.p2p} helperText={t('copyToClipboard')} />
</div>
</TableCell>
</TableRow>
Expand Down Expand Up @@ -167,6 +112,7 @@ const EndpointsTable = ({ producers }) => {

EndpointsTable.propTypes = {
producers: PropTypes.array,
textLists: PropTypes.object,
}

export default EndpointsTable
2 changes: 1 addition & 1 deletion webapp/src/components/EndpointsTable/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default (theme) => ({
alignItems: 'center',
'& .MuiButton-root': {
alignSelf: 'center',
marginLeft: theme.spacing(2),
margin: `${theme.spacing(0, 0, 0, 2)} !important`,
}
},
})
58 changes: 0 additions & 58 deletions webapp/src/components/EndpointsTextList/index.js

This file was deleted.

16 changes: 0 additions & 16 deletions webapp/src/components/EndpointsTextList/styles.js

This file was deleted.

4 changes: 2 additions & 2 deletions webapp/src/components/HealthCheck/HealthCheckInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const HealthCheckInfo = ({ healthCheck }) => {
</Typography>
{healthCheck.head_block_time && healthCheck.response?.status === 200 && (
<>
<Typography>{t('headBlockTime')}</Typography>
<Typography>{t('headBlockTime')}:</Typography>
{moment(healthCheck.head_block_time).format('lll') || 'N/A'}
</>
)}
<Typography>{t('updatedAt')}</Typography>
<Typography>{t('updatedAt')}:</Typography>
{moment(healthCheck.updated_at).format('lll') || 'N/A'}
</>
)
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/NodeCard/EndpointsChips.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ const EndpointsChips = ({ node }) => {
<span>{`${workingEndpoints}/${totalEndpoints}`}</span>
)}
<HealthCheck status={healthStatus}>
<Typography>{t('status')}</Typography>
<Typography>{t('status')}:</Typography>
<Typography>
{getStatusMessage(healthStatus, failingEndpoints)}
</Typography>
<Typography>{t('updatedAt')}</Typography>
<Typography>{t('updatedAt')}:</Typography>
{moment(updatedAt).format('lll') || 'N/A'}
</HealthCheck>
</div>
Expand Down
13 changes: 13 additions & 0 deletions webapp/src/gql/producer.gql.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ export const PRODUCERS_QUERY = gql`
}
}
`

export const PRODUCERS_COUNT_QUERY = gql`
query producer(
$where: producer_bool_exp
) {
info: producer_aggregate(where: $where) {
producers: aggregate {
count
}
}
}
`

export const NODES_SUBSCRIPTION = gql`
subscription ($offset: Int = 0, $limit: Int = 21, $where: producer_bool_exp) {
producers: producer(
Expand Down
19 changes: 15 additions & 4 deletions webapp/src/hooks/customHooks/useBlockProducerState.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,26 @@ const CHIPS_FILTERS = [
const CHIPS_NAMES = ['all', ...eosConfig.producerTypes]

const useBlockProducerState = () => {
const [
{ filters, pagination, producers },
{ handleOnSearch, handleOnPageChange, setPagination },
] = useSearchState({ query: PRODUCERS_QUERY })
const defaultVariables = {
limit: 20,
offset: 0,
endpointFilter: undefined,
where: {
owner: { _like: '%%' },
nodes: { endpoints: { value: { _gt: '' } } },
}
}
const [variables, setVariables] = useState(defaultVariables)
const [loadProducers, { data: { info, producers } = {} }] = useLazyQuery(PRODUCERS_QUERY, { variables })
const { data: dataHistory } = useSubscription(MISSED_BLOCKS_SUBSCRIPTION)
const [loadStats, { loading = true, data: { eosrate_stats: stats } = {} }] =
useLazyQuery(EOSRATE_STATS_QUERY)
const [items, setItems] = useState([])
const [missedBlocks, setMissedBlocks] = useState({})
const [
{ filters, pagination },
{ handleOnSearch, handleOnPageChange, setPagination },
] = useSearchState({ loadProducers, info, variables, setVariables })

useEffect(() => {
loadStats({})
Expand Down
Loading

0 comments on commit 154857b

Please sign in to comment.