koishi-plugin-adapter-onebot-multi 0.0.7 → 0.0.8
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/client/page.vue +3 -6
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +6 -2
- package/package.json +1 -1
package/client/page.vue
CHANGED
|
@@ -22,6 +22,7 @@ import { send } from '@koishijs/client'
|
|
|
22
22
|
interface PanelConfig {
|
|
23
23
|
basePath: string
|
|
24
24
|
enabled: boolean
|
|
25
|
+
adminUrl: string
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
const loading = ref(true)
|
|
@@ -29,12 +30,8 @@ const panelConfig = ref<PanelConfig | null>(null)
|
|
|
29
30
|
|
|
30
31
|
const panelEnabled = computed(() => panelConfig.value?.enabled ?? false)
|
|
31
32
|
|
|
32
|
-
//
|
|
33
|
-
const adminUrl = computed(() =>
|
|
34
|
-
if (!panelConfig.value) return ''
|
|
35
|
-
const { basePath } = panelConfig.value
|
|
36
|
-
return `${basePath}/admin`
|
|
37
|
-
})
|
|
33
|
+
// 使用服务端返回的完整 URL
|
|
34
|
+
const adminUrl = computed(() => panelConfig.value?.adminUrl || '')
|
|
38
35
|
|
|
39
36
|
onMounted(async () => {
|
|
40
37
|
try {
|
package/dist/index.js
CHANGED
|
@@ -1 +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
|
|
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 s,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(n){const t=u(true),o=u(null),a=d(()=>{var e;return((e=o.value)==null?void 0:e.enabled)??false}),i=d(()=>{var e;return((e=o.value)==null?void 0:e.adminUrl)||""});return g(async()=>{try{o.value=await p("onebot-multi/config")}catch(e){console.error("Failed to get panel config:",e)}finally{t.value=false}}),(e,c)=>{const m=y("k-layout");return r(),k(m,null,{default:x(()=>[t.value?(r(),s("div",h,[...c[0]||(c[0]=[l("span",null,"加载中...",-1)])])):a.value?(r(),s("iframe",{key:2,src:i.value,class:"admin-iframe"},null,8,b)):(r(),s("div",w,[...c[1]||(c[1]=[l("h2",null,"面板未启用",-1),l("p",null,"请在插件配置中启用「展示面板」功能",-1)])]))]),_:1})}}}),_=(n,t)=>{const o=n.__vccOpts||n;for(const[a,i]of t)o[a]=i;return o},C=_(B,[["__scopeId","data-v-c05bc3f0"]]),E={},I={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 M(n,t){return r(),s("svg",I,[...t[0]||(t[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 O=_(E,[["render",M]]);f.register("activity:onebot-multi",O);const j=n=>{n.page({name:"OneBot Multi",path:"/onebot-multi",component:C,icon:"activity:onebot-multi",order:600})};export{j as default};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";[data-v-
|
|
1
|
+
@charset "UTF-8";[data-v-c05bc3f0] .k-layout{background:transparent!important;padding:0!important;margin:0!important}[data-v-c05bc3f0] .k-layout__main{background:transparent!important;padding:0!important;margin:0!important;overflow:hidden!important}[data-v-c05bc3f0] .k-layout__header,[data-v-c05bc3f0] .k-layout__left,[data-v-c05bc3f0] .k-layout__right{display:none!important}.admin-iframe[data-v-c05bc3f0]{width:100%;height:100%;border:none;display:block}.loading-state[data-v-c05bc3f0],.disabled-state[data-v-c05bc3f0]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--k-text-light)}.disabled-state h2[data-v-c05bc3f0]{margin-bottom:.5rem;color:var(--k-text-dark)}.disabled-state p[data-v-c05bc3f0]{color:var(--k-text-light)}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -2699,9 +2699,13 @@ function apply(ctx, config) {
|
|
|
2699
2699
|
prod: (0, import_path.resolve)(__dirname, "../dist")
|
|
2700
2700
|
});
|
|
2701
2701
|
ctx2.console.addListener("onebot-multi/config", () => {
|
|
2702
|
+
const basePath = config.panel?.basePath || "/status";
|
|
2703
|
+
const port = config.panel?.port;
|
|
2704
|
+
const adminUrl = port ? `http://localhost:${port}${basePath}/admin` : `${basePath}/admin`;
|
|
2702
2705
|
return {
|
|
2703
|
-
basePath
|
|
2704
|
-
enabled: config.panel?.enabled || false
|
|
2706
|
+
basePath,
|
|
2707
|
+
enabled: config.panel?.enabled || false,
|
|
2708
|
+
adminUrl
|
|
2705
2709
|
};
|
|
2706
2710
|
});
|
|
2707
2711
|
});
|