From 8c63f5493b101b1af9653c2af120c56d98c811a4 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 17 Mar 2024 22:05:20 +0200 Subject: supa dupa neet html output update --- bin/ak-zblock-gen-html | 203 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 178 insertions(+), 25 deletions(-) (limited to 'bin/ak-zblock-gen-html') diff --git a/bin/ak-zblock-gen-html b/bin/ak-zblock-gen-html index 5c9a8ea..0ad01ad 100755 --- a/bin/ak-zblock-gen-html +++ b/bin/ak-zblock-gen-html @@ -1,5 +1,9 @@ #!/bin/bash +PROGRAM="$(basename $0)" +time_started=$(date -u +%s.%N) +ss=$(echo $time_started | cut -d '.' -f 1) +nss=$(echo $time_started | cut -d '.' -f 2) # Check if there are enough arguments if [ $# -lt 1 ] then @@ -18,8 +22,8 @@ then fi fi -ak-enter -l 1 "$1" | jq '.[]' > tempz -arg="tempz" +arg="$(mktemp)" +ak-enter -l 1 "$1" | jq '.[]' > $arg ( \ # Create HTML document @@ -29,14 +33,50 @@ echo "" echo " Arching Kaos Chain Data" echo ' ' echo ' ' +echo ' ' echo "" echo "" # Iterate through each argument and parse data -# for arg in "$@" if [ -f "$arg" ] then -#do # Extract data from argument zblock=$(cat $arg | jq -r '.zblock') block=$(cat $arg | jq -r '.block') @@ -51,30 +91,143 @@ then datablock=$(cat $arg | jq -r ".$data") # Output data in HTML format - echo "

ZBLOCK: $zblock

" - echo "

BLOCK SIGNATURE: $block_signature

" - echo "
$(ak-ipfs-cat $zblock | jq)
" - echo "

BLOCK: $block

" - echo "
$(ak-ipfs-cat $block | jq)
" - echo "

TIMESTAMP: $timestamp

" - echo "

DETACH: $detach

" - echo "
$(ak-ipfs-cat $detach)
" - echo "

MODULE: $module

" - echo "

ACTION: $action

" - echo "

GPG: $gpg

" - echo "
$(ak-ipfs-cat $gpg)
" - echo "

PREVIOUS: $previous

" - echo "

DATA: $data

" - echo "
$datablock
" - echo "

ipfs: $(echo $datablock | jq -r '.ipfs')

" - echo "

detach: $(echo $datablock | jq -r '.detach')

" - echo "
$(ak-ipfs-cat $(echo $datablock | jq -r '.detach'))
" - echo "

Rendered ZBLOCK

" + echo "

$PROGRAM

" + echo "

🔎 $zblock

" + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo " " + echo "
" + echo "
📦 ZBLOCK
" + echo "
" + echo "
" + echo " $zblock" + echo "
$(ak-ipfs-cat $zblock | jq)
" + echo "
" + echo "
" + echo "
📦 BLOCK
" + echo "
" + echo "
" + echo " $block" + echo "
$(ak-ipfs-cat $block | jq)
" + echo "
" + echo "
" + echo "
🔏 BLOCK SIGNATURE
" + echo "
" + echo "
" + echo " $block_signature" + echo "
$(ak-ipfs-cat $block_signature)
" + echo "
" + echo "
" + echo "
⌚ TIMESTAMP
" + echo "
" + echo "

$timestamp

" + echo "
" + echo "
🔌 MODULE
" + echo "
" + echo "

$module

" + echo "
" + echo "
🪧 ACTION
" + echo "
" + echo "

$action

" + echo "
" + echo "
🔑 GPG
" + echo "
" + echo "
" + echo " $gpg" + echo "
$(ak-ipfs-cat $gpg)
" + echo "
" + echo "
" + echo "
📦 PREVIOUS
" + echo "
" + echo ' 🔗 '$previous'' + echo "
" + echo "
📦 DATA
" + echo "
" + echo "
" + echo " $data" + echo "
$datablock
" + echo "
" + echo "
" + echo "
🔏 DATA_SIGNATURE
" + echo "
" + echo "
" + echo " $detach" + echo "
$(ak-ipfs-cat $detach)
" + echo "
" + echo "
" + echo "
📄 ipfs
" + echo "
" + echo ' '🔗 $(echo $datablock | jq -r '.ipfs')'' + echo "
" + echo "
🔏 detach
" + echo "
" + echo "
" + echo " $(echo $datablock | jq -r '.detach')" + echo "
$(ak-ipfs-cat $(echo $datablock | jq -r '.detach'))
" + echo "
" + echo "
" + echo "
📃 Rendered ZBLOCK
" echo "
$(cat $arg | jq)
" fi -#done +time_ended=$(date -u +%s.%N) +se=$(echo $time_ended | cut -d '.' -f 1) +nse=$(echo $time_ended | cut -d '.' -f 2) +echo "
" +echo -n " " +else + echo "$(( $nse - $(echo -n $nss|sed 's/^0*//') )) seconds" +fi echo "" echo "" ) > zblock-$1.html -rm tempz +rm $arg -- cgit v1.2.3