goback(); $this->pageTitle = 'Peers - '.$coin->symbol; $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport); $info = $remote->getinfo(); echo getAdminSideBarLinks().'

'; echo getAdminWalletLinks($coin, $info, 'peers').'

'; ////////////////////////////////////////////////////////////////////////////////////// JavascriptFile("/yaamp/ui/js/jquery.metadata.js"); JavascriptFile("/yaamp/ui/js/jquery.tablesorter.widgets.js"); echo << td.red { color: darkred; } table.dataGrid a.red { color: darkred; } div.form { text-align: right; height: 30px; width: 350px; float: right; margin-top: -48px; margin-bottom: 16px; margin-right: -8px; } .main-submit-button { cursor: pointer; }
end; showTableSorter('maintable', "{ tableClass: 'dataGrid', headers: { 0:{sorter:'text'}, 1:{sorter:'text'}, 2:{sorter:'numeric'}, 3:{sorter:'numeric'}, 4:{sorter:'text'}, 5:{sorter:'metadata'}, 6:{sorter:'metadata'}, 7:{sorter:'numeric'}, 7:{sorter:false} }, widgets: ['zebra','Storage','saveSort'], widgetOptions: { saveSort: true } }"); echo << Address Version Height Ping Services Since Last Rx / Tx (kB) end; $addnode = array(); $version = ''; $localheight = arraySafeVal($info, 'blocks'); $list = $remote->getpeerinfo(); if(!empty($list)) foreach($list as $peer) { echo ''; $node = arraySafeVal($peer,'addr'); echo ''.$node.''; $addnode[] = ($coin->symbol=='DCR' ? 'addpeer=' : 'addnode=') . $node; $peerver = trim(arraySafeVal($peer,'subver'),'/'); $version = max($version, $peerver); echo ''.$peerver.''; $height = arraySafeVal($peer,'currentheight'); $class = abs($height - $localheight) > 5 ? 'red' : ''; if (!$height) $height = arraySafeVal($peer,'synced_blocks'); echo ''.$height.''; echo ''.arraySafeVal($peer,'pingtime','').''; echo ''.arraySafeVal($peer,'services','').''; $conntime = arraySafeVal($peer,'conntime',time()); $startingheight = arraySafeVal($peer,'startingheight'); echo ''.datetoa2($conntime)." ($startingheight)".''; $lastrecv = arraySafeVal($peer,'lastrecv',time()); $lastsend = arraySafeVal($peer,'lastsend',time()); echo ''.datetoa2(max($lastrecv,$lastsend)).''; $bytesrecv = round(arraySafeVal($peer,'bytesrecv')/1024.,1); $bytessent = round(arraySafeVal($peer,'bytessent')/1024.,1); if ($bytesrecv+$bytessent) echo ''."$bytesrecv / $bytessent".''; else echo ''; echo ''; $options = array('class'=>'red', 'title'=>'Disconnect from node'); echo CHtml::link('remove','/site/peerRemove?id='.$coin->id.'&node='.$node, $options); echo ''; echo ''; } echo '
'; echo 'Local version: '.formatWalletVersion($coin).' '; echo 'Latest : '.$version; echo '
';
echo implode("\n",$addnode);
echo '
'; //echo json_encode($list);