line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Reports::Web::Controller::Tapper; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
3
|
|
|
|
|
|
|
$Tapper::Reports::Web::Controller::Tapper::VERSION = '5.0.14'; |
4
|
10
|
|
|
10
|
|
5370
|
use strict; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
368
|
|
5
|
10
|
|
|
10
|
|
261
|
use warnings; |
|
10
|
|
|
|
|
91
|
|
|
10
|
|
|
|
|
387
|
|
6
|
10
|
|
|
10
|
|
285
|
use 5.010; |
|
10
|
|
|
|
|
41
|
|
7
|
10
|
|
|
10
|
|
4718
|
use Tapper::Reports::Web::Util; |
|
10
|
|
|
|
|
33
|
|
|
10
|
|
|
|
|
393
|
|
8
|
|
|
|
|
|
|
|
9
|
10
|
|
|
10
|
|
84
|
use parent 'Tapper::Reports::Web::Controller::Base'; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
93
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub index :Path :Args(0) |
12
|
|
|
|
|
|
|
{ |
13
|
3
|
|
|
3
|
|
4233
|
my ( $self, $c ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# the easy way, to avoid fiddling with Mason autohandlers on |
16
|
|
|
|
|
|
|
# simple redirects |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
9
|
my $body = <<EOF; |
19
|
|
|
|
|
|
|
<html> |
20
|
|
|
|
|
|
|
<head> |
21
|
|
|
|
|
|
|
<meta http-equiv="refresh" content="0; URL=/tapper/start"> |
22
|
|
|
|
|
|
|
<meta name="description" content="Tapper" |
23
|
|
|
|
|
|
|
<title>Tapper</title> |
24
|
|
|
|
|
|
|
</head> |
25
|
|
|
|
|
|
|
EOF |
26
|
3
|
|
|
|
|
70
|
$c->response->body($body); |
27
|
10
|
|
|
10
|
|
1290
|
} |
|
10
|
|
|
|
|
27
|
|
|
10
|
|
|
|
|
91
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub auto :Private |
31
|
|
|
|
|
|
|
{ |
32
|
18
|
|
|
18
|
1
|
28708
|
my ( $self, $c ) = @_; |
33
|
18
|
|
|
|
|
219
|
my $util = Tapper::Reports::Web::Util->new(); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
18
|
|
|
|
|
4843
|
my (undef, $action) = split '/', $c->req->action; |
37
|
18
|
|
|
|
|
1325
|
$c->stash->{top_menu} = $util->prepare_top_menu($action); |
38
|
18
|
50
|
|
|
|
1416
|
if ($c->config->{use_authentication}) { |
39
|
0
|
0
|
|
|
|
0
|
if ($c->user_exists()) { |
40
|
0
|
|
|
|
|
0
|
my $username = $c->user->username; |
41
|
0
|
|
|
|
|
0
|
foreach (@{$c->stash->{top_menu}}) { |
|
0
|
|
|
|
|
0
|
|
42
|
0
|
0
|
|
|
|
0
|
if ($_->{text} eq 'Login') { |
43
|
0
|
|
|
|
|
0
|
$_->{text} = "Logout $username"; |
44
|
0
|
|
|
|
|
0
|
$_->{uri} = '/tapper/user/logout'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# if auto returns false the remaining actions are not called |
51
|
18
|
|
|
|
|
1939
|
1; |
52
|
10
|
|
|
10
|
|
134870
|
} |
|
10
|
|
|
|
|
31
|
|
|
10
|
|
|
|
|
53
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=pod |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=encoding UTF-8 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 NAME |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Tapper::Reports::Web::Controller::Tapper |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 auto |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This function is called. It creates the datastructure for the associated |
70
|
|
|
|
|
|
|
autohandler template to generate the navigation links. This |
71
|
|
|
|
|
|
|
datastructure is put onto the stash and therefore the function does not |
72
|
|
|
|
|
|
|
return anything. It is called automatically from Catalyst with an object |
73
|
|
|
|
|
|
|
reference ($self) and the catalyst context. Thus you also don't need to |
74
|
|
|
|
|
|
|
worry about parameters. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 AUTHORS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over 4 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This software is Copyright (c) 2019 by Advanced Micro Devices, Inc.. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This is free software, licensed under: |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |