Skip to content

Commit

Permalink
plugins: web_api: Add /flush (log)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsf authored and Mimoja committed Apr 16, 2021
1 parent 6f1cd24 commit b44a634
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion de1plus/plugins/web_api/plugin.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ namespace eval ::plugins::${plugin_name} {
::wibble::return_200_json
}

proc ::wibble::flushLog {state} {
if { ![check_auth $state] } {
return;
}

::logging::flush_log

::wibble::return_200_json
}

proc ::wibble::checkStatus {state} {
if { ![check_auth $state] } {
return;
Expand All @@ -120,7 +130,8 @@ namespace eval ::plugins::${plugin_name} {

::wibble::handle /on togglePowerOn
::wibble::handle /off togglePowerOff
::wibble::handle /status checkStatus
::wibble::handle /status checkStatus
::wibble::handle /flush flushLog
::wibble::handle / notfound

# Start a server and enter the event loop if not already there.
Expand Down

0 comments on commit b44a634

Please sign in to comment.