Skip to content

Commit

Permalink
#83 /ping removed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 1, 2017
1 parent 90fc4f7 commit 071dbb0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 81 deletions.
28 changes: 26 additions & 2 deletions src/main/resources/org/jpeek/web/all.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,37 @@ SOFTWARE.
<xsl:text>All </xsl:text>
<xsl:value-of select="count(recent/repo)"/>
</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js">
<!-- nothing -->
</script>
</xsl:template>
<xsl:template match="/page" mode="body">
<xsl:apply-templates select="recent"/>
<script>
<xsl:text>
function ping() {
$('.ping').each(function() {
var $span = $(this);
$.get(
$span.attr('data-uri'),
function(data, status) {
$span.text(status);
}
);
})
}
</xsl:text>
</script>
</xsl:template>
<xsl:template match="recent">
<p>
<xsl:text>There are </xsl:text>
<xsl:value-of select="count(repo)"/>
<xsl:text> artifacts in our database:</xsl:text>
<xsl:text> artifacts in our database (</xsl:text>
<a href="#" onclick="ping(); return false;">
<xsl:text>ping them all</xsl:text>
</a>
<xsl:text>):</xsl:text>
</p>
<table data-sortable="true">
<thead>
Expand Down Expand Up @@ -103,7 +125,9 @@ SOFTWARE.
<xsl:text>%</xsl:text>
</td>
<td>
<xsl:value-of select="version"/>
<span class="ping" data-uri="http://i.jpeek.org/{group}/{artifact}/index.html">
<xsl:value-of select="version"/>
</span>
</td>
</tr>
</xsl:template>
Expand Down
10 changes: 3 additions & 7 deletions src/main/resources/org/jpeek/web/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ SOFTWARE.
<a href="/mistakes">
<xsl:text>summary</xsl:text>
</a>
<xsl:text>, </xsl:text>
<a href="/all">
<xsl:text>all artifacts</xsl:text>
</a>
<xsl:text>, and the </xsl:text>
<xsl:text> and the </xsl:text>
<a href="/queue">
<xsl:text>queue</xsl:text>
</a>
Expand Down Expand Up @@ -202,8 +198,8 @@ SOFTWARE.
<xsl:value-of select="artifact"/>
</a>
</xsl:for-each>
<xsl:text> </xsl:text>
<a href="/ping">
<xsl:text>, </xsl:text>
<a href="/all">
<xsl:text>...</xsl:text>
</a>
</p>
Expand Down
71 changes: 0 additions & 71 deletions src/main/resources/org/jpeek/web/ping.xsl

This file was deleted.

1 change: 0 additions & 1 deletion src/test/java/org/jpeek/web/TkAppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void pingsSimplePages() throws IOException {
"/jpeek.css",
"/",
"/mistakes",
"/ping",
"/all",
"/robots.txt",
};
Expand Down

0 comments on commit 071dbb0

Please sign in to comment.