mirror of
https://github.com/oceanprotocol/status-frontend.git
synced 2025-02-14 21:10:31 +01:00
updating request to new status API, adding key to componenets in map
This commit is contained in:
parent
16a5815688
commit
3110514c16
@ -1,3 +1,3 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
statusServiceUri: process.env.NEXT_STATUS_API_URI || 'http://localhost:8080'
|
statusApiUri: process.env.NEXT_STATUS_API_URI || 'http://localhost:8000'
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,10 @@ export default function HomePage(): ReactElement {
|
|||||||
{data && (
|
{data && (
|
||||||
<>
|
<>
|
||||||
{data.map((value: Summary) => (
|
{data.map((value: Summary) => (
|
||||||
<div className={`${styles.card} ${style(value.status)}`}>
|
<div
|
||||||
|
key={value.component}
|
||||||
|
className={`${styles.card} ${style(value.status)}`}
|
||||||
|
>
|
||||||
<h2>{value?.component}</h2>
|
<h2>{value?.component}</h2>
|
||||||
<p>{value?.status}</p>
|
<p>{value?.status}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
import { Status, Summary } from '../@types'
|
import { Status, Summary } from '../@types'
|
||||||
import { statusServiceUri } from '../../app.config'
|
import { statusApiUri } from '../../app.config'
|
||||||
|
|
||||||
export async function getData(): Promise<Status[]> {
|
export async function getData(): Promise<Status[]> {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<Status[]> = await axios.get(
|
const response: AxiosResponse<Status[]> = await axios.get(`${statusApiUri}`)
|
||||||
`${statusServiceUri}`
|
|
||||||
)
|
|
||||||
if (!response || response.status !== 200 || !response.data)
|
if (!response || response.status !== 200 || !response.data)
|
||||||
console.log('ERROR: no data recieved')
|
console.log('ERROR: no data recieved')
|
||||||
|
|
||||||
@ -43,14 +41,14 @@ export async function getSummary(network: number): Promise<Summary[]> {
|
|||||||
status: data[network].daoGrants
|
status: data[network].daoGrants
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
data[network].faucet.status &&
|
||||||
|
summary.push({
|
||||||
|
component: 'Faucet',
|
||||||
|
status: data[network].faucet.status
|
||||||
|
})
|
||||||
|
|
||||||
return summary
|
return summary
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// data[network].faucet.status && {
|
|
||||||
// component: 'Faucet',
|
|
||||||
// status: data[network].faucet.status
|
|
||||||
// }
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user