Browse Source

Merge pull request #47 from pbca26/master

added debug log tab in wallet settings
master
Satinder Grewal 8 years ago
committed by GitHub
parent
commit
946d702982
  1. 27
      assets/scripts/walletsettings.js
  2. 41
      index.html

27
assets/scripts/walletsettings.js

@ -292,3 +292,30 @@ function Settings_AddCoinPeers() {
}
});
}
function Settings_LoadDebugLog() {
var settings_selected_targed_val = $("option:selected","#settings_select_debuglog_options").val();
var numLinesToRead = $('#read_debug_log_lines').val();
var ajax_data = { 'herdname': settings_selected_targed_val, 'lastLines': numLinesToRead };
$.ajax({
type: 'POST',
data: ajax_data,
url: 'http://127.0.0.1:17777/shepherd/debuglog',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
$('#read_debug_log_textarea').text(JSON.parse(data).result.replace('\n', '<br/>'));
console.log(data);
},
error: function(xhr, textStatus, error) {
console.log('failed getting debug.log');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
$('#read_debug_log_textarea').text(error);
}
});
}

41
index.html

@ -1930,7 +1930,48 @@
</div>
<div class="panel">
<div class="panel-heading" id="DebugLog" role="tab">
<a class="panel-title collapsed" data-toggle="collapse" href="#DebugLogTab"
data-parent="#SettingsAccordion" aria-expanded="false"
aria-controls="DebugLogTab">
<i class="icon md-info" aria-hidden="true"></i>Debug Log
</a>
</div>
<div class="panel-collapse collapse" id="DebugLogTab" aria-labelledby="DebugLog"
role="tabpanel">
<div class="panel-body">
<p>This section allows you to read last N lines from debug log file.</i></b></p>
<div class="col-sm-12"></div>
<form class="read-debug-log-import-form" method="post" action="javascript:;" autocomplete="off" onsubmit="return false;">
<div class="form-group form-material floating">
<input type="text" class="form-control" name="read_debug_log_lines" id="read_debug_log_lines" value="10">
<label class="floating-label" for="read_debug_log_lines">Input number of lines to read</label>
</div>
<div class="form-group form-material floating">
<select class="form-control form-material" id="settings_select_debuglog_options">
<option value="iguana">Iguana</option>
<option value="komodo">Komodo</option>
</select>
<label class="floating-label" for="settings_select_debuglog_options">Target</label>
</div>
<div class="col-sm-12 col-xs-12" style="text-align: center;">
<button type="submit" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="read_debug_log_btn" onclick="Settings_LoadDebugLog()">Load debug log</button>
</div>
<div class="col-sm-12 col-xs-12" style="text-align: center;">
<br/>
<textarea id="read_debug_log_textarea" style="width:100%;height:200px"></textarea>
</div>
</form>
<div class="col-sm-12" style="padding-top: 15px;">
<div class="row" id="wif-priv-keys" data-plugin="masonry">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save