Skip to content

Commit

Permalink
transcript update
Browse files Browse the repository at this point in the history
  • Loading branch information
0205miss committed Mar 16, 2023
1 parent b72c8bd commit 89f40ed
Show file tree
Hide file tree
Showing 17 changed files with 339 additions and 107 deletions.
20 changes: 10 additions & 10 deletions website/app/[lang]/pibrowser/explorer/block/[block]/dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react"
import { Server } from "stellar-sdk"
import Link from "next/link"
export default function Dashboard({block}){
export default function Dashboard({block,transcript}){
const [lang,setlang] = useState()
const server = new Server(process.env['NEXT_PUBLIC_HORIZON_SERVER'])
const [data,setdata] = useState(null)
Expand All @@ -24,7 +24,7 @@ export default function Dashboard({block}){
<tbody>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Hash
{transcript.Hash}
</td>
<td className=" px-3 py-1 font-bold">
{data&&
Expand All @@ -35,7 +35,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Pre Hash
{transcript.Pre}
</td>
<td className=" px-3 py-1">
{data &&
Expand All @@ -49,7 +49,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Operation
{transcript.Operation}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -60,7 +60,7 @@ export default function Dashboard({block}){

<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Transaction
{transcript.Transaction}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -74,7 +74,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Base Fee
{transcript.BaseFee}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -88,7 +88,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Base Reserve
{transcript.BaseReserve}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -102,7 +102,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Fee Pool
{transcript.FeePool}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -116,7 +116,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Total Pi
{transcript.TotalPi}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -130,7 +130,7 @@ export default function Dashboard({block}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Protocol
{transcript.Protocol}
</td>
<td className=" px-3 py-1">
{data&&
Expand Down
6 changes: 3 additions & 3 deletions website/app/[lang]/pibrowser/explorer/block/[block]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export default async function BlockPage({params:{lang,block}}){
<section className=" m-4 overflow-y-scroll h-full pb-28">
<section className="my-2">
<div className="text-center text-2xl font-mono font-semibold border-b mx-4">
Block {block}
{transcript.explorer.block.Block} {block}
<Share block={block}/>
</div>

<div className="text-center pb-2 text-purple-500 text-lg my-2 border-b mx-4" >
<Dashboard block={block}/>
<Dashboard block={block} transcript={transcript.explorer.block}/>
</div>
</section>

<section>
<div className="text-center mb-2 font-bold text-lg bg-border bg-border-size bg-no-repeat bg-left-bottom">
Transaction
{transcript.explorer.block.Transaction}
</div>
<Transaction block={block} transcript={transcript.explorer.transaction}/>
</section>
Expand Down
20 changes: 10 additions & 10 deletions website/app/[lang]/pibrowser/explorer/tx/[tx_hash]/dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react"
import { Server } from "stellar-sdk"
import Link from "next/link"
export default function Dashboard({tx_hash}){
export default function Dashboard({tx_hash,transcript}){
const [lang,setlang] = useState()
const server = new Server(process.env['NEXT_PUBLIC_HORIZON_SERVER'])
const [data,setdata] = useState(null)
Expand All @@ -25,7 +25,7 @@ export default function Dashboard({tx_hash}){
<tbody>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Block
{transcript.Block}
</td>
<td className=" px-3 py-1">
{data &&
Expand All @@ -39,7 +39,7 @@ export default function Dashboard({tx_hash}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Hash
{transcript.Hash}
</td>
<td className=" px-3 py-1 font-bold">
{data&&
Expand All @@ -51,7 +51,7 @@ export default function Dashboard({tx_hash}){

<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Operation
{transcript.Operation}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -61,7 +61,7 @@ export default function Dashboard({tx_hash}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Account
{transcript.Account}
</td>
<td className=" px-3 py-1">
{data &&
Expand All @@ -75,7 +75,7 @@ export default function Dashboard({tx_hash}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Fee
{transcript.Fee}
</td>
<td className=" px-3 py-1">
{data&&
Expand All @@ -89,13 +89,13 @@ export default function Dashboard({tx_hash}){
</tr>
<tr className="border-b border-[#F7E4BE] bg-[#FBF2DE] text-neutral-800">
<td className=" py-1 font-medium">
Memo
{transcript.Memo}
</td>
<td className=" px-3 py-1">
{data&&
<>
<span className="font-bold">
{data.memo ? data.memo:<>None</>}
{data.memo ? data.memo:<>{transcript.None}</>}

</span>
</>
Expand All @@ -107,14 +107,14 @@ export default function Dashboard({tx_hash}){
{data&&data.successful&&
<>
<span className=" inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-green-400 text-white rounded-full">
Success
{transcript.Success}
</span>
</>
}
{data&&!data.successful&&
<>
<span className=" inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-red-600 text-white rounded-full">
Failed
{transcript.Failed}
</span>
</>
}
Expand Down
8 changes: 4 additions & 4 deletions website/app/[lang]/pibrowser/explorer/tx/[tx_hash]/op.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function Operation({tx_hash,transcript}){
return(
<>
<div className="text-center">
There has no Operation
{transcript.no}
</div>
</>
)
Expand All @@ -43,9 +43,9 @@ export default function Operation({tx_hash,transcript}){
<table className="w-full text-center table-fixed font-mono">
<thead className="border-b border-slate-400 text-lg">
<tr>
<th>Account</th>
<th>Type</th>
<th>Detail</th>
<th>{transcript.account}</th>
<th>{transcript.operation}</th>
<th>{transcript.detail}</th>
</tr>
</thead>
<tbody>
Expand Down
6 changes: 3 additions & 3 deletions website/app/[lang]/pibrowser/explorer/tx/[tx_hash]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ export default async function TxPage({params:{lang,tx_hash}}){
<section className=" m-4 overflow-y-scroll h-full pb-28">
<section className="my-2">
<div className="text-center text-2xl font-mono font-semibold border-b mx-4">
Transaction
{transcript.explorer.transaction.Transaction}
<div className=" break-words">
{tx_hash}
</div>
<Share tx_hash={tx_hash}/>
</div>

<div className="text-center pb-2 text-purple-500 text-lg my-2 border-b mx-4" >
<Dashboard tx_hash={tx_hash}/>
<Dashboard tx_hash={tx_hash} transcript={transcript.explorer.transaction}/>
</div>
</section>

<section className="mx-2">
<div className="text-center mb-2 font-bold text-lg bg-border bg-border-size bg-no-repeat bg-left-bottom">
Operation
{transcript.explorer.transaction.op}
</div>
<Operation tx_hash={tx_hash} transcript={transcript.explorer.operation}/>
</section>
Expand Down
14 changes: 7 additions & 7 deletions website/app/[lang]/pibrowser/statistic/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { Line } from "react-chartjs-2"
},
};

export default function Block({data}){
export default function Block({data,transcript}){
if(!data) return
const [filter,setfilter] = useState([])
const [range,setrange] = useState('all')
Expand All @@ -57,14 +57,14 @@ export default function Block({data}){
{
datasets: [
{
label: 'AverageClosedTime',
label: transcript.closed,
data: filter,
borderColor: 'rgb(255, 99, 132)',
backgroundColor: 'rgba(255, 99, 132, 0.5)',
yAxisID: 'y',
},
{
label: 'TotalOperation',
label: transcript.op,
data: filter,
borderColor: 'rgb(53, 162, 235)',
backgroundColor: 'rgba(53, 162, 235, 0.5)',
Expand All @@ -81,13 +81,13 @@ export default function Block({data}){
return(
<>
<div className="text-center mb-2 font-bold text-lg bg-border bg-border-size bg-no-repeat bg-left-bottom ">
Block Performance
{transcript.title}
</div>
<div className="flex items-center justify-center mb-3">
<div className="inline-flex shadow-md hover:shadow-lg focus:shadow-lg" role="group">
<button type="button" className="rounded-l inline-block px-6 py-2.5 bg-yellow-400 text-white font-medium text-xs leading-tight uppercase hover:bg-yellow-600 focus:bg-yellow-600 focus:outline-none focus:ring-0 active:bg-yellow-700 transition duration-150 ease-in-out" onClick={()=>setrange('m')}>Month</button>
<button type="button" className="inline-block px-6 py-2.5 bg-yellow-400 text-white font-medium text-xs leading-tight uppercase hover:bg-yellow-600 focus:bg-yellow-600 focus:outline-none focus:ring-0 active:bg-yellow-700 transition duration-150 ease-in-out" onClick={()=>setrange('y')}>Year</button>
<button type="button" className="rounded-r inline-block px-6 py-2.5 bg-yellow-400 text-white font-medium text-xs leading-tight uppercase hover:bg-yellow-600 focus:bg-yellow-600 focus:outline-none focus:ring-0 active:bg-yellow-700 transition duration-150 ease-in-out" onClick={()=>setrange('all')}>All</button>
<button type="button" className="rounded-l inline-block px-6 py-2.5 bg-yellow-400 text-white font-medium text-xs leading-tight uppercase hover:bg-yellow-600 focus:bg-yellow-600 focus:outline-none focus:ring-0 active:bg-yellow-700 transition duration-150 ease-in-out" onClick={()=>setrange('m')}>{transcript.Month}</button>
<button type="button" className="inline-block px-6 py-2.5 bg-yellow-400 text-white font-medium text-xs leading-tight uppercase hover:bg-yellow-600 focus:bg-yellow-600 focus:outline-none focus:ring-0 active:bg-yellow-700 transition duration-150 ease-in-out" onClick={()=>setrange('y')}>{transcript.Year}</button>
<button type="button" className="rounded-r inline-block px-6 py-2.5 bg-yellow-400 text-white font-medium text-xs leading-tight uppercase hover:bg-yellow-600 focus:bg-yellow-600 focus:outline-none focus:ring-0 active:bg-yellow-700 transition duration-150 ease-in-out" onClick={()=>setrange('all')}>{transcript.ALL}</button>
</div>
</div>
<div className="h-48">
Expand Down
Loading

0 comments on commit 89f40ed

Please sign in to comment.