implemented logs view as html

pull/2/head
Vyacheslav N. Boyko 2018-03-11 17:58:43 +03:00
parent af8fb07d7e
commit eeae1e726c
4 changed files with 16 additions and 15 deletions

View File

@ -110,7 +110,7 @@
<orderEntry type="library" name="Maven: com.google.http-client:google-http-client-jackson2:1.23.0" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava-jdk5:17.0" level="project" />
<orderEntry type="library" name="Maven: org.modelmapper:modelmapper:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.webjars:jquery:3.2.1" level="project" />
<orderEntry type="library" name="Maven: org.webjars:jquery:3.3.1-1" level="project" />
<orderEntry type="library" name="Maven: org.webjars:bootstrap:3.3.7-1" level="project" />
<orderEntry type="library" name="Maven: org.webjars:font-awesome:4.7.0" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />

View File

@ -155,7 +155,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.2.1</version>
<version>3.3.1-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>

View File

@ -33,25 +33,25 @@ public class IrcLogController {
@RequestMapping(value = "/{serverHost:.+}/{day}", method = RequestMethod.GET)
public String index(@PathVariable String serverHost, @RequestParam(name = "channel") String channelName, @PathVariable String day, Model model) throws Exception {
@RequestMapping(value = "/{serverHost:.+}/{channelName:.+}/{day}", method = RequestMethod.GET)
public String index(@PathVariable String serverHost, @PathVariable String channelName, @PathVariable String day, Model model) throws Exception {
prepareModel(model, serverHost, channelName, day);
return "irclog";
}
@RequestMapping(value = "/{serverHost:.+}", method = RequestMethod.GET)
public String index(@PathVariable String serverHost, @RequestParam(name = "channel") String channelName, Model model) throws Exception {
@RequestMapping(value = "/{serverHost:.+}/{channelName:.+}", method = RequestMethod.GET)
public String index(@PathVariable String serverHost, @PathVariable String channelName, Model model) throws Exception {
prepareModel(model, serverHost, channelName, DATE_READER.format(new Date()));
return "irclog";
}
@RequestMapping(value = "/text/{serverHost:.+}/{day}", method = RequestMethod.GET, produces = "plain/text; charset=utf-8")
public @ResponseBody String indexText(@PathVariable String serverHost, @RequestParam(name = "channel") String channelName, @PathVariable String day, Model model) throws Exception {
@RequestMapping(value = "/text/{serverHost:.+}/{channelName:.+}/{day}", method = RequestMethod.GET, produces = "plain/text; charset=utf-8")
public @ResponseBody String indexText(@PathVariable String serverHost, @PathVariable String channelName, @PathVariable String day, Model model) throws Exception {
return renderAsText(serverHost, channelName, day);
}
@RequestMapping(value = "/text/{serverHost:.+}", method = RequestMethod.GET, produces = "plain/text; charset=utf-8")
public @ResponseBody String indexText(@PathVariable String serverHost, @RequestParam(name = "channel") String channelName, Model model) throws Exception {
@RequestMapping(value = "/text/{serverHost:.+}/{channelName:.+}", method = RequestMethod.GET, produces = "plain/text; charset=utf-8")
public @ResponseBody String indexText(@PathVariable String serverHost, @PathVariable String channelName, Model model) throws Exception {
return renderAsText(serverHost, channelName, DATE_READER.format(new Date()));
}

View File

@ -6,6 +6,7 @@
<title th:text="|${day} - ${channelName} on ${serverHost}|"></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}" href="webjars/bootstrap/3.3.7-1/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" th:href="@{/webjars/font-awesome/4.7.0/css/font-awesome.min.css}" href="webjars/font-awesome/4.7.0/css/font-awesome.min.css" />
</head>
<body>
@ -17,8 +18,8 @@
<p>
<div class="btn-toolbar">
<a class="btn btn-default" th:href="@{'/logs/'+${serverHost}+'/'+${prevDay}+'?channel='+${channelName}}" th:text="${prevDay}"></a>
<a class="btn btn-default" th:href="@{'/logs/'+${serverHost}+'/'+${nextDay}+'?channel='+${channelName}}" th:text="${nextDay}"></a>
<a class="btn btn-default" th:href="@{'/logs/'+${serverHost}+'/'+${channelName}+'/'+${prevDay}}" th:text="${prevDay}"></a>
<a class="btn btn-default" th:href="@{'/logs/'+${serverHost}+'/'+${channelName}+'/'+${nextDay}}" th:text="${nextDay}"></a>
</div>
</p>
@ -36,12 +37,12 @@
<tbody>
<tr th:each="msg : ${messages}">
<div th:if="${msg.isUserSet()}">
<div th:if="${msg.isUserSet()}" th:remove="tag">
<td class="col-sm-2 col-md-2 col-lg-2" th:text="${msg.getDtCreatedStr()}"></td>
<td class="col-sm-2 col-md-2 col-lg-2" th:text="${msg.username}"></td>
<td class="col-sm-2 col-md-2 col-lg-2"><b th:text="${msg.username}"></b></td>
<td class="col-sm-8 col-md-8 col-lg-8" th:text="${msg.message}"></td>
</div>
<div th:if="${!msg.isUserSet()}">
<div th:unless="${msg.isUserSet()}" th:remove="tag">
<td class="col-sm-2 col-md-2 col-lg-2" th:text="${msg.getDtCreatedStr()}"></td>
<td class="col-sm-10 col-md-10 col-lg-10" colspan="2"><i th:text="${msg.message}"></i></td>
</div>