dashboard: fix select and make the table sortable

This commit is contained in:
Tanguy Pruvot 2015-09-19 02:40:51 +02:00
parent 3a26439428
commit 9fb0ad23f4
2 changed files with 39 additions and 24 deletions

View file

@ -65,6 +65,7 @@ var main_timeout;
function main_ready(data)
{
$('#main_results').html(data);
$('#server_select').val('{$server}');
// window.location.hash = current_hash;
main_timeout = setTimeout(main_refresh, main_delay);

View file

@ -2,27 +2,41 @@
/////////////////////////////////////////////////////////////////////////////////////
echo "<br><table class='dataGrid'>";
//showTableSorter('maintable');
echo "<thead class=''>";
//echo '<br><table id="maintable" class="dataGrid">';
showTableSorter('maintable', '{
headers: {
0:{sorter:false},
1:{sorter:false},
2:{sorter:"text"},
3:{sorter:"text"},
4:{sorter:"currency"},
5:{sorter:"currency"},
6:{sorter:"currency"},
7:{sorter:"currency"},
8:{sorter:"currency"},
9:{sorter:"currency"},
10:{sorter:"currency"}
}}');
echo "<tr>";
echo "<th width=30></th>";
echo "<th></th>";
echo "<th>Name</th>";
echo <<<end
<thead class="">
<tr>
<th width="30"></th>
<th></th>
echo "<th>Server</th>";
<th>Name</th>
<th>Server</th>
<th align="right">Diff/Height</th>
<th align="right">Profit</th>
<th align="right">Owed/BTC</th>
<th align="right">Balance/BTC</th>
<th align="right">Mint/BTC</th>
<th align="right">Price</th>
<th align="right">Win/Market</th>
echo "<th align=right>Diff/Height</th>";
echo "<th align=right>Profit</th>";
echo "<th align=right>Owed/BTC</th>";
echo "<th align=right>Balance/BTC</th>";
echo "<th align=right>Mint/BTC</th>";
echo "<th align=right>Price</th>";
echo "<th align=right>Win/Market</th>";
echo "</tr>";
echo "</thead><tbody>";
</tr>
</thead><tbody>
end;
$current_algo = '';
@ -35,12 +49,6 @@ if(!empty($server))
else
$coins = getdbolist('db_coins', "installed or enable order by algo, index_avg desc");
$total = count($coins);
echo "<tr>";
echo "<td colspan=2></td>";
echo "<td colspan=9>$total Coins</td>";
echo "</tr>";
foreach($coins as $coin)
{
if($coin->algo != $current_algo)
@ -150,6 +158,12 @@ foreach($coins as $coin)
echo "</tr>";
}
$total = count($coins);
echo "<tr>";
echo "<td colspan=2></td>";
echo "<td colspan=9>$total Coins</td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";