filecat 6.51.0 → 6.52.0
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/build/dist/{1472.16c1857f1b20e40064fe.js → 1472.fb0abd0e4e7d80ffae52.js} +1 -1
- package/build/dist/4488.8dc288aa8e0d3737c457.js +1 -0
- package/build/dist/8772.b7d5a1b506b63fadd144.js +2 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.e9f9077823db17d5a82e.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/4488.0fdf2f4a552ffff1b206.js +0 -1
- package/build/dist/8772.279446de10fefaf37eaa.js +0 -2
- package/build/dist/main.3876a819e780b321c1f1.js +0 -2
- /package/build/dist/{8772.279446de10fefaf37eaa.js.LICENSE.txt → 8772.b7d5a1b506b63fadd144.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.3876a819e780b321c1f1.js.LICENSE.txt → main.e9f9077823db17d5a82e.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4091,4488],{77481(e,t,n){n.d(t,{S:()=>l,X:()=>r});var s=n(96540),i=n(74848);function r(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,n)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},84091(e,t,n){n.r(t),n.d(t,{default:()=>d});var s=n(96540),i=n(80952),r=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(1234),n(47507),n(87268),n(24522)),l=n(34843),a=n(82893),c=n(78247),o=n(74848);function d(e){const t=(0,s.useRef)(null),[n,d]=(0,l.fp)(a.AG.user_base_info),u=n.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,s.useEffect)(()=>{const n=i.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??r.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return n.setOptions({}),n.container.addEventListener("wheel",function(e){e.preventDefault()}),n.focus(),n.on("change",function(t){e.on_change&&e.on_change()}),t.current=n,n.formatCode=()=>{const e=i.require("ace/ext/beautify"),n=t.current;n&&e.beautify(n.session)},c.xK.set_editor_temp(n,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),n.destroy()}},[]),(0,o.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}i.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("modePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("themePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("workerPath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`)},84488(e,t,n){n.r(t),n.d(t,{default:()=>x});var s=n(96540),i=n(57952),r=n(85997),l=n(14284),a=n(76213),c=n(77481),o=n(70447),d=n(34843),u=n(82893),h=n(84091),p=n(78247),m=n(74848);function x(){const e=(0,a.Zp)(),[t]=(0,d.fp)(u.AG.sqlite_query_context),n=(0,s.useMemo)(()=>t?.path??"",[t?.path]),x=(0,s.useMemo)(()=>t?.path?`${t?.name||"数据库"} | ${t.path}`:"未选择数据库",[t?.name,t?.path]),_=97,[f,j]=(0,s.useState)(""),[g,b]=(0,s.useState)("table"),[v,y]=(0,s.useState)(!1),[w,k]=(0,s.useState)(""),[q,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{p.xK.set_value_temp(f,_)},[f]),(0,s.useEffect)(()=>{j(""),k(""),C(null),b("table"),p.xK.set_value_temp("",_),n||k("请先从文件右键打开一个数据库")},[n,t?.open]);const S=async()=>{const e=(p.xK.get_editor_value(_)??f).trim();if(!n)return k("请先从文件右键打开一个数据库"),void C(null);if(!e)return k("请输入 SQL 语句"),void C(null);y(!0),k("");try{const t=await l.$M.post("sqlite/query",{path:n,sql:e});C(t.data),b("table")}catch(e){k(e?.message??`${e}`),C(null)}finally{y(!1)}},N=q?.columns?.length?q.columns:Object.keys(q?.rows?.[0]??{}),$=(q?.rows??[]).map(e=>N.map(t=>{return null==(n=e[t])?"":"object"==typeof n?JSON.stringify(n):`${n}`;var n}));return(0,m.jsxs)("div",{className:"db-query-page",children:[(0,m.jsx)(i.A,{ignore_tags:!0,left_children:[(0,m.jsx)(r.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,m.jsx)(r.rA,{icon:"play_arrow",title:"执行",onClick:S},"run"),(0,m.jsx)(r.rA,{icon:"table_chart",title:"表格视图",onClick:()=>b("table")},"table"),(0,m.jsx)(r.rA,{icon:"data_object",title:"原 JSON",onClick:()=>b("json")},"json")],children:(0,m.jsx)(o.xP,{context:x,tip_context:"点击复制数据库信息"})}),(0,m.jsxs)("div",{className:"db-query-page__content",children:[(0,m.jsxs)(o.Zp,{title:"SQL 查询",rightBottomCom:(0,m.jsxs)("div",{className:"db-query-page__actions",children:[(0,m.jsx)(r.C3,{text:v?"查询中...":"执行查询",clickFun:S}),(0,m.jsx)(r.C3,{text:"清空",clickFun:()=>{p.xK.set_value_temp("",_);const e=p.xK.get_editor(_);e&&e.setValue("",-1),j("")}}),(0,m.jsx)(r.C3,{text:"table"===g?"表格视图":"切换到表格",clickFun:()=>b("table")}),(0,m.jsx)(r.C3,{text:"json"===g?"原 JSON":"切换到 JSON",clickFun:()=>b("json")})]}),children:[(0,m.jsx)("div",{className:"db-query-page__editor",children:(0,m.jsx)(h.default,{name:"sqlite.sql",editor_id:_,model:"ace/mode/sql",on_change:()=>{const e=p.xK.get_editor_value(_)??"";j(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),w&&(0,m.jsx)("div",{className:"db-query-page__error",children:w})]}),(0,m.jsxs)(o.Zp,{title:"查询结果",titleCom:(0,m.jsx)("span",{children:q?`${q.row_count} 行`:"暂无结果"}),children:[q&&"table"===g&&(0,m.jsx)(c.X,{headers:N,rows:$}),q&&"json"===g&&(0,m.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(q.rows,null,2)}),!q&&!w&&(0,m.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!q&&w&&(0,m.jsx)("div",{className:"db-query-page__hint",children:w})]})]})]})}}}]);
|