fhemweb.js: Raw definition changes (Forum #56949)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12423 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-10-24 17:30:37 +00:00
parent 6ef873f6d5
commit 24cb4b2817
2 changed files with 10 additions and 10 deletions

16
fhem.pl
View File

@ -1404,7 +1404,7 @@ WriteStatefile()
$stateFile = ResolveDateWildcards($stateFile, @t); $stateFile = ResolveDateWildcards($stateFile, @t);
if(!open(SFH, ">$stateFile")) { if(!open(SFH, ">$stateFile")) {
my $msg = "WriteStateFile: Cannot open $stateFile: $!"; my $msg = "WriteStatefile: Cannot open $stateFile: $!";
Log 1, $msg; Log 1, $msg;
return $msg; return $msg;
} }
@ -2166,16 +2166,16 @@ CommandList($$)
my $str = ""; my $str = "";
if($param =~ m/^-r *(.*)$/) { if($param =~ m/^-r *(.*)$/) {
my $arg = ($1 ? $1 : ".*"); my @list = devspec2array($1 ? $1 : ".*", $cl);
foreach my $d (devspec2array($arg,$cl)) { foreach my $d (sort @list) {
if(!defined($defs{$d})) { return "No device named $d found" if(!defined($defs{$d}));
$str .= "No device named $d found";
last;
}
$str .= "\n" if($str); $str .= "\n" if($str);
my @a = GetDefAndAttr($d); my @a = GetDefAndAttr($d);
$str .= join("\n", @a)."\n" if(@a); $str .= join("\n", @a)."\n" if(@a);
@a = GetAllReadings($d); }
foreach my $d (sort @list) {
$str .= "\n" if($str);
my @a = GetAllReadings($d);
$str .= join("\n", @a)."\n" if(@a); $str .= join("\n", @a)."\n" if(@a);
} }
return $str; return $str;

View File

@ -600,7 +600,7 @@ FW_rawDef()
$("#content").append('<div id="rawDef">'+ $("#content").append('<div id="rawDef">'+
'<textarea id="td_longText" rows="25" cols="60" style="width:99%"/>'+ '<textarea id="td_longText" rows="25" cols="60" style="width:99%"/>'+
'<button>Apply changes</button>'+ '<button>Execute commands</button>'+
'</div></br>'); '</div></br>');
FW_cmd(FW_root+"?cmd=list -r "+dev+"&XHR=1", function(data) { FW_cmd(FW_root+"?cmd=list -r "+dev+"&XHR=1", function(data) {
@ -626,7 +626,7 @@ FW_rawDef()
doNext() doNext()
{ {
if(++i1 >= arr.length) { if(++i1 >= arr.length) {
return FW_okDialog("Applied changes, no errors found."); return FW_okDialog("Executed everything, no errors found.");
return; return;
} }
str += arr[i1]; str += arr[i1];