feat: affichage du numéro de version de l'application
This commit is contained in:
@@ -1,14 +1,23 @@
|
|||||||
package com.astalange.web.controller;
|
package com.astalange.web.controller;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
public class GlobalControllerAdvice {
|
public class GlobalControllerAdvice {
|
||||||
|
|
||||||
|
@Value("${app.version}")
|
||||||
|
private String appVersion;
|
||||||
|
|
||||||
@ModelAttribute("requestURI")
|
@ModelAttribute("requestURI")
|
||||||
public String requestURI(final HttpServletRequest request) {
|
public String requestURI(final HttpServletRequest request) {
|
||||||
return request.getRequestURI();
|
return request.getRequestURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModelAttribute("appVersion")
|
||||||
|
public String appVersion() {
|
||||||
|
return appVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: as-talange
|
name: as-talange
|
||||||
|
app.version: @project.version@
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:postgresql://localhost:5433/astalange
|
url: jdbc:postgresql://localhost:5433/astalange
|
||||||
username: myuser
|
username: myuser
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
<form th:action="@{/logout}" method="post">
|
<form th:action="@{/logout}" method="post">
|
||||||
<button type="submit" class="text-sm text-red-600 hover:text-red-700 font-medium">Déconnexion</button>
|
<button type="submit" class="text-sm text-red-600 hover:text-red-700 font-medium">Déconnexion</button>
|
||||||
</form>
|
</form>
|
||||||
|
<div class="mt-2 text-[10px] text-gray-400">v<span th:text="${appVersion}">1.0-SNAPSHOT</span></div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -131,6 +131,9 @@
|
|||||||
<p class="text-[10px] text-gray-400 text-center mt-4 leading-tight">
|
<p class="text-[10px] text-gray-400 text-center mt-4 leading-tight">
|
||||||
Les données sont stockées de manière sécurisée, accessibles uniquement au bureau du club. Vous pouvez demander leur suppression à tout moment.
|
Les données sont stockées de manière sécurisée, accessibles uniquement au bureau du club. Vous pouvez demander leur suppression à tout moment.
|
||||||
</p>
|
</p>
|
||||||
|
<p class="text-[10px] text-gray-400 text-center mt-2">
|
||||||
|
v<span th:text="${appVersion}">1.0-SNAPSHOT</span>
|
||||||
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user