Skip to content

Commit

Permalink
Zugriffsstatistiken eingebaut
Browse files Browse the repository at this point in the history
- und sonstige Korrekturen
  • Loading branch information
schipplock committed Jan 2, 2024
1 parent 8e7624c commit 82d3d13
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ FROM base

COPY docker/entrypoint.sh /bin/entrypoint.sh
COPY docker/postgresql-42.7.1.jar $JBOSS_HOME/standalone/deployments/postgresql-driver.jar
COPY --from=build-war /src/target/tilstory-0.0.1.war $JBOSS_HOME/standalone/deployments/tilstory.war
COPY --from=build-war /src/target/tilstory-0.0.6.war $JBOSS_HOME/standalone/deployments/tilstory.war
COPY docker/standalone.xml $JBOSS_HOME/standalone/configuration/standalone.xml
COPY docker/application.keystore $JBOSS_HOME/standalone/configuration/application.keystore

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Meine Blogsoftware. TIL = Today I learned.
## Das Image bauen

```bash
docker build --network=host --force-rm -t ghcr.io/schipplock/tilstory:v0.0.5 .
docker build --network=host --force-rm -t ghcr.io/schipplock/tilstory:v0.0.6 .
```
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
- flywaydb

tilstory-app:
image: ghcr.io/schipplock/tilstory:v0.0.5
image: ghcr.io/schipplock/tilstory:v0.0.6
container_name: tilstory-app
networks:
local-net:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
<groupId>de.schipplock.web</groupId>
<artifactId>tilstory</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
<version>0.0.6</version>
<name>TILstory</name>
<description>Today I learned - blogging tool</description>
<url>https://github.com/schipplock/tilstory</url>
Expand Down
15 changes: 15 additions & 0 deletions sql-migrations/V2__postaccess.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE SEQUENCE public.posthits_seq
INCREMENT BY 1
MINVALUE 1
START 1
CACHE 1
NO CYCLE;

CREATE TABLE public.posthits (
id bigint NOT NULL DEFAULT nextval('posthits_seq'),
guid uuid NOT NULL,
accessed timestamptz default now(),
CONSTRAINT posthits_pk PRIMARY KEY (id)
);

CREATE INDEX posthits_guid_idx ON public.posthits (guid);

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/includes/admin/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1># <a href="${pageContext.request.contextPath}/">${settings:name()}</a></h1>
<h2>Kurze Texte von ${settings:author()}</h2>
<h3>
<a href="https://github.com/schipplock/tilstory" target="_blank">TILStory 0.0.5</a> |
<a href="https://github.com/schipplock/tilstory" target="_blank">TILStory 0.0.6</a> |
<a href="${pageContext.request.contextPath}/rss.jsp">rss</a>
</h3>
</header>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/includes/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<h1># <a href="${pageContext.request.contextPath}/">${settings:name()}</a></h1>
<h2>Kurze Texte von ${settings:author()}</h2>
<h3>
<a href="https://github.com/schipplock/tilstory" target="_blank">TILStory 0.0.5</a> |
<a href="https://github.com/schipplock/tilstory" target="_blank">TILStory 0.0.6</a> |
<a href="${pageContext.request.contextPath}/rss.jsp">rss</a>
</h3>
</header>
7 changes: 3 additions & 4 deletions src/main/webapp/admin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@
<input type="submit" value="speichern" />
</form>
</section>

<section class="container">
<h2>Vorschau</h2>
</section>

<c:if test="${not empty param.id}">
<section class="container">
<h2>Vorschau</h2>
</section>
<section class="post">
<h1 class="subject"><a href="${pageContext.request.contextPath}/?postId=${guid}#post${guid}" target="_blank">#${id}:</a>&nbsp;${subject}</h1>
<h2 class="author">ein Beitrag von ${settings:author()}</h2>
Expand Down
11 changes: 10 additions & 1 deletion src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

<c:forEach var="postTitleItem" items="${postTitles.rows}">
<c:if test="${post.rows[0].guid eq postTitleItem.guid}">
<sql:update dataSource="postgres">
insert into posthits (guid) values (?::uuid)
<sql:param value="${post.rows[0].guid}" />
</sql:update>
<section class="post" id="post${post.rows[0].guid}">
<h1 class="subject"><a href="${pageContext.request.contextPath}/?postId=${post.rows[0].guid}#post${post.rows[0].guid}">#${post.rows[0].id}:</a>&nbsp;${post.rows[0].subject}</h1>
<h2 class="author">ein Beitrag von ${settings:author()}</h2>
Expand All @@ -40,7 +44,12 @@
<p class="created">Erstellt: <fmt:formatDate value="${post.rows[0].created}" type="both" dateStyle="short" timeStyle="short" />
<c:if test="${not empty post.rows[0].updated}">
, aktualisiert: <fmt:formatDate value="${post.rows[0].updated}" type="both" dateStyle="short" timeStyle="short" />
</c:if>
</c:if>,
<sql:query var="posthits" dataSource="postgres">
select count(guid) as hits from posthits where guid = ?::uuid
<sql:param value="${post.rows[0].guid}" />
</sql:query>
Aufrufe: ${posthits.rows[0].hits}
</p>
</section>
</c:if>
Expand Down

0 comments on commit 82d3d13

Please sign in to comment.