Add config viewer

This commit is contained in:
barbequesauce 2017-11-15 11:43:53 -05:00 committed by evilhero
parent 62b6f16e98
commit fab36cb53d
2 changed files with 104 additions and 13 deletions

View File

@ -45,7 +45,7 @@
<label><strong>Mylar Data Directory :</strong> ${config['data_dir']}</label></br>
<label><strong>Mylar Program Directory :</strong> ${config['prog_dir']}</label></br>
<label><strong>Mylar Cache Directory :</strong> ${config['cache_dir']}</label></br>
<label><strong>Mylar Config File :</strong>${config['config_file']}</label></br>
<a href="config_dump"><label><strong>Mylar Config File :</strong>${config['config_file']}</label></a></br>
</div>
</fieldset>
@ -362,11 +362,6 @@
</div>
</div>
<div class="row checkbox left clearfix">
<input type="checkbox" id="sab_client_post_processing" onclick="initConfigCheckbox($this));" name="sab_client_post_processing" value="1" ${config['sab_client_post_processing']} /><label>Enable Completed Download Handling<label>
<small>The category label above is used to when completed download handling is enabled</small>
</div>
<div align="center" class="row">
<input type="button" value="Test SABnzbd" id="test_sab" style="float:center" /></br>
<input type="text" name="sabstatus" style="text-align:center; font-size:11px;" id="sabstatus" size="50" DISABLED />
@ -414,12 +409,7 @@
%endfor
</select>
</div>
<div class="row checkbox left clearfix">
<input type="checkbox" id="nzbget_client_post_processing" onclick="initConfigCheckbox($this));" name="nzbget_client_post_processing" value="1" ${config['nzbget_client_post_processing']} /><label>Enable Completed Download Handling<label>
<small>The category label above is used to when completed download handling is enabled</small>
</div>
</fieldset>
<fieldset id="blackhole_options">
<div class="row">
@ -434,6 +424,7 @@
<input type="text" name="usenet_retention" value="${config['usenet_retention']}" size="10">
</div>
</fieldset>
</td>
<td>
<legend>Torrents</legend>
@ -937,6 +928,7 @@
</div>
</div>
</fieldset>
</td>
<td>
<fieldset>
@ -1805,7 +1797,6 @@
return;
}
$('#sabstatus').val(data);
// $('#sab_apikey').val(data);
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+data+"</div>");
});
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();

View File

@ -0,0 +1,100 @@
<%inherit file="base.html"/>
<%!
import mylar
from mylar import helpers
%>
<%def name="headerIncludes()">
<div id="subhead_container">
<div id="subhead_menu">
</div>
</div>
</%def>
<%def name="body()">
<div class="title">
<h1 class="clearfix"><img src="interfaces/default/images/icon_logs.png" alt="config"/>Config listing</h1>
</div>
<table class="display_config" id="config_table">
<thead>
<tr>
<th id="key">Key</th>
<th id="value">Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<br>
</%def>
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
</%def>
<%def name="javascriptIncludes()">
<script src="js/libs/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {
initActions();
$('#config_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": 'getConfig',
"sPaginationType": "full_numbers",
"aaSorting": [[0, 'desc']],
"iDisplayLength": 25,
"bStateSave": true,
"oLanguage": {
"sSearch":"Filter:",
"sLengthMenu":"Show _MENU_ lines per page",
"sEmptyTable": "No config information available",
"sInfo":"Showing _START_ to _END_ of _TOTAL_ lines",
"sInfoEmpty":"Showing 0 to 0 of 0 lines",
"sInfoFiltered":"(filtered from _MAX_ total lines)"},
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
// if (aData[1] === "ERROR") {
// $('td', nRow).closest('tr').addClass("gradeX");
// } else if (aData[1] === "WARNING") {
// $('td', nRow).closest('tr').addClass("gradeW");
// } else {
$('td', nRow).closest('tr').addClass("gradeZ");
// }
return nRow;
},
"fnDrawCallback": function (o) {
// Jump to top of page
$('html,body').scrollTop(0);
},
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
$.getJSON(sSource, aoData, function (json) {
fnCallback(json)
});
}
});
});
</script>
<script>
var timer;
function setRefresh()
{
refreshrate = document.getElementById('refreshrate');
if(refreshrate != null)
{
if(timer)
{
clearInterval(timer);
}
if(refreshrate.value != 0)
{
timer = setInterval("$('#config_table').dataTable().fnDraw()",1000*refreshrate.value);
}
}
}
</script>
</%def>