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) function main_ready(data)
{ {
$('#main_results').html(data); $('#main_results').html(data);
$('#server_select').val('{$server}');
// window.location.hash = current_hash; // window.location.hash = current_hash;
main_timeout = setTimeout(main_refresh, main_delay); main_timeout = setTimeout(main_refresh, main_delay);

View file

@ -2,27 +2,41 @@
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
echo "<br><table class='dataGrid'>"; //echo '<br><table id="maintable" class="dataGrid">';
//showTableSorter('maintable'); showTableSorter('maintable', '{
echo "<thead class=''>"; 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 <<<end
echo "<th width=30></th>"; <thead class="">
echo "<th></th>"; <tr>
echo "<th>Name</th>"; <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>"; </tr>
echo "<th align=right>Profit</th>"; </thead><tbody>
echo "<th align=right>Owed/BTC</th>"; end;
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>";
$current_algo = ''; $current_algo = '';
@ -35,12 +49,6 @@ if(!empty($server))
else else
$coins = getdbolist('db_coins', "installed or enable order by algo, index_avg desc"); $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) foreach($coins as $coin)
{ {
if($coin->algo != $current_algo) if($coin->algo != $current_algo)
@ -150,6 +158,12 @@ foreach($coins as $coin)
echo "</tr>"; echo "</tr>";
} }
$total = count($coins);
echo "<tr>";
echo "<td colspan=2></td>";
echo "<td colspan=9>$total Coins</td>";
echo "</tr>";
echo "</tbody>"; echo "</tbody>";
echo "</table>"; echo "</table>";