@karinjs/plugin-basic 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/logger.js +2 -2
- package/dist/apps/login.js +2 -2
- package/dist/apps/restart.js +2 -2
- package/dist/apps/status.js +2 -2
- package/dist/apps/update.js +2 -2
- package/dist/{chunk-QUWYQJAF.js → chunk-AAM3ZLYA.js} +1 -1
- package/dist/{chunk-PHDIUMOH.js → chunk-ZRGOU5NN.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/web.config.js +2 -2
- package/package.json +1 -1
- package/resources/logger/index.css +115 -129
- package/resources/logger/index.html +6 -4
package/dist/apps/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
render
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-AAM3ZLYA.js";
|
|
4
4
|
|
|
5
5
|
// src/apps/logger.ts
|
|
6
6
|
import fs from "fs";
|
|
@@ -181,7 +181,7 @@ var logViewer = karin.command(/^#日志\s*(\d+)?$/, async (e) => {
|
|
|
181
181
|
const match = e.msg.match(/^#日志\s*(\d+)?$/);
|
|
182
182
|
let limit = match && match[1] ? Number(match[1]) : 50;
|
|
183
183
|
if (!Number.isFinite(limit) || limit <= 0) limit = 50;
|
|
184
|
-
if (limit >
|
|
184
|
+
if (limit > 1e3) limit = 1e3;
|
|
185
185
|
const logs = await getTodayLogs(limit);
|
|
186
186
|
const parsedLogs = logs.map(parseLogLine);
|
|
187
187
|
try {
|
package/dist/apps/login.js
CHANGED
package/dist/apps/restart.js
CHANGED
package/dist/apps/status.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "../chunk-ODFXVVIE.js";
|
|
8
8
|
import {
|
|
9
9
|
cfg
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-ZRGOU5NN.js";
|
|
11
|
+
import "../chunk-AAM3ZLYA.js";
|
|
12
12
|
|
|
13
13
|
// src/apps/status.ts
|
|
14
14
|
import { karin } from "node-karin";
|
package/dist/apps/update.js
CHANGED
|
@@ -7,7 +7,7 @@ import { karinPathBase } from "node-karin";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@karinjs/plugin-basic",
|
|
10
|
-
version: "1.3.
|
|
10
|
+
version: "1.3.3",
|
|
11
11
|
description: "Karin\u7684\u57FA\u7840\u63D2\u4EF6,\u63D0\u4F9B\u6700\u57FA\u7840\u7684\u529F\u80FD",
|
|
12
12
|
homepage: "https://github.com/KarinJS/karin-plugin-basic",
|
|
13
13
|
bugs: {
|
package/dist/index.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-ODFXVVIE.js";
|
|
10
10
|
import {
|
|
11
11
|
cfg
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZRGOU5NN.js";
|
|
13
13
|
import {
|
|
14
14
|
plugin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AAM3ZLYA.js";
|
|
16
16
|
|
|
17
17
|
// src/index.ts
|
|
18
18
|
import { logger, restartDirect } from "node-karin";
|
package/dist/web.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--bg-color: #1e1e1e;
|
|
3
|
+
--container-bg: #252526;
|
|
4
|
+
--text-color: #d4d4d4;
|
|
5
|
+
--border-color: #3e3e42;
|
|
6
|
+
--header-bg: #333333;
|
|
7
|
+
--accent-color: #007acc;
|
|
8
|
+
|
|
9
|
+
--level-debug: #b5cea8;
|
|
10
|
+
--level-info: #569cd6;
|
|
11
|
+
--level-mark: #c586c0;
|
|
12
|
+
--level-warn: #ce9178;
|
|
13
|
+
--level-error: #f44747;
|
|
14
|
+
--level-fatal: #d16969;
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
* {
|
|
2
18
|
margin: 0;
|
|
3
19
|
padding: 0;
|
|
@@ -5,210 +21,180 @@
|
|
|
5
21
|
}
|
|
6
22
|
|
|
7
23
|
body {
|
|
8
|
-
font-family: '
|
|
9
|
-
background:
|
|
10
|
-
|
|
11
|
-
padding:
|
|
24
|
+
font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
25
|
+
background-color: var(--bg-color);
|
|
26
|
+
color: var(--text-color);
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
line-height: 1.5;
|
|
12
31
|
}
|
|
13
32
|
|
|
14
33
|
.container {
|
|
15
|
-
max-width:
|
|
16
|
-
margin: 0
|
|
17
|
-
background:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
overflow: hidden;
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
margin: 0;
|
|
36
|
+
background: var(--bg-color);
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
21
39
|
}
|
|
22
40
|
|
|
23
41
|
.header {
|
|
24
|
-
|
|
25
|
-
padding:
|
|
26
|
-
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
background: url('../img/logger.png') center/cover no-repeat, #e0f2ff;
|
|
29
|
-
border-bottom: 1px solid rgba(148, 163, 184, 0.35);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.header h1,
|
|
33
|
-
.header .info {
|
|
34
|
-
position: relative;
|
|
35
|
-
z-index: 2;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.header-bg-text {
|
|
39
|
-
position: absolute;
|
|
40
|
-
inset: 0;
|
|
42
|
+
background: var(--header-bg);
|
|
43
|
+
padding: 10px 20px;
|
|
44
|
+
border-bottom: 1px solid var(--border-color);
|
|
41
45
|
display: flex;
|
|
46
|
+
justify-content: space-between;
|
|
42
47
|
align-items: center;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
text-transform: uppercase;
|
|
48
|
-
color: rgba(30, 64, 175, 0.2);
|
|
49
|
-
filter: blur(2px);
|
|
50
|
-
pointer-events: none;
|
|
51
|
-
z-index: 1;
|
|
48
|
+
position: sticky;
|
|
49
|
+
top: 0;
|
|
50
|
+
z-index: 100;
|
|
51
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.header h1 {
|
|
55
|
-
font-size:
|
|
56
|
-
margin-bottom: 15px;
|
|
55
|
+
font-size: 16px;
|
|
57
56
|
font-weight: 600;
|
|
58
|
-
|
|
57
|
+
color: #fff;
|
|
58
|
+
margin: 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 10px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.header h1::before {
|
|
65
|
+
content: '>';
|
|
66
|
+
color: var(--accent-color);
|
|
67
|
+
font-weight: bold;
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
.info {
|
|
62
71
|
display: flex;
|
|
63
|
-
gap:
|
|
64
|
-
font-size:
|
|
65
|
-
|
|
72
|
+
gap: 15px;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
color: #cccccc;
|
|
66
75
|
}
|
|
67
76
|
|
|
68
77
|
.info span {
|
|
69
|
-
background: rgba(255, 255, 255, 0.
|
|
70
|
-
padding:
|
|
71
|
-
border-radius:
|
|
72
|
-
|
|
78
|
+
background: rgba(255, 255, 255, 0.1);
|
|
79
|
+
padding: 2px 8px;
|
|
80
|
+
border-radius: 3px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.header-bg-text {
|
|
84
|
+
display: none;
|
|
73
85
|
}
|
|
74
86
|
|
|
75
87
|
.logs-container {
|
|
76
|
-
padding:
|
|
77
|
-
/* 让截图包含全部日志,不使用内部滚动条 */
|
|
78
|
-
overflow: visible;
|
|
88
|
+
padding: 10px 0;
|
|
79
89
|
}
|
|
80
90
|
|
|
81
91
|
.log-item {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
margin-bottom: 8px;
|
|
86
|
-
border-radius: 8px;
|
|
87
|
-
background: #f9fafb;
|
|
88
|
-
border-left: 4px solid #e5e7eb;
|
|
89
|
-
transition: all 0.2s ease;
|
|
92
|
+
padding: 2px 10px;
|
|
93
|
+
border-left: 3px solid transparent;
|
|
94
|
+
transition: background-color 0.1s;
|
|
90
95
|
font-size: 13px;
|
|
91
96
|
line-height: 1.6;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
.log-item:hover {
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
background-color: #2a2d2e;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.log-content {
|
|
104
|
+
display: block;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.log-prefix {
|
|
108
|
+
color: #858585;
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
opacity: 0.9;
|
|
112
|
+
margin-right: 8px;
|
|
97
113
|
}
|
|
98
114
|
|
|
99
115
|
.log-time {
|
|
100
|
-
color: #
|
|
101
|
-
font-family: 'Consolas', 'Monaco', monospace;
|
|
102
|
-
min-width: 100px;
|
|
103
|
-
margin-right: 12px;
|
|
104
|
-
font-weight: 500;
|
|
116
|
+
color: #858585;
|
|
105
117
|
}
|
|
106
118
|
|
|
107
119
|
.log-level {
|
|
108
|
-
|
|
109
|
-
padding: 2px 10px;
|
|
110
|
-
border-radius: 4px;
|
|
111
|
-
font-weight: 600;
|
|
120
|
+
font-weight: bold;
|
|
112
121
|
text-transform: uppercase;
|
|
113
|
-
font-size:
|
|
114
|
-
min-width: 60px;
|
|
115
|
-
text-align: center;
|
|
116
|
-
margin-right: 12px;
|
|
122
|
+
font-size: 12px;
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
.level-debug {
|
|
120
|
-
|
|
121
|
-
color: white;
|
|
126
|
+
color: var(--level-debug);
|
|
122
127
|
}
|
|
123
128
|
|
|
124
129
|
.level-info {
|
|
125
|
-
|
|
126
|
-
color: white;
|
|
130
|
+
color: var(--level-info);
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
.level-mark {
|
|
130
|
-
|
|
131
|
-
color: white;
|
|
134
|
+
color: var(--level-mark);
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
.level-warn {
|
|
135
|
-
|
|
136
|
-
color: #422006;
|
|
138
|
+
color: var(--level-warn);
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
.level-error {
|
|
140
|
-
|
|
141
|
-
color: white;
|
|
142
|
+
color: var(--level-error);
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
.level-fatal {
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
color: var(--level-fatal);
|
|
147
|
+
background: #5a1d1d;
|
|
148
|
+
padding: 0 4px;
|
|
149
|
+
border-radius: 2px;
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
.log-message {
|
|
150
|
-
flex: 1;
|
|
151
|
-
word-break: break-all;
|
|
152
|
-
color: #212529;
|
|
153
|
-
font-family: 'Consolas', 'Monaco', monospace;
|
|
154
153
|
white-space: pre-wrap;
|
|
154
|
+
word-break: break-word;
|
|
155
|
+
color: #cccccc;
|
|
155
156
|
}
|
|
156
157
|
|
|
157
|
-
/*
|
|
158
|
-
.log-
|
|
159
|
-
border-left-color:
|
|
160
|
-
background:
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.log-info {
|
|
164
|
-
border-left-color: #93c5fd;
|
|
165
|
-
background: #e0f2fe;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.log-mark {
|
|
169
|
-
border-left-color: #c4b5fd;
|
|
170
|
-
background: #f3e8ff;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.log-warn {
|
|
174
|
-
border-left-color: #fcd34d;
|
|
175
|
-
background: #fef3c7;
|
|
158
|
+
/* Log item border indicators */
|
|
159
|
+
.log-item.log-error {
|
|
160
|
+
border-left-color: var(--level-error);
|
|
161
|
+
background: rgba(244, 71, 71, 0.05);
|
|
176
162
|
}
|
|
177
163
|
|
|
178
|
-
.log-
|
|
179
|
-
border-left-color:
|
|
180
|
-
background:
|
|
164
|
+
.log-item.log-warn {
|
|
165
|
+
border-left-color: var(--level-warn);
|
|
166
|
+
background: rgba(206, 145, 120, 0.05);
|
|
181
167
|
}
|
|
182
168
|
|
|
183
|
-
.log-fatal {
|
|
184
|
-
border-left-color:
|
|
185
|
-
background:
|
|
169
|
+
.log-item.log-fatal {
|
|
170
|
+
border-left-color: var(--level-fatal);
|
|
171
|
+
background: rgba(209, 105, 105, 0.1);
|
|
186
172
|
}
|
|
187
173
|
|
|
188
174
|
.footer {
|
|
189
|
-
|
|
190
|
-
padding: 15px 30px;
|
|
175
|
+
padding: 5px 20px;
|
|
191
176
|
text-align: center;
|
|
192
|
-
color: #
|
|
193
|
-
font-size:
|
|
194
|
-
border-top: 1px solid
|
|
177
|
+
color: #666;
|
|
178
|
+
font-size: 11px;
|
|
179
|
+
border-top: 1px solid var(--border-color);
|
|
180
|
+
background: var(--container-bg);
|
|
195
181
|
}
|
|
196
182
|
|
|
197
|
-
/*
|
|
198
|
-
|
|
199
|
-
width:
|
|
183
|
+
/* Scrollbar */
|
|
184
|
+
::-webkit-scrollbar {
|
|
185
|
+
width: 10px;
|
|
186
|
+
height: 10px;
|
|
200
187
|
}
|
|
201
188
|
|
|
202
|
-
|
|
203
|
-
background:
|
|
204
|
-
border-radius: 4px;
|
|
189
|
+
::-webkit-scrollbar-track {
|
|
190
|
+
background: var(--bg-color);
|
|
205
191
|
}
|
|
206
192
|
|
|
207
|
-
|
|
208
|
-
background: #
|
|
209
|
-
border-radius:
|
|
193
|
+
::-webkit-scrollbar-thumb {
|
|
194
|
+
background: #424242;
|
|
195
|
+
border-radius: 5px;
|
|
210
196
|
}
|
|
211
197
|
|
|
212
|
-
|
|
213
|
-
background: #
|
|
198
|
+
::-webkit-scrollbar-thumb:hover {
|
|
199
|
+
background: #4f4f4f;
|
|
214
200
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<body>
|
|
12
12
|
<div class="container">
|
|
13
13
|
<div class="header">
|
|
14
|
-
<h1
|
|
14
|
+
<h1>Karin 日志</h1>
|
|
15
15
|
<div class="info">
|
|
16
16
|
<span class="date">{{date}}</span>
|
|
17
17
|
<span class="count">共 {{total}} 条日志</span>
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
<div class="logs-container">
|
|
22
22
|
{{each logs}}
|
|
23
23
|
<div class="log-item log-{{$value.level}}">
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
<div class="log-content">
|
|
25
|
+
<span class="log-prefix">[<span class="log-time">{{$value.time}}</span>][<span
|
|
26
|
+
class="log-level level-{{$value.level}}">{{$value.level}}</span>]</span>
|
|
27
|
+
<span class="log-message">{{@ $value.messageHtml}}</span>
|
|
28
|
+
</div>
|
|
27
29
|
</div>
|
|
28
30
|
{{/each}}
|
|
29
31
|
</div>
|