Skip to content

Commit

Permalink
🔊 "now" on ping
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Nov 25, 2024
1 parent fcb6acb commit d802f05
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
2 changes: 0 additions & 2 deletions cf-admin-bot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>bot-github-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>io.quarkiverse.githubapp</groupId>
<artifactId>quarkus-github-app</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.commonhaus.automation.admin;

import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
Expand Down Expand Up @@ -32,7 +34,10 @@ public void handleRootRequest(RoutingContext routingContext, RoutingExchange rou
routingExchange
.ok()
.putHeader("X-Robots-Tag", "noindex, nofollow, noarchive, nosnippet, notranslate, noimageindex")
.end(engine.getTemplate("index.html").data("items", result).render());
.end(engine.getTemplate("index.html")
.data("items", result)
.data("now", DateTimeFormatter.ISO_INSTANT.format(Instant.now()))
.render());
}

@Route(path = "/ping", order = 99, produces = "text/html", methods = { HttpMethod.GET })
Expand Down
1 change: 1 addition & 0 deletions cf-admin-bot/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<body>
<p>Alive</p>
<p>{now}</p>
<table>{#each items}
<tr>
<td>{it.key}</td>
Expand Down
2 changes: 0 additions & 2 deletions commonhaus-bot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>bot-github-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>io.quarkiverse.githubapp</groupId>
<artifactId>quarkus-github-app</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.commonhaus.automation;

import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
Expand Down Expand Up @@ -33,7 +35,10 @@ public void handleRootRequest(RoutingContext routingContext, RoutingExchange rou
routingExchange
.ok()
.putHeader("X-Robots-Tag", "noindex, nofollow, noarchive, nosnippet, notranslate, noimageindex")
.end(engine.getTemplate("index.html").data("items", result).render());
.end(engine.getTemplate("index.html")
.data("items", result)
.data("now", DateTimeFormatter.ISO_INSTANT.format(Instant.now()))
.render());
}

@Route(path = "/ping", order = 99, produces = "text/html", methods = { HttpMethod.GET })
Expand Down
1 change: 1 addition & 0 deletions commonhaus-bot/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<body>
<p>Alive</p>
<p>{now}</p>
<table>{#each items}
<tr>
<td>{it.key}</td>
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>bot-github-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
Expand Down

0 comments on commit d802f05

Please sign in to comment.