-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogs.html
109 lines (92 loc) · 2.78 KB
/
logs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<title>Application Logs</title>
<link rel="stylesheet" href="styles.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: text;
}
body {
background: #1e1e2f;
color: #f8f8f2;
font-family: 'Roboto', sans-serif;
height: 100vh;
display: flex;
flex-direction: column;
padding: 20px;
}
#logContainer {
background: rgba(40, 42, 54, 0.9);
border-radius: 8px;
padding: 20px;
flex: 1;
overflow-y: auto;
overflow-x: hidden;
word-break: break-all;
white-space: pre-wrap;
font-family: 'Fira Code', monospace;
font-size: 13px;
line-height: 1.5;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
border: 1px solid rgba(68, 71, 90, 0.5);
margin-top: 32px;
}
#logContainer::-webkit-scrollbar {
width: 8px;
background: transparent;
}
#logContainer::-webkit-scrollbar-thumb {
background: #44475a;
border-radius: 4px;
}
#logContainer::-webkit-scrollbar-thumb:hover {
background: #6272a4;
}
#logContainer div {
padding: 2px 0;
border-bottom: 1px solid rgba(68, 71, 90, 0.2);
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: anywhere;
}
#logContainer div:last-child {
border-bottom: none;
}
</style>
</head>
<body>
<div class="title-bar">
<div class="window-controls">
<button class="window-button close-button" id="close-button"></button>
</div>
</div>
<div id="logContainer"></div>
<script src="https://cdn.alphasystem.dev/plugins/disable-dev-tools/latest/script-min.js"></script>
<script>
const { ipcRenderer } = require('electron');
const logContainer = document.getElementById('logContainer');
ipcRenderer.on('log-entry', (event, entry) => {
const logEntry = document.createElement('div');
logEntry.style.color = getColorForLevel(entry.level);
logEntry.textContent = `[${entry.timestamp}] ${entry.message}`;
logContainer.appendChild(logEntry);
logContainer.scrollTop = logContainer.scrollHeight;
});
document.getElementById('close-button')?.addEventListener('click', () => {
ipcRenderer.send('window-close');
});
function getColorForLevel(level) {
switch (level) {
case 'error': return '#ff5555';
case 'warn': return '#ffb86c';
default: return '#f8f8f2';
}
}
</script>
</body>
</html>