Commit 1ef86978 authored by MMuArFF's avatar MMuArFF
Browse files

logs

parent 4f15f1b1
......@@ -11,4 +11,5 @@ need a runnig LND node and php-curl.
Demo at http://lnd-wallet.zapto.org
Logs viewer : http://tailon.readthedocs.io/en/latest/
#Enjoy !
<?php
$conf['logs'] = true ;// an ifram for your favorite logviever
$conf['logs_port'] = 1338;
?>
\ No newline at end of file
<?php
include('conf.php');
$client = New LightningClient();
function in_array_r($needle, $haystack, $strict = true) {
foreach ($haystack as $item) {
......@@ -86,4 +86,14 @@ function getActiveandInactiveChannels($chans)
}
$channels = array($active,$inactive);
return $channels;
}
\ No newline at end of file
}
function logs_on()
{
global $conf;
if($fp = fsockopen('127.0.0.1',$conf['logs_port'],$errCode,$errStr,5) && $conf['logs']==true){
return true;
} else {
return false;
}
fclose($fp);
}
<?php
function Action(){
global $conf;
return template("../view/logs.html.php",$conf);
}
?>
\ No newline at end of file
......@@ -8,7 +8,7 @@ $client = new LightningClient();
if(isset($_GET['EN']) OR isset($_GET['FR'])): $langChanged = true; else: $langChanged = false; endif;
$page = key($_GET) ?? 'receive';
$page_secure = array('send','balance','channels','decode','list','listout','nodeinfo','transactions','peers','receive','sign','verify');
$page_secure = array('send','balance','channels','decode','list','listout','nodeinfo','transactions','peers','receive','sign','verify','logs');
if(in_array($page, $page_secure,true)){
......
......@@ -211,4 +211,5 @@ if(empty($pending_channels)): goto add_chan; endif; ?>
<span class="input-group-btn"><input type="submit" class="btn btn-secondary" ">Go!</input></span>
</div>
</fieldset>
</form>
\ No newline at end of file
</form>
<iframe src="http://127.0.0.1:1338" width="100%" height="500px"></iframe>
\ No newline at end of file
<?php
if(logs_on()== true):
?><iframe src="http://127.0.0.1:<?= $logs_port ?>" width="100%" height="500px"></iframe>
<?php
else:
echo 'please configure a logs viever service like <a href="http://tailon.readthedocs.io/en/latest/">tailon</a>';
endif;
?>
\ No newline at end of file
<?php
$active_balance = ''; $active_send = ''; $active_receive = ''; $active_node = ''; $active_channels = ''; $active_list = ''; $active_peer = ""; $active_list =''; $active_transactions = "";$active_listout = '';$active_decode = '';$active_sign = '';$active_verify = '';
$active_balance = ''; $active_send = ''; $active_receive = ''; $active_node = ''; $active_channels = ''; $active_list = ''; $active_peer = ""; $active_list =''; $active_transactions = "";$active_listout = '';$active_decode = '';$active_sign = '';$active_verify = '';$active_logs='';
if(isset($_GET['peer'])){$active_peer = 'class="active"';}
if(isset($_GET['balance'])){$active_balance = 'class="active"';}
......@@ -13,6 +13,7 @@ if(isset($_GET['transactions'])){$active_transactions = 'class="active"';}
if(isset($_GET['decode'])){$active_decode = 'class="active"';}
if(isset($_GET['sign'])){$active_sign = 'class="active"';}
if(isset($_GET['verify'])){$active_verify = 'class="active"';}
if(isset($_GET['logs'])){$active_logs = 'class="active"';}
if(empty($_GET) OR isset($_GET['receive'])){$active_receive = 'class="active"';}
?><div class="row">
<div class="col-md-2">
......@@ -43,6 +44,7 @@ if(empty($_GET) OR isset($_GET['receive'])){$active_receive = 'class="active"';}
<small><b>Misc</b></small>
<ul class="nav nav-pills nav-stacked">
<li <?=$active_decode?>><a href="?decode"><?=ucfirst($_lang_decode)?></a></li>
<li <?=$active_logs?>><a href="?logs">Logs</a></li>
<li <?=$active_sign?>><a href="?send"><?=ucfirst($_lang_sign)?></a></li>
<li <?=$active_verify?>><a href="?receive"><?=ucfirst($_lang_verify)?></a></li>
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment