Browse Source

html changes

pull/1/head
dan_s 2 years ago
parent
commit
1a1b4162f1
  1. 2
      var/www/explorer.dragonx.is/bin/balances.pl
  2. 49
      var/www/explorer.dragonx.is/bin/update_blocks_redis.pl
  3. 82
      var/www/explorer.dragonx.is/template.html

2
var/www/explorer.dragonx.is/bin/balances.pl

@ -8,7 +8,7 @@ $|=1;
# While Siona swims, we pave with bricks on the road she will run on...
my $STATS = {};
my $acname = $ENV{SIONA_ACNAME} || 'DRAGONWX';
my $ticker = $acname eq 'HUSH3' ? 'HUSH' : $acname;
my $ticker = $acname eq 'HUSH3' ? 'DRGX' : $acname;
my $domain = $ENV{SIONA_DOMAIN} || '$domain';
my $dir = shift || "/var/www/$domain/api";
my $getinfo = readfile("$dir/getinfo.json");

49
var/www/explorer.dragonx.is/bin/update_blocks_redis.pl

@ -19,11 +19,12 @@ my $acname = $ENV{SIONA_ACNAME} || 'DRAGONWX';
my $ticker = $acname eq 'HUSH3' ? 'HUSH' : $acname;
my $domain = $ENV{SIONA_DOMAIN} || 'explorer.dragonx.is';
my $root = "/var/www/$domain";
my $dir = shift || "$root/api";
my $basedir = "/var/www/$domain/var/www/$domain";
my $dir = shift || "$basedir/api";
my $cli = $ENV{SIONA_CLI} || "/git/hush3/src/hush-cli";
my $getinfo = readfile("$dir/getinfo.json");
my $mining = readfile("$dir/getmininginfo.json");
my $blocksdir = "$root/blocks";
my $blocksdir = "$basedir/blocks";
my $template = readfile("$blocksdir/template.html");
if($getinfo =~ m/"blocks": (\d+)/){ $STATS->{BLOCKS} ||= $1; }
if($getinfo =~ m/"tls_connections": (\d+)/){ $STATS->{TLS_CONNECTIONS} ||= $1; }
@ -56,10 +57,10 @@ for my $h ($height-80 .. $height) {
my $hash = qx!$cli -ac_name=$acname getblockhash $h!;
chomp $hash;
my $blockdir = "$root/block/$hash";
if (!-e "$root/block/$h") {
my $blockdir = "$root/var/www/$domain/block/$hash";
if (!-e "$basedir/block/$h") {
# make /block/HEIGHT work
my $cmd = "ln -s $blockdir $root/block/$h";
my $cmd = "ln -s $blockdir $root/var/www/$domain/block/$h";
qx{$cmd};
warn $cmd;
}
@ -68,7 +69,7 @@ for my $h ($height-80 .. $height) {
my $cmd = "mkdir -p $blockdir";
qx{$cmd};
warn $cmd;
my $block_template_file = "$root/block/template.html";
my $block_template_file = "$basedir/block/template.html";
my $new_block_file = "$blockdir/index.html";
# TODO: process template with block details
my $block_template = readfile($block_template_file);
@ -121,9 +122,9 @@ HTML
next if $@;
$TX->{$tx} = $o;
my $tx_dir = "$root/tx/$tx";
my $tx_file = "$root/tx/$tx/index.html";
my $tx_template_file = "$root/tx/template.html";
my $tx_dir = "$root/var/www/$domain/tx/$tx";
my $tx_file = "$root/var/www/$domain/tx/$tx/index.html";
my $tx_template_file = "$root/var/www/$domain/tx/template.html";
my $tx_template = readfile($tx_template_file);
my $txtime = localtime($o->{time});
#my $txsize = $o->{size} . " bytes";
@ -337,12 +338,12 @@ sub get_raw {
# render data
for my $b (reverse @blocks) {
my ($height,$hash,$reward,$time,$txs,$miner,$duration) = @$b;
my ($height,$hash,$reward,$time,$txs,$miner,$duration) = @$b;
$time = localtime($time);
$time = localtime($time);
# we can't calc the duration of the first block we look at, yet
$duration = "--" unless $duration;
# we can't calc the duration of the first block we look at, yet
$duration = "--" unless $duration;
$STATS->{BLOCKS_TABLE} .= <<"FUCK";
<table>
@ -363,7 +364,7 @@ FUCK
for my $s (@symbols) {
if($s && $STATS->{$s}) { $template =~ s/#$s#/$STATS->{$s}/ge }
if($s && $STATS->{$s}) { $template =~ s/#$s#/$STATS->{$s}/ge }
}
# derived stat
@ -382,7 +383,7 @@ sub get_block {
# create data if it's not there
if( $block =~ m/^HASH/ || length($block) == 0 ) {
my $cmd = "$cli -ac_name=$acname getblock $height";
my $cmd = "$cli -ac_name=$acname getblock $height";
warn $cmd;
$block = qx/$cmd/;
}
@ -401,13 +402,13 @@ sub get_block {
}
sub readfile {
my $file = shift;
my $data = "";
open(my $fh, '<', $file) or die "$file: $!";
my $txlist = 0;
while(<$fh>){
$data.=$_
}
close($fh);
return $data;
my $file = shift;
my $data = "";
open(my $fh, '<', $file) or die "$file: $!";
my $txlist = 0;
while(<$fh>){
$data.=$_
}
close($fh);
return $data;
}

82
var/www/explorer.dragonx.is/template.html

@ -21,7 +21,7 @@
</svg>
</a>
<nav class="nav-links mobile">
<!-- https://git.hush.is/dan_s/how-to-mine-dragonx/src/branch/master/README.md -->
<!-- How to mine guide - https://git.hush.is/dan_s/how-to-mine-dragonx/src/branch/master/README.md -->
<a href="" class="component-button" style="--index: 0;"><small class="" style="text-decoration: line-through;">Mine DragonX</small></a>
<a href="" class="component-button" style="--index: 1;"><small class="" style="text-decoration: line-through;">Download Wallet</small></a>
<a href="https://t.me/+ISXrAVgLnXkwZmU5" class="component-button" style="--index: 2;"><small class="">Tech Support</small></a>
@ -35,7 +35,7 @@
</nav>
<nav class="nav-bar desktop">
<nav class="nav-links">
<!-- https://git.hush.is/dan_s/how-to-mine-dragonx/src/branch/master/README.md -->
<!-- How to mine guide - https://git.hush.is/dan_s/how-to-mine-dragonx/src/branch/master/README.md -->
<a href="" class="component-button"><small class="" style="text-decoration: line-through;">Mine DragonX</small></a>
<a href="" class="component-button"><small class="" style="text-decoration: line-through;">Download Wallet</small></a>
<a href="https://t.me/+ISXrAVgLnXkwZmU5" class="component-button"><small class="">Tech Support</small></a>
@ -46,24 +46,24 @@
<div class="header-space"></div>
<div class="divider"></div>
<section class="explorer-section">
<input class="explorer-radio" type="radio" name="radio" id="hush-tab" style="">
<input class="explorer-radio" type="radio" checked="checked" name="radio" id="dragonx-tab" style="">
<input class="explorer-radio" type="radio" name="radio" id="hush-tab">
<input class="explorer-radio" type="radio" checked="checked" name="radio" id="dragonx-tab">
<div class="explorer-content-body">
<section class="explorer-content">
<div class="hush-tab-info-bar"><span>DragonX Was built on the&nbsp<a href="">HUSH</a> Blockchain.</span></div>
<div class="hush-tab-info-bar"><span>DragonX Was built on the&nbsp<a href="https://hush.is">HUSH</a> Blockchain.</span></div>
<img class="logo-hush" src="../img/logo_HUSH.svg" alt="">
</section>
<section class="explorer-content">
<div class="explorer-content-bar"><span>This Explorer was forked from the&nbsp<a href=""> HUSH Explorer</a>.</span></div>
<div class="explorer-content-bar"><span>This Explorer was forked from the&nbsp<a href="htpps://explorer.hush.land"> HUSH Explorer</a>.</span></div>
<div class="explorer-content-bar"><h3>Last Update: </h3><span>#TIPTIME#</span></div>
<div class="explorer-content-bar"><h3>Block Height : </h3><span>#BLOCKS#</span></div>
<div class="explorer-content-bar"><h3>Hashrate: </h3><span>#NETWORKSOLPS#</span></div>
<div class="explorer-content-bar"><h3>Anonymity Set: </h3><span>2410752</span></div>
<div class="explorer-content-bar"><h3 >Anonymity Set: </h3><span class="anonset">2410752</span></div>
<div class="explorer-content-bar"><h3>Total Transactions: </h3><span>#TXCOUNT#</span></div>
<div class="explorer-content-bar"><h3>Price: </h3><span>0.00000273 BTC</span></div>
<div class="explorer-content-bar"><h3>Price: </h3><span class='price'>0.00000273 BTC</span></div>
<div class="explorer-content-bar"><h3>Transaction Rate: </h3><span>#TXRATE#</span></div>
<div class="explorer-content-bar"><h3>Difficulty: </h3><span>#DIFFICULTY#</span></div>
<div class="explorer-content-bar"><h3>Total Volume: </h3><span>.0077033708 BTC</span></div>
<div class="explorer-content-bar"><h3>Total Volume: </h3><span class='volume'>.0077033708 BTC</span></div>
<div class="explorer-content-bar"><h3>Protocol Version: </h3><span>#PROTOCOLVERSION#</span></div>
<div class="explorer-content-bar"><h3>Peers Connected: </h3><span>#CONNECTIONS# via TLS 1.3</span></div>
<div class="explorer-content-bar" style="--explorer-content-index: 2;"><h3>Circulating Supply: </h3><span>#SUPPLY#</span></div>
@ -79,8 +79,6 @@
<div class="explorer-tab-bar">
<label for="hush-tab" class="explorer-tab" style="--tab-index: 2;">
<span>HUSH</span>
</label>
<label for="dragonx-tab" class="explorer-tab" style="--tab-index: 0;">
@ -93,67 +91,5 @@
</div>
</section>
<div class="divider"></div>
<!-- <div>
<h2>DragonX Explorer</h2>
<h3>Private Cryptocurrency and Messenger using Zero Knowledge Mathematics</h3>
<p class="header-details">This explorer was forked from the <a class="explorer-links" href="https://explorer.hush.land">HUSH Explorer</a>.</p>
<table>
<tr>
<td style="font-size: 14px; width: 50%">#TIPTIME#</td>
<td style="font-size: 14px; width: 50%"><a href="/blocks/" class="mainlinkexplorer">Blocks list</a></td>
</tr>
</table>
<table>
<tr>
<td style="font-size: 14px; width: 50%"><a href="/blocks/" class="mainlinkexplorer">Block Height: #BLOCKS# </a></td>
<td style="font-size: 14px; width: 50%"><a href="https://git.hush.is/hush/anonsets" class="mainlinkexplorer">Anonymity Set</a>:<span class='anonset'> 2410752 </span></td>
</tr>
</table>
<table>
<tr>
<td style="font-size: 14px; width: 50%">Total Transactions: #TXCOUNT#</td>
<td style="font-size: 14px; width: 50%">Transaction Rate: #TXRATE# per minute </td>
</tr>
</table>
<table>
<tr>
<td style="font-size: 14px; width: 50%">Hashrate: #NETWORKSOLPS# MSol/s</td>
<td style="font-size: 14px; width: 50%">Difficulty: #DIFFICULTY#</td>
</tr>
</table>
<table>
<tr>
<td style="font-size: 14px; width: 50%">Circulating Supply: #SUPPLY# HUSH</td>
<td style="font-size: 14px; width: 50%">Shielded Supply: #ZFUNDS# HUSH</td>
</tr>
</table>
<table>
<td style="font-size: 14px; width: 50%">Price:<span class='price'> 0.00000273 BTC</span></td>
<td style="font-size: 14px; width: 50%">Total Volume:<span class='volume'> .0077033708 BTC </span></td>
</table>
<table>
<tr>
<td style="font-size: 14px; width: 50%">Percent Shielded: #ZFUNDS_PERCENT# </td>
<td style="font-size: 14px; width: 50%"><a href="/addresses/" class="mainlinkexplorer">T-addresses list</a></td>
</tr>
</table>
<table>
<tr>
<td style="font-size: 14px; width: 50%">#CONNECTIONS# peers connected via TLS 1.3</td>
<td style="font-size: 14px; width: 50%">Protocol Version: #PROTOCOLVERSION#</td>
</tr>
</table>
<div class="links">
<a href="https://hush.is/matrix"><span style="color: #262626">[</span> matrix <span style="color: #262626">]</span></a>
<a href="https://hush.is/mastodon"><span style="color: #262626">[</span> mastodon <span style="color: #262626">]</span></a>
<a href="https://videos.hush.is"><span style="color: #262626">[</span> peertube <span style="color: #262626">]</span></a>
<a href="https://t.me/hush_main"><span style="color: #262626">[</span> telegram <span style="color: #262626">]</span></a>
</div>
</div> -->
</body>
</html>

Loading…
Cancel
Save