Skip to content

Commit

Permalink
Plus Release 0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Alcinzal committed Jan 16, 2024
1 parent 77a03f2 commit 39de56e
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 69 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### PLUS 0.2.5 (2024-01-16)
* Fixed bug where statistics graphs would disappear.
* Fixed the charts not updating when the resizing the browser.
* Optimized code a little to not call the same files multiple times.
* Fixed non-existent file being called.
### PLUS 0.2.0 (2024-01-15)
* Greatly improved statistics. Fully reworked, no more json files, everything happens directly in the database.
* Statistics will now also save hidden or shown legends (labels) to local storage.
Expand Down
65 changes: 20 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,32 @@
# UnamWebPanelPlus v0.2.0
# UnamWebPanelPlus v0.2.5

This is a modified version of Unam's [UnamWebPanel](https://github.com/UnamSanctam/UnamWebPanel).
A modified version of Unam's [UnamWebPanel](https://github.com/UnamSanctam/UnamWebPanel).

## What is different?
## Differences

### General
### Main

* Added the XSS patch from https://github.com/UnamSanctam/UnamWebPanel/issues/317#issuecomment-1884683799
* Database is different, includes a statistics table and a country column in the miners table.

### Miners
* Added a country column

### Configurations
* Increased the height of the configurations boxes.
* Added an examples box, so users can easily view how a configuration should look like. (Might be missing some options)
* Lifetime statistics - Statistics are saved every hour forever. You can view the statistics and toggle between viewing the data hourly, daily, weekly or monthly.
* Countries - See which country your miners are from, both in the table and in a pie chart.
* Total Hashrate - An overview of each algorithm, and their total hashrate, online miners and their average hashrate.
* Example configurations - View examples in the configurations page to better understand what settings are available. (In the future the whole configuration page will get reworked to ensure ease of use)
* More to come!

### Plus
* Added Plus page
* Total hashrate section. View the current hashrates, current miners for each hashrate, and average hashrate per miner.
* Statistics sections. Here you can view hourly data for Hashrate, Total Miners, Total Online miners, etc. You can also choose between viewing the data hourly, daily, weekly or monthly.
* Countries section. Here you get to view a pie chart of the amount of miners from each country.
### Other
* Added the XSS patch from https://github.com/UnamSanctam/UnamWebPanel/issues/317#issuecomment-1884683799

### Video
### Video (Outdated)

I have a video showcasing the panel. Statistics pages is unchanged. The IP addresses shown in the video are fake, it's only testing data. Here is the video, sorry for the flickering:
(this video is outdated)
The following video is outdated, however it still looks pretty similar. The IP addresses shown in the video are fake, it's only testing data. Here is the video, sorry for the flickering:

https://github.com/Alcinzal/UnamWebPanelPlus/assets/153958388/03144cbe-210d-443a-a33c-0dafddeb7eec

## Why/How?

### Statistics
A PHP file that saves the statistics gets called each time the endpoint gets called. This saves the current data to the database. The PHP file will write the data to the current hour, meaning that data saved 12:03 will get overwritten by data saved 12:50. This is to prevent large buildups of data. So I guess one could say that the data gets saved hourly. When choosing the intervals between daily, weekly and monthly, it simply takes the values and gets the average of them, it also saves the chosen interval and hidden/shown legends(labels) to local storage.

### Countries
To find which country the miners are from, https://country.is/ is used. Usage is simply: https://api.country.is/8.8.8.8. The country only gets checked if the miner does not exist in the database, aka it's a new miner.

## What needs to be worked on?

### Bugs
* When visting between the Plus page and the Statistics page, the charts at Statistics disappear until you refresh the page.
* ~~When visting between the Plus page and the Statistics page, the charts at Statistics disappear until you refresh the page.~~
* The charts at the plus statistics section will sometimes say that the end of the year is week 1, but it should say week 52 or 53.
* The charts dont update when resizing the browser window.
* ~~The charts dont update when resizing the browser window.~~
* ~~IMPORTANT: The JSON files are available to whoever visits them directly.~~

### Ideas
Expand All @@ -63,15 +47,16 @@ Here are some ideas, brainstorming I guess, so some of them might be dumb or use
* Adding an advanced page, where you can add miners/data to the database, for testing.
* Adding a update section, where you can check for updates from the github, and if there is a new update it updates it automatically.

Here you can see a screenshot of how it might look below the countries section, if I ever complete it.
![image](https://github.com/Alcinzal/UnamWebPanelPlus/assets/153958388/36d8684d-bdac-43dc-b569-a2dcc3ad7d2f)


## Supported Projects

* [SilentCryptoMiner](https://github.com/UnamSanctam/SilentCryptoMiner)

## Changelog
### PLUS 0.2.5 (2024-01-16)
* Fixed bug where statistics graphs would disappear.
* Fixed the charts not updating when the resizing the browser.
* Optimized code a little to not call the same files multiple times.
* Fixed non-existent file being called.
### PLUS 0.2.0 (2024-01-15)
* Greatly improved statistics. Fully reworked, no more json files, everything happens directly in the database.
* Statistics will now also save hidden or shown legends (labels) to local storage.
Expand Down Expand Up @@ -115,16 +100,6 @@ Here you can see a screenshot of how it might look below the countries section,
* Changed endpoint text when the request isn't from the miner to reduce confusion
* Changed string sanitation away from FILTER_SANITIZE_STRING due to PHP 8.1 deprication
* Moved database to its own folder to allow for broader database file blocks
### 1.5.0 (01/05/2022)
* Added new field "Version" that shows the miner version
* Added new field "Active Window" that shows the currently active foreground windows title
* Added new field "Run Time" that shows how long the current session of the miner has been running for
* Added "First Connection" field that shows the date and time when the miner first connected
* Added new miner statuses "Starting" and "Error"
* Added text next to the "Offline" status that shows how long the miner has been offline
* Added error text when an XMR miner cannot connect to its pool
* Added German and French datatable translation files
* Fixed miner table ordering

[You can view the full Changelog here](CHANGELOG.md)

Expand Down
1 change: 0 additions & 1 deletion UnamWebPanel/assets/php/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function generalCSSIncludes(){
<link rel='stylesheet' href='assets/modules/datatables-responsive/css/responsive.bootstrap4.min.css'>
<link rel='stylesheet' href='assets/modules/datatables-buttons/css/buttons.bootstrap4.min.css'>
<link rel='stylesheet' href='assets/css/adminlte.min.css'>
<link rel='stylesheet' href='assets/css/bootstrap.custom.css'>
<link rel='stylesheet' href='assets/css/custom.css'>";
}

Expand Down
2 changes: 1 addition & 1 deletion UnamWebPanel/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
'es'=>'Spanish'
];

$config['unam_version'] = "PLUS 0.2.0";
$config['unam_version'] = "PLUS 0.2.5";

global $config;
2 changes: 0 additions & 2 deletions UnamWebPanel/internalPages/configurationsAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ function getConfigValue($key) {
function loadConfig() {
selected = document.getElementById("selectExampleConfig").value
if (selected == "1") {
console.log(selected)
document.getElementById("textareaExample").innerHTML = JSON.stringify(xmrExampleConfig, null, 4)
}
else if (selected == "2") {
console.log(selected)
document.getElementById("textareaExample").innerHTML = JSON.stringify(ethExampleConfig, null, 4)
}
}
Expand Down
3 changes: 1 addition & 2 deletions UnamWebPanel/plus/countries/countries.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
require_once dirname(__DIR__, 2) . '/assets/php/templates.php';
require_once dirname(__DIR__, 2) . '/security.php';

$CountriesQuery = getConn()->query("SELECT ms_algorithm, ms_hashrate, ms_lastConnection, ms_status, ms_creationDate, ms_country FROM miners");
Expand All @@ -21,7 +20,7 @@

?>
<div class="plus-section">
<div style="height: 400px; width: 400px;" class="plus-box">
<div class="plus-box">
<h2>Total Countries</h2>
<div style="background-color:#343a40;">
<canvas id="chartCountries"></canvas>
Expand Down
8 changes: 8 additions & 0 deletions UnamWebPanel/plus/plus.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@
float: right;
}

#chartHashrate,
#chartExtra,
#chartOnlineOffline,
#chartCountries {
width: 100% !important;
height: 100% !important;
}

#chooseOnlineOffline,
#timeIntervalOnlineOffline,
#timeIntervalExtra,
Expand Down
8 changes: 2 additions & 6 deletions UnamWebPanel/plus/plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
echo '<html>
<head>
<link rel="stylesheet" href="plus/plus.css?timestamp='.$timestamp.'">
<title>Total Hashrate</title>
<script src="assets/modules/chartjs/chart.umd.js"></script>
<script src="assets/modules/chartjs/chartjs-adapter-date-fns.bundle.min.js"></script>
<script src="../UnamWebPanel/plus/plusFunctions.js?timestamp='.$timestamp.'"></script>
</head>
<body>';

Expand Down Expand Up @@ -41,6 +39,4 @@
include("plus/countries/countries.php");

// HTML END
echo '</body></html>';

?>
echo '</body></html>';
4 changes: 0 additions & 4 deletions UnamWebPanel/plus/statistics/viewExtra.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
require_once dirname(__DIR__, 2) . '/assets/php/templates.php';
require_once dirname(__DIR__, 2) . '/security.php';

$ExtraQuery = getConn()->query("SELECT st_date, st_totalMiners, st_totalOnline, st_totalOffline, st_totalActive, st_totalIdle, st_totalStarting, st_totalPaused, st_totalStopped, st_totalError, st_totalVRAM, st_totalUnknown FROM statistics");
Expand Down Expand Up @@ -44,9 +43,6 @@
<canvas id="chartExtra"></canvas>
</div>

<script src='../UnamWebPanel/assets/modules/chartjs/chart.umd.js'></script>
<script src='../UnamWebPanel/plus/plusFunctions.js'></script>

<script>
var myChartExtra = null;

Expand Down
4 changes: 0 additions & 4 deletions UnamWebPanel/plus/statistics/viewHashrate.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
require_once dirname(__DIR__, 2) . '/assets/php/templates.php';
require_once dirname(__DIR__, 2) . '/security.php';

$hashrateQuery = getConn()->query("SELECT st_date, st_hashrate FROM statistics");
Expand Down Expand Up @@ -35,9 +34,6 @@
<canvas id="chartHashrate"></canvas>
</div>

<script src='../UnamWebPanel/assets/modules/chartjs/chart.umd.js'></script>
<script src='../UnamWebPanel/plus/plusFunctions.js'></script>

<script>
var myChartHashrate = null;

Expand Down
4 changes: 0 additions & 4 deletions UnamWebPanel/plus/statistics/viewOnlineOffline.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
require_once dirname(__DIR__, 2) . '/assets/php/templates.php';
require_once dirname(__DIR__, 2) . '/security.php';

$OnlineOfflineQuery = getConn()->query("SELECT st_date, st_onlineMiners, st_offlineMiners FROM statistics");
Expand Down Expand Up @@ -48,9 +47,6 @@
<canvas id="chartOnlineOffline"></canvas>
</div>

<script src='../UnamWebPanel/assets/modules/chartjs/chart.umd.js'></script>
<script src='../UnamWebPanel/plus/plusFunctions.js'></script>

<script>
var myChartOnlineOffline = null;

Expand Down

0 comments on commit 39de56e

Please sign in to comment.