@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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  render
3
- } from "../chunk-W3Q26Z2E.js";
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 > 200) limit = 200;
184
+ if (limit > 1e3) limit = 1e3;
185
185
  const logs = await getTodayLogs(limit);
186
186
  const parsedLogs = logs.map(parseLogLine);
187
187
  try {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  cfg
3
- } from "../chunk-7LNXK3JJ.js";
4
- import "../chunk-W3Q26Z2E.js";
3
+ } from "../chunk-ZRGOU5NN.js";
4
+ import "../chunk-AAM3ZLYA.js";
5
5
 
6
6
  // src/apps/login.ts
7
7
  import karin, { common, contactFriend, logger, segment } from "node-karin";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  cfg
3
- } from "../chunk-7LNXK3JJ.js";
4
- import "../chunk-W3Q26Z2E.js";
3
+ } from "../chunk-ZRGOU5NN.js";
4
+ import "../chunk-AAM3ZLYA.js";
5
5
 
6
6
  // src/apps/restart.ts
7
7
  import { common, karin, logger, restart } from "node-karin";
@@ -7,8 +7,8 @@ import {
7
7
  } from "../chunk-ODFXVVIE.js";
8
8
  import {
9
9
  cfg
10
- } from "../chunk-7LNXK3JJ.js";
11
- import "../chunk-W3Q26Z2E.js";
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";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  cfg,
3
3
  sendToFirstAdmin
4
- } from "../chunk-7LNXK3JJ.js";
4
+ } from "../chunk-ZRGOU5NN.js";
5
5
  import {
6
6
  render
7
- } from "../chunk-W3Q26Z2E.js";
7
+ } from "../chunk-AAM3ZLYA.js";
8
8
 
9
9
  // src/apps/update.ts
10
10
  import fs from "fs";
@@ -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.2",
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: {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  plugin
3
- } from "./chunk-W3Q26Z2E.js";
3
+ } from "./chunk-AAM3ZLYA.js";
4
4
 
5
5
  // src/utils/utils.ts
6
6
  import karin, { config, logger } from "node-karin";
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-7LNXK3JJ.js";
12
+ } from "./chunk-ZRGOU5NN.js";
13
13
  import {
14
14
  plugin
15
- } from "./chunk-W3Q26Z2E.js";
15
+ } from "./chunk-AAM3ZLYA.js";
16
16
 
17
17
  // src/index.ts
18
18
  import { logger, restartDirect } from "node-karin";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  cfg
3
- } from "./chunk-7LNXK3JJ.js";
3
+ } from "./chunk-ZRGOU5NN.js";
4
4
  import {
5
5
  plugin
6
- } from "./chunk-W3Q26Z2E.js";
6
+ } from "./chunk-AAM3ZLYA.js";
7
7
 
8
8
  // src/web.config.ts
9
9
  import { components, defineConfig } from "node-karin";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karinjs/plugin-basic",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Karin的基础插件,提供最基础的功能",
5
5
  "homepage": "https://github.com/KarinJS/karin-plugin-basic",
6
6
  "bugs": {
@@ -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: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Microsoft YaHei';
9
- background: linear-gradient(135deg, #c7d2fe 0%, #fbcfe8 50%, #a5f3fc 100%);
10
- padding: 20px;
11
- display: flex;
12
- align-items: flex-start;
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: 1400px;
17
- margin: 0 auto;
18
- background: rgba(255, 255, 255, 0.96);
19
- border-radius: 18px;
20
- box-shadow: 0 18px 45px rgba(148, 163, 184, 0.45);
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
- position: relative;
26
- padding: 30px;
27
- color: #0f172a;
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
- justify-content: center;
45
- font-size: 92px;
46
- font-weight: 800;
47
- letter-spacing: 0.12em;
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: 32px;
57
- margin-bottom: 15px;
55
+ font-size: 16px;
58
56
  font-weight: 600;
59
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
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: 20px;
65
- font-size: 14px;
66
- opacity: 0.95;
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.2);
71
- padding: 6px 12px;
72
- border-radius: 6px;
73
- backdrop-filter: blur(10px);
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: 20px;
78
- /* 让截图包含全部日志,不使用内部滚动条 */
79
- overflow: visible;
88
+ padding: 10px 0;
80
89
  }
81
90
 
82
91
  .log-item {
83
- display: flex;
84
- align-items: flex-start;
85
- padding: 12px 16px;
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
- transform: translateX(4px);
97
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
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: #6c757d;
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
- display: inline-block;
110
- padding: 2px 10px;
111
- border-radius: 4px;
112
- font-weight: 600;
120
+ font-weight: bold;
113
121
  text-transform: uppercase;
114
- font-size: 11px;
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
- background: #9ca3af;
122
- color: white;
126
+ color: var(--level-debug);
123
127
  }
124
128
 
125
129
  .level-info {
126
- background: #38bdf8;
127
- color: white;
130
+ color: var(--level-info);
128
131
  }
129
132
 
130
133
  .level-mark {
131
- background: #a855f7;
132
- color: white;
134
+ color: var(--level-mark);
133
135
  }
134
136
 
135
137
  .level-warn {
136
- background: #facc15;
137
- color: #422006;
138
+ color: var(--level-warn);
138
139
  }
139
140
 
140
141
  .level-error {
141
- background: #ef4444;
142
- color: white;
142
+ color: var(--level-error);
143
143
  }
144
144
 
145
145
  .level-fatal {
146
- background: #000;
147
- color: white;
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-debug {
160
- border-left-color: #d1d5db;
161
- background: #f9fafb;
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-info {
165
- border-left-color: #93c5fd;
166
- background: #e0f2fe;
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-mark {
170
- border-left-color: #c4b5fd;
171
- background: #f3e8ff;
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
- background: #f8f9fa;
191
- padding: 15px 30px;
175
+ padding: 5px 20px;
192
176
  text-align: center;
193
- color: #6c757d;
194
- font-size: 12px;
195
- border-top: 1px solid #dee2e6;
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
- .logs-container::-webkit-scrollbar {
200
- width: 8px;
183
+ /* Scrollbar */
184
+ ::-webkit-scrollbar {
185
+ width: 10px;
186
+ height: 10px;
201
187
  }
202
188
 
203
- .logs-container::-webkit-scrollbar-track {
204
- background: #f1f1f1;
205
- border-radius: 4px;
189
+ ::-webkit-scrollbar-track {
190
+ background: var(--bg-color);
206
191
  }
207
192
 
208
- .logs-container::-webkit-scrollbar-thumb {
209
- background: #888;
210
- border-radius: 4px;
193
+ ::-webkit-scrollbar-thumb {
194
+ background: #424242;
195
+ border-radius: 5px;
211
196
  }
212
197
 
213
- .logs-container::-webkit-scrollbar-thumb:hover {
214
- background: #555;
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>📋 Karin 日志</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
- <span class="log-time">{{$value.time}}</span>
25
- <span class="log-level level-{{$value.level}}">{{$value.level}}</span>
26
- <span class="log-message">{{@ $value.messageHtml}}</span>
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>