Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Commit

Permalink
Clearing old logs should remove the file
Browse files Browse the repository at this point in the history
  • Loading branch information
hummypkg committed Jan 17, 2019
1 parent a4fe3dc commit 0618809
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion webif/html/diag/diag.jim
Expand Up @@ -136,13 +136,15 @@ puts {

source /mod/webif/html/log/_lib.jim
foreach file [lsort -command logsort $loglist] {
set act clear
if {[string match {*.[0-9][0-9][0-9][0-9]*} $file]} { set act unlink }
puts "
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
<a href=\"../log/?log=[cgi_quote_url $file]\">
[file tail $file]
</a>
(<span class=lsize>[pretty_size [file size $file]]</span>)
<a class=\"va footnote logclear\" href=# file=\"$file\">
<a class=\"va footnote logclear\" act=$act href=# file=\"$file\">
<img class=va border=0 src=/img/close.png width=20>Clear</a>
<br>"
}
Expand Down
9 changes: 7 additions & 2 deletions webif/html/diag/script.js
Expand Up @@ -85,12 +85,17 @@ $('a.logclear').on('click', function(e) {

var $t = $(this);
var file = $t.attr('file');
var act = $t.attr('act');

if (!confirm('Delete ' + file + '?'))
if (act == 'clear')
t = 'Truncate';
else
t = 'Delete';
if (!confirm(t + ' ' + file + '?'))
return;

chunked_request('Clearing log <i>' + file + '</i>',
'/log/act.jim', { action: 'clear', file: file });
'/log/act.jim', { action: act, file: file });
});

$.getJSON('/diag/rpc.jim?act=getall', function(data) {
Expand Down

0 comments on commit 0618809

Please sign in to comment.