@karinjs/plugin-basic 1.3.2 → 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-W3Q26Z2E.js → chunk-AAM3ZLYA.js} +1 -1
- package/dist/{chunk-7LNXK3JJ.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 -130
- 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,211 +21,180 @@
|
|
|
5
21
|
}
|
|
6
22
|
|
|
7
23
|
body {
|
|
8
|
-
font-family: '
|
|
9
|
-
background:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
13
31
|
}
|
|
14
32
|
|
|
15
33
|
.container {
|
|
16
|
-
max-width:
|
|
17
|
-
margin: 0
|
|
18
|
-
background:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
overflow: hidden;
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
margin: 0;
|
|
36
|
+
background: var(--bg-color);
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
22
39
|
}
|
|
23
40
|
|
|
24
41
|
.header {
|
|
25
|
-
|
|
26
|
-
padding:
|
|
27
|
-
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
background: url('../img/logger.png') center/cover no-repeat, #e0f2ff;
|
|
30
|
-
border-bottom: 1px solid rgba(148, 163, 184, 0.35);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.header h1,
|
|
34
|
-
.header .info {
|
|
35
|
-
position: relative;
|
|
36
|
-
z-index: 2;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.header-bg-text {
|
|
40
|
-
position: absolute;
|
|
41
|
-
inset: 0;
|
|
42
|
+
background: var(--header-bg);
|
|
43
|
+
padding: 10px 20px;
|
|
44
|
+
border-bottom: 1px solid var(--border-color);
|
|
42
45
|
display: flex;
|
|
46
|
+
justify-content: space-between;
|
|
43
47
|
align-items: center;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
text-transform: uppercase;
|
|
49
|
-
color: rgba(30, 64, 175, 0.2);
|
|
50
|
-
filter: blur(2px);
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
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);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
.header h1 {
|
|
56
|
-
font-size:
|
|
57
|
-
margin-bottom: 15px;
|
|
55
|
+
font-size: 16px;
|
|
58
56
|
font-weight: 600;
|
|
59
|
-
|
|
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;
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
.info {
|
|
63
71
|
display: flex;
|
|
64
|
-
gap:
|
|
65
|
-
font-size:
|
|
66
|
-
|
|
72
|
+
gap: 15px;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
color: #cccccc;
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
.info span {
|
|
70
|
-
background: rgba(255, 255, 255, 0.
|
|
71
|
-
padding:
|
|
72
|
-
border-radius:
|
|
73
|
-
|
|
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;
|
|
74
85
|
}
|
|
75
86
|
|
|
76
87
|
.logs-container {
|
|
77
|
-
padding:
|
|
78
|
-
/* 让截图包含全部日志,不使用内部滚动条 */
|
|
79
|
-
overflow: visible;
|
|
88
|
+
padding: 10px 0;
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
.log-item {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
margin-bottom: 8px;
|
|
87
|
-
border-radius: 8px;
|
|
88
|
-
background: #f9fafb;
|
|
89
|
-
border-left: 4px solid #e5e7eb;
|
|
90
|
-
transition: all 0.2s ease;
|
|
92
|
+
padding: 2px 10px;
|
|
93
|
+
border-left: 3px solid transparent;
|
|
94
|
+
transition: background-color 0.1s;
|
|
91
95
|
font-size: 13px;
|
|
92
96
|
line-height: 1.6;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
.log-item:hover {
|
|
96
|
-
|
|
97
|
-
|
|
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;
|
|
98
113
|
}
|
|
99
114
|
|
|
100
115
|
.log-time {
|
|
101
|
-
color: #
|
|
102
|
-
font-family: 'Consolas', 'Monaco', monospace;
|
|
103
|
-
min-width: 100px;
|
|
104
|
-
margin-right: 12px;
|
|
105
|
-
font-weight: 500;
|
|
116
|
+
color: #858585;
|
|
106
117
|
}
|
|
107
118
|
|
|
108
119
|
.log-level {
|
|
109
|
-
|
|
110
|
-
padding: 2px 10px;
|
|
111
|
-
border-radius: 4px;
|
|
112
|
-
font-weight: 600;
|
|
120
|
+
font-weight: bold;
|
|
113
121
|
text-transform: uppercase;
|
|
114
|
-
font-size:
|
|
115
|
-
min-width: 60px;
|
|
116
|
-
text-align: center;
|
|
117
|
-
margin-right: 12px;
|
|
122
|
+
font-size: 12px;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
.level-debug {
|
|
121
|
-
|
|
122
|
-
color: white;
|
|
126
|
+
color: var(--level-debug);
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
.level-info {
|
|
126
|
-
|
|
127
|
-
color: white;
|
|
130
|
+
color: var(--level-info);
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
.level-mark {
|
|
131
|
-
|
|
132
|
-
color: white;
|
|
134
|
+
color: var(--level-mark);
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
.level-warn {
|
|
136
|
-
|
|
137
|
-
color: #422006;
|
|
138
|
+
color: var(--level-warn);
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
.level-error {
|
|
141
|
-
|
|
142
|
-
color: white;
|
|
142
|
+
color: var(--level-error);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
.level-fatal {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
color: var(--level-fatal);
|
|
147
|
+
background: #5a1d1d;
|
|
148
|
+
padding: 0 4px;
|
|
149
|
+
border-radius: 2px;
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
.log-message {
|
|
151
|
-
flex: 1;
|
|
152
|
-
word-break: break-all;
|
|
153
|
-
color: #212529;
|
|
154
|
-
font-family: 'Consolas', 'Monaco', monospace;
|
|
155
153
|
white-space: pre-wrap;
|
|
154
|
+
word-break: break-word;
|
|
155
|
+
color: #cccccc;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
/*
|
|
159
|
-
.log-
|
|
160
|
-
border-left-color:
|
|
161
|
-
background:
|
|
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);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
.log-
|
|
165
|
-
border-left-color:
|
|
166
|
-
background:
|
|
164
|
+
.log-item.log-warn {
|
|
165
|
+
border-left-color: var(--level-warn);
|
|
166
|
+
background: rgba(206, 145, 120, 0.05);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
.log-
|
|
170
|
-
border-left-color:
|
|
171
|
-
background:
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.log-warn {
|
|
175
|
-
border-left-color: #fcd34d;
|
|
176
|
-
background: #fef3c7;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.log-error {
|
|
180
|
-
border-left-color: #fca5a5;
|
|
181
|
-
background: #fee2e2;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.log-fatal {
|
|
185
|
-
border-left-color: #9ca3af;
|
|
186
|
-
background: #f5f5f5;
|
|
169
|
+
.log-item.log-fatal {
|
|
170
|
+
border-left-color: var(--level-fatal);
|
|
171
|
+
background: rgba(209, 105, 105, 0.1);
|
|
187
172
|
}
|
|
188
173
|
|
|
189
174
|
.footer {
|
|
190
|
-
|
|
191
|
-
padding: 15px 30px;
|
|
175
|
+
padding: 5px 20px;
|
|
192
176
|
text-align: center;
|
|
193
|
-
color: #
|
|
194
|
-
font-size:
|
|
195
|
-
border-top: 1px solid
|
|
177
|
+
color: #666;
|
|
178
|
+
font-size: 11px;
|
|
179
|
+
border-top: 1px solid var(--border-color);
|
|
180
|
+
background: var(--container-bg);
|
|
196
181
|
}
|
|
197
182
|
|
|
198
|
-
/*
|
|
199
|
-
|
|
200
|
-
width:
|
|
183
|
+
/* Scrollbar */
|
|
184
|
+
::-webkit-scrollbar {
|
|
185
|
+
width: 10px;
|
|
186
|
+
height: 10px;
|
|
201
187
|
}
|
|
202
188
|
|
|
203
|
-
|
|
204
|
-
background:
|
|
205
|
-
border-radius: 4px;
|
|
189
|
+
::-webkit-scrollbar-track {
|
|
190
|
+
background: var(--bg-color);
|
|
206
191
|
}
|
|
207
192
|
|
|
208
|
-
|
|
209
|
-
background: #
|
|
210
|
-
border-radius:
|
|
193
|
+
::-webkit-scrollbar-thumb {
|
|
194
|
+
background: #424242;
|
|
195
|
+
border-radius: 5px;
|
|
211
196
|
}
|
|
212
197
|
|
|
213
|
-
|
|
214
|
-
background: #
|
|
198
|
+
::-webkit-scrollbar-thumb:hover {
|
|
199
|
+
background: #4f4f4f;
|
|
215
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>
|