koishi-plugin-adapter-onebot-multi 0.0.5 → 0.0.7

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.
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": "..",
4
+ "target": "es2022",
5
+ "module": "esnext",
6
+ "declaration": true,
7
+ "jsx": "preserve",
8
+ "noEmit": true,
9
+ "composite": true,
10
+ "incremental": true,
11
+ "skipLibCheck": true,
12
+ "esModuleInterop": true,
13
+ "moduleResolution": "bundler",
14
+ "strictBindCallApply": true,
15
+ "types": [
16
+ "@koishijs/client/global"
17
+ ]
18
+ },
19
+ "include": [
20
+ ".",
21
+ "../src"
22
+ ]
23
+ }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{send as p,icons as f}from"@koishijs/client";import{defineComponent as v,ref as u,computed as d,onMounted as g,resolveComponent as y,createBlock as k,openBlock as r,withCtx as x,createElementBlock as a,createElementVNode as l}from"vue";const h={key:0,class:"loading-state"},w={key:1,class:"disabled-state"},b=["src"],B=v({__name:"page",setup(o){const e=u(true),t=u(null),c=d(()=>{var n;return((n=t.value)==null?void 0:n.enabled)??false}),i=d(()=>{if(!t.value)return"";const{basePath:n}=t.value;return`${n}/admin`});return g(async()=>{try{t.value=await p("onebot-multi/config")}catch(n){console.error("Failed to get panel config:",n)}finally{e.value=false}}),(n,s)=>{const m=y("k-layout");return r(),k(m,null,{default:x(()=>[e.value?(r(),a("div",h,[...s[0]||(s[0]=[l("span",null,"加载中...",-1)])])):c.value?(r(),a("iframe",{key:2,src:i.value,class:"admin-iframe"},null,8,b)):(r(),a("div",w,[...s[1]||(s[1]=[l("h2",null,"面板未启用",-1),l("p",null,"请在插件配置中启用「展示面板」功能",-1)])]))]),_:1})}}}),_=(o,e)=>{const t=o.__vccOpts||o;for(const[c,i]of e)t[c]=i;return t},C=_(B,[["__scopeId","data-v-c08a2848"]]),E={},$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function I(o,e){return r(),a("svg",$,[...e[0]||(e[0]=[l("rect",{x:"2",y:"4",width:"20",height:"18",rx:"3"},null,-1),l("circle",{cx:"8",cy:"13",r:"2.5"},null,-1),l("circle",{cx:"16",cy:"13",r:"2.5"},null,-1)])])}const M=_(E,[["render",I]]);f.register("activity:onebot-multi",M);const j=o=>{o.page({name:"OneBot Multi",path:"/onebot-multi",component:C,icon:"activity:onebot-multi",order:600})};export{j as default};
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @charset "UTF-8";[data-v-c08a2848] .k-layout{background:transparent!important;padding:0!important;margin:0!important}[data-v-c08a2848] .k-layout__main{background:transparent!important;padding:0!important;margin:0!important;overflow:hidden!important}[data-v-c08a2848] .k-layout__header,[data-v-c08a2848] .k-layout__left,[data-v-c08a2848] .k-layout__right{display:none!important}.admin-iframe[data-v-c08a2848]{width:100%;height:100%;border:none;display:block}.loading-state[data-v-c08a2848],.disabled-state[data-v-c08a2848]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--k-text-light)}.disabled-state h2[data-v-c08a2848]{margin-bottom:.5rem;color:var(--k-text-dark)}.disabled-state p[data-v-c08a2848]{color:var(--k-text-light)}
package/lib/index.js CHANGED
@@ -1779,7 +1779,8 @@ var StatusPanel = class {
1779
1779
  .bot-avatar { width: 64px; height: 64px; border: var(--nl-border); border-radius: 50%; background: #fff; }
1780
1780
  .bot-info { flex: 1; }
1781
1781
  .bot-id { font-weight: 900; font-size: 1.2rem; }
1782
- .bot-protocol { color: #92400e; font-size: 0.9rem; font-weight: 700; background: #fffbeb; display: inline-block; padding: 2px 6px; border: 2px solid #451a03; border-radius: 6px; margin-top: 4px; }
1782
+ .bot-protocol { color: #92400e; font-size: 0.9rem; font-weight: 700; background: #fffbeb; display: inline-block; padding: 2px 6px; border: 2px solid #451a03; border-radius: 6px; margin-top: 4px; text-decoration: none; cursor: pointer; transition: all 0.15s; }
1783
+ .bot-protocol:hover { background: #fef3c7; transform: scale(1.02); }
1783
1784
  .status-badge { padding: 0.4rem 0.8rem; border: 2px solid #451a03; border-radius: 20px; font-size: 0.8rem; font-weight: 900; }
1784
1785
  .status-online { background: #dcfce7; border-color: #10b981; color: #15803d; }
1785
1786
  .status-offline { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }
@@ -1805,9 +1806,39 @@ var StatusPanel = class {
1805
1806
  .empty-state h3 { font-size: 1.5rem; margin-bottom: 1rem; }
1806
1807
  .footer { margin-top: 3rem; text-align: center; font-weight: 700; color: #92400e; }
1807
1808
  @media (max-width: 768px) {
1808
- body { padding: 1rem; align-items: flex-start; }
1809
- .admin-container { padding: 1rem; }
1809
+ body { padding: 0.5rem; align-items: flex-start; }
1810
+ .auth-box { padding: 1.5rem; margin: 0.5rem; }
1811
+ .auth-box h1 { font-size: 1.4rem; }
1812
+ .admin-container { padding: 0.75rem; border-radius: 12px; }
1813
+ .admin-container h1 { font-size: 1.3rem; margin-bottom: 0.75rem; }
1814
+ .toolbar { gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
1815
+ .toolbar .btn { padding: 0.5rem 0.8rem; font-size: 0.8rem; }
1816
+ .bots { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
1817
+ .bot-card { padding: 0.75rem; border-radius: 10px; box-shadow: 2px 2px 0 #451a03; }
1818
+ .bot-card:hover { transform: none; box-shadow: 2px 2px 0 #451a03; }
1819
+ .bot-header { gap: 0.5rem; margin-bottom: 0.5rem; }
1820
+ .bot-avatar { width: 36px; height: 36px; }
1821
+ .bot-info { min-width: 0; }
1822
+ .bot-id { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1823
+ .bot-protocol { font-size: 0.7rem; padding: 1px 4px; }
1824
+ .status-badge { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
1825
+ .bot-stats { padding: 0.5rem; gap: 4px; grid-template-columns: repeat(3, 1fr); border-radius: 8px; margin-bottom: 0.5rem; }
1826
+ .bot-stat-label { font-size: 0.6rem; }
1827
+ .bot-stat-value { font-size: 0.75rem; }
1828
+ .bot-actions { gap: 0.3rem; }
1829
+ .bot-actions .btn { padding: 0.3rem 0.5rem; font-size: 0.7rem; }
1830
+ .modal-content { padding: 1rem; margin: 0.5rem; }
1831
+ .modal h2 { font-size: 1.1rem; }
1832
+ .modal-actions { flex-direction: column; gap: 0.5rem; }
1833
+ .toast { left: 0.5rem; right: 0.5rem; transform: none; text-align: center; padding: 0.75rem; font-size: 0.85rem; }
1834
+ .footer { margin-top: 1.5rem; font-size: 0.8rem; }
1835
+ }
1836
+ @media (max-width: 400px) {
1837
+ .toolbar { flex-direction: column; }
1838
+ .toolbar .btn { width: 100%; text-align: center; }
1810
1839
  .bots { grid-template-columns: 1fr; }
1840
+ .bot-stats { grid-template-columns: repeat(3, 1fr); }
1841
+ .bot-actions { flex-direction: row; flex-wrap: wrap; }
1811
1842
  }
1812
1843
  </style>
1813
1844
  </head>
@@ -2224,7 +2255,7 @@ var StatusPanel = class {
2224
2255
  <img class="bot-avatar" src="http://q.qlogo.cn/headimg_dl?dst_uin=${bot.selfId}&spec=640" alt="avatar">
2225
2256
  <div class="bot-info">
2226
2257
  <div class="bot-id">${displayName}</div>
2227
- <div class="bot-protocol">QQ: ${bot.selfId}</div>
2258
+ <a class="bot-protocol" href="https://wpa.qq.com/msgrd?v=3&uin=${bot.selfId}&site=qq&menu=yes" target="_blank" title="点击添加好友">QQ: ${bot.selfId}</a>
2228
2259
  </div>
2229
2260
  <span class="status-badge status-${bot.status}">${statusText}</span>
2230
2261
  </div>
@@ -2320,7 +2351,8 @@ var StatusPanel = class {
2320
2351
  .bot-avatar { width: 64px; height: 64px; border: var(--nl-border); border-radius: 50%; background: #fff; }
2321
2352
  .bot-info { flex: 1; }
2322
2353
  .bot-id { font-weight: 900; font-size: 1.2rem; }
2323
- .bot-protocol { color: #92400e; font-size: 0.9rem; font-weight: 700; background: #fffbeb; display: inline-block; padding: 2px 6px; border: 2px solid #451a03; border-radius: 6px; margin-top: 4px; }
2354
+ .bot-protocol { color: #92400e; font-size: 0.9rem; font-weight: 700; background: #fffbeb; display: inline-block; padding: 2px 6px; border: 2px solid #451a03; border-radius: 6px; margin-top: 4px; text-decoration: none; cursor: pointer; transition: all 0.15s; }
2355
+ .bot-protocol:hover { background: #fef3c7; transform: scale(1.02); }
2324
2356
  .status-badge { padding: 0.4rem 0.8rem; border: 2px solid #451a03; border-radius: 20px; font-size: 0.8rem; font-weight: 900; }
2325
2357
  .status-online { background: #dcfce7; border-color: #10b981; color: #15803d; }
2326
2358
  .status-offline { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }
@@ -2331,9 +2363,6 @@ var StatusPanel = class {
2331
2363
  .bot-stat-value { font-weight: 700; font-size: 1rem; }
2332
2364
  .footer { margin-top: 3rem; text-align: center; font-weight: 700; color: #92400e; }
2333
2365
  .refresh-btn {
2334
- position: fixed;
2335
- bottom: 2rem;
2336
- right: 2rem;
2337
2366
  background: var(--nl-primary);
2338
2367
  border: var(--nl-border);
2339
2368
  color: var(--nl-text);
@@ -2344,14 +2373,10 @@ var StatusPanel = class {
2344
2373
  font-weight: 800;
2345
2374
  box-shadow: var(--nl-shadow);
2346
2375
  transition: all 0.1s;
2347
- z-index: 100;
2348
2376
  }
2349
2377
  .refresh-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #451a03; }
2350
2378
  .refresh-btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #451a03; }
2351
2379
  .admin-btn {
2352
- position: fixed;
2353
- bottom: 2rem;
2354
- right: 9rem;
2355
2380
  background: #f3f4f6;
2356
2381
  border: var(--nl-border);
2357
2382
  color: var(--nl-text);
@@ -2362,15 +2387,52 @@ var StatusPanel = class {
2362
2387
  font-weight: 800;
2363
2388
  box-shadow: var(--nl-shadow);
2364
2389
  transition: all 0.1s;
2365
- z-index: 100;
2366
2390
  text-decoration: none;
2367
2391
  }
2368
2392
  .admin-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #451a03; }
2369
2393
  .admin-btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #451a03; }
2394
+ .floating-btns {
2395
+ position: fixed;
2396
+ bottom: 1.5rem;
2397
+ right: 1.5rem;
2398
+ display: flex;
2399
+ gap: 0.75rem;
2400
+ z-index: 100;
2401
+ }
2370
2402
  @media (max-width: 768px) {
2371
- body { padding: 1rem; }
2372
- .container { padding: 1rem; }
2373
- .stats { grid-template-columns: 1fr; }
2403
+ body { padding: 0.5rem; }
2404
+ .container { padding: 0.75rem; border-radius: 12px; }
2405
+ h1 { font-size: 1.3rem !important; margin-bottom: 1rem !important; }
2406
+ .stats { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
2407
+ .stat-card { padding: 0.5rem; border-radius: 10px; }
2408
+ .stat-value { font-size: 1.5rem; }
2409
+ .stat-label { font-size: 11px; }
2410
+ .bots { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
2411
+ .bot-card { padding: 0.75rem; border-radius: 10px; box-shadow: 2px 2px 0 #451a03; }
2412
+ .bot-card:hover { transform: none; box-shadow: 2px 2px 0 #451a03; }
2413
+ .bot-header { gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
2414
+ .bot-avatar { width: 36px; height: 36px; }
2415
+ .bot-info { flex: 1; min-width: 0; }
2416
+ .bot-id { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
2417
+ .bot-protocol { font-size: 0.7rem; padding: 1px 4px; }
2418
+ .status-badge { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
2419
+ .bot-stats { padding: 0.5rem; gap: 4px; grid-template-columns: repeat(3, 1fr); border-radius: 8px; }
2420
+ .bot-stat-label { font-size: 0.6rem; }
2421
+ .bot-stat-value { font-size: 0.75rem; }
2422
+ .footer { margin-top: 1rem; font-size: 0.75rem; }
2423
+ .floating-btns { bottom: 0.75rem; right: 0.75rem; gap: 0.4rem; }
2424
+ .admin-btn, .refresh-btn {
2425
+ position: static;
2426
+ padding: 0.5rem 0.8rem;
2427
+ font-size: 0.8rem;
2428
+ border-width: 2px;
2429
+ box-shadow: 2px 2px 0 #451a03;
2430
+ }
2431
+ }
2432
+ @media (max-width: 400px) {
2433
+ .bots { grid-template-columns: 1fr; }
2434
+ .bot-stats { grid-template-columns: repeat(3, 1fr); }
2435
+ .floating-btns { flex-direction: row; }
2374
2436
  }
2375
2437
  </style>
2376
2438
  </head>
@@ -2385,8 +2447,10 @@ var StatusPanel = class {
2385
2447
  <div class="bots">${botCardsHtml}</div>
2386
2448
  <div class="footer">更新时间: ${updatedAtStr}</div>
2387
2449
  </div>
2388
- <a href="${basePath}/admin" class="admin-btn">管理 🛠️</a>
2389
- <button class="refresh-btn" onclick="location.reload()">刷新 ⚡</button>
2450
+ <div class="floating-btns">
2451
+ <a href="${basePath}/admin" class="admin-btn">管理 🛠️</a>
2452
+ <button class="refresh-btn" onclick="location.reload()">刷新 ⚡</button>
2453
+ </div>
2390
2454
  <script>setTimeout(() => location.reload(), 30000)</script>
2391
2455
  </body>
2392
2456
  </html>`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-adapter-onebot-multi",
3
3
  "description": "奶龙bot定制版onebot适配器,支持自动负载均衡,适配器级黑名单/白名单,提供webui,可指定端口",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -35,12 +35,15 @@
35
35
  "optional": [
36
36
  "console"
37
37
  ]
38
- }
38
+ },
39
+ "browser": true
39
40
  },
40
41
  "peerDependencies": {
42
+ "@koishijs/plugin-console": "^5.30.0",
41
43
  "koishi": "^4.18.6"
42
44
  },
43
45
  "devDependencies": {
46
+ "@koishijs/client": "^5.30.0",
44
47
  "@koishijs/plugin-console": "^5.30.8",
45
48
  "@koishijs/plugin-server": "^3.2.4",
46
49
  "@types/koa": "^2.15.0",