| 1 | package Zabbix::Reporter::Web::Plugin::List; | ||||||||||||
| 2 | { | ||||||||||||
| 3 | 1 | $Zabbix::Reporter::Web::Plugin::List::VERSION = '0.07'; | |||||||||||
| 4 | } | ||||||||||||
| 5 | 1 | ▶ | BEGIN { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | $Zabbix::Reporter::Web::Plugin::List::AUTHORITY = 'cpan:TEX'; | |||||||||||
| 7 | } | ||||||||||||
| 8 | # ABSTRACT: List all active triggers | ||||||||||||
| 9 | |||||||||||||
| 10 | 1 | ▶ | use 5.010_000; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 1 | ▶ | use mro 'c3'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 1 | ▶ | use feature ':5.10'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 1 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | 1 | ▶ | use namespace::autoclean; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | |||||||||||||
| 17 | # use IO::Handle; | ||||||||||||
| 18 | # use autodie; | ||||||||||||
| 19 | # use MooseX::Params::Validate; | ||||||||||||
| 20 | # use Carp; | ||||||||||||
| 21 | # use English qw( -no_match_vars ); | ||||||||||||
| 22 | # use Try::Tiny; | ||||||||||||
| 23 | 1 | ▶ | use Template; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 24 | |||||||||||||
| 25 | # extends ... | ||||||||||||
| 26 | 1 | extends 'Zabbix::Reporter::Web::Plugin'; | |||||||||||
| 27 | # has ... | ||||||||||||
| 28 | # with ... | ||||||||||||
| 29 | # initializers ... | ||||||||||||
| 30 | 0 | ▶ | sub _init_fields { return [qw(limit offset refresh)]; } | ||||||||||
|
Subroutine
_init_fields: not called CC=1 SCAR=6.9
| |||||||||||||
| 31 | |||||||||||||
| 32 | 0 | ▶ | sub _init_alias { return 'list_triggers'; } | ||||||||||
|
Subroutine
_init_alias: not called CC=1 SCAR=6.9
| |||||||||||||
| 33 | |||||||||||||
| 34 | # your code here ... | ||||||||||||
| 35 | 0 | ▶ | sub execute { | ||||||||||
|
Subroutine
execute: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 36 | 0 | my $self = shift; | |||||||||||
| 37 | 0 | my $request = shift; | |||||||||||
| 38 | |||||||||||||
| 39 | 0 | my $triggers = $self->zr()->triggers(); | |||||||||||
| 40 | 0 | ▶ | my $refresh = $request->{'refresh'} || 30; | ||||||||||
|
Condition0%0/2
$request->{'refresh'} || 30
MC/DC0%0/1
$request->{'refresh'} || 30
$request->{'refresh'}
Truth table0%0/2
A
A= $request->{'refresh'}
| |||||||||||||
| 41 | |||||||||||||
| 42 | 0 | my $body; | |||||||||||
| 43 | 0 | ▶ | $self->tt()->process( | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 44 | 'list_triggers.tpl', | ||||||||||||
| 45 | { | ||||||||||||
| 46 | 'triggers' => $triggers, | ||||||||||||
| 47 | 'refresh' => $refresh, | ||||||||||||
| 48 | }, | ||||||||||||
| 49 | \$body, | ||||||||||||
| 50 | ) or $self->logger()->log( message => 'TT error: '.$self->tt()->error, level => 'warning', ); | ||||||||||||
| 51 | |||||||||||||
| 52 | 0 | return [ 200, [ | |||||||||||
| 53 | 'Content-Type', 'text/html', | ||||||||||||
| 54 | 'Cache-Control', 'max-age='.($refresh-1).', private', | ||||||||||||
| 55 | ], [$body] ]; | ||||||||||||
| 56 | } | ||||||||||||
| 57 | |||||||||||||
| 58 | 1 | ▶ | no Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 59 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||
| 60 | |||||||||||||
| 61 | 1 | 1; | |||||||||||
| 62 | |||||||||||||
| 63 | __END__ | ||||||||||||