filecat 7.32.2 → 7.33.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.
Files changed (30) hide show
  1. package/build/dist/1246.2504cc1737e1f6c1b7df.js +1 -0
  2. package/build/dist/1793.388505f01a0f2cfa51ee.js +1 -0
  3. package/build/dist/{2136.20ea58a65c7fb22d5e43.js → 2136.6a16e77023578d9b1d94.js} +1 -1
  4. package/build/dist/2539.4a8af43f286966a85f50.js +1 -0
  5. package/build/dist/{5308.073eb181f5ca0d6d2594.js → 2927.0c19d87ad8ee4eaaf334.js} +1 -1
  6. package/build/dist/{3355.fe615f78b2015ec080c2.js → 3355.b6d8493bf1901b761473.js} +1 -1
  7. package/build/dist/{4598.7f2b7c8ee1751b912cc6.js → 4598.d7b34a6ecf05aee2caf9.js} +1 -1
  8. package/build/dist/{47.d5cc6abee0da2951a189.js → 47.a2da5cd3257ddf268be7.js} +1 -1
  9. package/build/dist/526.bff76b57b88c2d4ffa93.js +1 -0
  10. package/build/dist/5308.48f7ed633a2ccd08e9a4.js +1 -0
  11. package/build/dist/5599.3106e89134ff993bc90b.js +1 -0
  12. package/build/dist/{6097.fa01bd2ab412cdcb52df.js → 6097.e3c8830eb391ed4af10f.js} +1 -1
  13. package/build/dist/{6439.e984788ff732b4eeaed8.js → 6439.ee22062f4138f66a40b3.js} +1 -1
  14. package/build/dist/6471.c5f6de5c28d0ce0ece0e.js +1 -0
  15. package/build/dist/676.d6c4977162563e3414d5.js +1 -0
  16. package/build/dist/6930.155cf4ed8fff0398c4b1.js +1 -0
  17. package/build/dist/7518.39a7d163fd064dd730ea.js +1 -0
  18. package/build/dist/{7678.954622f85bb32a50ad25.js → 7678.4adb2a0c9f541878bbb8.js} +1 -1
  19. package/build/dist/8891.bdc07e7b0fdb9b33cb83.js +1 -0
  20. package/build/dist/{9260.fd785c5b4418123dd54f.js → 9260.7efb31121354032f37f9.js} +1 -1
  21. package/build/dist/9724.e50b15571a3aed321e10.js +1 -0
  22. package/build/dist/{9765.046a87c8c6ed9427eb45.js → 9765.041a6563b8a199f68331.js} +1 -1
  23. package/build/dist/9984.ab2ec08866b8f1eca3ca.js +1 -0
  24. package/build/dist/index.html +1 -1
  25. package/build/dist/main.33ce288c271cbe87de33.js +2 -0
  26. package/build/main.js +1 -1
  27. package/package.json +2 -1
  28. package/build/dist/676.82cbafd4308ac08d1e69.js +0 -1
  29. package/build/dist/main.89376a85f16c77177628.js +0 -2
  30. /package/build/dist/{main.89376a85f16c77177628.js.LICENSE.txt → main.33ce288c271cbe87de33.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "filecat",
3
- "version": "7.32.2",
3
+ "version": "7.33.0",
4
4
  "description": "A self-hosted Web File browser and lightweight server management tool.",
5
5
  "author": "xiaobaidadada",
6
6
  "repository": {
@@ -91,6 +91,7 @@
91
91
  "flexsearch": "^0.8.212",
92
92
  "fluent-ffmpeg": "^2.1.3",
93
93
  "flv.js": "^1.6.2",
94
+ "foliate-js": "^1.0.1",
94
95
  "fs-extra": "^11.2.0",
95
96
  "github-markdown-css": "^5.6.1",
96
97
  "highlight.js": "^11.11.1",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,4091,8319],{77481(e,t,s){s.d(t,{S:()=>l,X:()=>i});var n=s(96540),r=s(61443),o=s(74848);function i(e){const[t,s]=n.useState([]),i=(0,n.useRef)(-1),[l,a]=(0,n.useState)(-1),[c,u]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const d=()=>{i.current=-1,a(-1),u(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let i=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(i=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},s)})})}),(0,o.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(l===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(i.current=s,a(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",u(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=i.current,s=c;d(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:d,children:t.map((s,n)=>{const r=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:r,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},48890(e,t,s){s.d(t,{Kw:()=>n,Tt:()=>r});var n=s(80952),r=(s(82327),s(1766),s(24854),s(90008),s(90846),s(40975),s(44286),s(30766),s(14973),s(69687),s(1234),s(47507),s(87268),s(55208),s(34678),s(24522));const o=`https://gcore.jsdelivr.net/npm/ace-builds@${n.version}/src-min-noconflict/`;n.config.set("basePath",o),n.config.set("modePath",o),n.config.set("themePath",o),n.config.set("workerPath",o)},84091(e,t,s){s.r(t),s.d(t,{default:()=>d});var n=s(96540),r=(s(80952),s(48890)),o=s(34843),i=s(82893),l=s(78247),a=s(93245),c=s(23430),u=s(74848);function d(e){const t=(0,n.useRef)(null),[s,d]=(0,o.fp)(i.AG.user_base_info),[p,f]=(0,n.useState)(!1),h=(0,n.useRef)(p);h.current=p;const _=(0,n.useRef)(e.save);_.current=e.save;const m=(0,n.useRef)(e.on_dirty);m.current=e.on_dirty,(0,n.useEffect)(()=>{m.current?.(p)},[p]);const x=async e=>{if(!_.current||!h.current)return;!1!==await _.current(e)&&f(!1)},g=(0,n.useRef)(x);g.current=x;const v=(0,n.useRef)(e.register);v.current=e.register;const j=(0,n.useRef)(e.on_view_state);j.current=e.on_view_state,(0,n.useEffect)(()=>{v.current?.({save:e=>g.current(e),get_view_state:()=>{const e=t.current;if(!e)return;const s=e.getCursorPosition();return{scroll:e.session.getScrollTop(),row:s.row,column:s.column}}})},[]),(0,a.a)(c.nE.ace,()=>!!_.current&&h.current,x);const w=s.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,n.useEffect)(()=>{const s=r.Kw.edit(t.current,{value:l.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${w}`,mode:e.model??r.Tt.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});s.setOptions({}),s.container.addEventListener("wheel",function(e){e.preventDefault()}),s.focus(),s.on("change",function(t){f(!0),e.on_change&&e.on_change()}),t.current=s;const n=e.view_state;if(n&&("number"==typeof n.scroll&&s.session.setScrollTop(n.scroll),"number"==typeof n.row)){const e={row:n.row,column:n.column??0};s.moveCursorToPosition(e),s.clearSelection(),s.scrollToLine(n.row,!1,!1);s.renderer.getFirstVisibleRow()<=n.row&&s.renderer.getLastVisibleRow()>=n.row||"number"!=typeof n.scroll||s.session.setScrollTop(n.scroll)}s.formatCode=()=>{const e=r.Kw.require("ace/ext/beautify"),s=t.current;s&&e.beautify(s.session)},l.xK.set_editor_temp(s,e.editor_id);const o=()=>{if(!j.current)return;const e=s.getCursorPosition();j.current({scroll:s.session.getScrollTop(),row:e.row,column:e.column})};return s.session.on("changeScrollTop",o),s.on("changeSelection",o),()=>{o(),l.xK.delete_editor_temp(e.editor_id),s.destroy()}},[]),(0,u.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}},60676(e,t,s){s.r(t),s.d(t,{default:()=>C});var n=s(96540),r=s(57952),o=s(85997),i=s(14284),l=s(52671),a=s(77481),c=s(7572),u=s(34843),d=s(82893),p=s(84091),f=s(78247),h=s(61443),_=s(23496),m=s(62042),x=s(22022),g=s(53459),v=s(7523),j=s(74848);function w(e,t="auto"){return"s"===t||"auto"===t&&e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`}function b(e){const{running:t=!1,resetKey:s=0,format:r="auto",prefix:o="",onTick:i,className:l}=e,[a,c]=(0,n.useState)(0),u=(0,n.useRef)(0),d=(0,n.useRef)(null),p=(0,n.useRef)(t);p.current=t;const f=(0,n.useCallback)(()=>{null!==d.current&&(cancelAnimationFrame(d.current),d.current=null)},[]),h=(0,n.useCallback)(()=>{f();const e=()=>{const t=performance.now()-u.current;c(t),i?.(t),p.current&&(d.current=requestAnimationFrame(e))};e()},[i,f]);return(0,n.useEffect)(()=>{u.current=performance.now(),c(0),i?.(0),p.current&&h()},[s]),(0,n.useEffect)(()=>{t?h():f()},[t,h,f]),(0,n.useEffect)(()=>()=>f(),[f]),(0,j.jsxs)("span",{className:l,children:[o,w(a,r)]})}var S=s(87361),y=s(28319);function q(e){const[t,s]=(0,n.useState)("");return(0,j.jsxs)("div",{className:"db-query-preset-input",children:[(0,j.jsx)(h.Sm,{placeholder:e.placeholder,value:t,handleInputChange:s}),(0,j.jsx)("div",{className:"db-query-preset-input__actions",children:(0,j.jsx)(o.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function C(){const e=(0,l.Zp)(),{t}=(0,x.Bd)(),{initUserInfo:s}=(0,n.useContext)(v.F),[w]=(0,u.fp)(d.AG.sqlite_query_context),[C]=(0,u.fp)(d.AG.user_base_info),[,k]=(0,u.fp)(d.AG.prompt_card),E=(0,n.useMemo)(()=>w?.path??"",[w?.path]),N=(0,n.useMemo)(()=>w?.path?`${w?.name||"数据库"} | ${w.path}`:"未选择数据库",[w?.name,w?.path]),A=97,[R,K]=(0,n.useState)(""),[L,T]=(0,n.useState)("table"),[F,$]=(0,n.useState)(!1),[P,M]=(0,n.useState)(""),[O,Q]=(0,n.useState)(null),[D,G]=(0,n.useState)(!1),[I,J]=(0,n.useState)(0),[V,Z]=(0,n.useState)(!1),[W,B]=(0,n.useState)([]),[H,X]=(0,n.useState)(-1);(0,n.useEffect)(()=>{const e=C?.user_data?.sql_preset_list;e&&e.length?B([...e]):B([{index:0,note:t("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}])},[C?.user_data?.sql_preset_list]);const U=async e=>{const t=e.map((e,t)=>({...e,index:t})),n=await i.wm.post(_.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return n?.code===g.m.Success&&(await s(),B(t),!0)},z=async(e,s)=>{const n=[...W,{note:s||t("SQL 预设"),sql:e,env:y.sqlEnvDefault}];await U(n)&&(k({open:!1}),(0,m.SK)(t("创建成功")),X(n.length-1))},Y=(e,t)=>{if(!e)return"";for(const s of e.split("\n")){const e=s.indexOf("=");if(!(e<0)&&s.slice(0,e).trim()===t)return s.slice(e+1).trim()}return""},[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)("");(0,n.useEffect)(()=>{f.xK.set_value_temp(R,A)},[R]),(0,n.useEffect)(()=>{K(""),M(""),Q(null),T("table"),G(!1),Z(!1),J(0),te(""),ne(""),f.xK.set_value_temp("",A),E||M("请先从文件右键打开一个数据库")},[E,w?.open]);const re=async()=>{const e=(f.xK.get_editor_value(A)??R).trim();if(!E)return M("请先从文件右键打开一个数据库"),void Q(null);if(!e)return M("请输入 SQL 语句"),void Q(null);$(!0),M(""),Z(!0),J(e=>e+1),G(!0);try{const s=(t=e,ee?t.split(ee).join(se):t),n=await i.$M.post("sqlite/query",{path:E,sql:s});Q(n.data),T("table")}catch(e){M(e?.message??`${e}`),Q(null)}finally{G(!1),$(!1)}var t},oe=O?.columns?.length?O.columns:Object.keys(O?.rows?.[0]??{}),ie=(O?.rows??[]).map(e=>oe.map(t=>{return null==(s=e[t])?"":"object"==typeof s?JSON.stringify(s):`${s}`;var s}));return(0,j.jsxs)("div",{className:"db-query-page",children:[(0,j.jsx)(r.A,{ignore_tags:!0,left_children:[(0,j.jsx)(o.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,j.jsx)(o.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,j.jsx)(o.rA,{icon:"table_chart",title:"表格视图",onClick:()=>T("table")},"table"),(0,j.jsx)(o.rA,{icon:"data_object",title:"原 JSON",onClick:()=>T("json")},"json"),(0,j.jsx)(o.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(S.o.sql_preset_setting_page)}},"preset-setting")],children:(0,j.jsx)(c.xP,{context:N,tip_context:"点击复制数据库信息"})}),(0,j.jsxs)("div",{className:"db-query-page__content",children:[(0,j.jsxs)(c.Zp,{title:"SQL 查询",rightTopCom:(0,j.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,j.jsx)(h.Sm,{placeholder:`${t("替换")}: ${ee}`,value:se,handleInputChange:ne,width:"12rem"}),W.length>0&&(0,j.jsx)(h.l6,{width:"16rem",tip:t("SQL预设"),value:H,onChange:e=>{const t=W[e];t&&(X(e),(e=>{f.xK.set_value_temp(e,A);const t=f.xK.get_editor(A);t&&t.setValue(e,-1),K(e)})(t.sql),te(Y(t.env??"","find")),ne(""),M(""))},options:W.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,j.jsx)(o.C3,{text:t(H>=0?"更新保存":"创建新预选项"),clickFun:async()=>{const e=(f.xK.get_editor_value(A)??R).trim();if(!e)return void M(t("sql_in"));const s=[...W];if(H>=0&&s[H]){s[H].sql=e,s[H].note||(s[H].note=t("SQL 预设"));await U(s)&&(0,m.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,j.jsx)(q,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,j.jsxs)("div",{className:"db-query-page__actions",children:[(0,j.jsx)(o.C3,{text:F?"查询中...":"执行查询",clickFun:re}),(0,j.jsx)(o.C3,{text:"清空",clickFun:()=>{f.xK.set_value_temp("",A);const e=f.xK.get_editor(A);e&&e.setValue("",-1),K("")}}),(0,j.jsx)(o.C3,{text:"table"===L?"表格视图":"切换到表格",clickFun:()=>T("table")}),(0,j.jsx)(o.C3,{text:"json"===L?"原 JSON":"切换到 JSON",clickFun:()=>T("json")})]}),children:[(0,j.jsx)("div",{className:"db-query-page__editor",children:(0,j.jsx)(p.default,{name:"sqlite.sql",editor_id:A,model:"ace/mode/sql",on_change:()=>{const e=f.xK.get_editor_value(A)??"";K(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),P&&(0,j.jsx)("div",{className:"db-query-page__error",children:P})]}),(0,j.jsxs)(c.Zp,{title:"查询结果",rightTopCom:(0,j.jsxs)("span",{className:"db-query-page__result-meta",children:[O?`${O.row_count} 行`:"暂无结果",V&&(0,j.jsx)("span",{className:"db-query-page__elapsed",children:(0,j.jsx)(b,{running:D,resetKey:I,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[O&&"table"===L&&(0,j.jsx)(a.X,{headers:oe,rows:ie}),O&&"json"===L&&(0,j.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(O.rows,null,2)}),!O&&!P&&(0,j.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!O&&P&&(0,j.jsx)("div",{className:"db-query-page__hint",children:P})]})]})]})}},28319(e,t,s){s.r(t),s.d(t,{default:()=>b,defaultSqlPreset:()=>j,sqlEnvDefault:()=>w});var n=s(96540),r=s(22022),o=s(4412),i=s(85997),l=s(75725),a=s(77481),c=s(7572),u=s(61443),d=s(34843),p=s(82893),f=s(14284),h=s(23496),_=s(53459),m=(s(62042),s(7523)),x=s(78247),g=s(52671),v=s(74848);function j(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const w='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function b(){const{t:e}=(0,r.Bd)(),{initUserInfo:t}=(0,n.useContext)(m.F),[,s]=(0,d.fp)(p.AG.editorSetting),[b]=(0,d.fp)(p.AG.user_base_info),S=(0,g.Zp)(),y=n.useRef(-1),[q,C]=(0,n.useState)([]);(0,n.useEffect)(()=>{const t=b?.user_data?.sql_preset_list;C(t?.length?[...t]:[j(e)])},[e,b?.user_data?.sql_preset_list]);const k=async()=>{const e=q.map((e,t)=>({...e,index:t})),s=await f.wm.post(h.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:e});s?.code===_.m.Success&&await t()},E=(e,t)=>{y.current=e;const n=q[e][t]??"";x.xK.set_value_temp(n),s({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{q[y.current][t]=e,C([...q]),x.xK.set_value_temp(""),k()}})},N=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,v.jsxs)("div",{children:[(0,v.jsx)(o.aZ,{position:"right",children:(0,v.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>S(-1)})}),(0,v.jsx)(l.jW,{isFull:!0,more:!0,children:(0,v.jsx)(l.NN,{children:(0,v.jsx)(l.xh,{children:(0,v.jsx)(l.fI,{children:(0,v.jsx)(l.VP,{widthPer:60,children:(0,v.jsx)(c.uF,{self_title:(0,v.jsx)("span",{className:"div-row",children:(0,v.jsx)("h2",{children:e("SQL 预设")})}),rightTopCom:(0,v.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,v.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>C([...q,{note:"",sql:"",env:w}])}),(0,v.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>k()})]}),children:(0,v.jsx)(a.X,{headers:N,rows:q.map((t,s)=>[(0,v.jsx)("div",{children:s+1}),(0,v.jsx)(u.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,C([...q])}}),(0,v.jsx)("div",{children:(0,v.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>E(s,"sql")})}),(0,v.jsx)("div",{children:(0,v.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>E(s,"env")})}),(0,v.jsx)("div",{children:(0,v.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{q.splice(s,1),C([...q])}})})]),width:"8rem"})})})})})})})]})}}}]);