mirror of
https://github.com/fullstack-cash/explorer.fullstack.cash.git
synced 2026-09-21 16:52:05 -07:00
feat(filter): Added 'appId' filter to explorer.fullstack.cash
This commit is contained in:
+1
-1
@@ -6,5 +6,5 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/* Your site config here */
|
/* Your site config here */
|
||||||
plugins: ["fullstack-gatsby-theme-bch-wallet"]
|
plugins: ['fullstack-gatsby-theme-bch-wallet']
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-28
@@ -1,11 +1,11 @@
|
|||||||
import React from "react"
|
import React from 'react'
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from 'prop-types'
|
||||||
import { Row, Col, Box, Button } from "adminlte-2-react"
|
import { Row, Col, Box, Button } from 'adminlte-2-react'
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||||
import JSONPretty from "react-json-pretty"
|
import JSONPretty from 'react-json-pretty'
|
||||||
|
|
||||||
const HASH_EXPLORER = "https://p2wdb.fullstack.cash/entry/hash/" // PSF p2wdb hash explorer
|
const HASH_EXPLORER = 'https://p2wdb.fullstack.cash/entry/hash/' // PSF p2wdb hash explorer
|
||||||
const TX_EXPLORER = "https://simpleledger.info/tx/" // BCH Transaction Explorer
|
const TX_EXPLORER = 'https://simpleledger.info/tx/' // BCH Transaction Explorer
|
||||||
|
|
||||||
let _this
|
let _this
|
||||||
class Details extends React.Component {
|
class Details extends React.Component {
|
||||||
@@ -16,7 +16,7 @@ class Details extends React.Component {
|
|||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
entry: {},
|
entry: {},
|
||||||
entryData: {},
|
entryData: {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,26 +26,26 @@ class Details extends React.Component {
|
|||||||
<>
|
<>
|
||||||
<Row>
|
<Row>
|
||||||
<Col sm={12}>
|
<Col sm={12}>
|
||||||
<Box className=" border-none mt-2" loaded={!this.state.inFetch}>
|
<Box className=' border-none mt-2' loaded={!this.state.inFetch}>
|
||||||
<Row className="text-center">
|
<Row className='text-center'>
|
||||||
<Col sm={12}>
|
<Col sm={12}>
|
||||||
<h1 id="SendTokens">
|
<h1 id='SendTokens'>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
className="title-icon"
|
className='title-icon'
|
||||||
size="xs"
|
size='xs'
|
||||||
icon="info-circle"
|
icon='info-circle'
|
||||||
/>
|
/>
|
||||||
<span>Details</span>
|
<span>Details</span>
|
||||||
</h1>
|
</h1>
|
||||||
{entry._id && (
|
{entry._id && (
|
||||||
<Box className="border-none details-data-content">
|
<Box className='border-none details-data-content'>
|
||||||
<p>
|
<p>
|
||||||
<b>IS VALID: </b>
|
<b>IS VALID: </b>
|
||||||
{entry.isValid}
|
{entry.isValid}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>APP ID: </b>
|
<b>APP ID: </b>
|
||||||
{entry.appId || "none"}
|
{entry.appId || 'none'}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>CREATE AT: </b>
|
<b>CREATE AT: </b>
|
||||||
@@ -59,8 +59,8 @@ class Details extends React.Component {
|
|||||||
<b>HASH: </b>
|
<b>HASH: </b>
|
||||||
<a
|
<a
|
||||||
href={`${HASH_EXPLORER}${entry.hash}`}
|
href={`${HASH_EXPLORER}${entry.hash}`}
|
||||||
target="_blank"
|
target='_blank'
|
||||||
rel="noreferrer"
|
rel='noreferrer'
|
||||||
>
|
>
|
||||||
{entry.hash}
|
{entry.hash}
|
||||||
</a>
|
</a>
|
||||||
@@ -69,8 +69,8 @@ class Details extends React.Component {
|
|||||||
<b>TRANSACTION ID : </b>
|
<b>TRANSACTION ID : </b>
|
||||||
<a
|
<a
|
||||||
href={`${TX_EXPLORER}${entry.key}`}
|
href={`${TX_EXPLORER}${entry.key}`}
|
||||||
target="_blank"
|
target='_blank'
|
||||||
rel="noreferrer"
|
rel='noreferrer'
|
||||||
>
|
>
|
||||||
{entry.key}
|
{entry.key}
|
||||||
</a>
|
</a>
|
||||||
@@ -95,7 +95,7 @@ class Details extends React.Component {
|
|||||||
<>
|
<>
|
||||||
- <b>Data :</b>
|
- <b>Data :</b>
|
||||||
<JSONPretty
|
<JSONPretty
|
||||||
id="json-pretty"
|
id='json-pretty'
|
||||||
data={entryData.data}
|
data={entryData.data}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
@@ -107,11 +107,11 @@ class Details extends React.Component {
|
|||||||
)}
|
)}
|
||||||
</Col>
|
</Col>
|
||||||
<Col sm={12}>
|
<Col sm={12}>
|
||||||
<div className="btn-wrapper">
|
<div className='btn-wrapper'>
|
||||||
<Button
|
<Button
|
||||||
text="Close"
|
text='Close'
|
||||||
type="primary"
|
type='primary'
|
||||||
className="btn-lg btn-close-entry mr-1 ml-1 mt-1"
|
className='btn-lg btn-close-entry mr-1 ml-1 mt-1'
|
||||||
onClick={_this.handleClose}
|
onClick={_this.handleClose}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -139,10 +139,10 @@ class Details extends React.Component {
|
|||||||
const { entry } = _this.props
|
const { entry } = _this.props
|
||||||
_this.setState({
|
_this.setState({
|
||||||
entry,
|
entry,
|
||||||
entryData: entry.value,
|
entryData: entry.value
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn("Error in handleData()", err)
|
console.warn('Error in handleData()', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +162,6 @@ class Details extends React.Component {
|
|||||||
}
|
}
|
||||||
Details.propTypes = {
|
Details.propTypes = {
|
||||||
entry: PropTypes.object,
|
entry: PropTypes.object,
|
||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func
|
||||||
}
|
}
|
||||||
export default Details
|
export default Details
|
||||||
|
|||||||
+54
-2
@@ -1,7 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Row, Col, Content, Box, DataTable } from 'adminlte-2-react'
|
import { Row, Col, Content, Box, DataTable, Inputs, Button } from 'adminlte-2-react'
|
||||||
import Details from './details'
|
import Details from './details'
|
||||||
import './explorer.css'
|
import './explorer.css'
|
||||||
|
const { Text } = Inputs
|
||||||
|
|
||||||
const axios = require('axios').default
|
const axios = require('axios').default
|
||||||
|
|
||||||
const SERVER = 'https://p2wdb.fullstack.cash/'
|
const SERVER = 'https://p2wdb.fullstack.cash/'
|
||||||
@@ -16,7 +18,8 @@ class Explorer extends React.Component {
|
|||||||
showEntry: false,
|
showEntry: false,
|
||||||
data: [],
|
data: [],
|
||||||
entries: [],
|
entries: [],
|
||||||
entryData: null
|
entryData: null,
|
||||||
|
addId: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
this.firstColumns = [
|
this.firstColumns = [
|
||||||
@@ -52,6 +55,25 @@ class Explorer extends React.Component {
|
|||||||
browserTitle='P2WDB Explorer'
|
browserTitle='P2WDB Explorer'
|
||||||
>
|
>
|
||||||
<Row>
|
<Row>
|
||||||
|
{!entryData && (
|
||||||
|
<Box title='Search By Appid' className='text-center'>
|
||||||
|
<Text
|
||||||
|
id='appId'
|
||||||
|
name='appId'
|
||||||
|
placeholder='Enter AppId'
|
||||||
|
label='AppId'
|
||||||
|
labelPosition='above'
|
||||||
|
onChange={this.handleUpdate}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
text='Search'
|
||||||
|
type='primary'
|
||||||
|
className='btn-lg btn-close-entry mr-1 ml-1 mt-1'
|
||||||
|
onClick={_this.handleSearchByAppId}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
{entryData && (
|
{entryData && (
|
||||||
<Col xs={12}>
|
<Col xs={12}>
|
||||||
<Details entry={entryData} onClose={_this.handleClose} />
|
<Details entry={entryData} onClose={_this.handleClose} />
|
||||||
@@ -83,6 +105,12 @@ class Explorer extends React.Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleUpdate (event) {
|
||||||
|
_this.setState({
|
||||||
|
[event.target.name]: event.target.value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async componentDidMount () {
|
async componentDidMount () {
|
||||||
_this.handleEntries()
|
_this.handleEntries()
|
||||||
|
|
||||||
@@ -202,6 +230,30 @@ class Explorer extends React.Component {
|
|||||||
entryData: null
|
entryData: null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async handleSearchByAppId () {
|
||||||
|
try {
|
||||||
|
const { appId } = _this.state
|
||||||
|
let entries
|
||||||
|
if (!appId) {
|
||||||
|
entries = await _this.getEntries()
|
||||||
|
} else {
|
||||||
|
const options = {
|
||||||
|
method: 'GET',
|
||||||
|
url: `${SERVER}entry/appid/${appId}`
|
||||||
|
}
|
||||||
|
const result = await axios.request(options)
|
||||||
|
entries = result.data.data
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.setState({
|
||||||
|
entries
|
||||||
|
})
|
||||||
|
_this.generateDataTable(entries)
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Explorer
|
export default Explorer
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
of the Wallet View.
|
of the Wallet View.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from "react"
|
import React from 'react'
|
||||||
|
|
||||||
import Wallet from "fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/wallet/index"
|
import Wallet from 'fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/wallet/index'
|
||||||
|
|
||||||
// import TXHistory from 'gatsby-plugin-bch-tx-history/src/components/txhistory'
|
// import TXHistory from 'gatsby-plugin-bch-tx-history/src/components/txhistory'
|
||||||
// import TXHistory from "gatsby-plugin-bch-tx-history"
|
// import TXHistory from "gatsby-plugin-bch-tx-history"
|
||||||
@@ -15,7 +15,7 @@ class Wallet2 extends Wallet {
|
|||||||
// class Wallet2 extends React.Component {
|
// class Wallet2 extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
console.log("Loading new example view.")
|
console.log('Loading new example view.')
|
||||||
|
|
||||||
// console.log('Wallet info: ', props.walletInfo)
|
// console.log('Wallet info: ', props.walletInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
It over-rides he default file in the gatsby-ipfs-web-wallet Theme.
|
It over-rides he default file in the gatsby-ipfs-web-wallet Theme.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from "react"
|
import React from 'react'
|
||||||
import { Sidebar } from "adminlte-2-react"
|
import { Sidebar } from 'adminlte-2-react'
|
||||||
|
|
||||||
// Example/Demo component. This is how you would build a component internal to
|
// Example/Demo component. This is how you would build a component internal to
|
||||||
// your wallet app/site.
|
// your wallet app/site.
|
||||||
@@ -20,11 +20,11 @@ import { Sidebar } from "adminlte-2-react"
|
|||||||
// import TXHistory from "gatsby-plugin-bch-tx-history"
|
// import TXHistory from "gatsby-plugin-bch-tx-history"
|
||||||
|
|
||||||
// Default components from gatsby-ipfs-web-wallet.
|
// Default components from gatsby-ipfs-web-wallet.
|
||||||
import Wallet from "fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/wallet"
|
import Wallet from 'fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/wallet'
|
||||||
import Tokens from "fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/tokens"
|
import Tokens from 'fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/tokens'
|
||||||
import Configure from "fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/configure"
|
import Configure from 'fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/configure'
|
||||||
import SendReceive from "fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/send-receive"
|
import SendReceive from 'fullstack-gatsby-theme-bch-wallet/src/components/admin-lte/send-receive'
|
||||||
import Explorer from "../../explorer"
|
import Explorer from '../../explorer'
|
||||||
|
|
||||||
const { Item } = Sidebar
|
const { Item } = Sidebar
|
||||||
|
|
||||||
@@ -32,35 +32,35 @@ const MenuComponents = props => {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
active: true, // Set this view as default
|
active: true, // Set this view as default
|
||||||
key: "Explorer",
|
key: 'Explorer',
|
||||||
component: <Explorer key="Explorer" {...props} />,
|
component: <Explorer key='Explorer' {...props} />,
|
||||||
menuItem: <Item icon="fas-binoculars" key="Explorer" text="Explorer" />
|
menuItem: <Item icon='fas-binoculars' key='Explorer' text='Explorer' />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "Tokens",
|
key: 'Tokens',
|
||||||
component: <Tokens key="Tokens" {...props} />,
|
component: <Tokens key='Tokens' {...props} />,
|
||||||
menuItem: <Item icon="fas-coins" key="Tokens" text="Tokens" />
|
menuItem: <Item icon='fas-coins' key='Tokens' text='Tokens' />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "Send/Receive BCH",
|
key: 'Send/Receive BCH',
|
||||||
component: <SendReceive key="Send/Receive BCH" {...props} />,
|
component: <SendReceive key='Send/Receive BCH' {...props} />,
|
||||||
menuItem: (
|
menuItem: (
|
||||||
<Item
|
<Item
|
||||||
icon="fa-exchange-alt"
|
icon='fa-exchange-alt'
|
||||||
key="Send/Receive BCH"
|
key='Send/Receive BCH'
|
||||||
text="Send/Receive BCH"
|
text='Send/Receive BCH'
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "Wallet",
|
key: 'Wallet',
|
||||||
component: <Wallet key="Wallet" {...props} />,
|
component: <Wallet key='Wallet' {...props} />,
|
||||||
menuItem: <Item icon="fa-wallet" key="Wallet" text="Wallet" />
|
menuItem: <Item icon='fa-wallet' key='Wallet' text='Wallet' />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "Configure",
|
key: 'Configure',
|
||||||
component: <Configure key="Configure" {...props} />,
|
component: <Configure key='Configure' {...props} />,
|
||||||
menuItem: <Item icon="fas-cog" key="Configure" text="Configure" />
|
menuItem: <Item icon='fas-cog' key='Configure' text='Configure' />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -1,5 +1,5 @@
|
|||||||
import React from "react"
|
import React from 'react'
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from 'prop-types'
|
||||||
// import { withPrefix, Link } from 'gatsby'
|
// import { withPrefix, Link } from 'gatsby'
|
||||||
|
|
||||||
// window && typeof window !== 'undefined' && window.test = 'testing'
|
// window && typeof window !== 'undefined' && window.test = 'testing'
|
||||||
@@ -8,15 +8,15 @@ export default function HTML(props) {
|
|||||||
return (
|
return (
|
||||||
<html {...props.htmlAttributes}>
|
<html {...props.htmlAttributes}>
|
||||||
<head>
|
<head>
|
||||||
<meta charSet="utf-8" />
|
<meta charSet='utf-8' />
|
||||||
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
|
<meta httpEquiv='x-ua-compatible' content='ie=edge' />
|
||||||
<meta
|
<meta
|
||||||
name="viewport"
|
name='viewport'
|
||||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
content='width=device-width, initial-scale=1, shrink-to-fit=no'
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* minimal-slp-wallet-web */}
|
{/* minimal-slp-wallet-web */}
|
||||||
<script src="https://unpkg.com/minimal-slp-wallet" />
|
<script src='https://unpkg.com/minimal-slp-wallet' />
|
||||||
|
|
||||||
{/* bch-message-lib */}
|
{/* bch-message-lib */}
|
||||||
{/* <script src='https://unpkg.com/bch-message-lib' /> */}
|
{/* <script src='https://unpkg.com/bch-message-lib' /> */}
|
||||||
@@ -26,8 +26,8 @@ export default function HTML(props) {
|
|||||||
<body {...props.bodyAttributes}>
|
<body {...props.bodyAttributes}>
|
||||||
{props.preBodyComponents}
|
{props.preBodyComponents}
|
||||||
<div
|
<div
|
||||||
key="body"
|
key='body'
|
||||||
id="___gatsby"
|
id='___gatsby'
|
||||||
dangerouslySetInnerHTML={{ __html: props.body }}
|
dangerouslySetInnerHTML={{ __html: props.body }}
|
||||||
/>
|
/>
|
||||||
{props.postBodyComponents}
|
{props.postBodyComponents}
|
||||||
|
|||||||
Reference in New Issue
Block a user