From 1b6785375ef9d641b95f3dda29e23c05a5afae1a Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 3 Jun 2014 17:23:03 +0000 Subject: [PATCH] checkpoint sweeper GUI --- webif/plugin/sweeper/auto.hook | 12 +- webif/plugin/sweeper/config.jim | 14 + webif/plugin/sweeper/edit.jim | 116 ++++-- webif/plugin/sweeper/rules_json.jim | 2 +- webif/plugin/sweeper/save.jim | 37 ++ webif/plugin/sweeper/schema.js | 95 +++-- webif/plugin/sweeper/script.js | 571 ++++++++++++++++++++++++++-- webif/plugin/sweeper/style.css | 52 ++- webif/plugin/sweeper/test | 16 + 9 files changed, 833 insertions(+), 82 deletions(-) create mode 100755 webif/plugin/sweeper/config.jim create mode 100755 webif/plugin/sweeper/save.jim diff --git a/webif/plugin/sweeper/auto.hook b/webif/plugin/sweeper/auto.hook index 7eceeea..e9c8fbc 100644 --- a/webif/plugin/sweeper/auto.hook +++ b/webif/plugin/sweeper/auto.hook @@ -339,12 +339,14 @@ proc ::sweeper::apply {dir cf} { if {[lindex $rule 0] eq "folder"} { incr runfolder } } - log "Sweep scan starting for $dir" 2 + log "" 2 + log "--- SWEEP SCAN STARTING FOR $dir ---" 2 + log "" 2 foreach e [readdir -nocomplain $dir] { set entry "$dir/$e" if {[file isdirectory $entry]} continue - #if {![string match {*.ts} $entry]} continue + if {![string match {*.ts} $entry]} continue log "+ Sweeper processing $entry" 2 @@ -440,8 +442,14 @@ proc ::sweeper::apply {dir cf} { } } +proc ::sweeper::sweep {dir} { + if {$dir eq $::root} return + ::sweeper::apply $dir "$dir/.sweeper" +} + proc ::sweeper::scan {args} { ::sweeper::apply $::root $::sweeper::cf + scan_run $::root sweeper ::sweeper::sweep } if {[file exists $::sweeper::cf]} { diff --git a/webif/plugin/sweeper/config.jim b/webif/plugin/sweeper/config.jim new file mode 100755 index 0000000..469515d --- /dev/null +++ b/webif/plugin/sweeper/config.jim @@ -0,0 +1,14 @@ +#!/mod/bin/jimsh + +package require cgi +source /mod/webif/lib/setup +require system.class + +httpheader "text/javascript" + +puts { + +var showraw = true; + +} + diff --git a/webif/plugin/sweeper/edit.jim b/webif/plugin/sweeper/edit.jim index 02125d2..d5572c5 100755 --- a/webif/plugin/sweeper/edit.jim +++ b/webif/plugin/sweeper/edit.jim @@ -6,43 +6,111 @@ require system.class set dir [cgi_get dir ""] -if {$dir eq ""} { - set dir [system mediaroot] - set cf "/mod/etc/sweeper.conf" -} else { - set cf "[system mediaroot]/$dir/.rulelist" -} +if {$dir eq ""} { set dir [system mediaroot] } -jscss {schema.js script.js} style.css +jscss {schema.js config.jim script.js} style.css +jqplugin confirmAction enadis header puts "

Sweeper rules for $dir + + (changes pending, not yet saved.) +

-
+
+
+ + + + + +
+
" puts { -