From 84cb939a442679d892a16dfecf63b8df39c9291a Mon Sep 17 00:00:00 2001 From: dbachm123 Date: Sat, 17 Mar 2018 21:47:37 +0000 Subject: [PATCH] tighter layout with grouping --- README.md | 19 +--- api.php | 10 ++- contribute.php | 6 +- index.php | 9 +- modules/config.sample.php | 3 + modules/defaults.php | 5 +- modules/footer.php | 10 +-- modules/functions.php | 13 ++- static/css/custom.css | 12 +++ templates/index.hbs | 181 ++++++++++++++------------------------ 10 files changed, 115 insertions(+), 153 deletions(-) diff --git a/README.md b/README.md index 43725df..47f39fd 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,13 @@ Nano Node Monitor is a server-side PHP-based monitor for a Nano node. It connect Here is what it looks like on a desktop computer ... -![phpNodeXRaiImage](https://i.imgur.com/yZtAtTN.png) +![phpNodeXRaiImage](https://i.imgur.com/1k5BCfc.png) ... and on a mobile device: -![phpNodeXRaiImage](https://i.imgur.com/GZONaxe.jpg) - -Currently, the following information is displayed: -* Node version -* Current block number -* Number of unchecked blocks -* Number of peers -* System load -* System uptime -* Memory usage -* Node address -* Balances -* Voting weight -* Representative -* Market data from coinmarketcap.com +![phpNodeXRaiImage](https://i.imgur.com/PTSwL69.jpg) + ## First Installation diff --git a/api.php b/api.php index 0b4c36e..0d04f43 100644 --- a/api.php +++ b/api.php @@ -40,23 +40,25 @@ // -- Get node account balance from nano_node $rpcNodeAccountBalance = getAccountBalance($ch, $nanoNodeAccount); -$data->accBalanceMnano = rawToMnano($rpcNodeAccountBalance->{'balance'}, 4); +$data->accBalanceMnano = rawToMnano($rpcNodeAccountBalance->{'balance'}, $nanoNumDecimalPlaces); $data->accBalanceRaw = (int) $rpcNodeAccountBalance->{'balance'}; -$data->accPendingMnano = rawToMnano($rpcNodeAccountBalance->{'pending'}, 4); +$data->accPendingMnano = rawToMnano($rpcNodeAccountBalance->{'pending'}, $nanoNumDecimalPlaces); $data->accPendingRaw = (int) $rpcNodeAccountBalance->{'pending'}; // -- Get representative info for current node from nano_node $rpcNodeRepInfo = getRepresentativeInfo($ch, $nanoNodeAccount); -$data->votingWeight = rawToMnano($rpcNodeRepInfo->{'weight'}, 4); +$data->votingWeight = rawToMnano($rpcNodeRepInfo->{'weight'}, $nanoNumDecimalPlaces); $data->repAccount = $rpcNodeRepInfo->{'representative'} ?: ''; // -- System uptime & memory info -- $data->systemLoad = getSystemLoadAvg(); $systemUptime = getSystemUptime(); -$systemUptimeStr = $systemUptime['days'].' days, '.$systemUptime['hours'].' hours, '.$systemUptime['mins'].' minutes'; +$systemUptimeStr = $systemUptime['days'].' days, '.$systemUptime['hours'].' hrs, '.$systemUptime['mins'].' mins'; $data->systemUptime = $systemUptimeStr; $data->usedMem = getSystemUsedMem(); $data->totalMem = getSystemTotalMem(); +$data->uname = getUname(); +$data->nanoNodeName = $nanoNodeName; // close curl handle curl_close($ch); diff --git a/contribute.php b/contribute.php index b292cde..53c8101 100644 --- a/contribute.php +++ b/contribute.php @@ -14,10 +14,11 @@ - + + Nano Node Monitor - <?php echo $nanoNodeName; ?> @@ -98,9 +99,6 @@ - -

- diff --git a/index.php b/index.php index 5f4caea..0a9e782 100644 --- a/index.php +++ b/index.php @@ -35,15 +35,19 @@