@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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  render
3
- } from "../chunk-QUWYQJAF.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-PHDIUMOH.js";
4
- import "../chunk-QUWYQJAF.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-PHDIUMOH.js";
4
- import "../chunk-QUWYQJAF.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-PHDIUMOH.js";
11
- import "../chunk-QUWYQJAF.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-PHDIUMOH.js";
4
+ } from "../chunk-ZRGOU5NN.js";
5
5
  import {
6
6
  render
7
- } from "../chunk-QUWYQJAF.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.1",
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-QUWYQJAF.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-PHDIUMOH.js";
12
+ } from "./chunk-ZRGOU5NN.js";
13
13
  import {
14
14
  plugin
15
- } from "./chunk-QUWYQJAF.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-PHDIUMOH.js";
3
+ } from "./chunk-ZRGOU5NN.js";
4
4
  import {
5
5
  plugin
6
- } from "./chunk-QUWYQJAF.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.1",
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,210 +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
- min-height: 100vh;
11
- padding: 20px;
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: 1400px;
16
- margin: 0 auto;
17
- background: rgba(255, 255, 255, 0.96);
18
- border-radius: 18px;
19
- box-shadow: 0 18px 45px rgba(148, 163, 184, 0.45);
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
- position: relative;
25
- padding: 30px;
26
- color: #0f172a;
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
- justify-content: center;
44
- font-size: 92px;
45
- font-weight: 800;
46
- letter-spacing: 0.12em;
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: 32px;
56
- margin-bottom: 15px;
55
+ font-size: 16px;
57
56
  font-weight: 600;
58
- 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;
59
68
  }
60
69
 
61
70
  .info {
62
71
  display: flex;
63
- gap: 20px;
64
- font-size: 14px;
65
- opacity: 0.95;
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.2);
70
- padding: 6px 12px;
71
- border-radius: 6px;
72
- 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;
73
85
  }
74
86
 
75
87
  .logs-container {
76
- padding: 20px;
77
- /* 让截图包含全部日志,不使用内部滚动条 */
78
- overflow: visible;
88
+ padding: 10px 0;
79
89
  }
80
90
 
81
91
  .log-item {
82
- display: flex;
83
- align-items: flex-start;
84
- padding: 12px 16px;
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
- transform: translateX(4px);
96
- 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;
97
113
  }
98
114
 
99
115
  .log-time {
100
- color: #6c757d;
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
- display: inline-block;
109
- padding: 2px 10px;
110
- border-radius: 4px;
111
- font-weight: 600;
120
+ font-weight: bold;
112
121
  text-transform: uppercase;
113
- font-size: 11px;
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
- background: #9ca3af;
121
- color: white;
126
+ color: var(--level-debug);
122
127
  }
123
128
 
124
129
  .level-info {
125
- background: #38bdf8;
126
- color: white;
130
+ color: var(--level-info);
127
131
  }
128
132
 
129
133
  .level-mark {
130
- background: #a855f7;
131
- color: white;
134
+ color: var(--level-mark);
132
135
  }
133
136
 
134
137
  .level-warn {
135
- background: #facc15;
136
- color: #422006;
138
+ color: var(--level-warn);
137
139
  }
138
140
 
139
141
  .level-error {
140
- background: #ef4444;
141
- color: white;
142
+ color: var(--level-error);
142
143
  }
143
144
 
144
145
  .level-fatal {
145
- background: #000;
146
- color: white;
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-debug {
159
- border-left-color: #d1d5db;
160
- background: #f9fafb;
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-error {
179
- border-left-color: #fca5a5;
180
- background: #fee2e2;
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: #9ca3af;
185
- background: #f5f5f5;
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
- background: #f8f9fa;
190
- padding: 15px 30px;
175
+ padding: 5px 20px;
191
176
  text-align: center;
192
- color: #6c757d;
193
- font-size: 12px;
194
- 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);
195
181
  }
196
182
 
197
- /* 滚动条样式 */
198
- .logs-container::-webkit-scrollbar {
199
- width: 8px;
183
+ /* Scrollbar */
184
+ ::-webkit-scrollbar {
185
+ width: 10px;
186
+ height: 10px;
200
187
  }
201
188
 
202
- .logs-container::-webkit-scrollbar-track {
203
- background: #f1f1f1;
204
- border-radius: 4px;
189
+ ::-webkit-scrollbar-track {
190
+ background: var(--bg-color);
205
191
  }
206
192
 
207
- .logs-container::-webkit-scrollbar-thumb {
208
- background: #888;
209
- border-radius: 4px;
193
+ ::-webkit-scrollbar-thumb {
194
+ background: #424242;
195
+ border-radius: 5px;
210
196
  }
211
197
 
212
- .logs-container::-webkit-scrollbar-thumb:hover {
213
- background: #555;
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>📋 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>