/[SysIface]/templates/commands.html.epl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /templates/commands.html.epl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (hide annotations)
Tue Jun 16 22:15:34 2009 UTC (10 years, 1 month ago) by dpavlin
File size: 509 byte(s)
added atsar example, render hostname in title

1 dpavlin 6 % my $self = shift;
2     % my $hostname = $self->param('hostname');
3    
4     <form method=get>
5     <label for=hostname>hostname
6     <input name=hostname type=text value="<%= $hostname %>">
7     </label>
8     <input type=submit value=run>
9     </form>
10    
11     <h1><%= $hostname %></h1>
12    
13     % foreach my $cmd ( @{ $self->stash('commands') } ) {
14     % if ( $cmd =~ s{^(#+)\s*}{} ) {
15     % my $l = length($1) + 1;
16     %= "<h$l>$cmd</h$l>"
17     % } else {
18     % my $run = $hostname ? "ssh $hostname $cmd" : $cmd;
19     <b><tt><%= $cmd %></tt></b><br>
20     <pre><%= `$run` %></pre>
21     % }
22     % }

  ViewVC Help
Powered by ViewVC 1.1.26