Skip to content

Commit d79db43

Browse files
committed
fix(#5370): fix logfile view styling issues and make sure that links are rendered with an underline similarly to what already happens in other views
1 parent b3662bd commit d79db43

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

  • spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/sample
  • spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile

spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/sample/QuartzJobsConfiguration.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.quartz.SimpleScheduleBuilder;
2525
import org.quartz.Trigger;
2626
import org.quartz.TriggerBuilder;
27+
import org.slf4j.Logger;
28+
import org.slf4j.LoggerFactory;
2729
import org.springframework.context.annotation.Bean;
2830
import org.springframework.context.annotation.Configuration;
2931
import org.springframework.scheduling.quartz.QuartzJobBean;
@@ -107,10 +109,11 @@ public Trigger hourlyTestTrigger() {
107109
* Sample job that logs at regular intervals.
108110
*/
109111
public static class SampleJob extends QuartzJobBean {
112+
private static final Logger logger = LoggerFactory.getLogger(SampleJob.class);
110113

111114
@Override
112115
protected void executeInternal(org.quartz.JobExecutionContext context) {
113-
System.out.println("Sample Quartz Job executed at " + new java.util.Date());
116+
logger.info("Sample Quartz Job executed at {}", new java.util.Date());
114117
}
115118

116119
}
@@ -119,10 +122,11 @@ protected void executeInternal(org.quartz.JobExecutionContext context) {
119122
* Another sample job for demonstration.
120123
*/
121124
public static class AnotherSampleJob extends QuartzJobBean {
125+
private static final Logger logger = LoggerFactory.getLogger(AnotherSampleJob.class);
122126

123127
@Override
124128
protected void executeInternal(org.quartz.JobExecutionContext context) {
125-
System.out.println("Another Quartz Job executed at " + new java.util.Date());
129+
logger.info("Another Quartz Job executed at {}", new java.util.Date());
126130
}
127131

128132
}

spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
:class="{ 'wrap-lines': wrapLines }"
9696
class="log-viewer overflow-x-auto text-sm -mx-6 -my-20 pt-14"
9797
>
98-
<table class="table-striped" />
98+
<table class="table-striped min-w-full" />
9999
</div>
100100
</sba-instance-section>
101101
</template>
@@ -184,7 +184,12 @@ export default {
184184
tap(
185185
(part) => (this.skippedBytes = this.skippedBytes || part.skipped),
186186
),
187-
concatMap((part) => chunk(part.addendum.split(/\r?\n/), 250)),
187+
concatMap((part) =>
188+
chunk(
189+
part.addendum.split(/\r?\n/).filter((l) => l),
190+
250,
191+
),
192+
),
188193
map((lines) => of(lines, animationFrameScheduler)),
189194
concatAll(),
190195
)
@@ -269,15 +274,25 @@ export default {
269274
max-height: 100%;
270275
}
271276
277+
.log-viewer tr,
278+
.log-viewer td {
279+
@apply w-full;
280+
}
281+
272282
.log-viewer pre {
273283
padding: 0 0.75em;
274284
margin-bottom: 1px;
285+
@apply w-full;
275286
}
276287
277288
.log-viewer pre:hover {
278289
background: #dbdbdb;
279290
}
280291
292+
.log-viewer a[href] {
293+
@apply underline;
294+
}
295+
281296
.log-viewer.wrap-lines pre {
282297
@apply whitespace-pre-wrap;
283298
word-break: break-all;

0 commit comments

Comments
 (0)