/[SysIface]/templates/example/welcome.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

Contents of /templates/example/welcome.html.epl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations)
Tue Jun 16 20:01:10 2009 UTC (14 years, 10 months ago) by dpavlin
File size: 816 byte(s)
introduce <h1> for hostname and <h2> for comments from script

1 % my $self = shift;
2 <h2><%= $self->stash('message') %></h2>
3 This page was generated from the template
4 "templates/example/welcome.html.epl" and the layout
5 "templates/layouts/default.html.epl",
6 <a href="<%= $self->url_for %>">click here</a>
7 to reload the page or
8 <a href="/index.html">here</a>
9 to move forward to a static page.
10
11 % my $hostname = $self->param('hostname');
12
13 <form method=get>
14 <label for=hostname>hostname
15 <input name=hostname type=text value="<%= $hostname %>">
16 </label>
17 <input type=submit value=run>
18 </form>
19
20 <h1><%= $hostname %></h1>
21
22 % foreach my $cmd ( @{ $self->stash('commands') } ) {
23 % if ( $cmd =~ s{^(#+)\s*}{} ) {
24 % my $l = length($1) + 1;
25 %= "<h$l>$cmd</h$l>"
26 % } else {
27 % my $run = $hostname ? "ssh $hostname $cmd" : $cmd;
28 <b><tt><%= $cmd %></tt></b><br>
29 <pre><%= `$run` %></pre>
30 % }
31 % }

  ViewVC Help
Powered by ViewVC 1.1.26