diff --git a/webif/html/diag/diag.jim b/webif/html/diag/diag.jim
index 5bf875f..18fa276 100755
--- a/webif/html/diag/diag.jim
+++ b/webif/html/diag/diag.jim
@@ -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 "
[file tail $file]
([pretty_size [file size $file]])
-
+
Clear
"
}
diff --git a/webif/html/diag/script.js b/webif/html/diag/script.js
index 77a0652..f4e8f95 100644
--- a/webif/html/diag/script.js
+++ b/webif/html/diag/script.js
@@ -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 ' + file + '',
- '/log/act.jim', { action: 'clear', file: file });
+ '/log/act.jim', { action: act, file: file });
});
$.getJSON('/diag/rpc.jim?act=getall', function(data) {