Skip to content

Commit 032ebfd

Browse files
committed
Makes background dark
1 parent 7f74a0f commit 032ebfd

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Diff for: assets/pages/Container.vue

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template lang="html">
22
<ul ref="events" class="events">
3-
<li v-for="item in messages" class="event">
3+
<li v-for="item in messages" class="event" :key="item.key">
44
<span class="date">{{ item.dateRelative }}</span>
55
<span class="text">{{ item.message }}</span>
66
</li>
@@ -15,9 +15,9 @@ const parseMessage = data => {
1515
const date = new Date(data.substring(0, 30));
1616
const dateRelative = formatRelative(date, new Date());
1717
const message = data.substring(30);
18-
const id = nextId++;
18+
const key = nextId++;
1919
return {
20-
id,
20+
key,
2121
date,
2222
dateRelative,
2323
message
@@ -32,7 +32,10 @@ export default {
3232
messages: []
3333
};
3434
},
35-
mounted() {
35+
beforeCreate() {
36+
document.documentElement.className = "dark";
37+
},
38+
created() {
3639
ws = new WebSocket(`ws://${window.location.host}/api/logs?id=${this.id}`);
3740
ws.onopen = e => console.log("Connection opened.");
3841
ws.onclose = e => console.log("Connection closed.");
@@ -49,6 +52,7 @@ export default {
4952
beforeDestroy() {
5053
ws.close();
5154
ws = null;
55+
document.documentElement.className = "";
5256
}
5357
};
5458
</script>
@@ -71,4 +75,9 @@ export default {
7175
background-color: #262626;
7276
color: #258ccd;
7377
}
78+
79+
html.dark {
80+
background-color: #111;
81+
color: #ddd;
82+
}
7483
</style>

Diff for: main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func logs(w http.ResponseWriter, r *http.Request) {
7474
}
7575
defer c.Close()
7676

77-
options := types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Follow: true, Tail: "500", Timestamps: true}
77+
options := types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Follow: true, Tail: "300", Timestamps: true}
7878
reader, err := cli.ContainerLogs(context.Background(), id, options)
7979
defer reader.Close()
8080
if err != nil {

0 commit comments

Comments
 (0)