mirror of
https://github.com/brmlab/brmdoor.git
synced 2025-06-07 19:24:01 +02:00
brmstatus.txt interface support
This commit is contained in:
parent
4e017cb3db
commit
a9fdd97a66
1 changed files with 15 additions and 0 deletions
15
brmd.pl
15
brmd.pl
|
@ -26,6 +26,7 @@ my $web = POE::Component::Server::HTTP->new(
|
|||
"/brmstatus.html" => \&web_brmstatus_html,
|
||||
"/brmstatus.js" => \&web_brmstatus_js,
|
||||
"/brmstatus.png" => \&web_brmstatus_png,
|
||||
"/brmstatus.txt" => \&web_brmstatus_txt,
|
||||
"/" => \&web_index
|
||||
},
|
||||
Headers => {Server => 'brmd/xxx'},
|
||||
|
@ -187,6 +188,20 @@ EOT
|
|||
return RC_OK;
|
||||
}
|
||||
|
||||
sub web_brmstatus_txt {
|
||||
my ($request, $response) = @_;
|
||||
|
||||
my $st = status_str();
|
||||
|
||||
$response->code(RC_OK);
|
||||
$response->push_header("Content-Type", "text/plain");
|
||||
disable_caching($response);
|
||||
|
||||
$response->content($st);
|
||||
|
||||
return RC_OK;
|
||||
}
|
||||
|
||||
sub web_brmstatus_png {
|
||||
my ($request, $response) = @_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue