@tachybase/plugin-devtools 0.23.17 → 0.23.18

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.
@@ -3,7 +3,7 @@
3
3
  display: flex;
4
4
  `,children:jt.jsx("div",{style:{maxHeight:"700px",overflow:"auto",border:"1px solid",marginTop:"10px",marginBottom:"10px",borderColor:sa.colorBorder,width:"1205px"},children:jt.jsx(Dr.CodeMirror,{value:JSON.stringify(ca,null,2),width:"1200px",height:"600px",defaultLanguage:"typescript"})})})})});op.displayName="clientrouterToolPane";const kw="devtools";function ip(sa){return Dr.i18n.t(sa,{ns:[kw,"core"]})}function Cw(){return _i.useTranslation([kw,"core"])}const Aw=sr.memo(sa=>{const{token:la}=Ln.theme.useToken(),{t:ca}=Cw();xs.useMemoizedFn(ca);const Kn=Dr.useAPIClient(),{data:al}=Dr.useRequest(()=>Kn.resource("enviroment").get().then(zl=>{var Te;return(Te=zl.data)==null?void 0:Te.data}));return jt.jsx(Ln.Card,{style:{minHeight:"700px"},children:jt.jsx("div",{className:Dr.css`
5
5
  display: flex;
6
- `,children:jt.jsx("div",{style:{maxHeight:"700px",overflow:"auto",border:"1px solid",marginTop:"10px",marginBottom:"10px",borderColor:la.colorBorder,width:"1205px"},children:jt.jsx(Dr.CodeMirror,{value:JSON.stringify(al,null,2),width:"1200px",height:"600px",defaultLanguage:"typescript"})})})})});Aw.displayName="ENVToolPane";const Ow=sr.memo(sa=>{const{token:la}=Ln.theme.useToken(),ca=xs.useMemoizedFn(ip),Kn=Dr.useAPIClient(),[al,zl]=sr.useState(["0"]),[Te,Vc]=sr.useState(""),[_,j]=sr.useState(!0),[s,d]=sr.useState([]),[b,f]=sr.useState({name:void 0,belongto:void 0,seq:void 0}),[w,m]=sr.useState("");console.log("path: ",w);const{data:y}=Dr.useRequest(()=>Kn.resource("middlewares").get().then(O=>{var M;return(M=O.data)==null?void 0:M.data}));sr.useEffect(()=>{if(b){const O=jw(y,b);O&&m(O)}},[b]);const S=sr.useCallback((O,M)=>Array.isArray(O)?O.map((z,V)=>{const U=`${M}-${V}`;return z.files&&z.files.length>0?{title:z.name,seq:z.seq,belongto:z.belongto,key:U,icon:jt.jsx(ii.CodeOutlined,{}),children:S(z.files,U)}:{title:z.name,seq:z.seq,belongto:z.belongto,key:U,icon:jt.jsx(ii.CodeOutlined,{})}}):[],[]),k=sr.useMemo(()=>{const O=y||[];return[{title:ca("All"),key:"0",children:S(O,"0")}]},[y,S,ca]),P=O=>{zl(O),j(!1)},I=sr.useMemo(()=>{if(!Te)return k;const O=M=>{const z=[];for(const V of M){const U=V.title,$=U.indexOf(Te),K=U.substring(0,$),Y=U.substring($+Te.length),ee=$>-1?jt.jsxs("span",{children:[K,jt.jsx("span",{style:{color:la.colorPrimary},children:Te}),Y]}):jt.jsx("span",{children:U});if($>-1)z.push(zr(lt({},V),{title:ee}));else if(V.children){const te=O(V.children);te.length&&z.push(zr(lt({},V),{title:ee,children:te}))}}return z};return O(k)},[Te,k,la.colorPrimary]);return jt.jsx(Ln.Card,{style:{minHeight:"700px"},children:jt.jsxs("div",{className:Dr.css`
6
+ `,children:jt.jsx("div",{style:{maxHeight:"700px",overflow:"auto",border:"1px solid",marginTop:"10px",marginBottom:"10px",borderColor:la.colorBorder,width:"1205px"},children:jt.jsx(Dr.CodeMirror,{value:JSON.stringify(al,null,2),width:"1200px",height:"600px",defaultLanguage:"typescript"})})})})});Aw.displayName="ENVToolPane";const Ow=sr.memo(sa=>{const{token:la}=Ln.theme.useToken(),ca=xs.useMemoizedFn(ip),Kn=Dr.useAPIClient(),[al,zl]=sr.useState(["0"]),[Te,Vc]=sr.useState(""),[_,j]=sr.useState(!0),[s,d]=sr.useState([]),[b,f]=sr.useState({name:void 0,belongto:void 0,seq:void 0}),[w,m]=sr.useState(""),{data:y}=Dr.useRequest(()=>Kn.resource("middlewares").get().then(O=>{var M;return(M=O.data)==null?void 0:M.data}));sr.useEffect(()=>{if(b){const O=jw(y,b);O&&m(O)}},[b]);const S=sr.useCallback((O,M)=>Array.isArray(O)?O.map((z,V)=>{const U=`${M}-${V}`;return z.files&&z.files.length>0?{title:z.name,seq:z.seq,belongto:z.belongto,key:U,icon:jt.jsx(ii.CodeOutlined,{}),children:S(z.files,U)}:{title:z.name,seq:z.seq,belongto:z.belongto,key:U,icon:jt.jsx(ii.CodeOutlined,{})}}):[],[]),k=sr.useMemo(()=>{const O=y||[];return[{title:ca("All"),key:"0",children:S(O,"0")}]},[y,S,ca]),P=O=>{zl(O),j(!1)},I=sr.useMemo(()=>{if(!Te)return k;const O=M=>{const z=[];for(const V of M){const U=V.title,$=U.indexOf(Te),K=U.substring(0,$),Y=U.substring($+Te.length),ee=$>-1?jt.jsxs("span",{children:[K,jt.jsx("span",{style:{color:la.colorPrimary},children:Te}),Y]}):jt.jsx("span",{children:U});if($>-1)z.push(zr(lt({},V),{title:ee}));else if(V.children){const te=O(V.children);te.length&&z.push(zr(lt({},V),{title:ee,children:te}))}}return z};return O(k)},[Te,k,la.colorPrimary]);return jt.jsx(Ln.Card,{style:{minHeight:"700px"},children:jt.jsxs("div",{className:Dr.css`
7
7
  display: flex;
8
8
  `,children:[jt.jsx("div",{style:{maxHeight:"400px",width:"450px",overflow:"auto",border:"1px solid",marginTop:"6px",marginBottom:"10px",borderColor:la.colorBorder},children:I.length?jt.jsx(Ln.Tree,{checkable:!0,showIcon:!0,showLine:!0,checkedKeys:s,expandedKeys:al,autoExpandParent:_,onExpand:P,onCheck:O=>d(O),treeData:I,selectable:!0,onSelect:(O,M)=>{const z=M.node.title,V={name:String(M.node.title),belongto:M.node.belongto,seq:M.node.seq};f(z?V:void 0)}}):jt.jsx(Ln.Empty,{image:Ln.Empty.PRESENTED_IMAGE_SIMPLE})}),jt.jsx("div",{style:{maxHeight:"400px",overflow:"auto",border:"1px solid",marginTop:"6px",marginBottom:"10px",borderColor:la.colorBorder,width:"1005px",marginLeft:"10px"},children:b?jt.jsx(Dr.CodeMirror,{value:w,width:"1000px",height:"398px",defaultLanguage:"text"}):null})]})})});Ow.displayName="MiddlewareToolPane";function jw(sa,la){if(!(!la||!la.name||!la.belongto||la.seq===void 0)){for(let ca of sa){if(ca.name===la.name&&ca.belongto===la.belongto&&ca.seq===la.seq)return ca.path;if(ca.files&&ca.files.length>0){const Kn=jw(ca.files,la);if(Kn)return Kn}}return null}}const Pw="/api-documentation",Fk=sr.lazy(()=>Promise.resolve().then(()=>Wk)),Nw=()=>jt.jsx(sr.Suspense,{fallback:jt.jsx("div",{children:"Loading..."}),children:jt.jsx(Fk,{})}),Iw=Dr.createStyles(({css:sa,token:la})=>sa`
9
9
  position: relative;
@@ -1,13 +1,13 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "0.23.17",
4
- "@tachybase/sdk": "0.23.17",
3
+ "@tachybase/client": "0.23.18",
4
+ "@tachybase/sdk": "0.23.18",
5
5
  "antd": "5.22.5",
6
6
  "ahooks": "3.8.4",
7
7
  "@ant-design/icons": "5.5.2",
8
- "@tachybase/actions": "0.23.17",
9
- "@tachybase/server": "0.23.17",
8
+ "@tachybase/actions": "0.23.18",
9
+ "@tachybase/server": "0.23.18",
10
10
  "react-i18next": "15.2.0",
11
- "@tachybase/utils": "0.23.17",
12
- "@tachybase/database": "0.23.17"
11
+ "@tachybase/utils": "0.23.18",
12
+ "@tachybase/database": "0.23.18"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-devtools",
3
- "version": "0.23.17",
3
+ "version": "0.23.18",
4
4
  "main": "dist/server/index.js",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
@@ -11,13 +11,13 @@
11
11
  "swagger-ui-dist": "^5.18.2"
12
12
  },
13
13
  "peerDependencies": {
14
- "@tachybase/client": "0.23.17",
15
- "@tachybase/sdk": "0.23.17",
16
- "@tachybase/actions": "0.23.17",
17
- "@tachybase/database": "0.23.17",
18
- "@tachybase/server": "0.23.17",
19
- "@tachybase/test": "0.23.17",
20
- "@tachybase/utils": "0.23.17"
14
+ "@tachybase/actions": "0.23.18",
15
+ "@tachybase/client": "0.23.18",
16
+ "@tachybase/database": "0.23.18",
17
+ "@tachybase/test": "0.23.18",
18
+ "@tachybase/sdk": "0.23.18",
19
+ "@tachybase/server": "0.23.18",
20
+ "@tachybase/utils": "0.23.18"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tachybase-build --no-dts @tachybase/plugin-devtools"