Skip to content

Commit

Permalink
Rename conflict to spend in dashboard frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrvivian committed Nov 21, 2023
1 parent 9e667b2 commit aa045a2
Show file tree
Hide file tree
Showing 20 changed files with 157 additions and 157 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion components/dashboard/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html> <html> <head> <meta charset="utf-8"> <title>iota-core Dashboard</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"/> </head> <body> <div id="root"></div> <script type="text/javascript" src="/app/a1e7322de4eb5154c0c3.js"></script><script type="text/javascript" src="/app/vendor.146c9687b00ba21e0070.js"></script><script type="text/javascript" src="/app/app.6eea8010fee08f23aca6.js"></script></body> </html>
<!doctype html> <html> <head> <meta charset="utf-8"> <title>iota-core Dashboard</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"/> </head> <body> <div id="root"></div> <script type="text/javascript" src="/app/a1e7322de4eb5154c0c3.js"></script><script type="text/javascript" src="/app/vendor.146c9687b00ba21e0070.js"></script><script type="text/javascript" src="/app/app.48ab2676b5153e0e40b7.js"></script></body> </html>
6 changes: 3 additions & 3 deletions components/dashboard/frontend/src/app/components/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {ExplorerSearchbar} from "./ExplorerSearchbar";
import {ExplorerLiveFeed} from "./ExplorerLiveFeed";
import {ExplorerTransactionSearchbar} from "./ExplorerTransactionSearchbar";
import {ExplorerOutputSearchbar} from "./ExplorerOutputSearchbar";
import {ExplorerConflictSearchbar} from "./ExplorerConflictSearchbar";
import {ExplorerSpendSearchbar} from "./ExplorerSpendSearchbar";

interface Props {
nodeStore?: NodeStore;
Expand All @@ -24,7 +24,7 @@ export class Explorer extends React.Component<Props, any> {
<Row className={"mb-3"}>
<Col>
<p>
Search for addresses, blocks, transactions, outputs and conflicts.
Search for addresses, blocks, transactions, outputs and spends.
</p>
</Col>
</Row>
Expand All @@ -41,7 +41,7 @@ export class Explorer extends React.Component<Props, any> {
<ExplorerOutputSearchbar/>
</Col>
<Col>
<ExplorerConflictSearchbar/>
<ExplorerSpendSearchbar/>
</Col>
</Row>
<ExplorerLiveFeed/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {Link} from 'react-router-dom';
import {displayManaUnit} from "../utils";
import {OutputType, outputToComponent, outputTypeToName} from "../utils/output";
import {Button, ListGroupItem} from "react-bootstrap";
import {resolveBase58ConflictID} from "../utils/conflict";
import {resolveBase58SpendID as resolveBase58SpendID} from "../utils/spend";

interface Props {
nodeStore?: NodeStore;
Expand Down Expand Up @@ -227,9 +227,9 @@ class OutputMeta extends React.Component<omProps, any> {
{
metadata.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1} className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
<ListGroup.Item key={"SpendID" + index + 1} className="text-break">
<Link to={`/explorer/spend/${value}`}>
{resolveBase58SpendID(value)}
</Link>
</ListGroup.Item>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Link } from 'react-router-dom';
import { BasicPayload } from './BasicPayload'
import { TransactionPayload } from './TransactionPayload'
import { getPayloadType, PayloadType } from '../misc/Payload'
import { resolveBase58ConflictID } from "../utils/conflict";
import { resolveBase58SpendID } from "../utils/spend";
import { FaucetPayload } from './FaucetPayload';
import { TaggedDataPayload } from './TaggedDataPayload';

Expand Down Expand Up @@ -129,10 +129,10 @@ export class ExplorerBlockQueryResult extends React.Component<Props, any> {
{
blk.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1}
<ListGroup.Item key={"SpendID" + index + 1}
className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
<Link to={`/explorer/spend/${value}`}>
{resolveBase58SpendID(value)}
</Link>
</ListGroup.Item>
)
Expand All @@ -146,10 +146,10 @@ export class ExplorerBlockQueryResult extends React.Component<Props, any> {
{
blk.addedSpendIDs.map((value, index) => {
return (
<ListGroup.Item key={"AddedConflictID" + index + 1}
<ListGroup.Item key={"AddedSpendID" + index + 1}
className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
<Link to={`/explorer/spend/${value}`}>
{resolveBase58SpendID(value)}
</Link>
</ListGroup.Item>
)
Expand All @@ -163,10 +163,10 @@ export class ExplorerBlockQueryResult extends React.Component<Props, any> {
{
blk.subtractedSpendIDs.map((value, index) => {
return (
<ListGroup.Item key={"SubtractedConflictID" + index + 1}
<ListGroup.Item key={"SubtractedSpendID" + index + 1}
className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
<Link to={`/explorer/spend/${value}`}>
{resolveBase58SpendID(value)}
</Link>
</ListGroup.Item>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ExplorerStore from "../stores/ExplorerStore";
import Badge from "react-bootstrap/Badge";
import {Link} from 'react-router-dom';
import {displayManaUnit} from "../utils";
import {resolveBase58ConflictID} from "../utils/conflict";
import {resolveBase58SpendID} from "../utils/spend";
import {outputToComponent} from "../utils/output";
import {resolveConfirmationState} from "../utils/confirmation_state";

Expand Down Expand Up @@ -81,9 +81,9 @@ export class ExplorerOutputQueryResult extends React.Component<Props, any> {
{
outputMetadata.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1} className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
<ListGroup.Item key={"SpendID" + index + 1} className="text-break">
<Link to={`/explorer/spend/${value}`}>
{resolveBase58SpendID(value)}
</Link>
</ListGroup.Item>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import NodeStore from "../stores/NodeStore";
import { inject, observer } from "mobx-react";
import ExplorerStore from "../stores/ExplorerStore";
import ListGroup from "react-bootstrap/ListGroup";
import {resolveBase58ConflictID} from "../utils/conflict";
import {resolveBase58SpendID} from "../utils/spend";
import {resolveConfirmationState} from "../utils/confirmation_state";


Expand All @@ -21,65 +21,65 @@ interface Props {
@inject("nodeStore")
@inject("explorerStore")
@observer
export class ExplorerConflictQueryResult extends React.Component<Props, any> {
export class ExplorerSpendQueryResult extends React.Component<Props, any> {
componentDidMount() {
this.props.explorerStore.getConflict(this.props.match.params.id);
this.props.explorerStore.getConflictChildren(this.props.match.params.id);
this.props.explorerStore.getConflictConflicts(this.props.match.params.id);
this.props.explorerStore.getConflictVoters(this.props.match.params.id);
this.props.explorerStore.getSpend(this.props.match.params.id);
this.props.explorerStore.getSpendChildren(this.props.match.params.id);
this.props.explorerStore.getSpendSpends(this.props.match.params.id);
this.props.explorerStore.getSpendVoters(this.props.match.params.id);
}

componentWillUnmount() {
this.props.explorerStore.reset();
}
render() {
let {id} = this.props.match.params;
let { query_err, conflict, conflictChildren, conflictConflicts, conflictVoters } = this.props.explorerStore;
let { query_err, spend, spendChildren, spendSpends, spendVoters } = this.props.explorerStore;

if (query_err) {
return (
<Container>
<h4>Conflict not found - 404</h4>
<h4>Spend not found - 404</h4>
<span>{id}</span>
</Container>
);
}
return (
<Container>
<h4>Conflict</h4>
{conflict && <ListGroup>
<ListGroup.Item>ID: {resolveBase58ConflictID(conflict.id)}</ListGroup.Item>
<h4>Spend</h4>
{spend && <ListGroup>
<ListGroup.Item>ID: {resolveBase58SpendID(spend.id)}</ListGroup.Item>
<ListGroup.Item>Parents:
<ListGroup>
{conflict.parents.map((p,i) => <ListGroup.Item key={i}><a href={`/explorer/conflict/${p}`}>{resolveBase58ConflictID(p)}</a></ListGroup.Item>)}
{spend.parents.map((p,i) => <ListGroup.Item key={i}><a href={`/explorer/spend/${p}`}>{resolveBase58SpendID(p)}</a></ListGroup.Item>)}
</ListGroup>
</ListGroup.Item>
{<ListGroup.Item>Conflicts:
{conflict.spendIDs && <ListGroup>
{conflict.spendIDs.map((c,i) => <ListGroup.Item key={i}><a href={`/explorer/output/${c}`}>{c}</a></ListGroup.Item>)}
{<ListGroup.Item>Spends:
{spend.spendIDs && <ListGroup>
{spend.spendIDs.map((c,i) => <ListGroup.Item key={i}><a href={`/explorer/output/${c}`}>{c}</a></ListGroup.Item>)}
</ListGroup>}
</ListGroup.Item>}
<ListGroup.Item>ConfirmationState: {resolveConfirmationState(conflict.confirmationState)}</ListGroup.Item>
<ListGroup.Item>ConfirmationState: {resolveConfirmationState(spend.confirmationState)}</ListGroup.Item>
<ListGroup.Item> Children:
{conflictChildren && <ListGroup>
{conflictChildren.childConflicts.map((c,i) => <ListGroup.Item key={i}><a href={`/explorer/conflict/${c.conflictID}`}>{resolveBase58ConflictID(c.conflictID)}</a></ListGroup.Item>)}
{spendChildren && <ListGroup>
{spendChildren.childSpends.map((c,i) => <ListGroup.Item key={i}><a href={`/explorer/spend/${c.spendID}`}>{resolveBase58SpendID(c.spendID)}</a></ListGroup.Item>)}
</ListGroup> }
</ListGroup.Item>
{<ListGroup.Item> Conflicts:
{conflictConflicts && <ListGroup>
{conflictConflicts.conflicts.map((c,i) => <div key={i}>
{<ListGroup.Item> Spends:
{spendSpends && <ListGroup>
{spendSpends.spends.map((c,i) => <div key={i}>
OutputID: <a href={`/explorer/output/${c.outputID.base58}`}>{c.outputID.base58}</a>
<ListGroup className={"mb-2"}>
{c.spendIDs.map((b,j) => <ListGroup.Item key={j}>
<a href={`/explorer/conflict/${b}`}>{resolveBase58ConflictID(b)}</a>
<a href={`/explorer/spend/${b}`}>{resolveBase58SpendID(b)}</a>
</ListGroup.Item>)}
</ListGroup>
</div>)}
</ListGroup> }
</ListGroup.Item>}
<ListGroup.Item> Voters:
{conflictVoters && <ListGroup>
{conflictVoters.voters.map((s,i) => <ListGroup.Item key={s+i}>{s}</ListGroup.Item>)}
{spendVoters && <ListGroup>
{spendVoters.voters.map((s,i) => <ListGroup.Item key={s+i}>{s}</ListGroup.Item>)}
</ListGroup> }
</ListGroup.Item>
</ListGroup>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ interface Props {
@inject("nodeStore")
@inject("explorerStore")
@observer
export class ExplorerConflictSearchbar extends React.Component<Props, any> {
conflictID: string;
export class ExplorerSpendSearchbar extends React.Component<Props, any> {
spendID: string;

updateSearch = (e) => {
this.conflictID =e.target.value;
this.spendID =e.target.value;
};

executeSearch = (e: KeyboardEvent) => {
if (e.key !== 'Enter') return;
this.props.explorerStore.routerStore.push(`/explorer/conflict/${this.conflictID}`);
this.props.explorerStore.routerStore.push(`/explorer/spend/${this.spendID}`);
};

render() {
Expand All @@ -37,10 +37,10 @@ export class ExplorerConflictSearchbar extends React.Component<Props, any> {
<Col>
<InputGroup className="mb-3">
<FormControl
placeholder="Conflict ID"
aria-label="Conflict ID"
placeholder="Spend ID"
aria-label="Spend ID"
aria-describedby="basic-addon1"
value={this.conflictID} onChange={this.updateSearch}
value={this.spendID} onChange={this.updateSearch}
onKeyUp={this.executeSearch}
disabled={searching}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import NodeStore from "../stores/NodeStore";
import { inject, observer } from "mobx-react";
import ExplorerStore from "../stores/ExplorerStore";
import ListGroup from "react-bootstrap/ListGroup";
// import {resolveBase58ConflictID} from "../utils/conflict";
// import {resolveBase58SpendID} from "../utils/spend";

interface Props {
nodeStore?: NodeStore;
Expand Down Expand Up @@ -40,12 +40,12 @@ export class ExplorerTransactionMetadata extends React.Component<Props, any> {
<h4>Metadata</h4>
{txMetadata && <ListGroup>
<ListGroup.Item>
ConflictIDs:
SpendIDs:
<ListGroup>
{
txMetadata.conflictIDs && txMetadata.conflictIDs.map((value, index) => {
txMetadata.spendIDs && txMetadata.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1} className="text-break">
<ListGroup.Item key={"SpendID" + index + 1} className="text-break">
<a href={`/explorer/transaction/${value}`}>{value}</a>
</ListGroup.Item>
)
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard/frontend/src/app/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {Visualizer} from "./Visualizer";
import {Tips} from "./Tips";
import {ExplorerTransactionQueryResult} from "./ExplorerTransactionQueryResult";
import {ExplorerOutputQueryResult} from "./ExplorerOutputQueryResult";
import {ExplorerConflictQueryResult} from "./ExplorerConflictQueryResult";
import {ExplorerSpendQueryResult} from "./ExplorerSpendQueryResult";
import { SlotLiveFeed } from './SlotLiveFeed';
import { ExplorerSlotQueryResult } from './ExplorerSlotQueryResult';

Expand Down Expand Up @@ -92,7 +92,7 @@ export class Root extends React.Component<Props, any> {
<Route exact path="/explorer/address/:id" component={ExplorerAddressQueryResult}/>
<Route exact path="/explorer/transaction/:id" component={ExplorerTransactionQueryResult}/>
<Route exact path="/explorer/output/:id" component={ExplorerOutputQueryResult}/>
<Route exact path="/explorer/conflict/:id" component={ExplorerConflictQueryResult}/>
<Route exact path="/explorer/spend/:id" component={ExplorerSpendQueryResult}/>
<Route exact path="/explorer/slot/commitment/:commitment" component={ExplorerSlotQueryResult}/>
<Route exact path="/explorer/404/:search" component={Explorer404}/>
<Route exact path="/slots" component={SlotLiveFeed}/>
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/frontend/src/app/misc/Payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class Balance {
color: string;
}

export class Conflict {
export class Spend {
tx_id: string;
opinion: Opinion;
}
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard/frontend/src/app/misc/WS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export enum WSMsgType {
ManaMapOnline,
BlkManaDashboardAddress,
RateSetter,
ConflictSet,
Conflict,
SpendSet,
Spend,
SlotInfo,
}

Expand Down
Loading

0 comments on commit aa045a2

Please sign in to comment.