文档归位:雪猫 README 门面 + 公告/制作文档/发布工具并入仓库根
Release Tag / validate-version (push) Waiting to run

This commit is contained in:
天天的鸟蛋蛋 committed 2026-11-12 06:29:38 +08:00
1 parent b9655a5ab1
commit e292824161
122 files changed
+90002 -69

No files matched your search

@@ -0,0 +1,2 @@
import{r,j as t}from"./react-vendor-jWT2yUdV.js";import{t as L,a as S}from"./chunk-ML27DD5T-ZFWrMOn-.js";import{P as $,b as C,s as M}from"./index-DiaaLdUu.js";import{z}from"./react-hot-toast-cGcFZPSt.js";import{a as R}from"./index-DvErMbt6.js";import{w}from"./index-DE7yoXMZ.js";import{E as _}from"./empty_state-BmDJmEaB.js";import{P as U}from"./page_header-Dr2OAQrb.js";import{P as W}from"./plugin_manager-OIjldREQ.js";import"./qface-BZLvZXJ8.js";import"./index-BV9-YCKp.js";import"./chunk-UX7UMZL5-CMHjUaC_.js";import"./SelectionManager-Dl9uHsLK.js";import"./usePress-BrNwsdVw.js";import"./layout-Buao20KT.js";import"./gestures-BHfQC-M8.js";import"./features-animation-BkV7kg8P.js";import"./Item-D8Sud-UP.js";import"./react-router-dom-C6k78GT4.js";import"./iconBase-B7bT1FlI.js";function ne(){const[u,d]=r.useState(!0),[o,p]=r.useState([]),[a,m]=r.useState(""),[P,f]=r.useState(!1),g=async()=>{var e;d(!0);try{const s=await W.getPluginList();s.pluginManagerNotFound?p([]):(p(s.extensionPages||[]),((e=s.extensionPages)==null?void 0:e.length)>0&&!a&&m(`${s.extensionPages[0].pluginId}:${s.extensionPages[0].path}`))}catch(s){const i=s.message;z.error(`获取扩展页面失败: ${i}`)}finally{d(!1)}},j=async()=>{await g()},N=r.useMemo(()=>o.map(e=>({key:`${e.pluginId}:${e.path}`,title:e.title,pluginId:e.pluginId,pluginName:e.pluginName,path:e.path,icon:e.icon,description:e.description})),[o]),c=r.useMemo(()=>{if(!a)return"";const[e,...s]=a.split(":"),i=s.join(":").replace(/^\//,"");return`/plugin/${e}/page/${i}`},[a]);r.useEffect(()=>{g()},[]),r.useEffect(()=>{c&&f(!0)},[c]);const k=()=>{f(!1)},y=(e,s)=>{const i=s.replace(/^\//,""),E=`/plugin/${e}/page/${i}`;window.open(E,"_blank")},n=r.useRef(null),l=r.useRef(!1),x=r.useRef(0),h=r.useRef(0),v=r.useCallback(e=>{const s=n.current;s&&(l.current=!0,x.current=e.clientX,h.current=s.scrollLeft,s.setPointerCapture(e.pointerId),s.style.cursor="grabbing",s.style.userSelect="none")},[]),I=r.useCallback(e=>{if(!l.current||!n.current)return;const s=e.clientX-x.current;n.current.scrollLeft=h.current-s},[]),b=r.useCallback(e=>{!l.current||!n.current||(l.current=!1,n.current.releasePointerCapture(e.pointerId),n.current.style.cursor="grab",n.current.style.userSelect="")},[]);return t.jsxs(t.Fragment,{children:[t.jsx("title",{children:"扩展页面 - SnowCat WebUI"}),t.jsxs("div",{className:"sc-page h-[calc(100vh-3.5rem)] flex flex-col",children:[t.jsx($,{loading:u}),t.jsx(U,{icon:t.jsx(w,{size:20}),title:"扩展页面",description:"插件注册的扩展界面,可直接在控制台内打开",accent:"secondary",actions:t.jsx(C,{isIconOnly:!0,className:"bg-white/60 dark:bg-white/10 text-default-600 dark:text-default-300 backdrop-blur-md hover:bg-white/80 dark:hover:bg-white/20",radius:"full",onPress:j,children:t.jsx(R,{size:22})})}),o.length>0&&t.jsx("div",{ref:n,className:"overflow-x-auto min-w-0 w-full mb-3 scrollbar-thin scrollbar-thumb-default-300 scrollbar-track-transparent cursor-grab touch-pan-x",style:{WebkitOverflowScrolling:"touch"},onPointerDown:v,onPointerMove:I,onPointerUp:b,onPointerCancel:b,children:t.jsx(L,{"aria-label":"Extension Pages",className:"w-max min-w-full",selectedKey:a,onSelectionChange:e=>m(e),classNames:{tabList:"sc-tablist flex-nowrap",cursor:"sc-tab-cursor",panel:"hidden"},children:N.map(e=>t.jsx(S,{title:t.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[e.icon&&t.jsx("span",{children:e.icon}),t.jsx("span",{className:"cursor-pointer hover:underline truncate max-w-[6rem] md:max-w-none",title:`插件:${e.pluginName}
点击在新窗口打开`,onClick:s=>{s.stopPropagation(),y(e.pluginId,e.path)},children:e.title}),t.jsxs("span",{className:"text-xs text-default-400 hidden md:inline",children:["(",e.pluginName,")"]})]})},e.key))})}),o.length===0&&!u?t.jsx(_,{icon:t.jsx(w,{size:22}),title:"暂无插件扩展页面",description:"插件可以通过注册页面来扩展 WebUI 功能,注册后会在这里出现。",className:"flex-1"}):t.jsxs("div",{className:"flex-1 min-h-0 sc-panel overflow-hidden relative",children:[P&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white/40 dark:bg-black/30 backdrop-blur-sm z-10",children:t.jsx(M,{size:"lg"})}),t.jsx("iframe",{src:c,className:"w-full h-full border-0",onLoad:k,title:"extension-page",allow:"clipboard-read; clipboard-write; fullscreen"})]})]})]})}export{ne as default};