filecat 6.44.0 → 6.45.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/{1448.c9f76a52d88a488d6da2.js → 1448.9d36cf216585774aa090.js} +1 -1
- package/build/dist/{1472.7f06129bac68ad0b2cf3.js → 1472.1d82f53e309eceea3e9a.js} +1 -1
- package/build/dist/{1595.5f5ec6122acae3a9cd0b.js → 1595.2c366cdfe302dc5a5050.js} +1 -1
- package/build/dist/{1636.64b2c5dd5956d512a0fc.js → 1636.723781f88d68ed3657cb.js} +1 -1
- package/build/dist/{1832.a01933ba5df99576ecc2.js → 1832.99a4c37ffea35d9b9cb3.js} +1 -1
- package/build/dist/{2502.754728f7e85723b16fc3.js → 2502.cd914e22b13cdaaf78bc.js} +1 -1
- package/build/dist/{2542.26cb302b60de23166227.js → 2542.58c52e3d0bd7af6d9a62.js} +1 -1
- package/build/dist/2674.c58839496f66c6512ae5.js +1 -0
- package/build/dist/{2851.b4b84820b81113718235.js → 2851.a7ecf5bca38c79677f03.js} +1 -1
- package/build/dist/{3402.5d4caccb2e21dbeb3398.js → 3402.62335cc49fe962eaf134.js} +1 -1
- package/build/dist/{3659.f32a94d104cc1353e384.js → 3659.55a733505528331021e0.js} +1 -1
- package/build/dist/{4273.2f3c957012fa1d0c4747.js → 4273.19b11dd57545851ebc50.js} +1 -1
- package/build/dist/{4903.69328b798fc5c52d6069.js → 4903.f8714937dbb91b37c119.js} +1 -1
- package/build/dist/{5516.f442aef7efd919af92cd.js → 5516.e3b6d2b2c1439d8e4cf6.js} +1 -1
- package/build/dist/{5761.0afce3c97ce69979e9ee.js → 5761.2631a6de5c30fbfb66da.js} +1 -1
- package/build/dist/{5937.820d7e5fcf608c346964.js → 5937.9e77a5b78996adbdbe1b.js} +1 -1
- package/build/dist/{6247.cbbbe80520d738798cca.js → 6247.077a555b26c06aa2e96b.js} +1 -1
- package/build/dist/6505.bacc9c5cdd2094604a00.js +1 -0
- package/build/dist/{678.440a73a4b64c078cfb94.js → 678.f0aed27a613d4dd41080.js} +1 -1
- package/build/dist/{6892.fac5b622852f0aad613d.js → 6892.4db4a81a58e94e4356cc.js} +1 -1
- package/build/dist/{7133.cf2a4a51286b78a653af.js → 7133.ae2c0ab24c0d2a3a5a1c.js} +1 -1
- package/build/dist/{7180.e79b454cc9ea523bfebc.js → 7180.32c831dec9865cde8006.js} +1 -1
- package/build/dist/{7181.9f22415130200367cfda.js → 7181.4a60db9c9a2603feeff8.js} +1 -1
- package/build/dist/{7209.de0fc874821ef1cb0684.js → 7209.f4ad503eb484aa601281.js} +1 -1
- package/build/dist/{7759.8041fbbd5fcb8366c098.js → 7759.b58c5676b606e60d7aac.js} +1 -1
- package/build/dist/8090.90cb45de35e21b9cfcb0.js +2 -0
- package/build/dist/{8603.8b4a272c8bbe4d5fd4c4.js → 8603.557bbe67c1b08a3627d6.js} +1 -1
- package/build/dist/{8714.a9a6d15b8cc47c1ae191.js → 8714.3360add5f45201f4c8da.js} +1 -1
- package/build/dist/{8765.32baeac654f4d839c1d0.js → 8765.35d24edc172c477ba795.js} +1 -1
- package/build/dist/8947.f2b4fad4c25fb147ea42.js +2 -0
- package/build/dist/index.html +1 -1
- package/build/dist/{main.0b5d3cea9208fae2823e.js → main.151df5e8840564caf370.js} +2 -2
- package/build/main.js +1 -1
- package/build/main.js.LICENSE.txt +1 -1
- package/build/threads.work.filecat.js +1 -1
- package/package.json +2 -2
- package/shell/config/base.webpack.config.js +1 -1
- package/shell/config/webpack.npm.config.js +2 -1
- package/build/dist/2674.79672d4369bb7a384e04.js +0 -1
- package/build/dist/6505.f730960378f6e4b7bc24.js +0 -1
- package/build/dist/8090.c4e60cb0780036d49258.js +0 -2
- package/build/dist/9572.304acc81bcceeb2ade2a.js +0 -2
- /package/build/dist/{8090.c4e60cb0780036d49258.js.LICENSE.txt → 8090.90cb45de35e21b9cfcb0.js.LICENSE.txt} +0 -0
- /package/build/dist/{9572.304acc81bcceeb2ade2a.js.LICENSE.txt → 8947.f2b4fad4c25fb147ea42.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.0b5d3cea9208fae2823e.js.LICENSE.txt → main.151df5e8840564caf370.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filecat",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.45.0",
|
|
4
4
|
"description": "FileCat File Browser Server Manager",
|
|
5
5
|
"author": "xiaobaidadada",
|
|
6
6
|
"repository": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"ace-builds": "^1.32.9",
|
|
64
64
|
"archiver": "^7.0.1",
|
|
65
65
|
"awesomplete": "^1.1.7",
|
|
66
|
-
"axios": "1.
|
|
66
|
+
"axios": "1.18.1",
|
|
67
67
|
"babel-loader": "^10.1.1",
|
|
68
68
|
"chart.js": "^4.4.2",
|
|
69
69
|
"chokidar": "^4.0.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>j});var a=n(96540),o=n(82893),i=n(34843),s=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function p(e){{const[t,n]=(0,a.useState)(!1),[o,i]=(0,a.useState)([]),l=e=>{i(e)},h=async()=>{"folder"===e.type?(t||!e.click||o||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},m=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{i(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:h,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,m)},className:"studio-item-title",children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(s.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&o&&(0,d.jsx)("div",{style:{marginLeft:20},children:o.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(p,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:m},n)},n))})]})}}n(61443);function h(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(p,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,children:t.children,click:e.click,size:t.size},n))})}var m=n(14284),u=n(34289),f=n(53459),x=n(78247),w=(n(62042),n(2543)),y=n(27690),v=n(22022),_=n(88815),k=n(61973);const g=a.lazy(()=>Promise.all([n.e(9988),n.e(4091)]).then(n.bind(n,84091)));function j(e){const[t,n]=(0,a.useState)([]),[p,j]=(0,a.useState)(""),[C,E]=(0,a.useState)(""),[N,S]=(0,a.useState)(!1),[M,P]=(0,a.useState)({path:"",name:""}),[$,b]=(0,a.useState)(""),[G,I]=(0,i.fp)(o.AG.confirm),[z,A]=(0,a.useState)(!1),[F,D]=(0,i.fp)(o.AG.fileShellShow),[L,R]=(0,i.fp)(o.AG.file_shell_hidden),T=(0,a.useRef)(null),K=(0,a.useRef)(null),[U,B]=(0,a.useState)(!1),[W,X]=(0,a.useState)(16),[Y,Z]=(0,i.fp)(o.AG.showPrompt),{t:q}=(0,v.Bd)(),H=(0,k.Zp)();let J=(0,k.zy)().pathname.split("/").filter(Boolean).pop();J=decodeURIComponent(J);const O=async()=>{const e=(0,u.GG)("file",J);j(e);const t=await m.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],a=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&a.push(n);n([...e,...a])}};(0,a.useEffect)(()=>{E(""),P({}),A(!1),O()},[]);const Q=async(e,t)=>{const n=await m.$M.get(`${encodeURIComponent(t)}`);E(n.data),x.xK.set_value_temp(n.data),P({path:t,name:e}),b(t)},V=(e,t)=>{e.size>_.o5?I({open:!0,handle:()=>{Q(e.name,t),I({open:!1,handle:null}),A(!1)},title:"超过20MB了还要打开吗?"}):Q(e.name,t)};async function ee(){if(!z)return;const e={context:x.xK.get_editor_value()};0===(await m.$M.post(`save/${encodeURIComponent($)}`,e)).code&&A(!1)}const te=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),z&&ee())};(0,a.useEffect)(()=>(document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}),[z]);const ne=(0,a.useCallback)(w.throttle(e=>{const t=parseFloat(getComputedStyle(K.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,o=2.25+T.current.offsetWidth/t;a<=n&&a>=o&&X(parseFloat(a.toFixed(2)))},32),[]),ae=()=>{B(!1),K.current.removeEventListener("pointermove",ne)},oe=[{r:q("创建文件"),v:"创建文件"},{r:q("创建目录"),v:"创建目录"},{r:q("重命名"),v:"重命名"},{r:q("删除"),v:"删除"}],ie=[{r:q("重命名"),v:"重命名"},{r:q("删除"),v:"删除"}],se=(e,t,n,a,o)=>{e.preventDefault();const i=new c.ik;i.path=n,i.filename=t,i.x=e.clientX,i.y=e.clientY,i.items=a?oe:ie,o===O&&(i.items=i.items.slice(0,2)),i.type=a?r.Iw.studio_folder:r.Iw.studio_file;const s=e=>{o(e)};i.textClick=e=>{switch(e){case"创建文件":Z({show:!0,type:y.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:s}});break;case"创建目录":Z({show:!0,type:y.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:s}});break;case"删除":if(z&&(M.path===n||M.path.includes(n))){const e=()=>{s(a),A(!1),P({}),E(""),x.xK.set_value_temp("")};Z({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}Z({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:a?()=>{s(!0)}:s}});break;case"重命名":Z({show:!0,type:y.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,u.Yp)(n),call:()=>{s(!0)},filename:t}})}},Z({show:!0,type:y.PromptEnum.FileMenu,overlay:!1,data:i})};return(0,d.jsxs)("div",{className:"studio",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:"取消",icon:"close",onClick:()=>{D({show:!1,path:""}),R(void 0),H(-1)}},1),(0,d.jsx)("title",{children:M.name},2)],children:[(0,c.zr)(M.name)&&(0,d.jsx)(s.rA,{title:"格式化",icon:"data_object",onClick:function(){x.xK.get_editor()?.formatCode()}}),(0,d.jsx)(s.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==L&&!1!==L?F.show?D({show:!1,path:""}):(D({show:!0,path:(0,u.GG)("file",J)}),R(!1)):R(!L)}}),z&&(0,d.jsx)(s.rA,{title:"保存",icon:"save",onClick:ee})]}),(0,d.jsxs)("div",{className:"studio-body",ref:K,children:[(0,d.jsx)("div",{className:"studio-nav",style:{width:W-1+"em"},onContextMenu:e=>{se(e,M.name,(0,u.GG)("file",J),!0,O)},children:(0,d.jsx)(h,{pre_path:p,list:t,click:async(e,t,n)=>{if("folder"===e.type){const e=await m.$M.post("studio/get/item",{path:`${n}`});if(e.code===f.m.Success){const n=[],a=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&a.push(t);t([...n,...a])}}else{if(z)return void I({open:!0,handle:()=>{I({open:!1,handle:null}),A(!1),V(e,n)},title:"确定不保存就切换吗?"});V(e,n)}},handleContextMenu:se,fatherNowToggleExpansion:O})}),(0,d.jsx)("div",{className:"studio__divider",ref:T,onPointerDown:()=>{B(!0),K.current.addEventListener("pointermove",ne)},onPointerUp:ae}),U&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:ae}),(0,d.jsx)("div",{className:"studio-editor",children:M.name&&(0,d.jsx)(g,{name:M.name,on_change:()=>{z||A(!0)}})},M.path)]})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6505],{26505(e,t,s){s.r(t),s.d(t,{default:()=>k});var a=s(96540),r=(s(82893),s(14284)),n=s(62042),o=s(22022),i=s(85997),l=s(57952),d=s(61973),c=s(34289),p=s(87361),h=s(2543),x=s(74848);const u="var(--surfacePrimary, #ffffff)",f="var(--surfaceSecondary, #f1f3f4)",g="var(--divider, rgba(0,0,0,0.08))",y="var(--textPrimary, #202124)",b="var(--textSecondary, #5f6368)",m="var(--primary, #1a73e8)",j="var(--primary-light, #d2e3fc)",v="var(--secondary, #34a853)",S="var(--accent, #ea4335)",z="#f9ab00";function k(){const{t:e}=(0,o.Bd)(),t=(0,d.Zp)();let s=decodeURIComponent((0,c.GG)(p.o.git_page,(0,c.vX)()));s=s.replace(/\/+$/,"");const[k,C]=(0,a.useState)([]),[N,U]=(0,a.useState)([]),[$,R]=(0,a.useState)({current:"",branches:[]}),[T,W]=(0,a.useState)(""),[B,K]=(0,a.useState)(new Set),[_,P]=(0,a.useState)("status"),[A,D]=(0,a.useState)(!1),[I,F]=(0,a.useState)(16),[L,E]=(0,a.useState)(!1),G=(0,a.useRef)(null),X=(0,a.useRef)(null);(0,a.useEffect)(()=>{s&&(H(),M(),Z())},[s]);const H=async()=>{try{D(!0);const e=await r.TU.post("status",{path:s});0===e.code&&C(e.data||[])}catch(e){}finally{D(!1)}},M=async()=>{try{const e=await r.TU.post("log",{path:s,maxCount:50});0===e.code&&U(e.data||[])}catch(e){}},Z=async()=>{try{const e=await r.TU.post("branches",{path:s});0===e.code&&R(e.data||{current:"",branches:[]})}catch(e){}},q=()=>{B.size===k.length?K(new Set):K(new Set(k.map(e=>e.path)))},J=async(t=!1)=>{try{D(!0);const a=await r.TU.post("push",{path:s,force:t});0===a.code?(0,n.SK)(e("推送成功")):(0,n.zN)(a.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}},O=e=>{switch(e){case"modified":return z;case"added":return v;case"deleted":case"conflict":return S;case"untracked":default:return b;case"renamed":return m}},Q=e=>{switch(e){case"modified":return"M";case"added":return"A";case"deleted":return"D";case"untracked":return"?";case"renamed":return"R";case"conflict":return"!";default:return e}},V=(0,a.useCallback)(h.throttle(e=>{const t=parseFloat(getComputedStyle(X.current).fontSize),s=window.innerWidth/t-4,a=e.clientX/t,r=2.25+G.current.offsetWidth/t;a<=s&&a>=r&&F(parseFloat(a.toFixed(2)))},32),[]),Y=()=>{E(!1),X.current.removeEventListener("pointermove",V)},ee=s.split("/").filter(Boolean).pop()||s;return(0,x.jsxs)("div",{className:"studio",children:[(0,x.jsx)(l.A,{ignore_tags:!0,left_children:[(0,x.jsx)(i.rA,{title:e("取消"),icon:"close",onClick:()=>{t(-1)}},1),(0,x.jsx)("span",{children:decodeURIComponent(ee)})],children:(0,x.jsx)(i.rA,{icon:"refresh",title:e("刷新"),onClick:()=>{H(),M(),Z()}})}),(0,x.jsxs)("div",{className:"studio-body",ref:X,children:[(0,x.jsxs)("div",{className:"studio-nav",style:{width:I-1+"em"},children:[(0,x.jsxs)("div",{style:{display:"flex",borderBottom:`1px solid ${g}`},children:[(0,x.jsxs)("button",{onClick:()=>P("status"),style:{flex:1,padding:"10px 8px",border:"none",background:"status"===_?j:"transparent",color:"status"===_?m:b,cursor:"pointer",fontSize:13,fontWeight:"status"===_?600:400,borderBottom:"status"===_?`2px solid ${m}`:"2px solid transparent"},children:["📝 ",e("变更")," (",k.length,")"]}),(0,x.jsxs)("button",{onClick:()=>P("log"),style:{flex:1,padding:"10px 8px",border:"none",background:"log"===_?j:"transparent",color:"log"===_?m:b,cursor:"pointer",fontSize:13,fontWeight:"log"===_?600:400,borderBottom:"log"===_?`2px solid ${m}`:"2px solid transparent"},children:["📜 ",e("提交记录")," (",N.length,")"]})]}),"status"===_&&(0,x.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[k.length>0&&(0,x.jsxs)("div",{style:{padding:"6px 12px",borderBottom:`1px solid ${g}`,display:"flex",alignItems:"center",gap:8,fontSize:12,color:b,cursor:"pointer"},onClick:q,children:[(0,x.jsx)("input",{type:"checkbox",checked:B.size===k.length&&k.length>0,onChange:q,style:{cursor:"pointer"}}),(0,x.jsxs)("span",{children:[e("全选")," (",B.size,"/",k.length,")"]})]}),k.map(e=>(0,x.jsxs)("div",{onClick:()=>(e=>{const t=new Set(B);t.has(e)?t.delete(e):t.add(e),K(t)})(e.path),style:{padding:"8px 12px",cursor:"pointer",borderBottom:`1px solid ${g}`,display:"flex",alignItems:"center",gap:8,background:B.has(e.path)?j:"transparent",transition:"background 0.2s"},children:[(0,x.jsx)("input",{type:"checkbox",checked:B.has(e.path),onChange:()=>{},style:{cursor:"pointer"}}),(0,x.jsx)("span",{style:{fontSize:11,fontWeight:600,width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#fff",background:O(e.status),flexShrink:0},children:Q(e.status)}),(0,x.jsxs)("span",{style:{fontSize:13,color:y,wordBreak:"break-all"},children:[e.path,e.oldPath&&(0,x.jsxs)("span",{style:{color:b,fontSize:11},children:[" (← ",e.oldPath,")"]})]})]},e.path)),0===k.length&&(0,x.jsx)("p",{style:{color:b,textAlign:"center",padding:20,fontSize:12},children:e("没有变更")})]}),"log"===_&&(0,x.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[N.map((e,t)=>(0,x.jsxs)("div",{style:{padding:"10px 12px",borderBottom:`1px solid ${g}`,display:"flex",flexDirection:"column",gap:4},children:[(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,x.jsx)("span",{style:{fontSize:11,fontFamily:"monospace",color:m,background:j,padding:"2px 6px",borderRadius:4},children:e.hash}),(0,x.jsx)("span",{style:{fontSize:13,color:y,flex:1},children:e.message})]}),(0,x.jsxs)("div",{style:{fontSize:11,color:b,paddingLeft:4},children:[e.author," · ",e.date]})]},t)),0===N.length&&(0,x.jsx)("p",{style:{color:b,textAlign:"center",padding:20,fontSize:12},children:e("暂无提交记录")})]})]}),(0,x.jsx)("div",{className:"studio__divider",ref:G,onPointerDown:()=>{E(!0),X.current.addEventListener("pointermove",V)},onPointerUp:Y}),L&&(0,x.jsx)("div",{className:"shell__overlay",onPointerUp:Y}),(0,x.jsx)("div",{className:"studio-editor",children:(0,x.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"16px",gap:12,overflow:"auto"},children:[(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:u},children:[(0,x.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:y,marginBottom:8},children:["🌿 ",e("分支"),": ",(0,x.jsx)("span",{style:{color:v},children:$.current})]}),(0,x.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:$.branches.map(t=>(0,x.jsx)("button",{onClick:()=>(async t=>{try{D(!0);const a=await r.TU.post("checkout",{path:s,branch:t});0===a.code?((0,n.SK)(e("切换分支成功")),H(),M(),Z()):(0,n.zN)(a.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}})(t),disabled:t===$.current||t.startsWith("*"),style:{padding:"4px 10px",borderRadius:12,fontSize:11,border:t===$.current?`1px solid ${v}`:`1px solid ${g}`,background:t===$.current?j:"transparent",color:t===$.current?v:b,cursor:t===$.current?"default":"pointer",opacity:t===$.current?1:.8},children:t.replace("remotes/origin/","")},t))})]}),(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:u,display:"flex",flexDirection:"column",gap:8},children:[(0,x.jsx)("textarea",{placeholder:e("输入提交信息..."),value:T,onChange:e=>W(e.target.value),rows:2,style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${g}`,background:u,color:y,fontSize:13,boxSizing:"border-box",resize:"vertical"}}),(0,x.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,x.jsxs)("button",{onClick:async()=>{if(T.trim())try{D(!0);const t=await r.TU.post("commit",{path:s,message:T.trim(),allChanged:!0});0===t.code?((0,n.SK)(e("提交成功")),W(""),H(),M()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}else(0,n.zN)(e("请输入提交信息"))},disabled:A||!T.trim(),style:w(v),children:["✅ ",e("提交")]}),(0,x.jsxs)("button",{onClick:async()=>{try{const t=await r.TU.post("add_all",{path:s});0===t.code?((0,n.SK)(e("已暂存全部")),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:w(m),children:["➕ ",e("暂存全部")]}),(0,x.jsxs)("button",{onClick:async()=>{if(0!==B.size)try{const t=await r.TU.post("add",{path:s,files:[...B]});0===t.code?((0,n.SK)(e("已暂存")),K(new Set),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}else(0,n.zN)(e("请先选择文件"))},style:w(m),children:["📥 ",e("暂存选中")]}),(0,x.jsxs)("button",{onClick:async()=>{if(0!==B.size)try{const t=await r.TU.post("reset",{path:s,files:[...B]});0===t.code?((0,n.SK)(e("已取消暂存")),K(new Set),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}else(0,n.zN)(e("请先选择文件"))},style:w(z),children:["↩ ",e("取消暂存")]})]})]}),(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:u,display:"flex",flexDirection:"column",gap:8},children:[(0,x.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:y},children:["☁️ ",e("远程操作")]}),(0,x.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,x.jsxs)("button",{onClick:async()=>{try{D(!0);const t=await r.TU.post("pull",{path:s});0===t.code?((0,n.SK)(e("拉取成功")),H(),M()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}},disabled:A,style:w(m),children:["⬇ ",e("拉取")]}),(0,x.jsxs)("button",{onClick:()=>J(!1),disabled:A,style:w(m),children:["⬆ ",e("推送")]}),(0,x.jsxs)("button",{onClick:()=>J(!0),disabled:A,style:w(S),children:["⚠ ",e("强制推送")]})]}),(0,x.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,x.jsxs)("button",{onClick:async()=>{try{const t=await r.TU.post("stash",{path:s});0===t.code?((0,n.SK)(e("暂存工作区成功")),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:w(b),children:["📦 ",e("暂存工作区")]}),(0,x.jsxs)("button",{onClick:async()=>{try{const t=await r.TU.post("stash_pop",{path:s});0===t.code?((0,n.SK)(e("恢复工作区成功")),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:w(b),children:["📤 ",e("恢复工作区")]})]})]}),(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:f,fontSize:11,color:b,lineHeight:1.6},children:["💡 ",e("提示:"),(0,x.jsxs)("ul",{style:{margin:"4px 0",paddingLeft:16},children:[(0,x.jsx)("li",{children:e("左侧勾选文件后,使用「暂存选中」将其加入暂存区")}),(0,x.jsx)("li",{children:e("输入提交信息后点击「提交」")}),(0,x.jsx)("li",{children:e("如有冲突,请自行在shell中解决冲突后再提交")}),(0,x.jsx)("li",{children:e("「强制推送」会覆盖远程分支,请谨慎使用")})]})]})]})})]})]})}function w(e){return{padding:"6px 12px",borderRadius:6,border:`1px solid ${e}`,background:"transparent",color:e,cursor:"pointer",fontSize:12}}}}]);
|