mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +00:00
configDB.pm: add attribute shortinfo for use with configdb info
git-svn-id: https://svn.fhem.de/fhem/trunk@26291 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
eeb25045b5
commit
04b67d0444
@ -482,6 +482,7 @@ sub cfgDB_SaveCfg { ## prototype used in fhem.pl
|
|||||||
$internal = defined($internal) ? $internal : 0;
|
$internal = defined($internal) ? $internal : 0;
|
||||||
my $c = "configdb";
|
my $c = "configdb";
|
||||||
my @dontSave = qw(configdb:rescue configdb:nostate configdb:loadversion
|
my @dontSave = qw(configdb:rescue configdb:nostate configdb:loadversion
|
||||||
|
configdb:shortinfo
|
||||||
global:configfile global:statefile global:version);
|
global:configfile global:statefile global:version);
|
||||||
my (%devByNr, @rowList, %comments, $t, $out);
|
my (%devByNr, @rowList, %comments, $t, $out);
|
||||||
|
|
||||||
@ -946,6 +947,9 @@ sub _cfgDB_Info {
|
|||||||
my ($sql, $sth, @line, $row);
|
my ($sql, $sth, @line, $row);
|
||||||
|
|
||||||
# read versions table statistics
|
# read versions table statistics
|
||||||
|
|
||||||
|
$configDB{attr}{shortinfo} //= 0;
|
||||||
|
if ($configDB{attr}{shortinfo} == 0) {
|
||||||
my $maxVersions = $configDB{attr}{maxversions};
|
my $maxVersions = $configDB{attr}{maxversions};
|
||||||
$maxVersions = ($maxVersions) ? $maxVersions : 0;
|
$maxVersions = ($maxVersions) ? $maxVersions : 0;
|
||||||
push @r, " max Versions: $maxVersions" if($maxVersions);
|
push @r, " max Versions: $maxVersions" if($maxVersions);
|
||||||
@ -969,21 +973,15 @@ sub _cfgDB_Info {
|
|||||||
$row .= " tag: ".$line[8] if $line[8];
|
$row .= " tag: ".$line[8] if $line[8];
|
||||||
push @r, $row;
|
push @r, $row;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
my $count;
|
||||||
|
$count = $fhem_dbh->selectrow_array('SELECT count(*) FROM fhemversions');
|
||||||
|
push @r, " versions: $count";
|
||||||
|
$count = $fhem_dbh->selectrow_array('SELECT count(*) FROM fhemconfig');
|
||||||
|
push @r, " config: $count entries";
|
||||||
|
}
|
||||||
push @r, $l;
|
push @r, $l;
|
||||||
|
|
||||||
## read state table statistics
|
|
||||||
# $count = $fhem_dbh->selectrow_array('SELECT count(*) FROM fhemstate');
|
|
||||||
# $f = ($count>1) ? "s" : "";
|
|
||||||
## read state table creation time
|
|
||||||
# $sth = $fhem_dbh->prepare( "SELECT * FROM fhemstate WHERE STATESTRING like '#%'" );
|
|
||||||
# $sth->execute();
|
|
||||||
# while ($row = $sth->fetchrow_array()) {
|
|
||||||
# (undef,$row) = split(/#/,$row);
|
|
||||||
# $row = " state: $count entrie$f saved: $row";
|
|
||||||
# push @r, $row;
|
|
||||||
# }
|
|
||||||
# push @r, $l;
|
|
||||||
|
|
||||||
$row = $fhem_dbh->selectall_arrayref("SELECT filename from fhemb64filesave group by filename");
|
$row = $fhem_dbh->selectall_arrayref("SELECT filename from fhemb64filesave group by filename");
|
||||||
$count = @$row;
|
$count = @$row;
|
||||||
$count = ($count)?$count:'No';
|
$count = ($count)?$count:'No';
|
||||||
@ -1268,16 +1266,18 @@ sub _cfgDB_knownAttr {
|
|||||||
"(0|1) delete file from filesystem after import";
|
"(0|1) delete file from filesystem after import";
|
||||||
$configDB{knownAttr}{dumpPath} =
|
$configDB{knownAttr}{dumpPath} =
|
||||||
"(valid path) define path for database dump";
|
"(valid path) define path for database dump";
|
||||||
# $configDB{knownAttr}{loadversion}=
|
|
||||||
# "for internal use only";
|
|
||||||
$configDB{knownAttr}{maxversions}=
|
$configDB{knownAttr}{maxversions}=
|
||||||
"(number) define maximum number of configurations stored in database";
|
"(number) define maximum number of configurations stored in database";
|
||||||
$configDB{knownAttr}{mysqldump}=
|
$configDB{knownAttr}{mysqldump}=
|
||||||
"(valid parameter string) define additional parameters used for dump in mysql environment";
|
"(valid parameter string) define additional parameters used for dump in mysql environment";
|
||||||
# $configDB{knownAttr}{nostate}=
|
|
||||||
# "for internal use only";
|
|
||||||
$configDB{knownAttr}{private}=
|
$configDB{knownAttr}{private}=
|
||||||
"(0|1) show or supress userdata in info output";
|
"(0|1) show or supress userdata in info output";
|
||||||
|
$configDB{knownAttr}{shortinfo}=
|
||||||
|
"(0|1) show detailed or short result in info output";
|
||||||
|
# $configDB{knownAttr}{loadversion}=
|
||||||
|
# "for internal use only";
|
||||||
|
# $configDB{knownAttr}{nostate}=
|
||||||
|
# "for internal use only";
|
||||||
# $configDB{knownAttr}{rescue}=
|
# $configDB{knownAttr}{rescue}=
|
||||||
# "for internal use only";
|
# "for internal use only";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user