diff --git a/README.md b/README.md index 7513879..43725df 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Currently, the following information is displayed: * Representative * Market data from coinmarketcap.com -## Installation +## First Installation To use Nano Node Monitor, you will need to setup a Nano node (either [standalone](https://github.com/nanocurrency/raiblocks/releases) or as a [docker image](https://github.com/nanocurrency/raiblocks/wiki/Docker-node)), and a webserver on the same (Linux) machine. See the "Links" section below for tutorials on that. @@ -85,6 +85,9 @@ $nanoNodeRPCIP = '[::1]'; $nanoNodeRPCPort = '7076'; ``` +## Updating +Switch to your installation directory and execute `git pull`. + ## Links * [How to run your own Nano node on DigitalOcean](https://medium.com/@seanomlor/how-to-run-your-own-raiblocks-node-on-digitalocean-6a5a2492c29b) diff --git a/contribute.php b/contribute.php new file mode 100644 index 0000000..b292cde --- /dev/null +++ b/contribute.php @@ -0,0 +1,114 @@ + + + + + + + + + + + Nano Node Monitor - <?php echo $nanoNodeName; ?> + + + + + + + + + + + + + + +
+ + + +
+ +

Contribute

+

+ If you want to contribute to Nano Node Monitor and further improve it, your help is very welcome. Have a look at its GitHub page, browse through open issues, check out the source code, create a branch, develop features, fix some bugs, and open pull requests. Development follows the standard GitHub Flow method. +

+ +

Donate

+ + + + Donations support the efforts of the Nano community to further decentralize the Nano network by running representative nodes. + + + +

+ Donate to the maintainer of this Nano node to help cover some of its costs. +

+ &payment.currency=rai&urls.return=&urls.cancel=&payment.amount=" target="_blank" class="donationButton">Donate + Nano + +

 

+ + + +

+ Donate to the developers of Nano Node Monitor to support further development. +

+ &payment.currency=rai&urls.return=&urls.cancel=&payment.amount=" target="_blank" class="donationButton">Donate + Nano + + + + +

+ + + + +
+ + + + + + + diff --git a/index.php b/index.php index 7264650..5f4caea 100644 --- a/index.php +++ b/index.php @@ -25,30 +25,12 @@ - + + +
+
- + + @@ -97,5 +72,6 @@ + diff --git a/modules/config.sample.php b/modules/config.sample.php index 2ac26df..6418efc 100644 --- a/modules/config.sample.php +++ b/modules/config.sample.php @@ -2,7 +2,9 @@ // FIRST USE // Please copy this file as config.php -// To edit a config uncomment the line + +// To edit a config uncomment the line, otherwise +// defaults will be used for each variable. // ----------- General Variables ----------- @@ -35,8 +37,8 @@ // ip address for RPC (default: 7076) // $nanoNodeRPCPort = '7076'; -// node account +// account of this node // $nanoNodeAccount = 'xrb_1f56swb9qtpy3yoxiscq9799nerek153w43yjc9atoaeg3e91cc9zfr89ehj'; -// donation account -// $nanoDonationAccount = 'xrb_1f56swb9qtpy3yoxiscq9799nerek153w43yjc9atoaeg3e91cc9zfr89ehj'; \ No newline at end of file +// donation account for maintaining this node +// $nanoDonationAccount = 'xrb_1f56swb9qtpy3yoxiscq9799nerek153w43yjc9atoaeg3e91cc9zfr89ehj'; diff --git a/modules/constants.php b/modules/constants.php index 605d66c..8e01272 100644 --- a/modules/constants.php +++ b/modules/constants.php @@ -1,4 +1,16 @@ +
+
+ +

+ +

Contributors: dbachm123, BitDesert, NiFNi

+
+
+ \ No newline at end of file diff --git a/modules/functions.php b/modules/functions.php index 751d2c3..8e95716 100644 --- a/modules/functions.php +++ b/modules/functions.php @@ -75,6 +75,66 @@ function returnJson($data) } // converts boolean to a string -function bool2string($boolean){ +function bool2string($boolean) +{ return ($boolean) ? 'true' : 'false'; +} + +// get version of latest release from github +function getLatestReleaseVersion() +{ + + // get release tag of "latest" from github + $ch = curl_init(); + curl_setopt_array($ch, [ + CURLOPT_URL => GITHUB_LATEST_API_URL, + CURLOPT_HTTPHEADER => [ + "Accept: application/vnd.github.v3+json", + "Content-Type: text/plain", + "User-Agent: Chrome/47.0.2526.111" + ], + CURLOPT_RETURNTRANSFER => true, + CURLOPT_FOLLOWLOCATION => false, + CURLOPT_GET => true + ]); + $output = curl_exec($ch); + curl_close($ch); + + // decode json + $decoded = json_decode($output); + + // tag string + if (array_key_exists("tag_name", $decoded)) + { + $tagString = $decoded->tag_name; + + // search for version name x.x.x + if (0 != preg_match('/(\d+\.?)+$/', $tagString, $versionString)) + { + return $versionString[0]; + } + } + + return ""; +} + +// get a string with information about the +// current version and possible updates + +function getVersionInformation() +{ + $currentVersion = PROJECT_VERSION; + $latestVersion = getLatestReleaseVersion(); + + $versionInfo = "Version: " . $currentVersion; + + if ( version_compare($currentVersion, $latestVersion) < 0 ) + { + $versionInfo .= ". A new version " . $latestVersion; + $versionInfo .= " is available for update at "; + $versionInfo .= "GitHub."; + } + + return $versionInfo; + } \ No newline at end of file diff --git a/modules/navbar.php b/modules/navbar.php new file mode 100644 index 0000000..c9ebf98 --- /dev/null +++ b/modules/navbar.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index a358afd..1db3ee2 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -135,3 +135,28 @@ h2 { margin-top: 1em; color: #ea882e } + +a.donationButton { /* Nano orange */ + background-color: #ea882e; + color: #f7f7f9; + padding: 8px 16px; + text-align: center; + font-size: 16px; + margin: 4px 2px; + text-decoration: none; + transition: 0.3s; + display: inline-block; +} + + + +input[type=number] { /* Nano orange */ + border: 6px solid #ea882e; + color: black; + width: 20%; + padding: 5px 5px; + font-size: 14px; + margin: 4px 2px; + box-sizing: border-box; + border-radius: 4px; +}