diff mbox

[OSSTEST,1/2] ms-* html generation: Provide <title>

Message ID 1451926178-10812-2-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Jan. 4, 2016, 4:49 p.m. UTC
This means that these browser windows will actually get titles!

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ms-flights-summary |    2 ++
 ms-planner         |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Ian Campbell Jan. 5, 2016, 10:28 a.m. UTC | #1
On Mon, 2016-01-04 at 16:49 +0000, Ian Jackson wrote:
> This means that these browser windows will actually get titles!

!

I suppose in theory we ought to also close the <body> tag, but we've not
even been opening it until now, so blah.

> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>
diff mbox

Patch

diff --git a/ms-flights-summary b/ms-flights-summary
index ec8fa18..ea72088 100755
--- a/ms-flights-summary
+++ b/ms-flights-summary
@@ -347,6 +347,8 @@  foreach my $f (keys %flights) {
 
 gather_events();
 
+printf("<html><head><title>Flights - %s</title></head><body>\n",
+       $c{DnsDomain} // '?');
 printf("<p>Report at ".fmttime(time)." based on plan at ".fmttime($plan->{Start})."</p>\n");
 
 printf("<p><h1>Overview</h1></p>\n");
diff --git a/ms-planner b/ms-planner
index fc65a5b..7ce0405 100755
--- a/ms-planner
+++ b/ms-planner
@@ -687,6 +687,9 @@  sub cmd_show_html () {
     #print DEBUG "==============================\n",
     #    Dumper(\@rows, \@newoutcols);
 
+    printf "<html><head><title>Resource %s - %s</title></head><body>\n",
+        $walker, ($c{DnsDomain} // '?');
+
     printf "<table rules=all><tr><td>plan age %s</td><td>report at %s</td>\n",
         show_rel_time($now);
     foreach my $ch (@colheads) {
@@ -753,7 +756,7 @@  sub cmd_show_html () {
 	    printf "</ul>\n";
 	    printf "<p>\n";
     }
-    printf "Report generated %s.\n",
+    printf "Report generated %s.\n</body></html>",
         strftime("%Y-%b-%d %a %H:%M:%S", localtime $now);
     die $! if STDOUT->error;
     die $! unless STDOUT->flush;