diff --git a/fhem/CHANGED b/fhem/CHANGED index b2a38926b..172e4b089 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -11,6 +11,7 @@ - feature: NetIO230B module by Andy - feature: Retaining configfile comments (not within a define statement) - feature: EnOcean PM101 by Ignaz + - feature: FHEMWEB redirectCmds attribute added - 2011-12-31 (5.2) - bugfix: applying smallscreen attributes to firefox/opera diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index f95f399d4..142718a44 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -7348,6 +7348,16 @@ href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=29870">U
+ +
  • redirectCmds
    + Clear the browser URL window after issuing the command by redirecting + the browser, as a reload for the same site might have unintended + side-effects. Default is 1 (enabled). Disable it by setting this + attribute to 0 if you want to study the command syntax, in order to + communicate with FHEMWEB. +
  • +
    +
  • webCmd
    Colon separated list of commands to be shown in the room overview for a diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index e44f8e197..9fefb3b56 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -91,7 +91,7 @@ FHEMWEB_Initialize($) $hash->{AttrList}= "loglevel:0,1,2,3,4,5,6 webname fwmodpath fwcompress " . "plotmode:gnuplot,gnuplot-scroll,SVG plotsize refresh " . "touchpad smallscreen plotfork basicAuth basicAuthMsg ". - "stylesheetPrefix hiddenroom HTTPS longpoll"; + "stylesheetPrefix hiddenroom HTTPS longpoll redirectCmds"; ############### # Initialize internal structures @@ -436,6 +436,19 @@ FW_AnswerCall($) return 0; } + # Redirect after a command, to clean the browser URL window + if($docmd && !$FW_cmdret && AttrVal($FW_wname, "redirectCmds", 1)) { + my $tgt = $FW_ME; + if($FW_detail) { $tgt .= "?detail=$FW_detail" } + elsif($FW_room) { $tgt .= "?room=$FW_room" } + my $c = $defs{$FW_cname}{CD}; + print $c "HTTP/1.1 302 Found\r\n", + "Content-Length: 0\r\n", + "Location: $tgt\r\n", + "\r\n"; + return -1; + } + FW_updateHashes(); if($cmd =~ m/^showlog /) { FW_showLog($cmd); @@ -501,7 +514,8 @@ FW_AnswerCall($) FW_pO $FW_cmdret; } FW_pO ""; - } + + } FW_roomOverview($cmd); FW_style($cmd,undef) if($cmd =~ m/^style /); @@ -1528,6 +1542,7 @@ FW_style($$) my $ret = FW_fC("rereadcfg") if($fName eq $attr{global}{configfile}); $ret = ($ret ? "

    ERROR:

    $ret" : "Saved the file $fName"); FW_style("style list", $ret); + $ret = ""; } }