Skip to content

Commit 5c12767

Browse files
committed
made skipped bytes text to show at all times including 0 bytes
replaced plain strings with Enum
1 parent e3f7040 commit 5c12767

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

  • spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ import {
155155
import { VIEW_GROUP } from '@/views/ViewGroup';
156156
import SbaInstanceSection from '@/views/instances/shell/sba-instance-section';
157157
158+
const LogfileMode = Object.freeze({
159+
FOLLOW: 'follow',
160+
MANUAL: 'manual',
161+
});
162+
158163
export default {
159164
components: { SbaInstanceSection },
160165
mixins: [subscribing],
@@ -173,7 +178,7 @@ export default {
173178
renderedLines: [],
174179
wrapLines: false,
175180
scrollSubscription: null,
176-
mode: 'follow',
181+
mode: LogfileMode.FOLLOW,
177182
chunkSize: DEFAULT_LOGFILE_CHUNK_SIZE,
178183
windowStart: 0,
179184
windowEnd: -1,
@@ -185,13 +190,13 @@ export default {
185190
}),
186191
computed: {
187192
skippedBytesString() {
188-
if (this.skippedBytes != null && this.skippedBytes > 0) {
193+
if (this.skippedBytes != null) {
189194
return `skipped ${prettyBytes(this.skippedBytes)}`;
190195
}
191196
return '';
192197
},
193198
isFollowing() {
194-
return this.mode === 'follow';
199+
return this.mode === LogfileMode.FOLLOW;
195200
},
196201
canLoadPrevious() {
197202
return !this.isChunkLoading && this.windowStart > 0;
@@ -243,7 +248,7 @@ export default {
243248
return autolink(this.ansiUp.ansi_to_html(line));
244249
},
245250
resetFollowState() {
246-
this.mode = 'follow';
251+
this.mode = LogfileMode.FOLLOW;
247252
this.error = null;
248253
this.hasLoaded = false;
249254
this.isChunkLoading = false;
@@ -303,7 +308,7 @@ export default {
303308
},
304309
async loadChunk(start, end) {
305310
this.error = null;
306-
this.mode = 'manual';
311+
this.mode = LogfileMode.MANUAL;
307312
this.isChunkLoading = true;
308313
309314
try {
@@ -348,7 +353,7 @@ export default {
348353
async toggleFollowMode() {
349354
if (this.isFollowing) {
350355
this.unsubscribe();
351-
this.mode = 'manual';
356+
this.mode = LogfileMode.MANUAL;
352357
return;
353358
}
354359

0 commit comments

Comments
 (0)