zen-gitsync 2.1.6 → 2.1.8
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/package.json +1 -1
- package/src/ui/public/assets/index-B7Bmz9T9.js +22 -0
- package/src/ui/public/assets/index-DNVXEFTm.css +1 -0
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/index.js +90 -9
- package/src/ui/public/assets/index-8gQo1ABk.js +0 -20
- package/src/ui/public/assets/index-IcGOG2Ja.css +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{d as jt,r as c,o as ut,a as ss,E as r,l as as,b as gt,c as Ve,w as Qe,e as w,f as p,F as Se,g as e,h as s,i as At,u as i,j as l,k as Ot,m as Mt,n as Pt,p as Oe,q as Ut,s as Ft,t as ls,v as Q,x as ae,y as ht,z as T,A as yt,B as os,C as R,D as Nt,G as ze,H as It,I as wt,J as rt,K as Ht,L as ns,M as zt,N as ot,O as qe,P as Vt,Q as et,T as Et,R as Xt,S as Rt,U as it,V as vt,W as mt,X as Wt,Y as Lt,Z as rs,_ as ft,$ as is,a0 as cs,a1 as Jt,a2 as qt,a3 as us,a4 as Ze,a5 as ds,a6 as fs,a7 as ps,a8 as Dt,a9 as vs,aa as ms,ab as gs,ac as hs,ad as ys,ae as ws,af as _s,ag as $s,ah as at,ai as bs,aj as Cs,ak as Gt,al as ks,am as Ss,an as Ts,ao as Be,ap as xs,aq as Ls}from"./vendor-Bm8yNvvz.js";(function(){const h=document.createElement("link").relList;if(h&&h.supports&&h.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))f(m);new MutationObserver(m=>{for(const j of m)if(j.type==="childList")for(const V of j.addedNodes)V.tagName==="LINK"&&V.rel==="modulepreload"&&f(V)}).observe(document,{childList:!0,subtree:!0});function x(m){const j={};return m.integrity&&(j.integrity=m.integrity),m.referrerPolicy&&(j.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?j.credentials="include":m.crossOrigin==="anonymous"?j.credentials="omit":j.credentials="same-origin",j}function f(m){if(m.ep)return;m.ep=!0;const j=x(m);fetch(m.href,j)}})();const Tt=300,ct=jt("git",()=>{const ke=c(""),h=c([]),x=c(""),f=c(""),m=c(!1),j=c(!1),V=c(!1),O=c(0),N=c(""),ee=c(!1),z=c(!1),Y=c(!1),A=c(!1),b=c(0),I=c(0),H=c(!1),W=c(""),U=c(0),me=c(0);let C=null;const ne=c(!0),se=c([]),Z=c({staged:[],unstaged:[],untracked:[]}),re=c(""),de=c([]),L=c(!1),g=c(!1),E=c(!1),M=c(!1),F=c(!1);function he(){ke.value="",h.value=[],x.value="",f.value="",m.value=!1,j.value=!1,V.value=!1,O.value=0,b.value=0,I.value=0,H.value=!1,W.value="",U.value=0,me.value=0,z.value=!1,Y.value=!1,A.value=!1,N.value="",ee.value=!1,se.value=[],Z.value={staged:[],unstaged:[],untracked:[]},re.value="",de.value=[],L.value=!1,g.value=!1,E.value=!1,M.value=!1,F.value=!1}async function ie(){if(V.value)try{console.log("获取分支状态...");const d=await(await fetch("/api/branch-status")).json();d&&(b.value=d.ahead||0,I.value=d.behind||0,H.value=d.hasUpstream||!1,W.value=d.upstreamBranch||"",U.value=Date.now(),console.log(`分支状态更新:领先 ${b.value} 个提交,落后 ${I.value} 个提交,上游分支:${H.value?W.value:"无"}`))}catch(v){console.error("获取分支状态失败:",v),b.value=0,I.value=0,H.value=!1,W.value=""}}async function Me(){const v=Date.now();if(v-O.value<1e3)return console.log("使用缓存的Git仓库状态:",V.value?"是":"不是"),V.value;try{const _=await(await fetch("/api/current_directory")).json();return V.value=_.isGitRepo===!0,O.value=v,console.log(`当前目录${V.value?"是":"不是"}Git仓库`),V.value}catch(d){return console.error("检查Git仓库状态失败:",d),V.value=!1,O.value=v,!1}}async function xe(){try{const d=await(await fetch("/api/branch")).json();d.branch&&(ke.value=d.branch)}catch(v){console.error("获取分支信息失败:",v)}}async function k(){if(V.value)try{console.log("获取所有分支...");const d=await(await fetch("/api/branches")).json();d.branches&&Array.isArray(d.branches)&&(h.value=d.branches,me.value=Date.now(),console.log(`获取到${d.branches.length}个分支`))}catch(v){console.error("获取所有分支信息失败:",v)}}async function ye(v){console.log("切换到分支:",v);try{m.value=!0;const _=await(await fetch("/api/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:v})})).json();return _.success?(r({message:`已切换到分支: ${v}`,type:"success"}),await xe(),await ie(),!0):(r({message:`切换分支失败: ${_.error}`,type:"error"}),!1)}catch(d){return r({message:`切换分支失败: ${d.message}`,type:"error"}),!1}finally{m.value=!1}}async function ge(){try{const d=await(await fetch("/api/user-info")).json();d.name&&d.email&&(x.value=d.name,f.value=d.email)}catch(v){console.error("获取用户信息失败:",v)}}async function Le(v,d){if(!v.trim())return r({message:"分支名称不能为空",type:"warning"}),!1;try{j.value=!0;const le=await(await fetch("/api/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newBranchName:v,baseBranch:d||ke.value})})).json();return le.success?(r({message:`已创建并切换到分支: ${v}`,type:"success"}),await xe(),await ie(),await k(),!0):(r({message:`创建分支失败: ${le.error}`,type:"error"}),!1)}catch(_){return r({message:`创建分支失败: ${_.message}`,type:"error"}),!1}finally{j.value=!1}}async function Pe(){try{const d=await(await fetch("/api/clear-user-config",{method:"POST"})).json();return d.success?(x.value="",f.value="",r({message:"已清除Git用户配置",type:"success"}),!0):(r({message:`清除配置失败: ${d.error}`,type:"error"}),!1)}catch(v){return r({message:`清除配置失败: ${v.message}`,type:"error"}),!1}}async function Ue(v,d){try{const le=await(await fetch("/api/restore-user-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v,email:d})})).json();return le.success?(x.value=v,f.value=d,r({message:"已恢复Git用户配置",type:"success"}),!0):(r({message:`恢复配置失败: ${le.error}`,type:"error"}),!1)}catch(_){return r({message:`恢复配置失败: ${_.message}`,type:"error"}),!1}}async function Fe(){if(!V.value)return r({message:"当前目录不是Git仓库",type:"warning"}),!1;try{Y.value=!0;const d=await(await fetch("/api/pull",{method:"POST"})).json();return d.success?(r({message:"拉取成功",type:"success"}),await ie(),!0):(d.needsMerge?r({message:`需要合并更改: ${d.pullOutput||"存在冲突需要手动解决"}`,type:"warning",duration:5e3}):r({message:`拉取失败: ${d.error}`,type:"error"}),!1)}catch(v){return r({message:`拉取失败: ${v.message}`,type:"error"}),!1}finally{Y.value=!1}}async function Ne(){if(!V.value)return r({message:"当前目录不是Git仓库",type:"warning"}),!1;try{A.value=!0;const d=await(await fetch("/api/fetch-all",{method:"POST"})).json();return d.success?(r({message:"获取所有远程分支信息成功",type:"success"}),await ie(),!0):(r({message:`获取远程分支信息失败: ${d.error}`,type:"error"}),!1)}catch(v){return r({message:`获取远程分支信息失败: ${v.message}`,type:"error"}),!1}finally{A.value=!1}}function Ke(){C&&C.disconnect();try{const v="http://localhost:3000";if(console.log("尝试连接Socket.IO服务器:",v),C=as(v,{reconnectionDelayMax:1e4,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3,timeout:2e4,autoConnect:!0,forceNew:!0,transports:["websocket","polling"]}),!C){console.error("Socket.IO初始化失败: socket为null");return}console.log("Socket.IO初始化成功,socket ID:",C.id||"未连接"),C.on("connect",()=>{console.log("成功连接到Socket.IO服务器"),ne.value&&C&&C.emit("start_monitoring")}),C.on("disconnect",d=>{console.log("与Socket.IO服务器断开连接:",d)}),C.on("git_status_update",d=>{ne.value&&(console.log("收到Git状态更新通知:",new Date().toLocaleTimeString()),d.status&&(re.value=d.status),d.porcelain!==void 0&&Ye(d.porcelain))}),C.on("monitoring_status",d=>{console.log("文件监控状态:",d.active?"已启动":"已停止")}),C.on("connect_error",d=>{console.error("Socket连接错误:",d.message)}),C.on("connect_timeout",()=>{console.error("Socket连接超时")}),C.on("reconnect",d=>{console.log(`Socket重连成功,尝试次数: ${d}`),ne.value&&(console.log("重连后重新发送start_monitoring请求"),C==null||C.emit("start_monitoring"))}),C.on("reconnect_attempt",d=>{console.log(`Socket尝试重连,第 ${d} 次尝试`)}),C.on("reconnect_error",d=>{console.error("Socket重连错误:",d.message)}),C.on("reconnect_failed",()=>{console.error("Socket重连失败,已达到最大重试次数")}),C&&!C.connected&&(console.log("Socket未连接,尝试手动连接..."),C.connect())}catch(v){console.error("Socket.IO连接初始化失败:",v)}}function st(){if(console.log("toggleAutoUpdate调用,当前值:",ne.value),!C){console.error("无法切换自动更新状态: socket连接不存在"),r.error("无法连接到服务器,自动更新可能不会生效"),console.log("尝试重新建立socket连接..."),Ke(),localStorage.setItem("zen-gitsync-auto-update",ne.value.toString());return}try{ne.value?(console.log("发送start_monitoring命令..."),C.emit("start_monitoring"),r.success("自动更新已启用")):(console.log("发送stop_monitoring命令..."),C.emit("stop_monitoring"),r.info("自动更新已禁用")),localStorage.setItem("zen-gitsync-auto-update",ne.value.toString()),console.log("已保存自动更新设置到本地存储:",ne.value)}catch(v){console.error("切换自动更新状态时出错:",v),r.error(`切换自动更新失败: ${v.message}`)}}function Ye(v){if(v===void 0||v===""){de.value=[];return}const d=v.split(`
|
|
2
|
+
`),_=[];for(const le of d){const He=le.match(/^([ MADRCU\?]{2})\s+(.+)$/);if(He){let Ce="";const Xe=He[1],Ee=Xe.charAt(0),We=Xe.charAt(1);Ee==="A"||Ee==="M"||Ee==="D"||Ee==="R"?Ce="added":Ee===" "&&We==="M"?Ce="modified":Ee===" "&&We==="D"?Ce="deleted":Xe==="??"?Ce="untracked":Ce="other",_.push({path:He[2],type:Ce})}}de.value=_}async function Ie(v=!0){if(!V.value){console.log("当前目录不是Git仓库,跳过加载提交历史");return}try{L.value=!0,console.log("开始加载提交历史...");const d=new Date().getTime(),le=await(await fetch(`/api/log?page=1&_t=${d}`)).json();le&&le.data&&Array.isArray(le.data)?(se.value=[...le.data],console.log(`提交历史加载完成,共 ${se.value.length} 条记录`)):(console.warn("API返回的提交历史格式不正确:",le),se.value=[]),v&&r({message:"提交历史已更新",type:"success"})}catch(d){console.error("获取提交历史失败:",d),v&&r({message:`获取提交历史失败: ${d.message}`,type:"error"})}finally{L.value=!1}}async function be(){if(!V.value){console.log("当前目录不是Git仓库,跳过加载Git状态");return}try{g.value=!0;const d=await(await fetch("/api/status")).json();d.status&&(re.value=d.status,Z.value={staged:d.status.staged||[],unstaged:d.status.unstaged||[],untracked:d.status.untracked||[]}),await Te()}catch(v){console.error("获取Git状态失败:",v),r({message:`获取Git状态失败: ${v.message}`,type:"error"})}finally{g.value=!1}}async function Te(){if(console.log("开始获取Git状态(porcelain格式)..."),!V.value){console.log("当前目录不是Git仓库,跳过加载Git状态");return}try{const d=await(await fetch("/api/status_porcelain")).json();d.status!==void 0?Ye(d.status):de.value=[]}catch(v){console.error("获取Git状态(porcelain)失败:",v),r({message:`获取Git状态(porcelain)失败: ${v.message}`,type:"error"}),de.value=[]}}async function De(){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{E.value=!0;const d=await(await fetch("/api/add",{method:"POST"})).json();return d.success?(r({message:"文件已添加到暂存区",type:"success"}),be(),!0):(r({message:`添加文件失败: ${d.error}`,type:"error"}),!1)}catch(v){return r({message:`添加文件失败: ${v.message}`,type:"error"}),!1}finally{E.value=!1}}async function y(v){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{E.value=!0;const _=await(await fetch("/api/add-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:v})})).json();return _.success?(r({message:"文件已暂存",type:"success"}),be(),!0):(r({message:`暂存文件失败: ${_.error}`,type:"error"}),!1)}catch(d){return r({message:`暂存文件失败: ${d.message}`,type:"error"}),!1}finally{E.value=!1}}async function n(v){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{F.value=!0;const _=await(await fetch("/api/unstage-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:v})})).json();return _.success?(r({message:"已取消暂存文件",type:"success"}),be(),!0):(r({message:`取消暂存失败: ${_.error}`,type:"error"}),!1)}catch(d){return r({message:`取消暂存失败: ${d.message}`,type:"error"}),!1}finally{F.value=!1}}function P(v){return new Promise(d=>setTimeout(d,v))}async function D(v,d=!1){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{M.value=!0;const le=await(await fetch("/api/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:v,hasNewlines:v.includes(`
|
|
3
|
+
`),noVerify:d})})).json();return le.success?(r({message:"提交成功",type:"success"}),be(),Ie(),ie(),!0):(r({message:`提交失败: ${le.error}`,type:"error"}),!1)}catch(_){return r({message:`提交失败: ${_.message}`,type:"error"}),!1}finally{M.value=!1}}async function ue(){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{z.value=!0;const d=await(await fetch("/api/push",{method:"POST"})).json();return d.success?(r({message:"推送成功",type:"success"}),be(),Ie(),ie(),!0):(r({message:`推送失败: ${d.error}`,type:"error"}),!1)}catch(v){return r({message:`推送失败: ${v.message}`,type:"error"}),!1}finally{z.value=!1}}async function Ae(v,d=!1){return await De()?(await P(Tt),await D(v,d)):!1}async function we(v,d=!1){try{return!await De()||(await P(Tt),!await D(v,d))?!1:(await P(Tt),await ue())}catch(_){try{(await(await fetch("/api/remove-lock",{method:"POST"})).json()).success&&r({message:"已清理锁定文件,请重试操作",type:"warning"})}catch(le){console.error("清理锁定文件失败:",le)}return r({message:`操作失败: ${_.message}`,type:"error"}),be(),Ie(),ie(),!1}}async function fe(){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{F.value=!0;const d=await(await fetch("/api/reset-head",{method:"POST"})).json();return d.success?(r({message:"已重置暂存区",type:"success"}),be(),!0):(r({message:`重置暂存区失败: ${d.error}`,type:"error"}),!1)}catch(v){return r({message:`重置暂存区失败: ${v.message}`,type:"error"}),!1}finally{F.value=!1}}async function Re(v){if(!V.value)return r.warning("当前目录不是Git仓库"),!1;try{F.value=!0;const _=await(await fetch("/api/reset-to-remote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:v})})).json();return _.success?(r({message:`已重置分支 ${v} 到远程状态`,type:"success"}),be(),Ie(),!0):(r({message:`重置分支失败: ${_.error}`,type:"error"}),!1)}catch(d){return r({message:`重置分支失败: ${d.message}`,type:"error"}),!1}finally{F.value=!1}}async function $e(){if(V.value)try{ee.value=!0,console.log("获取远程仓库地址...");const d=await(await fetch("/api/remote-url")).json();d.success?(N.value=d.url||"",console.log(`获取到远程仓库地址: ${N.value}`)):(console.warn("获取远程仓库地址失败:",d.error),N.value="")}catch(v){console.error("获取远程仓库地址失败:",v),N.value=""}finally{ee.value=!1}}async function _e(){if(!N.value)return r({message:"没有可复制的远程仓库地址",type:"warning"}),!1;try{return await navigator.clipboard.writeText(N.value),r({message:"已复制远程仓库地址",type:"success"}),!0}catch(v){return console.error("复制远程仓库地址失败:",v),r({message:`复制失败: ${v.message}`,type:"error"}),!1}}return ut(()=>{const v=localStorage.getItem("zen-gitsync-auto-update");v!==null&&(ne.value=v==="true"),Ke()}),ss(()=>{C&&(C.disconnect(),C=null)}),{currentBranch:ke,allBranches:h,userName:x,userEmail:f,isChangingBranch:m,isCreatingBranch:j,isGitRepo:V,lastCheckedTime:O,branchAhead:b,branchBehind:I,hasUpstream:H,upstreamBranch:W,lastBranchStatusTime:U,lastBranchesTime:me,remoteUrl:N,isLoadingRemoteUrl:ee,log:se,status:Z,statusText:re,fileList:de,isLoadingLog:L,isLoadingStatus:g,isAddingFiles:E,isCommiting:M,isResetting:F,autoUpdateEnabled:ne,$reset:he,checkGitRepo:Me,getCurrentBranch:xe,getAllBranches:k,changeBranch:ye,getUserInfo:ge,createBranch:Le,clearUserConfig:Pe,restoreUserConfig:Ue,getBranchStatus:ie,gitPull:Fe,gitFetchAll:Ne,isPushing:z,isGitPulling:Y,isGitFetching:A,initSocketConnection:Ke,toggleAutoUpdate:st,parseStatusPorcelain:Ye,fetchLog:Ie,fetchStatus:be,fetchStatusPorcelain:Te,addToStage:De,addFileToStage:y,unstageFile:n,commitChanges:D,pushToRemote:ue,addAndCommit:Ae,addCommitAndPush:we,resetHead:fe,resetToRemote:Re,getRemoteUrl:$e,copyRemoteUrl:_e}}),As={class:"card"},Vs={class:"status-header"},Rs={class:"header-actions"},Bs={class:"card-content"},Ms={key:0,class:"status-box"},zs={key:1,class:"status-box-wrap"},Es={key:0,class:"branch-status-info"},Ds={class:"branch-sync-status"},Gs={class:"sync-status-content"},js={class:"status-badges"},Os={class:"badge-content"},Ps={class:"badge-content"},Us={key:1,class:"file-list-container"},Fs={key:0,class:"file-group"},Ns={class:"file-list"},Is=["onClick"],Hs={class:"file-info"},Xs={class:"file-path-container"},Ws={class:"file-name"},Js={class:"file-directory"},qs={class:"file-actions"},Ys={key:1,class:"file-group"},Zs={class:"file-list"},Ks=["onClick"],Qs={class:"file-info"},ea={class:"file-path-container"},ta={class:"file-name"},sa={class:"file-directory"},aa={class:"file-actions"},la={key:2,class:"file-group"},oa={class:"file-list"},na=["onClick"],ra={class:"file-info"},ia={class:"file-path-container"},ca={class:"file-name"},ua={class:"file-directory"},da={class:"file-actions"},fa={key:2,class:"empty-status"},pa={class:"empty-icon"},va={class:"diff-content"},ma=["innerHTML"],ga={key:1,class:"no-diff"},ha={class:"file-navigation"},ya={class:"file-counter"},wa=gt({__name:"GitStatus",props:{initialDirectory:{type:String,default:""}},setup(ke,{expose:h}){const x=ke,f=ct(),m=Ve(()=>f.isLoadingStatus),j=c(""),V=c(""),O=c(!1),N=c(!1),ee=c(-1),z=c(x.initialDirectory||"");async function Y(){try{if(!z.value){const g=await(await fetch("/api/current_directory")).json();z.value=g.directory||"未知目录"}if(!f.isGitRepo)return;await f.fetchStatus(),await f.getBranchStatus(),r({message:"Git 状态已刷新",type:"success"})}catch(L){r({message:"刷新失败: "+L.message,type:"error"})}}function A(L){if(!L)return"";const g=L.split(`
|
|
4
|
+
`);function E(M){return M.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return g.map(M=>{const F=E(M);return M.startsWith("diff --git")?`<div class="diff-header">${F}</div>`:M.startsWith("---")?`<div class="diff-old-file">${F}</div>`:M.startsWith("+++")?`<div class="diff-new-file">${F}</div>`:M.startsWith("@@")?`<div class="diff-hunk-header">${F}</div>`:M.startsWith("+")?`<div class="diff-added">${F}</div>`:M.startsWith("-")?`<div class="diff-removed">${F}</div>`:`<div class="diff-context">${F}</div>`}).join("")}async function b(L){try{N.value=!0,j.value=L,ee.value=f.fileList.findIndex(E=>E.path===L);const g=f.fileList[ee.value];if(g&&g.type==="untracked"){try{const M=await(await fetch(`/api/file-content?file=${encodeURIComponent(L)}`)).json();M.success&&M.content?V.value=`diff --git a/${L} b/${L}
|
|
5
|
+
新文件: ${L}
|
|
6
|
+
--- /dev/null
|
|
7
|
+
+++ b/${L}
|
|
8
|
+
@@ -0,0 +1,${M.content.split(`
|
|
9
|
+
`).length} @@
|
|
10
|
+
`+M.content.split(`
|
|
11
|
+
`).map(F=>`+${F}`).join(`
|
|
12
|
+
`):V.value=`这是一个新文件,尚未被Git跟踪。
|
|
13
|
+
添加到暂存区后可以提交该文件。`}catch(E){console.error("获取未跟踪文件内容失败:",E),V.value=`这是一个新文件,尚未被Git跟踪。
|
|
14
|
+
添加到暂存区后可以提交该文件。`}O.value=!0}else{const M=await(await fetch(`/api/diff?file=${encodeURIComponent(L)}`)).json();V.value=M.diff||"没有变更",O.value=!0}}catch(g){r({message:"获取文件差异失败: "+g.message,type:"error"}),V.value="获取差异失败: "+g.message}finally{N.value=!1}}async function I(){if(f.fileList.length===0||ee.value<=0)return;const L=ee.value-1,g=f.fileList[L];await b(g.path)}async function H(){if(f.fileList.length===0||ee.value>=f.fileList.length-1)return;const L=ee.value+1,g=f.fileList[L];await b(g.path)}function W(L){b(L.path)}async function U(L){await f.addFileToStage(L)}async function me(L){await f.unstageFile(L)}async function C(){await Y()}async function ne(){try{await f.gitPull(),await Y()}catch(L){console.error("拉取操作发生错误:",L)}}async function se(){try{await f.gitFetchAll(),await Y()}catch(L){console.error("获取远程分支信息操作发生错误:",L)}}async function Z(L){try{await et.confirm(`确定要撤回文件 "${L}" 的所有修改吗?此操作无法撤销。`,"撤回修改",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const E=await(await fetch("/api/revert_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:L})})).json();E.success?(r.success("已撤回文件修改"),await Y()):r.error(E.error?`撤回失败: ${E.error}`:"撤回文件修改失败,请重试")}catch(g){if(g==="cancel"||g.message==="cancel")return;const E=g.message||"未知错误";E!=="undefined"?r.error(`撤回文件修改失败: ${E}`):r.error("撤回文件修改失败,请重试")}}function re(L){const g=L.split("/");return g[g.length-1]}function de(L){const g=L.split("/");return g.length<=1?"":g.slice(0,-1).join("/")}return ut(()=>{Y()}),Qe(()=>f.autoUpdateEnabled,(L,g)=>{console.log(`自动更新状态变更: ${g} -> ${L}`),f.toggleAutoUpdate()},{immediate:!1}),h({refreshStatus:C}),(L,g)=>{const E=Ot,M=At,F=Oe,he=yt,ie=ht,Me=wt,xe=Ht;return p(),w(Se,null,[e("div",As,[e("div",Vs,[g[2]||(g[2]=e("h2",null,"Git 状态",-1)),e("div",Rs,[s(M,{content:i(f).autoUpdateEnabled?"禁用自动更新文件状态":"启用自动更新文件状态",placement:"top","hide-after":1e3},{default:l(()=>[s(E,{modelValue:i(f).autoUpdateEnabled,"onUpdate:modelValue":g[0]||(g[0]=k=>i(f).autoUpdateEnabled=k),style:{"--el-switch-on-color":"#67C23A","--el-switch-off-color":"#909399","margin-right":"10px"},"inline-prompt":"","active-icon":i(Pt),"inactive-icon":i(Mt),class:"auto-update-switch"},null,8,["modelValue","active-icon","inactive-icon"])]),_:1},8,["content"]),s(M,{content:"Git Pull (拉取远程更新)",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"primary",icon:i(Ut),circle:"",size:"small",onClick:ne,loading:i(f).isGitPulling,disabled:!i(f).hasUpstream},null,8,["icon","loading","disabled"])]),_:1}),s(M,{content:"Git Fetch All (获取所有远程分支)",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"info",icon:i(Ft),circle:"",size:"small",onClick:se,loading:i(f).isGitFetching},null,8,["icon","loading"])]),_:1}),s(M,{content:"刷新状态",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"primary",icon:i(ls),circle:"",size:"small",onClick:C,loading:m.value},null,8,["icon","loading"])]),_:1})])]),e("div",Bs,[i(f).isGitRepo?(p(),w("div",zs,[i(f).hasUpstream&&(i(f).branchAhead>0||i(f).branchBehind>0)?(p(),w("div",Es,[e("div",Ds,[e("div",Gs,[s(M,{content:"本地分支与远程分支的状态对比",placement:"top"},{default:l(()=>[e("div",js,[i(f).branchAhead>0?(p(),ae(ie,{key:0,size:"small",type:"warning",class:"status-badge"},{default:l(()=>[e("span",Os,[s(he,null,{default:l(()=>[s(i(os))]),_:1}),T(" 你的分支领先 'origin/"+R(i(f).currentBranch)+"' "+R(i(f).branchAhead)+" 个提交 ",1)])]),_:1})):Q("",!0),i(f).branchBehind>0?(p(),ae(ie,{key:1,size:"small",type:"info",class:"status-badge"},{default:l(()=>[e("span",Ps,[s(he,null,{default:l(()=>[s(i(Nt))]),_:1}),T(" 你的分支落后 'origin/"+R(i(f).currentBranch)+"' "+R(i(f).branchBehind)+" 个提交 ",1)])]),_:1})):Q("",!0)])]),_:1})])])])):Q("",!0),i(f).fileList.length?(p(),w("div",Us,[i(f).fileList.some(k=>k.type==="added")?(p(),w("div",Fs,[g[5]||(g[5]=e("div",{class:"file-group-header"},"已暂存的更改",-1)),e("div",Ns,[(p(!0),w(Se,null,ze(i(f).fileList.filter(k=>k.type==="added"),k=>(p(),w("div",{key:k.path,class:"file-item",onClick:ye=>W(k)},[e("div",Hs,[e("div",Xs,[e("span",Ws,R(re(k.path)),1),e("span",Js,R(de(k.path)),1)])]),e("div",qs,[s(M,{content:"取消暂存",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"warning",size:"small",circle:"",onClick:ot(ye=>me(k.path),["stop"])},{default:l(()=>g[4]||(g[4]=[T("-")])),_:2},1032,["onClick"])]),_:2},1024)])],8,Is))),128))])])):Q("",!0),i(f).fileList.some(k=>k.type==="modified"||k.type==="deleted")?(p(),w("div",Ys,[g[7]||(g[7]=e("div",{class:"file-group-header"},"未暂存的更改",-1)),e("div",Zs,[(p(!0),w(Se,null,ze(i(f).fileList.filter(k=>k.type==="modified"||k.type==="deleted"),k=>(p(),w("div",{key:k.path,class:"file-item",onClick:ye=>W(k)},[e("div",Qs,[e("div",{class:qe(["file-status-indicator",k.type])},null,2),e("div",ea,[e("span",ta,R(re(k.path)),1),e("span",sa,R(de(k.path)),1)])]),e("div",aa,[s(M,{content:"添加到暂存区",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"success",size:"small",circle:"",onClick:ot(ye=>U(k.path),["stop"])},{default:l(()=>g[6]||(g[6]=[T("+")])),_:2},1032,["onClick"])]),_:2},1024),s(M,{content:"撤回修改",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"danger",size:"small",icon:i(Vt),circle:"",onClick:ot(ye=>Z(k.path),["stop"])},null,8,["icon","onClick"])]),_:2},1024)])],8,Ks))),128))])])):Q("",!0),i(f).fileList.some(k=>k.type==="untracked")?(p(),w("div",la,[g[10]||(g[10]=e("div",{class:"file-group-header"},"未跟踪的文件",-1)),e("div",oa,[(p(!0),w(Se,null,ze(i(f).fileList.filter(k=>k.type==="untracked"),k=>(p(),w("div",{key:k.path,class:"file-item",onClick:ye=>W(k)},[e("div",ra,[g[8]||(g[8]=e("div",{class:"file-status-indicator untracked"},null,-1)),e("div",ia,[e("span",ca,R(re(k.path)),1),e("span",ua,R(de(k.path)),1)])]),e("div",da,[s(M,{content:"添加到暂存区",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"success",size:"small",circle:"",onClick:ot(ye=>U(k.path),["stop"])},{default:l(()=>g[9]||(g[9]=[T("+")])),_:2},1032,["onClick"])]),_:2},1024),s(M,{content:"删除文件",placement:"top","hide-after":1e3},{default:l(()=>[s(F,{type:"danger",size:"small",icon:i(Mt),circle:"",onClick:ot(ye=>Z(k.path),["stop"])},null,8,["icon","onClick"])]),_:2},1024)])],8,na))),128))])])):Q("",!0)])):i(f).isGitRepo?(p(),w("div",fa,[e("div",pa,[s(he,null,{default:l(()=>[s(i(It))]),_:1})]),g[11]||(g[11]=e("div",{class:"empty-text"},"没有检测到任何更改",-1)),g[12]||(g[12]=e("div",{class:"empty-subtext"},"工作区是干净的",-1))])):Q("",!0)])):(p(),w("div",Ms,g[3]||(g[3]=[e("div",{class:"empty-status"},[e("p",null,"当前目录不是Git仓库")],-1)])))])]),s(Me,{modelValue:O.value,"onUpdate:modelValue":g[1]||(g[1]=k=>O.value=k),title:`文件差异: ${j.value}`,width:"80%","destroy-on-close":"",class:"diff-dialog"},{footer:l(()=>[e("div",ha,[s(F,{type:"primary",icon:i(ns),onClick:I,disabled:ee.value<=0||i(f).fileList.length===0,plain:"",class:"nav-button"},{default:l(()=>g[13]||(g[13]=[T(" 上一个文件 ")])),_:1},8,["icon","disabled"]),e("div",ya,[s(ie,{type:"info",effect:"plain",class:"counter-tag"},{default:l(()=>[T(R(ee.value+1)+" / "+R(i(f).fileList.length),1)]),_:1})]),s(F,{type:"primary",icon:i(zt),onClick:H,disabled:ee.value>=i(f).fileList.length-1||i(f).fileList.length===0,plain:"",class:"nav-button"},{icon:l(()=>[s(he,{class:"el-icon--right"},{default:l(()=>[s(i(zt))]),_:1})]),default:l(()=>[g[14]||(g[14]=T(" 下一个文件 "))]),_:1},8,["icon","disabled"])])]),default:l(()=>[rt((p(),w("div",va,[V.value?(p(),w("div",{key:0,innerHTML:A(V.value),class:"diff-formatted"},null,8,ma)):(p(),w("div",ga,"该文件没有差异或是新文件"))])),[[xe,N.value]])]),_:1},8,["modelValue","title"])],64)}}}),_t=(ke,h)=>{const x=ke.__vccOpts||ke;for(const[f,m]of h)x[f]=m;return x},_a=_t(wa,[["__scopeId","data-v-4361e2ea"]]),Yt=jt("config",()=>{const ke=c(""),h=c([]),x=c([]),f=c([]),m=c(!1),j=c(!1),V=Ve(()=>({defaultCommitMessage:ke.value,descriptionTemplates:h.value,scopeTemplates:x.value,messageTemplates:f.value}));async function O(){if(j.value&&!m.value)return console.log("使用缓存的配置信息"),V.value;try{m.value=!0,console.log("加载配置信息...");const b=await(await fetch("/api/config/getConfig")).json();return ke.value=b.defaultCommitMessage||"",h.value=b.descriptionTemplates||[],x.value=b.scopeTemplates||[],f.value=b.messageTemplates||[],j.value=!0,console.log("配置信息加载完成"),V.value}catch(A){return console.error("加载配置失败:",A),r.error(`加载配置失败: ${A.message}`),null}finally{m.value=!1}}async function N(A){try{const I=await(await fetch("/api/config/saveDefaultMessage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultCommitMessage:A})})).json();return I.success?(ke.value=A,r.success("默认提交信息已保存"),!0):(r.error(`保存失败: ${I.error}`),!1)}catch(b){return r.error(`保存失败: ${b.message}`),!1}}async function ee(A,b){try{const H=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:A,type:b})})).json();return H.success?(b==="description"?h.value.includes(A)||h.value.push(A):b==="scope"?x.value.includes(A)||x.value.push(A):b==="message"&&(f.value.includes(A)||f.value.push(A)),r.success("模板已保存"),!0):(r.error(`保存模板失败: ${H.error}`),!1)}catch(I){return r.error(`保存模板失败: ${I.message}`),!1}}async function z(A,b){try{const H=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:A,type:b})})).json();return H.success?(b==="description"?h.value=h.value.filter(W=>W!==A):b==="scope"?x.value=x.value.filter(W=>W!==A):b==="message"&&(f.value=f.value.filter(W=>W!==A)),r.success("模板已删除"),!0):(r.error(`删除模板失败: ${H.error}`),!1)}catch(I){return r.error(`删除模板失败: ${I.message}`),!1}}async function Y(A,b,I){try{const W=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:A,newTemplate:b,type:I})})).json();if(W.success){if(I==="description"){const U=h.value.indexOf(A);U!==-1&&(h.value[U]=b)}else if(I==="scope"){const U=x.value.indexOf(A);U!==-1&&(x.value[U]=b)}else if(I==="message"){const U=f.value.indexOf(A);U!==-1&&(f.value[U]=b)}return r.success("模板已更新"),!0}else return r.error(`更新模板失败: ${W.error}`),!1}catch(H){return r.error(`更新模板失败: ${H.message}`),!1}}return{defaultCommitMessage:ke,descriptionTemplates:h,scopeTemplates:x,messageTemplates:f,isLoading:m,isLoaded:j,config:V,loadConfig:O,saveDefaultMessage:N,saveTemplate:ee,deleteTemplate:z,updateTemplate:Y}}),$a={key:0,class:"pushing-indicator"},ba={key:0,class:"push-success-indicator"},Ca={class:"card-content"},ka={class:"layout-container"},Sa={key:0,class:"git-config-warning"},Ta={class:"commit-section"},xa={class:"commit-options"},La={class:"options-row"},Aa={class:"commit-mode-toggle"},Va={class:"no-verify-toggle"},Ra={key:0,class:"commit-form"},Ba={class:"description-container"},Ma={class:"input-actions"},za={class:"preview-section"},Ea={class:"preview-content code-command"},Da={key:1,class:"standard-commit-form"},Ga={class:"standard-commit-header"},ja={class:"type-scope-container"},Oa={class:"scope-wrapper"},Pa={class:"description-container"},Ua={class:"advanced-fields"},Fa={class:"preview-section"},Na={class:"preview-content"},Ia={class:"preview-content code-command"},Ha={class:"actions-section"},Xa={class:"action-groups"},Wa={class:"operations-wrapper"},Ja={class:"action-group"},qa={class:"group-buttons"},Ya={key:0},Za={key:0},Ka={key:0},Qa={key:0},el={class:"action-group"},tl={class:"group-buttons"},sl={class:"action-group reset-group"},al={class:"group-buttons"},ll={key:0},ol={class:"template-container"},nl={class:"template-form"},rl={class:"template-form-buttons"},il={class:"template-list"},cl={class:"template-content"},ul={class:"template-actions"},dl={class:"template-container"},fl={class:"template-form"},pl={class:"template-form-buttons"},vl={class:"template-list"},ml={class:"template-content"},gl={class:"template-actions"},hl={class:"template-container message-template-container"},yl={class:"template-form"},wl={class:"template-form-buttons"},_l={class:"templates-container"},$l={class:"message-templates-list"},bl={class:"templates-scroll-area"},Cl={class:"template-content"},kl={class:"template-actions"},Sl={class:"current-default-message"},Tl={class:"default-message-content"},xl={class:"message-help-text"},Ll=gt({__name:"CommitForm",setup(ke){const h=ct(),x=Yt(),f=c(""),m=c(!1),j=c("输入提交信息..."),V=c(""),O=c(!1),N=c("feat"),ee=c(""),z=c(""),Y=c(""),A=c(""),b=c([]),I=c(!1),H=c(""),W=c(!1),U=c(""),me=c(-1),C=c([]),ne=c(!1),se=c(""),Z=c(!1),re=c(""),de=c(-1),L=c(!1),g=c(""),E=c(!1),M=c(!1),F=[{value:"feat",label:"feat: 新功能"},{value:"fix",label:"fix: 修复bug"},{value:"docs",label:"docs: 文档修改"},{value:"style",label:"style: 样式修改"},{value:"refactor",label:"refactor: 代码重构"},{value:"test",label:"test: 测试代码"},{value:"chore",label:"chore: 构建/工具修改"}],he=c([]),ie=c(!1),Me=c(""),xe=c(-1);Qe(O,a=>{localStorage.setItem("zen-gitsync-standard-commit",a.toString())}),Qe(E,a=>{localStorage.setItem("zen-gitsync-skip-hooks",a.toString())});const k=Ve(()=>{if(!O.value)return f.value||V.value;let a=`${N.value||""}`;return ee.value&&(a+=`(${ee.value})`),a+=`: ${z.value}`,Y.value&&(a+=`
|
|
15
|
+
|
|
16
|
+
${Y.value}`),A.value&&(a+=`
|
|
17
|
+
|
|
18
|
+
${A.value}`),a}),ye=Ve(()=>{let a=`git commit -m "${k.value}"`;return E.value&&(a+=" --no-verify"),a});function ge(){const a=x.config;a&&(j.value=`输入提交信息 (默认: ${a.defaultCommitMessage})`,V.value=a.defaultCommitMessage||"",a.descriptionTemplates&&Array.isArray(a.descriptionTemplates)&&(b.value=a.descriptionTemplates),a.scopeTemplates&&Array.isArray(a.scopeTemplates)&&(C.value=a.scopeTemplates),a.messageTemplates&&Array.isArray(a.messageTemplates)&&(he.value=a.messageTemplates))}async function Le(){if(!H.value.trim()){r({message:"请输入模板内容",type:"warning"});return}try{if(W.value)await Pe();else{if(b.value.includes(H.value)){r({message:"该模板已存在",type:"warning"});return}await x.saveTemplate(H.value,"description")&&(b.value.includes(H.value)||b.value.push(H.value),b.value=[...b.value],H.value="")}}catch(a){r({message:`保存模板失败: ${a.message}`,type:"error"})}}async function Pe(){if(!H.value.trim()){r({message:"请输入模板内容",type:"warning"});return}try{if(await x.updateTemplate(U.value,H.value,"description")){const t=b.value.indexOf(U.value);t!==-1&&(b.value[t]=H.value),b.value=[...b.value],W.value=!1,U.value="",me.value=-1,H.value=""}}catch(a){r({message:`更新模板失败: ${a.message}`,type:"error"})}}function Ue(a,t){W.value=!0,U.value=a,me.value=t,H.value=a}function Fe(){W.value=!1,U.value="",me.value=-1,H.value=""}async function Ne(){if(!se.value.trim()){r({message:"请输入模板内容",type:"warning"});return}try{if(Z.value)await Ke();else{if(C.value.includes(se.value)){r({message:"该模板已存在",type:"warning"});return}await x.saveTemplate(se.value,"scope")&&(C.value.includes(se.value)||C.value.push(se.value),C.value=[...C.value],se.value="")}}catch(a){r({message:`保存模板失败: ${a.message}`,type:"error"})}}async function Ke(){if(!se.value.trim()){r({message:"请输入模板内容",type:"warning"});return}try{if(await x.updateTemplate(re.value,se.value,"scope")){const t=C.value.indexOf(re.value);t!==-1&&(C.value[t]=se.value),C.value=[...C.value],Z.value=!1,re.value="",de.value=-1,se.value=""}}catch(a){r({message:`更新模板失败: ${a.message}`,type:"error"})}}function st(a,t){Z.value=!0,re.value=a,de.value=t,se.value=a}function Ye(){Z.value=!1,re.value="",de.value=-1,se.value=""}async function Ie(a){try{if(await et.confirm(`确定要删除描述模板 "${a}" 吗?`,"删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await x.deleteTemplate(a,"description")){const te=b.value.indexOf(a);te!==-1&&b.value.splice(te,1),b.value=[...b.value]}}catch(t){if(t==="cancel")return;r({message:`删除模板失败: ${t.message}`,type:"error"})}}async function be(a){try{if(await et.confirm(`确定要删除作用域模板 "${a}" 吗?`,"删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await x.deleteTemplate(a,"scope")){const te=C.value.indexOf(a);te!==-1&&C.value.splice(te,1),C.value=[...C.value]}}catch(t){if(t==="cancel")return;r({message:`删除模板失败: ${t.message}`,type:"error"})}}function Te(a){z.value=a,I.value=!1}function De(a){ee.value=a,ne.value=!1}function y(){I.value=!0}function n(){ne.value=!0}async function P(){try{await h.addToStage()&&h.fetchStatus()}catch(a){r({message:`添加文件失败: ${a.message}`,type:"error"})}}async function D(){if(!k.value.trim()){r({message:"提交信息不能为空",type:"warning"});return}try{await h.commitChanges(k.value,E.value)&&(v(),h.fetchStatus(),h.fetchLog(),h.getBranchStatus())}catch(a){r({message:`提交失败: ${a.message}`,type:"error"})}}function ue(){m.value=!0,setTimeout(()=>{m.value=!1},2e3)}async function Ae(){try{await h.pushToRemote(),ue(),h.getBranchStatus()}catch(a){r({message:`推送失败: ${a.message}`,type:"error"})}finally{}}async function we(){try{await h.gitPull(),h.fetchStatus(),h.fetchLog()}catch(a){r({message:`拉取失败: ${a.message}`,type:"error"})}finally{}}async function fe(){try{await h.gitFetchAll(),await h.fetchStatus()}catch(a){r({message:`获取远程分支信息失败: ${a.message}`,type:"error"})}finally{}}async function Re(){if(!k.value.trim()){r({message:"提交信息不能为空",type:"warning"});return}try{await h.addAndCommit(k.value,E.value),v(),h.fetchStatus(),h.fetchLog()}catch(a){r({message:`暂存并提交失败: ${a.message}`,type:"error"})}}async function $e(){if(!k.value.trim()){r({message:"提交信息不能为空",type:"warning"});return}try{await h.addCommitAndPush(k.value,E.value),v(),ue()}catch(a){r({message:`暂存、提交并推送失败: ${a.message}`,type:"error"})}}async function _e(){try{await et.confirm(`确定要重置当前分支 "${h.currentBranch}" 到远程状态吗?这将丢失所有未推送的提交和本地更改。`,"重置到远程分支",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await h.resetToRemote(h.currentBranch)&&(h.fetchStatus(),h.fetchLog())}catch(a){a!=="cancel"&&r({message:`重置到远程分支失败: ${a.message}`,type:"error"})}}function v(){f.value="",z.value="",Y.value="",A.value=""}function d(){g.value=V.value,L.value=!0}async function _(){if(!g.value.trim()){r({message:"请输入默认提交信息",type:"warning"});return}try{await x.saveDefaultMessage(g.value)&&(V.value=g.value,j.value=`输入提交信息 (默认: ${g.value})`,L.value=!1)}catch(a){r({message:`保存默认提交信息失败: ${a.message}`,type:"error"})}}const le=Ve(()=>h.fileList.some(a=>["modified","deleted","untracked"].includes(a.type))),He=Ve(()=>h.fileList.filter(a=>["modified","deleted","untracked"].includes(a.type)).length),Ce=Ve(()=>h.fileList.filter(a=>a.type==="added").length),Xe=Ve(()=>Ce.value>0),Ee=Ve(()=>h.fileList.length>0),We=Ve(()=>h.branchAhead>0),tt=Ve(()=>h.branchBehind>0),$t=Ve(()=>h.hasUpstream&&(We.value||Xe.value&&k.value.trim())),dt=Ve(()=>Xe.value),bt=Ve(()=>h.hasUpstream&&(We.value||tt.value||Ee.value));async function Ct(){if(!g.value.trim()){r({message:"请输入模板内容",type:"warning"});return}try{if(ie.value)await kt();else{if(he.value.includes(g.value)){r({message:"该模板已存在",type:"warning"});return}he.value.push(g.value);const t=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:g.value,type:"message"})})).json();t.success?(r({message:"提交信息模板保存成功!",type:"success"}),g.value=""):r({message:"模板保存失败: "+t.error,type:"error"})}}catch(a){r({message:"模板保存失败: "+a.message,type:"error"})}}async function kt(){try{if(xe.value>=0){const a=Me.value,t=g.value;he.value[xe.value]=t;const K=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:a,newTemplate:t,type:"message"})})).json();K.success?(r({message:"提交信息模板更新成功!",type:"success"}),ie.value=!1,Me.value="",xe.value=-1,g.value=""):r({message:"模板更新失败: "+K.error,type:"error"})}}catch(a){r({message:"模板更新失败: "+a.message,type:"error"})}}function St(a,t){ie.value=!0,Me.value=a,xe.value=t,g.value=a}function lt(){ie.value=!1,Me.value="",xe.value=-1,g.value=""}async function u(a){try{const t=he.value.indexOf(a);t!==-1&&he.value.splice(t,1);const K=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:a,type:"message"})})).json();K.success?r({message:"提交信息模板删除成功!",type:"success"}):r({message:"模板删除失败: "+K.error,type:"error"})}catch(t){r({message:"模板删除失败: "+t.message,type:"error"})}}function o(a){f.value=a,g.value=a}return ut(async()=>{const a=localStorage.getItem("zen-gitsync-standard-commit");a!==null&&(O.value=a==="true");const t=localStorage.getItem("zen-gitsync-skip-hooks");t!==null&&(E.value=t==="true"),Qe(()=>x.config,ge,{immediate:!0}),x.config||await x.loadConfig()}),(a,t)=>{const te=yt,K=Xt,q=Ot,S=At,oe=Rt,X=Oe,J=vt,pe=mt,ce=Jt,ve=us,Ge=qt,$=wt,G=ht;return p(),w("div",{class:qe(["card",{"is-pushing":i(h).isPushing}])},[t[58]||(t[58]=e("div",{class:"card-header"},[e("h2",null,"提交更改")],-1)),s(Et,{name:"el-fade-in-linear"},{default:l(()=>[i(h).isPushing?(p(),w("div",$a,t[15]||(t[15]=[e("div",{class:"pushing-spinner"},[e("svg",{viewBox:"0 0 50 50",class:"circular"},[e("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})])],-1),e("div",{class:"pushing-text"},"正在推送...",-1)]))):Q("",!0)]),_:1}),s(Et,{name:"el-fade-in-linear"},{default:l(()=>[m.value?(p(),w("div",ba,[s(te,{class:"push-success-icon"},{default:l(()=>[s(i(Pt))]),_:1}),t[16]||(t[16]=e("div",{class:"push-success-text"},"推送成功!",-1))])):Q("",!0)]),_:1}),e("div",Ca,[e("div",ka,[i(h).userName===""||i(h).userEmail===""?(p(),w("div",Sa,[s(K,{title:"Git用户信息未配置",type:"warning",closable:!1,"show-icon":""},{default:l(()=>t[17]||(t[17]=[e("p",null,"您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:",-1),e("pre",{class:"config-command"},`git config --global user.name "Your Name"
|
|
19
|
+
git config --global user.email "your.email@example.com"`,-1)])),_:1})])):(p(),w(Se,{key:1},[e("div",Ta,[e("div",xa,[e("div",La,[e("div",Aa,[s(q,{modelValue:O.value,"onUpdate:modelValue":t[0]||(t[0]=B=>O.value=B),"active-text":"标准化提交","inactive-text":"普通提交"},null,8,["modelValue"])]),e("div",Va,[s(S,{content:"跳过 Git 钩子检查 (--no-verify)",placement:"top"},{default:l(()=>[s(q,{modelValue:E.value,"onUpdate:modelValue":t[1]||(t[1]=B=>E.value=B),"active-text":"跳过钩子 (--no-verify)"},null,8,["modelValue"])]),_:1})])])]),O.value?(p(),w("div",Da,[e("div",Ga,[e("div",ja,[s(pe,{modelValue:N.value,"onUpdate:modelValue":t[3]||(t[3]=B=>N.value=B),placeholder:"提交类型",class:"type-select",clearable:""},{default:l(()=>[(p(),w(Se,null,ze(F,B=>s(J,{key:B.value,label:B.label,value:B.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),e("div",Oa,[s(oe,{modelValue:ee.value,"onUpdate:modelValue":t[4]||(t[4]=B=>ee.value=B),placeholder:"作用域(可选)",class:"scope-input",clearable:""},null,8,["modelValue"]),s(X,{type:"primary",icon:i(it),circle:"",size:"small",class:"settings-button",onClick:n},null,8,["icon"])])]),e("div",Pa,[s(oe,{modelValue:z.value,"onUpdate:modelValue":t[5]||(t[5]=B=>z.value=B),placeholder:"简短描述(必填)",class:"description-input",clearable:""},null,8,["modelValue"]),s(X,{type:"primary",icon:i(it),circle:"",size:"small",class:"settings-button",onClick:y},null,8,["icon"])])]),e("div",{class:"advanced-options-toggle",onClick:t[6]||(t[6]=B=>M.value=!M.value)},[e("span",null,R(M.value?"收起":"正文及页脚"),1),s(te,{class:qe(["toggle-icon",{"is-active":M.value}])},{default:l(()=>[s(i(Nt))]),_:1},8,["class"])]),rt(e("div",Ua,[s(oe,{modelValue:Y.value,"onUpdate:modelValue":t[7]||(t[7]=B=>Y.value=B),type:"textarea",rows:4,placeholder:"正文(可选):详细描述本次提交的内容和原因",class:"body-input",clearable:""},null,8,["modelValue"]),s(oe,{modelValue:A.value,"onUpdate:modelValue":t[8]||(t[8]=B=>A.value=B),placeholder:"页脚(可选):如 Closes #123",class:"footer-input",clearable:""},null,8,["modelValue"])],512),[[Wt,M.value]]),e("div",Fa,[t[19]||(t[19]=e("div",{class:"preview-title"},"提交信息预览:",-1)),e("pre",Na,R(k.value),1),t[20]||(t[20]=e("div",{class:"preview-title",style:{"margin-top":"10px"}},"Git提交命令预览:",-1)),e("pre",Ia,R(ye.value),1)])])):(p(),w("div",Ra,[e("div",Ba,[s(oe,{modelValue:f.value,"onUpdate:modelValue":t[2]||(t[2]=B=>f.value=B),placeholder:j.value,type:"textarea",rows:6,resize:"none",class:"commit-message-input"},null,8,["modelValue","placeholder"]),e("div",Ma,[s(X,{type:"primary",icon:i(it),circle:"",size:"small",class:"settings-button",onClick:d},null,8,["icon"])])]),e("div",za,[t[18]||(t[18]=e("div",{class:"preview-title"},"Git提交命令预览:",-1)),e("pre",Ea,'git commit -m "'+R(k.value||"<提交信息>")+'"'+R(E.value?" --no-verify":""),1)])]))]),e("div",Ha,[t[33]||(t[33]=e("h3",null,"Git 操作",-1)),e("div",Xa,[e("div",Wa,[e("div",Ja,[t[26]||(t[26]=e("div",{class:"group-title"},"基础操作",-1)),e("div",qa,[s(S,{content:le.value?`暂存${He.value}个待更改文件`:"git add .",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"primary",onClick:P,loading:i(h).isAddingFiles,disabled:!le.value,class:"action-button"},{default:l(()=>[t[21]||(t[21]=T(" 暂存更改 ")),He.value>0?(p(),w("span",Ya,"("+R(He.value)+")",1)):Q("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),s(S,{content:Xe.value?`提交${Ce.value}个已暂存文件`:"git commit",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"primary",onClick:D,loading:i(h).isLoadingStatus,disabled:!Xe.value||!k.value.trim(),class:"action-button"},{default:l(()=>[t[22]||(t[22]=T(" 提交 ")),Ce.value>0?(p(),w("span",Za,"("+R(Ce.value)+")",1)):Q("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),s(S,{content:We.value?`推送${i(h).branchAhead}个本地提交`:"git push",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"primary",icon:i(rs),onClick:Ae,loading:i(h).isPushing,disabled:!$t.value,class:qe(["action-button","push-button",{"is-loading":i(h).isPushing}]),style:Lt(We.value?{backgroundColor:"#67c23a !important",borderColor:"#67c23a !important"}:{})},{default:l(()=>[t[23]||(t[23]=T(" 推送 ")),We.value?(p(),w("span",Ka,"("+R(i(h).branchAhead)+")",1)):Q("",!0)]),_:1},8,["icon","loading","disabled","class","style"])]),_:1},8,["content"]),s(S,{content:tt.value?`拉取${i(h).branchBehind}个远程提交`:"git pull",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"primary",icon:i(Ut),onClick:we,loading:i(h).isGitPulling,disabled:!i(h).hasUpstream,class:"action-button",style:Lt(tt.value?{color:"white",backgroundColor:"#E6A23C",borderColor:"#E6A23C"}:{})},{default:l(()=>[t[24]||(t[24]=T(" 拉取 ")),tt.value?(p(),w("span",Qa,"("+R(i(h).branchBehind)+")",1)):Q("",!0)]),_:1},8,["icon","loading","disabled","style"])]),_:1},8,["content"]),s(S,{content:"git fetch --all",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"info",icon:i(Ft),onClick:fe,loading:i(h).isGitFetching,class:"action-button"},{default:l(()=>t[25]||(t[25]=[T(" 获取所有远程分支 ")])),_:1},8,["icon","loading"])]),_:1})])]),e("div",el,[t[29]||(t[29]=e("div",{class:"group-title"},"组合操作",-1)),e("div",tl,[s(S,{content:"git add + git commit",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"primary",icon:i(ft),onClick:Re,loading:i(h).isAddingFiles||i(h).isCommiting,disabled:!le.value||!k.value.trim(),class:"action-button"},{default:l(()=>t[27]||(t[27]=[T(" 暂存并提交 ")])),_:1},8,["icon","loading","disabled"])]),_:1}),s(S,{content:"git add + git commit + git push",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"success",icon:i(is),onClick:$e,loading:i(h).isAddingFiles||i(h).isCommiting||i(h).isPushing,disabled:!Ee.value||!k.value.trim()||!i(h).hasUpstream,class:qe(["action-button","one-click-push",{"is-loading":i(h).isAddingFiles||i(h).isCommiting||i(h).isPushing}])},{default:l(()=>t[28]||(t[28]=[T(" 一键推送 ")])),_:1},8,["icon","loading","disabled","class"])]),_:1})])])]),e("div",sl,[t[32]||(t[32]=e("div",{class:"group-title"},"重置操作",-1)),e("div",al,[s(S,{content:dt.value?`撤销${Ce.value}个已暂存文件`:"git reset HEAD",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"warning",icon:i(Vt),onClick:i(h).resetHead,loading:i(h).isResetting,disabled:!dt.value,class:"action-button reset-button"},{default:l(()=>[t[30]||(t[30]=T(" 重置暂存区 ")),Ce.value>0?(p(),w("span",ll,"("+R(Ce.value)+")",1)):Q("",!0)]),_:1},8,["icon","onClick","loading","disabled"])]),_:1},8,["content"]),s(S,{content:"git reset --hard origin/branch",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:l(()=>[s(X,{type:"danger",icon:i(cs),onClick:_e,loading:i(h).isResetting,disabled:!bt.value,class:"action-button danger-button"},{default:l(()=>t[31]||(t[31]=[T(" 重置到远程 ")])),_:1},8,["icon","loading","disabled"])]),_:1})])])])])],64))]),s($,{title:"简短描述模板设置",modelValue:I.value,"onUpdate:modelValue":t[10]||(t[10]=B=>I.value=B),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"template-dialog"},{default:l(()=>[e("div",ol,[e("div",nl,[s(oe,{modelValue:H.value,"onUpdate:modelValue":t[9]||(t[9]=B=>H.value=B),placeholder:W.value?"编辑模板内容":"输入新模板内容",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",rl,[W.value?(p(),ae(X,{key:0,onClick:Fe},{default:l(()=>t[34]||(t[34]=[T("取消")])),_:1})):Q("",!0),s(X,{type:"primary",onClick:Le,disabled:!H.value.trim()},{default:l(()=>[T(R(W.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"])])]),e("div",il,[t[38]||(t[38]=e("h3",null,"已保存模板",-1)),b.value.length===0?(p(),ae(ce,{key:0,description:"暂无保存的模板"})):Q("",!0),(p(!0),w(Se,null,ze(b.value,(B,Je)=>(p(),ae(Ge,{key:Je,class:"template-item"},{default:l(()=>[s(ve,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:l(()=>[e("div",cl,R(B),1),e("div",ul,[s(X,{type:"primary",size:"small",onClick:je=>Te(B)},{default:l(()=>t[35]||(t[35]=[T("使用")])),_:2},1032,["onClick"]),s(X,{type:"warning",size:"small",icon:i(ft),onClick:je=>Ue(B,Je)},{default:l(()=>t[36]||(t[36]=[T("编辑")])),_:2},1032,["icon","onClick"]),s(X,{type:"danger",size:"small",onClick:je=>Ie(B)},{default:l(()=>t[37]||(t[37]=[T("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])])]),_:1},8,["modelValue"]),s($,{title:"作用域模板设置",modelValue:ne.value,"onUpdate:modelValue":t[12]||(t[12]=B=>ne.value=B),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"template-dialog"},{default:l(()=>[e("div",dl,[e("div",fl,[s(oe,{modelValue:se.value,"onUpdate:modelValue":t[11]||(t[11]=B=>se.value=B),placeholder:Z.value?"编辑作用域模板内容":"输入新作用域模板",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",pl,[Z.value?(p(),ae(X,{key:0,onClick:Ye},{default:l(()=>t[39]||(t[39]=[T("取消")])),_:1})):Q("",!0),s(X,{type:"primary",onClick:Ne,disabled:!se.value.trim()},{default:l(()=>[T(R(Z.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"])])]),e("div",vl,[t[43]||(t[43]=e("h3",null,"已保存作用域",-1)),C.value.length===0?(p(),ae(ce,{key:0,description:"暂无保存的作用域"})):Q("",!0),(p(!0),w(Se,null,ze(C.value,(B,Je)=>(p(),ae(Ge,{key:Je,class:"template-item"},{default:l(()=>[s(ve,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:l(()=>[e("div",ml,R(B),1),e("div",gl,[s(X,{type:"primary",size:"small",onClick:je=>De(B)},{default:l(()=>t[40]||(t[40]=[T("使用")])),_:2},1032,["onClick"]),s(X,{type:"warning",size:"small",icon:i(ft),onClick:je=>st(B,Je)},{default:l(()=>t[41]||(t[41]=[T("编辑")])),_:2},1032,["icon","onClick"]),s(X,{type:"danger",size:"small",onClick:je=>be(B)},{default:l(()=>t[42]||(t[42]=[T("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])])]),_:1},8,["modelValue"]),s($,{title:"默认提交信息设置",modelValue:L.value,"onUpdate:modelValue":t[14]||(t[14]=B=>L.value=B),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"message-template-dialog"},{default:l(()=>[e("div",hl,[e("div",yl,[s(oe,{modelValue:g.value,"onUpdate:modelValue":t[13]||(t[13]=B=>g.value=B),placeholder:ie.value?"编辑模板内容":"输入新模板内容",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",wl,[ie.value?(p(),ae(X,{key:0,onClick:lt},{default:l(()=>t[44]||(t[44]=[T("取消")])),_:1})):Q("",!0),s(X,{type:"primary",onClick:Ct,disabled:!g.value.trim()},{default:l(()=>[T(R(ie.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"]),s(X,{type:"success",onClick:_,disabled:!g.value.trim()},{default:l(()=>t[45]||(t[45]=[T(" 设为默认提交信息 ")])),_:1},8,["disabled"])])]),e("div",_l,[e("div",$l,[t[49]||(t[49]=e("h3",null,"已保存模板",-1)),e("div",bl,[he.value.length===0?(p(),ae(ce,{key:0,description:"暂无保存的模板"})):Q("",!0),(p(!0),w(Se,null,ze(he.value,(B,Je)=>(p(),ae(Ge,{key:Je,class:"template-item"},{default:l(()=>[s(ve,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:l(()=>[e("div",Cl,R(B),1),e("div",kl,[s(X,{type:"primary",size:"small",onClick:je=>o(B)},{default:l(()=>t[46]||(t[46]=[T("使用")])),_:2},1032,["onClick"]),s(X,{type:"warning",size:"small",icon:i(ft),onClick:je=>St(B,Je)},{default:l(()=>t[47]||(t[47]=[T("编辑")])),_:2},1032,["icon","onClick"]),s(X,{type:"danger",size:"small",onClick:je=>u(B)},{default:l(()=>t[48]||(t[48]=[T("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])]),e("div",Sl,[t[57]||(t[57]=e("h3",null,"当前默认提交信息",-1)),V.value?(p(),ae(Ge,{key:0,class:"default-message-card"},{default:l(()=>[e("div",Tl,R(V.value),1)]),_:1})):(p(),ae(ce,{key:1,description:"尚未设置默认提交信息","image-size":100})),e("div",xl,[t[55]||(t[55]=e("h4",null,"关于默认提交信息",-1)),t[56]||(t[56]=e("p",null,"默认提交信息将在未输入提交信息时自动使用。",-1)),e("p",null,[t[52]||(t[52]=T("你可以通过点击左侧模板的")),s(G,{size:"small",type:"primary"},{default:l(()=>t[50]||(t[50]=[T("使用")])),_:1}),t[53]||(t[53]=T("按钮先选择喜欢的模板,然后点击上方")),s(G,{size:"small",type:"success"},{default:l(()=>t[51]||(t[51]=[T("设为默认提交信息")])),_:1}),t[54]||(t[54]=T("按钮保存。"))])])])])])]),_:1},8,["modelValue"])])],2)}}}),Al=_t(Ll,[["__scopeId","data-v-872425f1"]]),Vl={class:"card"},Rl={key:0,class:"refresh-notification"},Bl={class:"log-header"},Ml={class:"log-actions"},zl={key:1,class:"filter-panel-header"},El={class:"filter-form"},Dl={class:"filter-item"},Gl={class:"filter-item"},jl={class:"filter-item"},Ol={class:"filter-item"},Pl={class:"filter-actions"},Ul={key:0},Fl={key:1,class:"content-area-content"},Nl={key:0,class:"graph-view"},Il={key:0,class:"commit-count"},Hl={class:"graph-controls"},Xl={class:"zoom-controls"},Wl={class:"scale-info"},Jl={key:1,class:"table-view-container"},ql=["id"],Yl=["onClick"],Zl={class:"author-name"},Kl={key:0,class:"branch-container"},Ql={key:0,class:"load-more-container"},eo={class:"pagination-info"},to={key:0,class:"loading-more"},so={key:2,class:"no-more-data"},ao={key:0,class:"total-loaded"},lo={class:"commit-detail-container"},oo={key:0,class:"commit-info"},no={class:"commit-info-header"},ro={class:"info-item"},io={class:"item-value"},co={class:"info-item"},uo={class:"item-value"},fo={class:"info-item"},po={class:"item-value"},vo={class:"commit-message-container"},mo=["innerHTML"],go={class:"commit-files-diff"},ho={class:"files-list"},yo={key:1},wo=["onClick"],_o={class:"file-diff"},$o={key:0},bo={key:1},Co=["innerHTML"],nt=.5,pt=1.5,xt=.1,ko=gt({__name:"LogList",setup(ke,{expose:h}){const x=ct();let f=[];const m=c(f),j=c(""),V=c(!1),O=Ve(()=>x.isLoadingLog||V.value),N=c(!1),ee=c(0),z=c(!1),Y=c(null),A=c(1),b=c(!0),I=c(!1),H=c(null),W=c(!1),U=c(null),me=c([]),C=c(""),ne=c(!1),se=c(""),Z=c(1),re=c(!1),de=c(!1),L=c([]),g=c(""),E=c(null),M=c([]),F=c([]),he=c([]),ie=c(!1),Me=c(0),xe=c(0),k=c(null),ye=c(new Map),ge=c([]),Le=c(1),Pe=c(new Map),Ue=Ve(()=>m.value);async function Fe(u=!1,o=1){if(!ct().isGitRepo){j.value="当前目录不是Git仓库";return}try{o>1?I.value=!0:V.value=!0,console.log(`加载提交历史: page=${o}, all=${u}`);const t=new URLSearchParams;t.append("page",o.toString()),t.append("all",u.toString()),t.append("with_parents","true"),L.value.length>0&&t.append("author",L.value.join(",")),F.value.length>0&&t.append("branch",F.value.join(",")),g.value&&t.append("message",g.value),E.value&&Array.isArray(E.value)&&E.value.length===2&&(t.append("dateFrom",E.value[0]),t.append("dateTo",E.value[1])),t.append("_t",Date.now().toString());const K=await(await fetch(`/api/log?${t.toString()}`)).json();if(!K||!K.data||!Array.isArray(K.data)){console.error("API返回的数据格式不正确:",K),j.value="加载提交历史失败: 服务器返回数据格式不正确";return}const q=o>1;q?K.data.forEach(S=>f.push(S)):(f.length=0,K.data.forEach(S=>f.push(S))),m.value=[...f],A.value=o,ee.value=K.total||f.length,b.value=K.hasMore===!0,console.log(`加载完成: 当前页=${A.value}, 是否有更多=${b.value}, 总条数=${ee.value}`),b.value||console.log("已加载所有提交记录"),q||(re.value=!0,setTimeout(()=>{re.value=!1},2e3)),!q&&z.value?setTimeout(Ne,0):!q&&!z.value&&!u&&Ze(()=>{y(),setTimeout(lt,200)}),j.value=""}catch(t){j.value="加载提交历史失败: "+(t instanceof Error?t.message:String(t)),console.error("加载日志失败:",t),o>1&&(b.value=!1)}finally{o>1?I.value=!1:V.value=!1}}async function Ne(){if(console.log(`开始渲染图表...数据长度: ${f.length}`),!Y.value){console.error("图表容器未找到");return}if(f.length===0){console.error("没有日志数据可渲染");return}try{Y.value.innerHTML="",console.log(`创建gitgraph实例,分支: ${x.currentBranch||"main"}`);const u=Cs(Y.value,{orientation:"vertical-reverse",template:"metro",author:"提交者 <committer@example.com>"}),o={},a=u.branch(x.currentBranch||"main");o[x.currentBranch||"main"]=a,console.log(`开始创建提交图...共${f.length}条提交`),f.forEach((t,te)=>{let K=a;if(t.branch){const q=Ye(t.branch.split(",")[0]);o[q]||(o[q]=u.branch(q)),K=o[q]}K.commit({hash:t.hash,subject:t.message,author:`${t.author} <${t.email}>`}),te%10===0&&console.log(`已渲染 ${te+1}/${f.length} 个提交`)}),console.log("图表渲染完成"),setTimeout(()=>{Re()},100)}catch(u){console.error("渲染图表失败:",u),j.value="渲染图表失败: "+(u instanceof Error?u.message:String(u))}}function Ke(){z.value=!z.value,z.value&&f.length>0&&setTimeout(Ne,0)}function st(){N.value=!N.value,N.value||(b.value=!0),A.value=1,Fe(N.value),Ze(()=>{setTimeout(()=>{!z.value&&!N.value&&(y(),lt())},300)})}function Ye(u){return u.includes("HEAD -> ")?u.replace("HEAD -> ",""):u.includes("origin/")?u:u.trim()}function Ie(u){return u.includes("HEAD")?"success":u.includes("origin/")?"warning":"info"}const be=c(null),Te=c(null);function De(u){if(z.value||!b.value||I.value||O.value)return;const o=u.target,{scrollTop:a,scrollHeight:t,clientHeight:te}=o,K=t-a-te;console.log("表格滚动:",{scrollTop:a,scrollHeight:t,clientHeight:te,scrollDistance:K,hasMoreData:b.value,isLoadingMore:I.value,isLoading:O.value}),K<=20&&(console.log("已滚动到底部,加载更多数据"),_())}function y(){if(console.log("设置表格滚动监听 - 开始"),!be.value){console.error("tableRef.value 不存在");return}const u=be.value.$el.querySelector(".el-table__body-wrapper");if(!u){console.error("未找到表格的body-wrapper元素");return}console.log("找到表格的body-wrapper元素"),Te.value=u,Te.value&&(Te.value.removeEventListener("scroll",De,!0),Te.value.addEventListener("scroll",De,!0),console.log("成功添加表格滚动监听"))}function n(){console.log("移除表格滚动监听 - 开始"),Te.value?(Te.value.removeEventListener("scroll",De,!0),console.log("成功移除表格滚动监听"),Te.value=null):console.log("tableBodyWrapper.value 不存在,无需移除监听")}ut(()=>{x.isGitRepo?(x.log.length>0?(console.log("使用已加载的日志数据"),f.length=0,x.log.forEach(u=>f.push(u)),ee.value=x.log.length,z.value?setTimeout(()=>{console.log(`准备渲染图表,数据长度: ${f.length}`),Ne()},100):setTimeout(()=>{Ee()},100)):(console.log("初始加载日志数据"),Fe()),Ce()):j.value="当前目录不是Git仓库",Ze(()=>{setTimeout(()=>{y()},500)}),Ze(()=>{setTimeout(()=>{z.value||Ee()},500)}),Qe(()=>be.value,u=>{u&&!z.value&&!N.value&&(console.log("表格引用已创建,设置滚动监听"),Ze(()=>{y()}))})}),Qe(()=>x.allBranches,u=>{u&&u.length>0?(he.value=[...u].sort(),console.log(`分支数据更新,共 ${he.value.length} 个分支`)):(he.value=[],console.warn("gitStore 中没有分支数据"))},{immediate:!0}),ds(()=>{n(),H.value!==null&&(window.clearInterval(H.value),H.value=null)});function P(u,o){let a=null;return function(...t){a&&clearTimeout(a),a=window.setTimeout(()=>{u(...t),a=null},o)}}const D=P(Ee,200);async function ue(){await x.fetchLog(!0),f.length=0,x.log.forEach(u=>f.push(u)),m.value=[...f],ee.value=x.log.length,A.value=1,b.value=!1,re.value=!0,setTimeout(()=>{re.value=!1},2e3),z.value?(await Ze(),Ne()):(ye.value.clear(),ge.value=[],Le.value=1,await Ze(),D())}Qe(()=>x.log,u=>{console.log("监听到gitStore.log变化,更新图表数据");try{f.length=0,Array.isArray(u)&&u.forEach(o=>o&&f.push(o)),ee.value=f.length,A.value=1,m.value=[...f],re.value=!0,setTimeout(()=>{re.value=!1},2e3),console.log(`数据更新完成,共${m.value.length}条记录,准备渲染图表`),z.value&&f.length>0&&setTimeout(Ne,0)}catch(o){console.error("更新日志数据失败:",o)}},{immediate:!0}),h({refreshLog:ue});function Ae(){Z.value<pt&&(Z.value=Math.min(pt,Z.value+xt),fe())}function we(){Z.value>nt&&(Z.value=Math.max(nt,Z.value-xt),fe())}function fe(){if(!Y.value)return;const u=Y.value.querySelector("svg");u&&(u.style.transform=`scale(${Z.value})`,u.style.transformOrigin="top left")}function Re(){if(!Y.value)return;const u=Y.value.querySelector("svg");if(!u)return;const o=u.getBoundingClientRect().width/Z.value,a=Y.value.clientWidth;o>a?Z.value=Math.max(nt,a/o):Z.value=1,fe()}async function $e(u){if(u){U.value=u,W.value=!0,ne.value=!0,me.value=[],C.value="",se.value="",console.log("提交详情对象:",JSON.stringify(u,null,2)),console.log("哈希值类型和长度:",typeof u.hash,u.hash?u.hash.length:0),console.log("提交信息类型和长度:",typeof u.message,u.message?u.message.length:0),console.log("提交分支:",u.branch);try{if(console.log(`获取提交详情: ${u.hash}`),!u.hash||u.hash.length<7){console.error("无效的提交哈希值:",u.hash),C.value="无效的提交哈希值",ne.value=!1;return}const o=await fetch(`/api/commit-files?hash=${u.hash}`);console.log("API响应状态: ",o.status);const a=await o.json();console.log("文件列表数据: ",a),a.success&&Array.isArray(a.files)?(me.value=a.files,me.value.length>0?await _e(u.hash,me.value[0]):(console.log("没有找到变更文件"),C.value="该提交没有变更文件")):(console.error("获取提交文件列表失败:",a.error||"未知错误"),C.value=`获取文件列表失败: ${a.error||"未知错误"}`)}catch(o){console.error("获取提交详情失败:",o),C.value=`获取提交详情失败: ${o.message}`}finally{ne.value=!1}}}async function _e(u,o){ne.value=!0,se.value=o;try{console.log(`获取文件差异: hash=${u}, file=${o}`);const a=await fetch(`/api/commit-file-diff?hash=${u}&file=${encodeURIComponent(o)}`);console.log("差异API响应状态: ",a.status);const t=await a.json();console.log("差异数据: ",t.success,typeof t.diff),t.success?C.value=t.diff||"没有变更内容":(console.error("获取差异失败: ",t.error),C.value=`获取差异失败: ${t.error||"未知错误"}`)}catch(a){console.error("获取文件差异失败:",a),C.value=`获取差异失败: ${a.message}`}finally{ne.value=!1}}function v(u){if(!u)return"";const o=u.split(`
|
|
20
|
+
`);function a(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return o.map(t=>{const te=a(t);return t.startsWith("diff --git")?`<div class="diff-header">${te}</div>`:t.startsWith("---")?`<div class="diff-old-file">${te}</div>`:t.startsWith("+++")?`<div class="diff-new-file">${te}</div>`:t.startsWith("@@")?`<div class="diff-hunk-header">${te}</div>`:t.startsWith("+")?`<div class="diff-added">${te}</div>`:t.startsWith("-")?`<div class="diff-removed">${te}</div>`:`<div class="diff-context">${te}</div>`}).join("")}function d(u){return u?(console.log("格式化前的提交信息:",u),console.log("提交信息中的换行符数量:",(u.match(/\n/g)||[]).length),u.trim()):"(无提交信息)"}function _(){if(!b.value||I.value||O.value){console.log("不满足加载更多条件:",{hasMoreData:b.value,isLoadingMore:I.value,isLoading:O.value});return}console.log(`加载更多日志,当前页码: ${A.value},下一页: ${A.value+1}`),Fe(N.value,A.value+1)}function le(){L.value=[],F.value=[],g.value="",E.value=null,A.value=1,Fe(N.value,1)}function He(){A.value=1,Fe(N.value,1)}async function Ce(){try{console.log("获取所有可用作者...");const o=await(await fetch("/api/authors")).json();o.success&&Array.isArray(o.authors)?(M.value=o.authors.sort(),console.log(`获取到${M.value.length}位作者`)):(console.warn("从API获取作者列表失败,将从现有日志中提取作者列表"),Xe())}catch(u){console.error("获取作者列表失败:",u),Xe()}}function Xe(){const u=new Set;m.value.forEach(o=>{o.author&&u.add(o.author)}),M.value=Array.from(u).sort(),console.log(`从现有日志中提取了${M.value.length}位作者`)}function Ee(){!be.value||z.value||(ye.value.clear(),ge.value=[],Le.value=1,We(),Ze(()=>{$t()}))}function We(){ye.value.clear(),ge.value=[],Pe.value.clear();const u=new Map,o=new Map;m.value.forEach(J=>{J.hash&&(J.parents&&J.parents.length>0?(u.set(J.hash,[...J.parents]),J.parents.forEach(pe=>{var ce;o.has(pe)||o.set(pe,[]),(ce=o.get(pe))==null||ce.push(J.hash)})):u.set(J.hash,[]))});const a=0,t="#2196f3",te=["#e91e63","#4caf50","#ff9800","#9c27b0","#00bcd4","#ff5722","#607d8b"],K=new Map;m.value.forEach(J=>{if(!J.hash||!J.branch)return;const pe=J.branch.match(/(HEAD -> |origin\/)?([^\s,]+)/g);if(pe&&pe.length>0){const ce=pe.find(ve=>ve.includes("HEAD -> "));if(ce){const ve=ce.replace("HEAD -> ","").trim();K.set(J.hash,ve)}else{const ve=pe[0].replace("origin/","").trim();K.set(J.hash,ve)}}});const q=new Map;let S=0;q.set("main",a),q.set("master",a),S++;const oe=new Map;oe.set("main",t),oe.set("master",t);const X=new Map;return m.value.forEach((J,pe)=>{if(!J.hash)return;const ce=J.hash,ve=K.get(ce)||"main";if(!q.has(ve)){q.set(ve,S++);const $=(q.get(ve)||0)%te.length;oe.set(ve,te[$])}const Ge=q.get(ve)||0;X.set(ce,Ge),ye.value.set(ce,{hash:ce,parents:J.parents||[],column:Ge,row:pe,branch:ve}),Pe.value.has(ve)||Pe.value.set(ve,{name:ve,color:oe.get(ve)||t,column:Ge})}),m.value.forEach((J,pe)=>{if(!J.hash||!J.parents||J.parents.length===0)return;const ce=ye.value.get(J.hash);if(!ce)return;const ve=ce.column,Ge=ce.branch||"main",$=oe.get(Ge)||t;J.parents.forEach((G,B)=>{const Je=m.value.findIndex(ts=>ts.hash===G);if(Je<0)return;const je=ye.value.get(G);if(!je)return;const Kt=je.column,Qt=je.branch||"main",es=oe.get(Qt)||t;let Bt=$;J.parents&&J.parents.length>1&&B>0&&(Bt=es),ge.value.push({fromRow:pe,fromColumn:ve,toRow:Je,toColumn:Kt,color:Bt})})}),Le.value=S,{mainBranchColor:t,branchColorMap:oe}}let tt=!1;function $t(){if(tt){console.log("已有渲染进行中,跳过");return}try{tt=!0;const u=new Map;u.set("main","#2196f3"),u.set("master","#2196f3");const o="#2196f3";if(ge.value.length===0){if(console.log("branchLines为空,重新计算"),We(),ge.value.length===0&&m.value.length>1){console.log("创建默认分支线");for(let a=0;a<m.value.length-1;a++)m.value[a].hash&&m.value[a+1].hash&&ge.value.push({fromRow:a,fromColumn:0,toRow:a+1,toColumn:0,color:o})}}else console.log(`使用现有分支线,数量: ${ge.value.length}`);m.value.forEach((a,t)=>{if(!a.hash)return;const te=`commit-graph-${a.hash.substring(0,7)}`,K=document.getElementById(te);if(!K||K.querySelector("svg"))return;const q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("width","100%"),q.setAttribute("height","100%"),q.setAttribute("viewBox","0 0 100 100"),q.style.display="block",q.style.overflow="visible",K.innerHTML="",K.appendChild(q);const S=ye.value.get(a.hash);if(!S)return;const oe=20,X=10+S.column*oe,J=50,pe=[];for(const $ of ge.value)$.fromRow<t&&$.toRow>t&&pe.push({...$,type:"through",x:10+$.fromColumn*oe});for(const $ of ge.value)$.fromRow===t&&pe.push({...$,type:"from",fromX:10+$.fromColumn*oe,toX:10+$.toColumn*oe});for(const $ of ge.value)$.toRow===t&&pe.push({...$,type:"to",fromX:10+$.fromColumn*oe,toX:10+$.toColumn*oe});pe.length===0&&t<m.value.length-1&&(ge.value.length>0?pe.push({...ge.value[0],type:"from",fromX:X,toX:X}):pe.push({type:"from",fromX:X,toX:X,fromRow:t,fromColumn:0,toRow:t+1,toColumn:0,color:o})),pe.filter($=>$.type==="through").forEach($=>{const G=document.createElementNS("http://www.w3.org/2000/svg","line");G.setAttribute("x1",$.x.toString()),G.setAttribute("y1","-20"),G.setAttribute("x2",$.x.toString()),G.setAttribute("y2","120"),G.setAttribute("stroke",$.color),G.setAttribute("stroke-width","2"),q.appendChild(G)}),pe.filter($=>$.type==="to").forEach($=>{if($.fromColumn===$.toColumn){const G=document.createElementNS("http://www.w3.org/2000/svg","line");G.setAttribute("x1",$.toX.toString()),G.setAttribute("y1","-20"),G.setAttribute("x2",$.toX.toString()),G.setAttribute("y2",J.toString()),G.setAttribute("stroke",$.color),G.setAttribute("stroke-width","2"),q.appendChild(G)}else{const G=document.createElementNS("http://www.w3.org/2000/svg","path");$.fromColumn<$.toColumn?G.setAttribute("d",`M${$.fromX},-20 C${$.fromX},15 ${$.toX},30 ${$.toX},${J}`):G.setAttribute("d",`M${$.fromX},-20 C${$.fromX},15 ${$.toX},30 ${$.toX},${J}`),G.setAttribute("stroke",$.color),G.setAttribute("stroke-width","2"),G.setAttribute("fill","none"),q.appendChild(G)}}),pe.filter($=>$.type==="from").forEach($=>{if($.fromColumn===$.toColumn){const G=document.createElementNS("http://www.w3.org/2000/svg","line");G.setAttribute("x1",$.fromX.toString()),G.setAttribute("y1",J.toString()),G.setAttribute("x2",$.fromX.toString()),G.setAttribute("y2","120"),G.setAttribute("stroke",$.color),G.setAttribute("stroke-width","2"),q.appendChild(G)}else{const G=document.createElementNS("http://www.w3.org/2000/svg","path");$.fromColumn<$.toColumn?G.setAttribute("d",`M${$.fromX},${J} C${$.fromX},70 ${$.toX},85 ${$.toX},120`):G.setAttribute("d",`M${$.fromX},${J} C${$.fromX},70 ${$.toX},85 ${$.toX},120`),G.setAttribute("stroke",$.color),G.setAttribute("stroke-width","2"),G.setAttribute("fill","none"),q.appendChild(G)}});const ce=document.createElementNS("http://www.w3.org/2000/svg","circle");ce.setAttribute("cx",X.toString()),ce.setAttribute("cy",J.toString()),ce.setAttribute("r","6");const ve=S.branch||"",Ge=u.get(ve)||o;ce.setAttribute("fill",Ge),ce.setAttribute("stroke","#fff"),ce.setAttribute("stroke-width","2"),q.appendChild(ce)})}catch(u){console.error("渲染分支图失败:",u),j.value="渲染分支图失败: "+(u instanceof Error?u.message:String(u))}finally{tt=!1}}Qe(()=>m.value,()=>{Ze(()=>{z.value||D()})},{deep:!0});function dt(u,o,a){console.log("handleContextMenu",u,o,a),a.preventDefault(),Me.value=a.clientY,xe.value=a.clientX,k.value=u,ie.value=!0;const t=()=>{ie.value=!1,document.removeEventListener("click",t)};setTimeout(()=>{document.addEventListener("click",t)},0)}async function bt(u){if(u)try{await et.confirm(`确定要撤销提交 ${u.hash.substring(0,7)} 吗?这将创建一个新的提交来撤销这次提交的更改。`,"撤销提交确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const a=await(await fetch("/api/revert-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:u.hash})})).json();a.success?(r.success(a.message||"已成功撤销提交"),ue(),x.fetchStatus(),x.getBranchStatus()):r.error(a.error||"撤销提交失败")}catch(o){o!=="cancel"&&(console.error("撤销提交出错:",o),r.error("撤销提交失败: "+(o.message||o)))}}async function Ct(u){if(u)try{await et.confirm(`确定要将提交 ${u.hash.substring(0,7)} Cherry-Pick 到当前分支吗?`,"Cherry-Pick确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const a=await(await fetch("/api/cherry-pick-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:u.hash})})).json();a.success?(r.success(a.message||"已成功Cherry-Pick提交"),ue(),x.fetchStatus(),x.getBranchStatus()):r.error(a.error||"Cherry-Pick提交失败")}catch(o){o!=="cancel"&&(console.error("Cherry-Pick提交出错:",o),r.error("Cherry-Pick提交失败: "+(o.message||o)))}}async function kt(u){if(u)try{await navigator.clipboard.writeText(u.hash),r.success(`已复制提交哈希: ${u.hash.substring(0,7)}`)}catch(o){console.error("复制提交哈希失败:",o),r.error(`复制提交哈希失败: ${o.message}`)}}async function St(u){if(u)try{await et.confirm(`确定要将当前分支重置(hard)到提交 ${u.hash.substring(0,7)} 吗?
|
|
21
|
+
|
|
22
|
+
警告:这将丢失该提交之后的所有更改!`,"重置确认",{confirmButtonText:"确认重置",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0});const a=await(await fetch("/api/reset-to-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:u.hash})})).json();a.success?(r.success(a.message||"已成功重置到指定提交"),ue(),x.fetchStatus(),x.getBranchStatus()):r.error(a.error||"重置到指定提交失败")}catch(o){o!=="cancel"&&(console.error("重置到指定提交出错:",o),r.error("重置到指定提交失败: "+(o.message||o)))}}function lt(){if(console.log("检查是否需要加载更多数据"),z.value||!b.value||I.value||O.value||N.value){console.log("不满足加载条件:",{showGraphView:z.value,hasMoreData:b.value,isLoadingMore:I.value,isLoading:O.value,showAllCommits:N.value});return}if(!Te.value){console.log("表格容器不存在,重新设置滚动监听"),y();return}const{scrollTop:u,scrollHeight:o,clientHeight:a}=Te.value,t=o-u-a;console.log("表格滚动位置:",{scrollTop:u,scrollHeight:o,clientHeight:a,scrollDistance:t}),t<=50&&(console.log("表格已滚动到底部,加载更多数据"),_())}return Qe(()=>z.value,u=>{!u&&!N.value&&(console.log("切换到表格视图,设置滚动监听和定时检查"),Ze(()=>{y(),setTimeout(lt,200)}))}),(u,o)=>{var q;const a=yt,t=At,te=Jt,K=Ht;return p(),w(Se,null,[e("div",Vl,[re.value?(p(),w("div",Rl,"提交历史已刷新")):Q("",!0),e("div",Bl,[o[14]||(o[14]=e("div",{class:"header-left"},[e("h2",null,"提交历史")],-1)),e("div",Ml,[z.value?Q("",!0):(p(),ae(i(Oe),{key:0,type:de.value?"primary":"default",size:"small",onClick:o[0]||(o[0]=S=>de.value=!de.value),class:qe(["action-button filter-button",{"active-filter":de.value}])},{icon:l(()=>[s(a,null,{default:l(()=>[s(i(ps))]),_:1})]),default:l(()=>[o[13]||(o[13]=T(" 筛选 ")),Ue.value.length!==m.value.length?(p(),ae(i(fs),{key:0,value:Ue.value.length,class:"filter-badge"},null,8,["value"])):Q("",!0)]),_:1},8,["type","class"])),s(i(Oe),{type:"primary",size:"small",onClick:Ke,class:qe(["action-button view-mode-button",{"active-view":z.value}])},{icon:l(()=>[s(a,null,{default:l(()=>[(p(),ae(Dt(z.value?i(It):i(vs))))]),_:1})]),default:l(()=>[T(" "+R(z.value?"表格视图":"图表视图"),1)]),_:1},8,["class"]),s(i(Oe),{type:"success",size:"small",onClick:st,loading:O.value,class:qe(["action-button commit-display-button",{"active-commits":N.value}])},{icon:l(()=>[s(a,null,{default:l(()=>[(p(),ae(Dt(N.value?i(ms):i(gs))))]),_:1})]),default:l(()=>[T(" "+R(N.value?"显示分页加载":"显示所有提交"),1)]),_:1},8,["loading","class"]),s(i(Oe),{circle:"",size:"small",onClick:o[1]||(o[1]=S=>ue()),class:qe([{"refresh-button-animated":re.value},"action-button refresh-button"])},{default:l(()=>[O.value?(p(),ae(a,{key:1},{default:l(()=>[s(i(hs))]),_:1})):(p(),ae(a,{key:0},{default:l(()=>[s(i(Vt))]),_:1}))]),_:1},8,["class"])])]),de.value&&!z.value?(p(),w("div",zl,[e("div",El,[e("div",Dl,[s(i(mt),{modelValue:L.value,"onUpdate:modelValue":o[2]||(o[2]=S=>L.value=S),placeholder:"选择作者",multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{prefix:l(()=>o[15]||(o[15]=[e("span",{class:"compact-label"},"作者",-1)])),default:l(()=>[(p(!0),w(Se,null,ze(M.value,S=>(p(),ae(i(vt),{key:S,label:S,value:S},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e("div",Gl,[s(i(mt),{modelValue:F.value,"onUpdate:modelValue":o[3]||(o[3]=S=>F.value=S),placeholder:"选择分支",multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{prefix:l(()=>o[16]||(o[16]=[e("span",{class:"compact-label"},"分支",-1)])),default:l(()=>[(p(!0),w(Se,null,ze(he.value,S=>(p(),ae(i(vt),{key:S,label:S,value:S},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e("div",jl,[s(i(Rt),{modelValue:g.value,"onUpdate:modelValue":o[4]||(o[4]=S=>g.value=S),placeholder:"提交信息关键词",clearable:"",class:"filter-input",size:"small"},{prefix:l(()=>o[17]||(o[17]=[e("span",{class:"compact-label"},"信息",-1)])),_:1},8,["modelValue"])]),e("div",Ol,[s(i(ys),{modelValue:E.value,"onUpdate:modelValue":o[5]||(o[5]=S=>E.value=S),type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",class:"filter-input date-range",size:"small"},{prefix:l(()=>o[18]||(o[18]=[e("span",{class:"compact-label"},"日期",-1)])),_:1},8,["modelValue"])]),e("div",Pl,[s(i(Oe),{type:"primary",size:"small",onClick:He,class:"filter-action-button"},{default:l(()=>o[19]||(o[19]=[T("应用")])),_:1}),s(i(Oe),{type:"info",size:"small",onClick:le,class:"filter-action-button"},{default:l(()=>o[20]||(o[20]=[T("重置")])),_:1})])])])):Q("",!0),e("div",{class:qe(["content-area",{"with-filter":de.value&&!z.value}])},[j.value?(p(),w("div",Ul,R(j.value),1)):(p(),w("div",Fl,[z.value?(p(),w("div",Nl,[i(f).length>0?(p(),w("div",Il," 显示 "+R(i(f).length)+" 条提交记录 "+R(N.value?"(全部)":"(分页加载,每页100条)"),1)):Q("",!0),e("div",Hl,[e("div",Xl,[s(i(Oe),{type:"primary",circle:"",size:"small",onClick:we,disabled:Z.value<=nt},{default:l(()=>[s(a,null,{default:l(()=>[s(i(ws))]),_:1})]),_:1},8,["disabled"]),s(i(_s),{modelValue:Z.value,"onUpdate:modelValue":o[6]||(o[6]=S=>Z.value=S),min:nt,max:pt,step:xt,onChange:fe,class:"zoom-slider"},null,8,["modelValue"]),s(i(Oe),{type:"primary",circle:"",size:"small",onClick:Ae,disabled:Z.value>=pt},{default:l(()=>[s(a,null,{default:l(()=>[s(i($s))]),_:1})]),_:1},8,["disabled"]),s(i(Oe),{type:"primary",size:"small",onClick:Re},{default:l(()=>o[21]||(o[21]=[T(" 自适应大小 ")])),_:1})]),e("div",Wl," 缩放: "+R(Math.round(Z.value*100))+"% ",1)]),e("div",{ref_key:"graphContainer",ref:Y,class:"graph-container"},null,512)])):(p(),w("div",Jl,[rt((p(),ae(i(bs),{ref_key:"tableRef",ref:be,data:Ue.value,stripe:"",border:"",class:"log-table","empty-text":O.value?"加载中...":"没有匹配的提交记录",height:"500",onRowContextmenu:dt},{default:l(()=>[s(i(at),{width:"60","class-name":"branch-graph-column"},{default:l(S=>[e("div",{class:"branch-graph-cell",id:`commit-graph-${S.row.hash.substring(0,7)}`},null,8,ql)]),_:1}),s(i(at),{label:"提交哈希",width:"100",resizable:""},{default:l(S=>[e("span",{class:"commit-hash",onClick:oe=>$e(S.row)},R(S.row.hash.substring(0,7)),9,Yl)]),_:1}),s(i(at),{prop:"date",label:"日期",width:"120",resizable:""}),s(i(at),{label:"作者",width:"120",resizable:""},{default:l(S=>[s(t,{content:S.row.email,placement:"top","hide-after":1e3},{default:l(()=>[e("span",Zl,R(S.row.author),1)]),_:2},1032,["content"])]),_:1}),s(i(at),{label:"分支",width:"180",resizable:""},{default:l(S=>[S.row.branch?(p(),w("div",Kl,[(p(!0),w(Se,null,ze(S.row.branch.split(","),(oe,X)=>(p(),ae(i(ht),{key:X,size:"small",type:Ie(oe),class:"branch-tag"},{default:l(()=>[T(R(Ye(oe)),1)]),_:2},1032,["type"]))),128))])):Q("",!0)]),_:1}),s(i(at),{prop:"message",label:"提交信息","min-width":"250"})]),_:1},8,["data","empty-text"])),[[K,O.value]]),N.value?Q("",!0):(p(),w("div",Ql,[e("div",eo,[e("span",null,"第 "+R(A.value)+" 页 "+R(ee.value>0?`/ 共 ${Math.ceil(ee.value/100)||1} 页`:"")+" (总计 "+R(ee.value)+" 条记录)",1)]),I.value?(p(),w("div",to,o[22]||(o[22]=[e("div",{class:"loading-spinner"},null,-1),e("span",null,"加载更多...",-1)]))):b.value?(p(),w("div",{key:1,class:"load-more-button",onClick:_},o[23]||(o[23]=[e("span",null,"加载更多",-1)]))):(p(),w("div",so,[o[24]||(o[24]=e("span",null,"没有更多数据了",-1)),m.value.length>0?(p(),w("span",ao,"(已加载 "+R(m.value.length)+" 条记录)",1)):Q("",!0)]))]))]))]))],2),s(i(wt),{modelValue:W.value,"onUpdate:modelValue":o[7]||(o[7]=S=>W.value=S),title:`提交详情: ${(q=U.value)!=null&&q.hash?U.value.hash.substring(0,7):"未知"}`,width:"80%","destroy-on-close":"",class:"commit-detail-dialog"},{default:l(()=>[rt((p(),w("div",lo,[U.value?(p(),w("div",oo,[e("div",no,[e("div",ro,[o[25]||(o[25]=e("span",{class:"item-label"},"哈希:",-1)),e("span",io,R(U.value.hash),1)]),e("div",co,[o[26]||(o[26]=e("span",{class:"item-label"},"作者:",-1)),e("span",uo,R(U.value.author)+" <"+R(U.value.email)+">",1)]),e("div",fo,[o[27]||(o[27]=e("span",{class:"item-label"},"日期:",-1)),e("span",po,R(U.value.date),1)])]),e("div",vo,[o[28]||(o[28]=e("div",{class:"message-label"},"提交信息:",-1)),e("div",{class:"message-content",innerHTML:d(U.value.message).replace(/\n/g,"<br>")},null,8,mo)])])):Q("",!0),e("div",go,[e("div",ho,[o[29]||(o[29]=e("h3",null,"变更文件",-1)),me.value.length===0?(p(),ae(te,{key:0,description:"没有找到变更文件"})):(p(),w("ul",yo,[(p(!0),w(Se,null,ze(me.value,S=>(p(),w("li",{key:S,class:qe({"active-file":S===se.value}),onClick:oe=>_e(U.value.hash,S)},R(S),11,wo))),128))]))]),e("div",_o,[se.value?(p(),w("h3",$o," 文件差异: "+R(se.value),1)):(p(),w("h3",bo,"文件差异")),!C.value&&!ne.value?(p(),ae(te,{key:2,description:"选择文件查看差异"})):C.value?(p(),w("div",{key:3,innerHTML:v(C.value),class:"diff-content"},null,8,Co)):Q("",!0)])])])),[[K,ne.value]])]),_:1},8,["modelValue","title"])]),rt(e("div",{class:"context-menu",style:Lt({top:Me.value+"px",left:xe.value+"px"})},[e("div",{class:"context-menu-item",onClick:o[8]||(o[8]=S=>$e(k.value))},o[30]||(o[30]=[e("i",{class:"el-icon-view"},null,-1),T(" 查看详情 ")])),e("div",{class:"context-menu-item",onClick:o[9]||(o[9]=S=>kt(k.value))},o[31]||(o[31]=[e("i",{class:"el-icon-document-copy"},null,-1),T(" 复制提交哈希 ")])),e("div",{class:"context-menu-item",onClick:o[10]||(o[10]=S=>St(k.value))},o[32]||(o[32]=[e("i",{class:"el-icon-refresh-right"},null,-1),T(" 重置到该提交(hard) ")])),e("div",{class:"context-menu-item",onClick:o[11]||(o[11]=S=>bt(k.value))},o[33]||(o[33]=[e("i",{class:"el-icon-delete"},null,-1),T(" 撤销提交 (Revert) ")])),e("div",{class:"context-menu-item",onClick:o[12]||(o[12]=S=>Ct(k.value))},o[34]||(o[34]=[e("i",{class:"el-icon-edit"},null,-1),T(" Cherry-Pick 到当前分支 ")]))],4),[[Wt,ie.value]])],64)}}}),So=_t(ko,[["__scopeId","data-v-9a51654c"]]),To="data:image/svg+xml,%3csvg%20width='200'%20height='200'%20viewBox='0%200%20200%20200'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20主分支%20--%3e%3cline%20x1='40'%20y1='40'%20x2='40'%20y2='160'%20stroke='%2334495e'%20stroke-width='8'%20stroke-linecap='round'%20/%3e%3c!--%20特性分支%20--%3e%3cpath%20d='M40,70%20C60,70%2080,90%2080,110%20L80,130'%20stroke='%233498db'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20开发分支%20--%3e%3cpath%20d='M40,100%20C60,100%20100,110%20100,130%20L100,160'%20stroke='%232ecc71'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20修复分支%20--%3e%3cpath%20d='M40,130%20C60,130%20120,140%20120,160'%20stroke='%23e74c3c'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20合并点%20--%3e%3cpath%20d='M80,130%20C80,145%2060,145%2040,145'%20stroke='%233498db'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20节点%20--%3e%3ccircle%20cx='40'%20cy='40'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='70'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='100'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='130'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='145'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='160'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='80'%20cy='130'%20r='10'%20fill='%233498db'%20/%3e%3ccircle%20cx='100'%20cy='160'%20r='10'%20fill='%232ecc71'%20/%3e%3ccircle%20cx='120'%20cy='160'%20r='10'%20fill='%23e74c3c'%20/%3e%3c/svg%3e",xo={class:"main-header"},Lo={class:"header-left"},Ao=["src"],Vo={class:"header-info"},Ro={key:0,id:"user-info"},Bo={class:"user-name"},Mo={class:"user-email"},zo={key:1,id:"user-info"},Eo={class:"directory-selector"},Do={class:"directory-display"},Go={class:"directory-icon"},jo=["title"],Oo={class:"directory-actions"},Po={class:"main-container"},Uo={key:0,class:"loading-container"},Fo={class:"loading-spinner"},No={key:1,class:"grid-layout"},Io={class:"git-status-panel"},Ho={key:0,class:"commit-form-panel"},Xo={key:0,class:"card"},Wo={class:"tips"},Jo={key:1,class:"commit-form-panel"},qo={key:2,class:"log-list-panel"},Yo={class:"dialog-footer"},Zo={class:"main-footer"},Ko={key:0,class:"branch-info"},Qo={class:"branch-wrapper"},en={key:1,class:"footer-right"},tn={class:"repo-url"},sn={class:"dialog-footer"},an={class:"directory-input-group"},ln={class:"recent-directories"},on={class:"dialog-footer"},nn=gt({__name:"App",setup(ke){const h=c(""),x=c(null),f=c(null),m=ct(),j=Yt(),V=c(!1),O=c("");function N(){j.config&&(h.value=`默认提交信息: ${j.config.defaultCommitMessage}`)}async function ee(){try{const n=await(await fetch("/api/current_directory")).json();return O.value=n.directory||"未知目录",n}catch(y){return console.error("获取当前目录失败:",y),{directory:"未知目录",isGitRepo:!1}}}ut(async()=>{console.log("---------- 页面初始化开始 ----------");try{const y=await ee();j.isLoaded||await j.loadConfig(),N(),m.isGitRepo=y.isGitRepo===!0,m.lastCheckedTime=Date.now(),m.isGitRepo?await Promise.all([m.getCurrentBranch(),m.getAllBranches(),m.getUserInfo(),m.getRemoteUrl()]):r.warning("当前目录不是Git仓库,部分功能将不可用")}catch(y){console.error("初始化失败:",y)}finally{V.value=!0,console.log("---------- 页面初始化完成 ----------"),setTimeout(()=>{F()},100)}});const z=c(!1),Y=c(""),A=c("");async function b(){await m.createBranch(Y.value,A.value)&&(z.value=!1,Y.value="",f.value&&f.value.refreshStatus(),x.value&&x.value.refreshLog())}function I(){A.value=m.currentBranch,z.value=!0}async function H(y){await m.changeBranch(y)&&(f.value&&f.value.refreshStatus(),x.value&&x.value.refreshLog())}const W=c(!1),U=c(""),me=c("");function C(){U.value=m.userName,me.value=m.userEmail,W.value=!0}async function ne(){if(!U.value||!me.value){r.warning("用户名和邮箱不能为空");return}await m.restoreUserConfig(U.value,me.value)&&(W.value=!1)}async function se(){await m.clearUserConfig()&&(U.value="",me.value="")}let Z=!1,re=!1,de=0,L=0,g="",E="";function M(){const y=document.querySelector(".grid-layout");if(!y)return;const n=getComputedStyle(y).gridTemplateColumns.split(" "),P=getComputedStyle(y).gridTemplateRows.split(" ");if(n.length>=3&&P.length>=3){const D=parseFloat(n[0]),ue=parseFloat(n[2]),Ae=D+ue,we=D/Ae,fe=parseFloat(P[0]),Re=parseFloat(P[2]),$e=fe+Re,_e=fe/$e;localStorage.setItem("zen-gitsync-layout-left-ratio",we.toString()),localStorage.setItem("zen-gitsync-layout-top-ratio",_e.toString()),console.log(`布局比例已保存 - 左侧: ${(we*100).toFixed(0)}%, 上方: ${(_e*100).toFixed(0)}%`)}}function F(){const y=document.querySelector(".grid-layout");if(!y)return;const n=localStorage.getItem("zen-gitsync-layout-left-ratio"),P=localStorage.getItem("zen-gitsync-layout-top-ratio");if(n){const D=parseFloat(n),ue=1-D;y.style.gridTemplateColumns=`${D}fr 8px ${ue}fr`,console.log(`已恢复左侧比例: ${(D*100).toFixed(0)}%`)}else y.style.gridTemplateColumns="1fr 8px 3fr";if(P){const D=parseFloat(P),ue=1-D;y.style.gridTemplateRows=`${D}fr 8px ${ue}fr`,console.log(`已恢复上方比例: ${(D*100).toFixed(0)}%`)}}function he(y){var P;Z=!0,de=y.clientX;const n=document.querySelector(".grid-layout");g=getComputedStyle(n).gridTemplateColumns,(P=document.getElementById("v-resizer"))==null||P.classList.add("active"),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",Me),y.preventDefault()}function ie(y){if(!Z)return;const n=document.querySelector(".grid-layout"),P=y.clientX-de,D=g.split(" ");if(D.length>=3){const ue=parseFloat(D[0]),Ae=parseFloat(D[2]),we=ue+Ae,fe=(ue+P/n.clientWidth*we)/we,Re=1-fe,$e=.1,_e=.5;fe<$e?n.style.gridTemplateColumns=`${$e}fr 8px ${1-$e}fr`:fe>_e?n.style.gridTemplateColumns=`${_e}fr 8px ${1-_e}fr`:n.style.gridTemplateColumns=`${fe}fr 8px ${Re}fr`}}function Me(){var y;Z=!1,(y=document.getElementById("v-resizer"))==null||y.classList.remove("active"),document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",Me),M()}function xe(y){var P;re=!0,L=y.clientY;const n=document.querySelector(".grid-layout");E=getComputedStyle(n).gridTemplateRows,(P=document.getElementById("h-resizer"))==null||P.classList.add("active"),document.addEventListener("mousemove",k),document.addEventListener("mouseup",ye),y.preventDefault()}function k(y){if(!re)return;const n=document.querySelector(".grid-layout"),P=y.clientY-L,D=E.split(" ");if(D.length>=3){const ue=parseFloat(D[0]),Ae=parseFloat(D[2]),we=ue+Ae,fe=(ue+P/n.clientHeight*we)/we,Re=1-fe,$e=.2,_e=.8;fe<$e?n.style.gridTemplateRows=`${$e}fr 8px ${1-$e}fr`:fe>_e?n.style.gridTemplateRows=`${_e}fr 8px ${1-_e}fr`:n.style.gridTemplateRows=`${fe}fr 8px ${Re}fr`}}function ye(){var y;re=!1,(y=document.getElementById("h-resizer"))==null||y.classList.remove("active"),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",ye),M()}const ge=c(!1),Le=c(""),Pe=c(!1),Ue=c([]);async function Fe(){if(!O.value){r.warning("当前目录路径为空");return}try{await navigator.clipboard.writeText(O.value),r.success("已复制目录路径")}catch(y){console.error("复制目录路径失败:",y),r.error(`复制失败: ${y.message}`)}}function Ne(){Le.value=O.value,ge.value=!0,Ke()}async function Ke(){try{const n=await(await fetch("/api/recent_directories")).json();n.success&&Array.isArray(n.directories)&&(Ue.value=n.directories)}catch(y){console.error("获取最近目录失败:",y)}}async function st(){if(!Le.value){r.warning("目录路径不能为空");return}try{Pe.value=!0;const n=await(await fetch("/api/change_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:Le.value})})).json();n.success?(r.success("已切换工作目录"),O.value=n.directory,ge.value=!1,await Ye(n.directory),m.isGitRepo=n.isGitRepo,n.isGitRepo?(await Promise.all([m.getCurrentBranch(),m.getAllBranches(),m.getUserInfo(),m.getRemoteUrl()]),f.value&&f.value.refreshStatus(),x.value&&x.value.refreshLog()):(r.warning("当前目录不是Git仓库,部分功能将不可用"),m.$reset())):r.error(n.error||"切换目录失败")}catch(y){r.error(`切换目录失败: ${y.message}`)}finally{Pe.value=!1}}async function Ye(y){try{await fetch("/api/save_recent_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:y})})}catch(n){console.error("保存最近目录失败:",n)}}async function Ie(){try{if(!O.value){r.warning("当前目录路径为空");return}const n=await(await fetch("/api/open_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:O.value})})).json();n.success?r.success("已在文件管理器中打开目录"):n.error&&r.error(n.error)}catch(y){console.error("打开目录失败:",y),r.error(`打开目录失败: ${y.message}`)}}async function be(){try{const n=await(await fetch("/api/browse_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPath:Le.value||O.value})})).json();n.success?Te(n):n.error&&r.error(n.error)}catch(y){console.error("浏览目录失败:",y),r.error(`浏览目录失败: ${y.message}`)}}function Te(y){!y||!y.items||et.alert(Be("div",{class:"directory-browser"},[Be("div",{class:"current-path"},[Be("span",{class:"path-label"},"当前路径: "),Be("span",{class:"path-value"},y.path)]),Be("div",{class:"directory-list"},[y.parentPath?Be("div",{class:"directory-item parent-dir",onClick:()=>{De(y.parentPath)}},[Be("span",{class:"dir-icon"},Be("svg",{class:"folder-icon",viewBox:"0 0 24 24",width:"20",height:"20",style:{fill:"#E6A23C"}},[Be("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})])),Be("span",{class:"dir-name"},"返回上级目录")]):null,...y.items.map(n=>Be("div",{class:"directory-item",onClick:()=>{De(n.path)}},[Be("span",{class:"dir-icon"},Be("svg",{class:"folder-icon",viewBox:"0 0 24 24",width:"20",height:"20",style:{fill:"#409EFF"}},[Be("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})])),Be("span",{class:"dir-name"},n.name)]))])]),"浏览并选择目录",{confirmButtonText:"使用当前目录",customClass:"directory-browser-dialog",callback:n=>{n==="confirm"&&(Le.value=y.path)}})}async function De(y){try{et.close(),setTimeout(async()=>{try{const P=await(await fetch("/api/browse_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPath:y})})).json();P.success?Te(P):P.error&&r.error(P.error)}catch(n){console.error("浏览目录失败:",n),r.error(`浏览目录失败: ${n.message}`)}},100)}catch(n){console.error("处理目录选择时出错:",n),r.error(`处理目录选择时出错: ${n.message}`)}}return(y,n)=>{const P=yt,D=Oe,ue=qt,Ae=Rt,we=Ss,fe=vt,Re=mt,$e=ks,_e=wt,v=Xt,d=ht;return p(),w(Se,null,[e("header",xo,[e("div",Lo,[e("img",{src:i(To),alt:"Zen GitSync Logo",class:"logo"},null,8,Ao),n[14]||(n[14]=e("h1",null,"Zen GitSync UI",-1))]),e("div",Vo,[i(m).userName&&i(m).userEmail?(p(),w("div",Ro,[n[15]||(n[15]=e("span",{class:"user-label"},"用户:",-1)),e("span",Bo,R(i(m).userName),1),e("span",Mo,"<"+R(i(m).userEmail)+">",1),s(D,{type:"primary",size:"small",onClick:C,class:"user-settings-btn",circle:""},{default:l(()=>[s(P,null,{default:l(()=>[s(i(it))]),_:1})]),_:1})])):(p(),w("div",zo,[n[16]||(n[16]=e("span",{class:"user-label"},"用户: ",-1)),n[17]||(n[17]=e("span",{class:"user-warning"},"未配置",-1)),s(D,{type:"primary",size:"small",onClick:C,class:"user-settings-btn",circle:""},{default:l(()=>[s(P,null,{default:l(()=>[s(i(it))]),_:1})]),_:1})])),e("div",Eo,[e("div",Do,[e("div",Go,[s(P,null,{default:l(()=>[s(i(Gt))]),_:1})]),e("div",{class:"directory-path",title:O.value},R(O.value),9,jo)]),e("div",Oo,[s(D,{type:"primary",size:"small",onClick:Ne,class:"dir-button",circle:"",title:"切换目录"},{default:l(()=>[s(P,null,{default:l(()=>n[18]||(n[18]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192H128zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32z"})],-1)])),_:1})]),_:1}),s(D,{type:"success",size:"small",onClick:Ie,class:"dir-button",circle:"",title:"在资源管理器中打开"},{default:l(()=>[s(P,null,{default:l(()=>n[19]||(n[19]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 0 0-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"})],-1)])),_:1})]),_:1}),s(D,{type:"info",size:"small",onClick:Fe,class:"dir-button",circle:"",title:"复制路径"},{default:l(()=>[s(P,null,{default:l(()=>n[20]||(n[20]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64h64z"}),e("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64H384zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64z"})],-1)])),_:1})]),_:1})])])])]),e("main",Po,[V.value?(p(),w("div",No,[e("div",Io,[s(_a,{ref_key:"gitStatusRef",ref:f,"initial-directory":O.value},null,8,["initial-directory"])]),e("div",{class:"vertical-resizer",id:"v-resizer",onMousedown:he},null,32),i(m).isGitRepo?(p(),w("div",Ho,[!i(m).userName||!i(m).userEmail?(p(),w("div",Xo,[n[26]||(n[26]=e("h2",null,"Git用户未配置",-1)),n[27]||(n[27]=e("p",null,"请先配置Git用户信息才能进行提交操作。",-1)),e("div",Wo,[n[24]||(n[24]=e("h3",null,"您可以通过以下方式配置:",-1)),n[25]||(n[25]=e("ol",null,[e("li",null,"点击右上角的设置按钮,配置用户名和邮箱"),e("li",null,"或者使用命令行配置:"),e("div",{class:"code-block"},[T(' git config --global user.name "您的用户名"'),e("br"),T(' git config --global user.email "您的邮箱" ')])],-1)),s(D,{type:"primary",onClick:C},{default:l(()=>n[23]||(n[23]=[T(" 立即配置 ")])),_:1})])])):(p(),ae(Al,{key:1}))])):(p(),w("div",Jo,n[28]||(n[28]=[e("div",{class:"card",style:{padding:"20px"}},[e("h2",null,"Git仓库初始化"),e("p",null,"当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。"),e("div",{class:"tips"},[e("h3",null,"可以使用以下命令初始化仓库:"),e("div",{class:"code-block"},"git init")])],-1)]))),e("div",{class:"horizontal-resizer",id:"h-resizer",onMousedown:xe},null,32),i(m).isGitRepo?(p(),w("div",qo,[s(So,{ref_key:"logListRef",ref:x},null,512)])):Q("",!0),s(_e,{modelValue:z.value,"onUpdate:modelValue":n[3]||(n[3]=_=>z.value=_),title:"创建新分支",width:"30%","destroy-on-close":""},{footer:l(()=>[e("span",Yo,[s(D,{onClick:n[2]||(n[2]=_=>z.value=!1)},{default:l(()=>n[29]||(n[29]=[T("取消")])),_:1}),s(D,{type:"primary",onClick:b,loading:i(m).isCreatingBranch},{default:l(()=>n[30]||(n[30]=[T(" 创建 ")])),_:1},8,["loading"])])]),default:l(()=>[s($e,{model:{newBranchName:Y.value,selectedBaseBranch:A.value}},{default:l(()=>[s(we,{label:"新分支名称"},{default:l(()=>[s(Ae,{modelValue:Y.value,"onUpdate:modelValue":n[0]||(n[0]=_=>Y.value=_),placeholder:"请输入新分支名称"},null,8,["modelValue"])]),_:1}),s(we,{label:"基于分支"},{default:l(()=>[s(Re,{modelValue:A.value,"onUpdate:modelValue":n[1]||(n[1]=_=>A.value=_),placeholder:"选择基础分支",style:{width:"100%"}},{default:l(()=>[(p(!0),w(Se,null,ze(i(m).allBranches,_=>(p(),ae(fe,{key:_,label:_,value:_},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])):(p(),w("div",Uo,[s(ue,{class:"loading-card"},{default:l(()=>[e("div",Fo,[s(P,{class:"is-loading"},{default:l(()=>n[21]||(n[21]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})],-1)])),_:1})]),n[22]||(n[22]=e("div",{class:"loading-text"},"加载中...",-1))]),_:1})]))]),e("footer",Zo,[i(m).currentBranch?(p(),w("div",Ko,[e("div",Qo,[n[32]||(n[32]=e("span",{class:"branch-label"},"当前分支:",-1)),s(Re,{modelValue:i(m).currentBranch,"onUpdate:modelValue":n[4]||(n[4]=_=>i(m).currentBranch=_),size:"small",onChange:H,loading:i(m).isChangingBranch,class:"branch-select"},{default:l(()=>[(p(!0),w(Se,null,ze(i(m).allBranches,_=>(p(),ae(fe,{key:_,label:_,value:_},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"]),s(D,{type:"primary",size:"small",onClick:I,class:"create-branch-btn"},{default:l(()=>[s(P,null,{default:l(()=>[s(i(Ts))]),_:1}),n[31]||(n[31]=T(" 新建分支 "))]),_:1})])])):Q("",!0),i(m).remoteUrl?(p(),w("div",en,[n[34]||(n[34]=e("span",{class:"repo-url-label"},"远程仓库:",-1)),e("span",tn,R(i(m).remoteUrl),1),s(D,{type:"primary",circle:"",size:"small",onClick:n[5]||(n[5]=_=>i(m).copyRemoteUrl()),class:"copy-url-btn",title:"复制仓库地址"},{default:l(()=>[s(P,null,{default:l(()=>n[33]||(n[33]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64h64z"}),e("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64H384zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64z"})],-1)])),_:1})]),_:1})])):Q("",!0)]),s(_e,{modelValue:W.value,"onUpdate:modelValue":n[9]||(n[9]=_=>W.value=_),title:"Git用户设置",width:"30%","destroy-on-close":""},{footer:l(()=>[e("span",sn,[s(D,{type:"danger",onClick:se},{default:l(()=>n[36]||(n[36]=[T(" 清除配置 ")])),_:1}),s(D,{onClick:n[8]||(n[8]=_=>W.value=!1)},{default:l(()=>n[37]||(n[37]=[T("取消")])),_:1}),s(D,{type:"primary",onClick:ne},{default:l(()=>n[38]||(n[38]=[T(" 保存 ")])),_:1})])]),default:l(()=>[s($e,null,{default:l(()=>[s(we,{label:"用户名"},{default:l(()=>[s(Ae,{modelValue:U.value,"onUpdate:modelValue":n[6]||(n[6]=_=>U.value=_),placeholder:"请输入Git用户名"},null,8,["modelValue"])]),_:1}),s(we,{label:"邮箱"},{default:l(()=>[s(Ae,{modelValue:me.value,"onUpdate:modelValue":n[7]||(n[7]=_=>me.value=_),placeholder:"请输入Git邮箱"},null,8,["modelValue"])]),_:1}),s(we,null,{default:l(()=>[s(v,{type:"info",closable:!1,"show-icon":""},{default:l(()=>n[35]||(n[35]=[T(" 这些设置将影响全局Git配置,对所有Git仓库生效。 ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),s(_e,{modelValue:ge.value,"onUpdate:modelValue":n[13]||(n[13]=_=>ge.value=_),title:"切换工作目录",width:"50%","destroy-on-close":""},{footer:l(()=>[e("span",on,[s(D,{onClick:n[11]||(n[11]=_=>ge.value=!1)},{default:l(()=>n[40]||(n[40]=[T("取消")])),_:1}),s(D,{type:"primary",onClick:n[12]||(n[12]=_=>st()),loading:Pe.value},{default:l(()=>n[41]||(n[41]=[T(" 切换 ")])),_:1},8,["loading"])])]),default:l(()=>[s($e,null,{default:l(()=>[s(we,{label:"目录路径"},{default:l(()=>[e("div",an,[s(Ae,{modelValue:Le.value,"onUpdate:modelValue":n[10]||(n[10]=_=>Le.value=_),placeholder:"请输入目录路径"},null,8,["modelValue"]),s(D,{type:"primary",onClick:be},{default:l(()=>[s(P,null,{default:l(()=>[s(i(Gt))]),_:1}),n[39]||(n[39]=T(" 浏览 "))]),_:1})])]),_:1}),Ue.value.length>0?(p(),ae(we,{key:0,label:"常用目录"},{default:l(()=>[e("div",ln,[(p(!0),w(Se,null,ze(Ue.value,(_,le)=>(p(),ae(d,{key:le,class:"recent-dir-tag",onClick:He=>Le.value=_,effect:"plain"},{default:l(()=>[T(R(_),1)]),_:2},1032,["onClick"]))),128))])]),_:1})):Q("",!0)]),_:1})]),_:1},8,["modelValue"])],64)}}}),rn=_t(nn,[["__scopeId","data-v-98ed32bc"]]),Zt=xs(rn);Zt.use(Ls());Zt.mount("#app");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.card[data-v-4361e2ea]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;border:1px solid rgba(0,0,0,.03);height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden}.status-header[data-v-4361e2ea]{display:flex;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid #f0f0f0}.status-header h2[data-v-4361e2ea]{margin:0;font-size:16px;font-weight:500;color:#303133}.header-actions[data-v-4361e2ea]{display:flex;align-items:center}.card-content[data-v-4361e2ea]{padding:15px;overflow-y:auto;flex:1;display:flex;flex-direction:column}.current-directory[data-v-4361e2ea]{display:none}.status-box[data-v-4361e2ea]{white-space:pre-wrap;font-family:monospace;background-color:#f8f9fa;padding:16px;border-radius:6px;margin-bottom:20px;max-height:200px;overflow-y:auto;border:1px solid #f0f0f0;font-size:14px;line-height:1.5}.file-list-container[data-v-4361e2ea]{flex:1;overflow:hidden;display:flex;flex-direction:column;margin-bottom:0;gap:12px;height:auto;min-height:100px}.file-group[data-v-4361e2ea]{background-color:#f8f9fa;border-radius:6px;overflow:hidden;border:1px solid #ebeef5;margin-bottom:12px;display:flex;flex-direction:column}.file-group[data-v-4361e2ea]{flex:0 1 auto}.file-group[data-v-4361e2ea]:last-child{margin-bottom:0;flex:1 1 auto}.file-group-header[data-v-4361e2ea]{font-size:14px;font-weight:700;padding:8px 12px;background-color:#f0f2f5;color:#606266;border-bottom:1px solid #ebeef5;flex-shrink:0}.file-list[data-v-4361e2ea]{overflow-y:auto;min-height:40px;max-height:200px;flex-grow:1;padding:0;margin:0;scrollbar-width:thin;scrollbar-color:rgba(144,147,153,.3) transparent}.file-list[data-v-4361e2ea]::-webkit-scrollbar{width:6px;height:6px}.file-list[data-v-4361e2ea]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:4px}.file-list[data-v-4361e2ea]::-webkit-scrollbar-thumb:hover{background-color:#90939980}.file-list[data-v-4361e2ea]::-webkit-scrollbar-track{background-color:transparent}.file-list[data-v-4361e2ea]:empty{display:none}.file-list[data-v-4361e2ea]:has(.empty-file-group){overflow-y:hidden}.empty-file-container[data-v-4361e2ea]{overflow-y:hidden!important;display:flex;flex-direction:column;align-items:stretch;flex:1}.empty-file-group[data-v-4361e2ea]{padding:16px;text-align:center;color:#909399;font-size:13px;font-style:italic;display:flex;align-items:center;justify-content:center;min-height:50px;background-color:#f8f9fa;border-radius:4px;margin:8px}.file-group[data-v-4361e2ea]:nth-child(1){flex:0 1 auto}.file-group[data-v-4361e2ea]:nth-child(2){flex:0 1 auto}.file-group[data-v-4361e2ea]:nth-child(3){flex:1 1 auto}.file-item[data-v-4361e2ea]{padding:8px 12px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ebeef5;cursor:pointer;transition:background-color .2s}.file-item[data-v-4361e2ea]:last-child{border-bottom:none}.file-item[data-v-4361e2ea]:hover{background-color:#ecf5ff}.file-info[data-v-4361e2ea]{display:flex;align-items:center;flex-grow:1;overflow:hidden;white-space:nowrap;gap:8px}.file-status-indicator[data-v-4361e2ea]{width:6px;height:6px;border-radius:50%;background-color:#409eff;flex-shrink:0}.file-status-indicator.added[data-v-4361e2ea]{background-color:#67c23a}.file-status-indicator.modified[data-v-4361e2ea]{background-color:#409eff}.file-status-indicator.deleted[data-v-4361e2ea]{background-color:#f56c6c}.file-status-indicator.untracked[data-v-4361e2ea]{background-color:#e6a23c}.file-path-container[data-v-4361e2ea]{display:flex;flex-direction:column;overflow:hidden}.file-name[data-v-4361e2ea]{font-weight:500;color:#303133;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.file-directory[data-v-4361e2ea]{font-size:12px;color:#909399;max-width:200px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.file-actions[data-v-4361e2ea]{display:flex;gap:5px;opacity:0;transition:opacity .2s}.file-item:hover .file-actions[data-v-4361e2ea]{opacity:1}.empty-status[data-v-4361e2ea]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;background-color:#f9f9f9;border-radius:8px;flex-grow:1}.empty-icon[data-v-4361e2ea]{width:60px;height:60px;display:flex;align-items:center;justify-content:center;background-color:#ebeef5;border-radius:50%;margin-bottom:15px;font-size:24px;color:#909399;animation:pulse-4361e2ea 2s infinite ease-in-out}@keyframes pulse-4361e2ea{0%{transform:scale(1);opacity:.7}50%{transform:scale(1.05);opacity:1}to{transform:scale(1);opacity:.7}}.empty-text[data-v-4361e2ea]{font-size:16px;font-weight:500;color:#606266;margin-bottom:5px}.empty-subtext[data-v-4361e2ea]{font-size:14px;color:#909399;margin-bottom:20px}.status-box-wrap[data-v-4361e2ea]{height:100%;display:flex;flex-direction:column}.branch-status-info[data-v-4361e2ea]{margin-bottom:15px;background-color:#f8f9fa;border-radius:8px;overflow:hidden;border:1px solid #ebeef5}.branch-sync-status[data-v-4361e2ea]{display:flex;align-items:center;padding:12px 15px;border-left:3px solid #e6a23c;margin-bottom:0;background-color:#fdf6ec}.git-status-message[data-v-4361e2ea],.branch-info[data-v-4361e2ea]{display:none}.card-content[data-v-4361e2ea]:empty{display:flex;align-items:center;justify-content:center;background-color:#f8f9fa;border-radius:6px;border:1px dashed #dcdfe6;color:#909399;height:100%}.card-content[data-v-4361e2ea]:empty:after{content:"没有Git状态信息可显示";font-size:14px}.browser-current-path[data-v-4361e2ea]{font-family:monospace;margin-bottom:15px;padding:10px;background-color:#f5f7fa;border-radius:6px;overflow-x:auto;white-space:nowrap;border:1px solid #ebeef5}.browser-error[data-v-4361e2ea]{color:#f56c6c;margin:10px 0;padding:10px;background-color:#fef0f0;border-radius:4px;border-left:3px solid #f56c6c}.browser-nav[data-v-4361e2ea]{display:flex;gap:10px;margin-bottom:10px}.no-padding-left[data-v-4361e2ea]{padding-left:12px}.directory-browser[data-v-4361e2ea]{height:400px;border:1px solid #ebeef5;border-radius:6px;overflow:hidden;display:flex;flex-direction:column}.directory-items-container[data-v-4361e2ea]{flex:1;overflow-y:auto;background-color:#f8f9fa;padding:10px}.directory-items[data-v-4361e2ea]{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.directory-item[data-v-4361e2ea]{display:flex;align-items:center;padding:8px;cursor:pointer;border-radius:4px;background-color:#fff;border:1px solid #ebeef5;transition:all .2s;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;gap:5px}.directory-item[data-v-4361e2ea]:hover{background-color:#ecf5ff;border-color:#c6e2ff}.directory-item.directory[data-v-4361e2ea]{background-color:#f0f7ff;color:#409eff}.directory-item .el-icon[data-v-4361e2ea]{margin-right:5px;flex-shrink:0}.directory-item.directory .el-icon[data-v-4361e2ea]{color:#409eff}.directory-item.file .el-icon[data-v-4361e2ea]{color:#909399}.directory-buttons[data-v-4361e2ea]{display:flex;gap:10px;margin-top:10px}.sync-status-content[data-v-4361e2ea]{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.status-badges[data-v-4361e2ea]{display:flex;flex-direction:column;gap:8px;width:100%}.status-badge[data-v-4361e2ea]{display:flex;align-items:center;width:100%}.status-badge.el-tag--warning[data-v-4361e2ea]{background-color:#fdf6ec;border-color:#faecd8}.status-badge.el-tag--info[data-v-4361e2ea]{background-color:#f4f4f5;border-color:#e9e9eb}.badge-content[data-v-4361e2ea]{display:flex;align-items:center;gap:6px;font-size:13px}.diff-dialog[data-v-4361e2ea]{height:calc(100vh - 150px)}.diff-dialog-header[data-v-4361e2ea]{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #ebeef5;background-color:#f9f9fb}.file-title[data-v-4361e2ea]{display:flex;align-items:center;font-size:16px;font-weight:500;color:#303133;gap:10px;overflow:hidden}.file-icon[data-v-4361e2ea]{color:#409eff;font-size:20px}.file-path[data-v-4361e2ea]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:monospace}.diff-content[data-v-4361e2ea]{flex:1;overflow-y:auto;padding:10px 20px;background-color:#fafafa}[data-v-4361e2ea] .el-dialog__body{height:calc(100vh - 320px);overflow:auto}.diff-formatted[data-v-4361e2ea]{font-family:Consolas,Courier New,monospace;font-size:14px;line-height:1.5;white-space:pre-wrap;padding-bottom:20px}.no-diff[data-v-4361e2ea]{display:flex;align-items:center;justify-content:center;height:100%;color:#909399;font-size:14px}.file-navigation[data-v-4361e2ea]{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;border-top:1px solid #ebeef5;background-color:#f9f9fb}.counter-tag[data-v-4361e2ea]{font-family:monospace;font-size:14px;padding:6px 12px;min-width:80px;text-align:center}.nav-button[data-v-4361e2ea]{min-width:120px}.diff-formatted[data-v-4361e2ea]::-webkit-scrollbar,.diff-content[data-v-4361e2ea]::-webkit-scrollbar{width:6px;height:6px}.diff-formatted[data-v-4361e2ea]::-webkit-scrollbar-thumb,.diff-content[data-v-4361e2ea]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:4px}.diff-formatted[data-v-4361e2ea]::-webkit-scrollbar-thumb:hover,.diff-content[data-v-4361e2ea]::-webkit-scrollbar-thumb:hover{background-color:#90939980}.diff-formatted[data-v-4361e2ea]::-webkit-scrollbar-track,.diff-content[data-v-4361e2ea]::-webkit-scrollbar-track{background-color:transparent}.diff-formatted[data-v-4361e2ea],.diff-content[data-v-4361e2ea]{scrollbar-width:thin;scrollbar-color:rgba(144,147,153,.3) transparent}.diff-header{font-weight:700;background-color:#e6f1fc;padding:5px;margin:8px 0;border-radius:4px;color:#0366d6;border-bottom:1px solid #c8e1ff}.diff-old-file,.diff-new-file{color:#586069;padding:2px 5px;font-family:monospace}.diff-old-file{color:#cb2431}.diff-new-file{color:#22863a}.diff-hunk-header{color:#6f42c1;background-color:#f1f8ff;padding:2px 5px;margin:5px 0;border-radius:3px;font-family:monospace}.diff-added{background-color:#e6ffed;color:#22863a;padding:0 5px;border-left:4px solid #22863a;font-family:monospace;display:block;margin:2px 0}.diff-removed{background-color:#ffeef0;color:#cb2431;padding:0 5px;border-left:4px solid #cb2431;font-family:monospace;display:block;margin:2px 0}.diff-context{color:#444;padding:0 5px;font-family:monospace;display:block;margin:2px 0;background-color:#fafbfc}.auto-update-switch .el-switch__core{transition:all .3s ease-in-out;box-shadow:0 2px 5px #0000001a}.auto-update-switch .el-switch__core:hover{box-shadow:0 2px 8px #0003}.auto-update-switch.is-checked .el-switch__core{box-shadow:0 2px 5px #67c23a4d}.auto-update-switch.is-checked .el-switch__core:hover{box-shadow:0 2px 8px #67c23a80}@keyframes snakeBorder-872425f1{0%,to{border-top:2px solid #409EFF;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent}25%{border-top:2px solid #409EFF;border-right:2px solid #67C23A;border-bottom:2px solid transparent;border-left:2px solid transparent}50%{border-top:2px solid transparent;border-right:2px solid #67C23A;border-bottom:2px solid #409EFF;border-left:2px solid transparent}75%{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid #409EFF;border-left:2px solid #67C23A}}@keyframes glowPulse-872425f1{0%,to{box-shadow:0 0 8px #409eff66}50%{box-shadow:0 0 12px #67c23a80}}.card[data-v-872425f1]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;border:1px solid rgba(0,0,0,.03);height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden;position:relative}.card-header[data-v-872425f1]{padding:8px 16px;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;align-items:center}.card-header h2[data-v-872425f1]{margin:0;font-size:16px;font-weight:500;color:#303133}.card-content[data-v-872425f1]{padding:15px;overflow-y:auto;flex:1}.layout-container[data-v-872425f1]{display:flex;flex-direction:column;gap:15px;height:100%}.commit-section[data-v-872425f1]{flex:1;min-width:0}.actions-section[data-v-872425f1]{width:100%;flex-shrink:0}.actions-section h3[data-v-872425f1]{margin-top:0;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #dcdfe6;font-size:16px;color:#303133;font-weight:500}.operations-wrapper[data-v-872425f1]{display:flex;gap:10px}.action-groups[data-v-872425f1]{display:flex;flex-direction:column;gap:12px}.action-group[data-v-872425f1]{background-color:#f9f9f9;border-radius:6px;padding:8px 10px;box-shadow:0 1px 3px #0000000d;border-left:3px solid #409EFF;flex:1}.action-group[data-v-872425f1]:nth-child(2){border-left-color:#e6a23c}.action-group[data-v-872425f1]:nth-child(3){border-left-color:#909399}.group-title[data-v-872425f1]{font-size:13px;font-weight:700;margin-bottom:8px;color:#606266;text-align:left;display:block;position:relative;padding-left:6px;border-bottom:1px solid rgba(0,0,0,.06);padding-bottom:6px}.group-buttons[data-v-872425f1]{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;padding:0}.action-button[data-v-872425f1]{font-size:14px;font-weight:500;flex:1;min-width:100px;border-radius:4px;height:36px;padding:0 10px}.action-button[data-v-872425f1]:hover{transform:translateY(-1px);box-shadow:0 2px 5px #00000026}.action-button[data-v-872425f1]:active{transform:translateY(0)}.command-text[data-v-872425f1],.command-text-long[data-v-872425f1]{display:none}.standard-commit-form[data-v-872425f1]{display:flex;flex-direction:column;gap:15px;margin-bottom:15px}.standard-commit-header[data-v-872425f1]{display:flex;flex-direction:column;gap:10px;width:100%}.type-scope-container[data-v-872425f1]{display:flex;gap:10px;width:100%;margin-bottom:10px}.type-select[data-v-872425f1]{width:35%}.scope-wrapper[data-v-872425f1]{display:flex;align-items:center;gap:5px;width:65%}.description-container[data-v-872425f1]{display:flex;align-items:center;gap:5px;width:100%}.scope-input[data-v-872425f1],.description-input[data-v-872425f1]{flex-grow:1}.settings-button[data-v-872425f1]{flex-shrink:0}.preview-section[data-v-872425f1]{background-color:#f5f7fa;padding:10px;border-radius:4px}.preview-title[data-v-872425f1]{font-weight:700;margin-bottom:5px}.preview-content[data-v-872425f1]{white-space:pre-wrap;font-family:monospace;margin:0;padding:10px;background-color:#ebeef5;border-radius:4px}.template-container[data-v-872425f1]{display:flex;flex-direction:column;height:calc(85vh - 100px);overflow-y:auto;padding:5px}.template-form[data-v-872425f1]{margin-bottom:20px;background-color:#f8f9fa;padding:15px;border-radius:6px;border:1px solid #ebeef5}.template-form-buttons[data-v-872425f1]{display:flex;gap:10px;margin-top:12px;justify-content:flex-end}.template-input[data-v-872425f1]{flex-grow:1}.template-list[data-v-872425f1]{overflow-y:auto;height:100%}.template-list h3[data-v-872425f1]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.template-item[data-v-872425f1]{margin-bottom:10px;transition:all .2s ease;border:1px solid #ebeef5}.template-item[data-v-872425f1]:hover{background-color:#f5f7fa;transform:translateY(-2px);box-shadow:0 2px 12px #0000001a}.template-content[data-v-872425f1]{flex-grow:1;margin-right:10px;word-break:break-all;padding:5px 0;color:#303133;font-weight:500}.template-actions[data-v-872425f1]{display:flex;gap:8px;justify-content:flex-end;min-width:180px;flex-shrink:0}.options-row[data-v-872425f1]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.code-command[data-v-872425f1]{background-color:#2d2d2d;color:#f8f8f2;font-family:Courier New,Courier,monospace;padding:10px;border-radius:4px;overflow-x:auto;white-space:pre;font-size:14px}@media (min-width: 768px){.layout-container[data-v-872425f1]{flex-direction:row}.commit-section[data-v-872425f1]{flex:3}.actions-section[data-v-872425f1]{width:320px}.operations-wrapper[data-v-872425f1]{flex-direction:column}}.git-config-warning[data-v-872425f1]{width:100%}.config-command[data-v-872425f1]{background-color:#2d2d2d;color:#f8f8f2;font-family:Courier New,Courier,monospace;padding:10px;border-radius:4px;margin-top:10px;white-space:pre}@keyframes pushing-pulse-872425f1{0%{box-shadow:0 0 #67c23a66}70%{box-shadow:0 0 0 15px #67c23a00}to{box-shadow:0 0 #67c23a00}}@keyframes pushing-border-872425f1{0%{border-color:#67c23a}50%{border-color:#85ce61}to{border-color:#67c23a}}.card.is-pushing[data-v-872425f1]{animation:pushing-border-872425f1 1.5s infinite ease-in-out;box-shadow:0 4px 12px #0000001a;transition:all .3s ease}.push-button[data-v-872425f1]{background-color:#67c23a;border-color:#67c23a}.push-button[data-v-872425f1]:hover{background-color:#85ce61;border-color:#85ce61}.push-button.is-loading[data-v-872425f1],.push-button.is-loading[data-v-872425f1]:hover,.push-button.is-loading[data-v-872425f1]:focus{animation:pushing-pulse-872425f1 1.5s infinite;background-color:#67c23a!important;border-color:#67c23a!important}.el-button.push-button.is-loading .el-loading-spinner[data-v-872425f1]{color:#fff!important}@keyframes one-click-push-glow-872425f1{0%{box-shadow:0 0 5px #67c23a80}50%{box-shadow:0 0 20px #67c23acc}to{box-shadow:0 0 5px #67c23a80}}.action-button.one-click-push[data-v-872425f1]{position:relative;overflow:hidden}.action-button.one-click-push.is-loading[data-v-872425f1],.action-button.one-click-push.is-loading[data-v-872425f1]:hover{animation:one-click-push-glow-872425f1 1.5s infinite;background-color:#67c23a!important;border-color:#67c23a!important}@keyframes push-success-872425f1{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.push-success-indicator[data-v-872425f1]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#fff;border-radius:12px;padding:20px 30px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;align-items:center;justify-content:center;animation:push-success-872425f1 .5s ease-out;z-index:9999;width:200px;height:200px}.push-success-icon[data-v-872425f1]{font-size:64px;color:#67c23a;margin-bottom:16px;animation:bounce-872425f1 .8s ease-in-out}@keyframes bounce-872425f1{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-20px)}60%{transform:translateY(-10px)}}.push-success-text[data-v-872425f1]{font-size:20px;font-weight:700;color:#303133;text-align:center}.reset-button[data-v-872425f1]{background-color:#909399;border-color:#909399}.reset-button[data-v-872425f1]:hover{background-color:#a6a9ad;border-color:#a6a9ad}.el-button+.el-button[data-v-872425f1]{margin-left:0}.pushing-indicator[data-v-872425f1]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#409eff;border-radius:12px;padding:20px 30px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;width:200px;height:200px;color:#fff}.pushing-spinner[data-v-872425f1]{margin-bottom:16px}.pushing-text[data-v-872425f1]{font-size:20px;font-weight:700;text-align:center}.circular[data-v-872425f1]{height:64px;width:64px;animation:pushing-rotate-872425f1 2s linear infinite}.path[data-v-872425f1]{stroke:#fff;stroke-width:4;stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0;animation:pushing-dash-872425f1 1.5s ease-in-out infinite}@keyframes pushing-rotate-872425f1{to{transform:rotate(360deg)}}@keyframes pushing-dash-872425f1{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.message-template-container[data-v-872425f1]{display:flex;flex-direction:column;height:calc(100vh - 278px);overflow:hidden}.templates-container[data-v-872425f1]{display:flex;gap:20px;margin-top:15px;flex:1;overflow:hidden}.message-templates-list[data-v-872425f1]{flex:3;display:flex;flex-direction:column;border-right:1px solid #ebeef5;padding-right:15px;height:calc(100vh - 432px)}.message-templates-list h3[data-v-872425f1]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.current-default-message[data-v-872425f1]{flex:2;display:flex;flex-direction:column;gap:15px;padding-left:15px}.current-default-message h3[data-v-872425f1]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.templates-scroll-area[data-v-872425f1]{overflow-y:auto;padding-right:5px;flex:1}.default-message-card[data-v-872425f1]{margin-bottom:15px;box-shadow:0 2px 8px #00000014;border-radius:4px;transition:all .3s ease}.default-message-card[data-v-872425f1]:hover{box-shadow:0 4px 12px #0000001f}.default-message-content[data-v-872425f1]{padding:12px 15px;background-color:#f0f9eb;border-left:3px solid #67c23a;font-weight:500;word-break:break-all;min-height:60px;display:flex;align-items:center;border-radius:0 4px 4px 0;color:#303133}.message-help-text[data-v-872425f1]{background-color:#f8f9fa;border-radius:4px;padding:15px;font-size:14px;color:#606266;border-left:3px solid #909399;margin-top:auto;box-shadow:0 2px 8px #0000000d}.message-help-text h4[data-v-872425f1]{margin-top:0;margin-bottom:10px;color:#303133;font-size:15px}.message-help-text p[data-v-872425f1]{margin:8px 0;line-height:1.5}.advanced-options-toggle[data-v-872425f1]{display:flex;align-items:center;justify-content:center;padding:8px 0;background-color:#f5f7fa;border-radius:4px;cursor:pointer;transition:all .3s ease;-webkit-user-select:none;user-select:none}.advanced-options-toggle[data-v-872425f1]:hover{background-color:#ebeef5;color:#409eff}.toggle-icon[data-v-872425f1]{margin-left:8px;transition:transform .3s ease}.toggle-icon.is-active[data-v-872425f1]{transform:rotate(180deg)}.advanced-fields[data-v-872425f1]{margin-top:10px;display:flex;flex-direction:column;gap:15px;animation:fade-in-872425f1 .3s ease-in-out}@keyframes fade-in-872425f1{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.git-cmd-tooltip{font-family:Consolas,Courier New,monospace!important;font-size:13px!important;font-weight:500!important;color:#303133!important;background-color:#f5f7fa!important;border:1px solid #dcdfe6!important;border-radius:4px!important;padding:8px 12px!important;box-shadow:0 2px 12px #0000001a!important}.template-dialog .el-dialog__header,.message-template-dialog .el-dialog__header{padding:15px 20px;margin-right:0;border-bottom:1px solid #ebeef5;background-color:#f8f9fa}.template-dialog .el-dialog__title,.message-template-dialog .el-dialog__title{font-size:16px;font-weight:600;color:#303133}.template-dialog .el-dialog__body,.message-template-dialog .el-dialog__body{padding:20px}.template-dialog .el-dialog__headerbtn,.message-template-dialog .el-dialog__headerbtn{top:15px;right:20px}.template-dialog .el-input__inner,.message-template-dialog .el-input__inner{height:40px;line-height:40px}.template-dialog .el-button,.message-template-dialog .el-button{border-radius:4px;font-weight:500}.template-dialog .el-card,.message-template-dialog .el-card{border-radius:4px;overflow:hidden}.template-dialog .el-card__body,.message-template-dialog .el-card__body{padding:12px 15px}.template-dialog .el-empty__image,.message-template-dialog .el-empty__image{width:80px;height:80px}.card[data-v-9a51654c]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;height:100%;width:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.03);overflow:hidden}.log-header[data-v-9a51654c]{display:flex;justify-content:space-between;align-items:center;margin-bottom:0;padding:8px 16px;background-color:#fff;border-bottom:1px solid #f0f0f0;position:sticky;top:0;z-index:100;flex-shrink:0}.header-left[data-v-9a51654c]{display:flex;align-items:center;gap:8px}.log-header h2[data-v-9a51654c]{margin:0;font-size:16px;font-weight:500}.log-actions[data-v-9a51654c]{display:flex;gap:8px}.action-button[data-v-9a51654c]{transition:all .3s ease;border-radius:6px;border:1px solid transparent;box-shadow:0 2px 4px #0000001a;font-weight:500;padding:8px 16px;min-width:120px;display:flex;align-items:center;justify-content:center;gap:6px}.action-button[data-v-9a51654c]:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.filter-button[data-v-9a51654c]{background:linear-gradient(135deg,#e6a23c,#f0c78a);color:#fff;min-width:90px}.filter-button.active-filter[data-v-9a51654c]{background:linear-gradient(135deg,#d48806,#e6a23c)}.filter-button .filter-badge[data-v-9a51654c] .el-badge__content{background-color:#f56c6c;color:#fff;border:2px solid white;box-shadow:0 0 0 1px #e6a23c}.view-mode-button[data-v-9a51654c]{background:linear-gradient(135deg,#409eff,#53a8ff);color:#fff}.view-mode-button.active-view[data-v-9a51654c]{background:linear-gradient(135deg,#1890ff,#096dd9)}.commit-display-button[data-v-9a51654c]{background:linear-gradient(135deg,#67c23a,#85ce61);color:#fff}.commit-display-button.active-commits[data-v-9a51654c]{background:linear-gradient(135deg,#52c41a,#389e0d)}.refresh-button[data-v-9a51654c]{background:linear-gradient(135deg,#909399,#c0c4cc);color:#fff;min-width:unset;padding:0;border-radius:50%}.refresh-button[data-v-9a51654c]:hover{background:linear-gradient(135deg,#606266,#909399)}.content-area[data-v-9a51654c]{padding:10px 0;flex:1;min-height:100px;height:calc(100% - 52px);display:flex;flex-direction:column}.content-area-content[data-v-9a51654c]{height:100%}.content-area.with-filter[data-v-9a51654c]{height:calc(100% - 112px)}.content-area>div[data-v-9a51654c]{flex:1;display:flex;flex-direction:column}.el-table[data-v-9a51654c]{--el-table-border-color: #f0f0f0;--el-table-header-bg-color: #f8f9fa;border-radius:4px;overflow:hidden}.log-actions[data-v-9a51654c]{display:flex;gap:12px}.branch-container[data-v-9a51654c]{display:flex;flex-wrap:wrap;gap:4px}.branch-tag[data-v-9a51654c]{margin-right:4px}.commit-count[data-v-9a51654c]{margin-bottom:10px;font-size:14px;color:#606266;text-align:right}.graph-view[data-v-9a51654c]{width:100%;flex:1;display:flex;flex-direction:column;overflow-y:auto}.graph-container[data-v-9a51654c]{width:100%;flex:1;min-height:500px;border:1px solid #ebeef5;border-radius:4px;padding:10px;background-color:#fff;position:relative}.graph-container svg[data-v-9a51654c]{transform-origin:top left;transition:transform .2s ease}.graph-controls[data-v-9a51654c]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.zoom-controls[data-v-9a51654c]{display:flex;gap:8px}.zoom-slider[data-v-9a51654c]{width:200px}.scale-info[data-v-9a51654c]{font-size:14px;color:#606266}.refresh-notification[data-v-9a51654c]{background-color:#f0f9eb;color:#67c23a;padding:10px 15px;border-radius:8px;font-size:14px;border-left:4px solid #67c23a;animation:fadeOut-9a51654c 2s forwards;position:fixed;top:20px;right:20px;z-index:9999;box-shadow:0 4px 12px #0000001a;max-width:300px;text-align:center}@keyframes fadeOut-9a51654c{0%{opacity:0;transform:translateY(-20px)}20%{opacity:1;transform:translateY(0)}80%{opacity:1}to{opacity:0}}.author-name[data-v-9a51654c]{cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:100%}.commit-hash[data-v-9a51654c]{cursor:pointer;color:#409eff;font-family:monospace}.commit-hash[data-v-9a51654c]:hover{text-decoration:underline}.commit-detail-container[data-v-9a51654c]{display:flex;flex-direction:column;gap:20px}.commit-info[data-v-9a51654c]{padding:12px;background-color:#f5f7fa;border-radius:8px;font-size:14px;display:flex;flex-direction:column;gap:12px}.commit-info-header[data-v-9a51654c]{display:flex;flex-wrap:wrap;gap:15px;align-items:center;background-color:#fff;padding:10px;border-radius:4px;border:1px solid #e4e7ed}.info-item[data-v-9a51654c]{display:flex;align-items:center;gap:5px}.item-label[data-v-9a51654c]{font-weight:700;color:#606266;white-space:nowrap}.item-value[data-v-9a51654c]{color:#333;word-break:break-all}.commit-message-container[data-v-9a51654c]{display:flex;flex-direction:column;gap:5px}.message-label[data-v-9a51654c]{font-weight:700;color:#606266}.message-content[data-v-9a51654c]{background-color:#fff;padding:12px;border-radius:4px;font-family:monospace;white-space:pre-wrap;line-height:1.5;border:1px solid #e4e7ed;border-left:4px solid #409eff}.commit-files-diff[data-v-9a51654c]{margin-top:5px;display:flex;gap:20px;height:60vh}.files-list[data-v-9a51654c]{width:25%;overflow-y:auto;background-color:#f5f7fa;border-radius:8px;padding:10px}.files-list h3[data-v-9a51654c]{margin-top:0;padding-bottom:10px;border-bottom:1px solid #dcdfe6;font-size:16px}.files-list ul[data-v-9a51654c]{list-style:none;padding:0;margin:0}.files-list li[data-v-9a51654c]{padding:8px 10px;cursor:pointer;border-radius:4px;margin-bottom:5px;font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.files-list li[data-v-9a51654c]:hover{background-color:#ecf5ff}.files-list li.active-file[data-v-9a51654c]{background-color:#409eff;color:#fff}.file-diff[data-v-9a51654c]{flex:1;display:flex;flex-direction:column;background-color:#f5f7fa;border-radius:8px;padding:10px;overflow:hidden}.file-diff h3[data-v-9a51654c]{margin-top:0;padding-bottom:10px;border-bottom:1px solid #dcdfe6;font-size:16px}.diff-content[data-v-9a51654c]{flex:1;overflow-y:auto;background-color:#fff;padding:10px;border-radius:4px;font-family:monospace;font-size:13px;line-height:1.5}.diff-header[data-v-9a51654c]{font-weight:700;color:#409eff}.diff-old-file[data-v-9a51654c]{color:#e6a23c}.diff-new-file[data-v-9a51654c]{color:#67c23a}.diff-hunk-header[data-v-9a51654c]{font-weight:700;color:#409eff}.diff-added[data-v-9a51654c]{background-color:#f0f9eb;color:#67c23a}.diff-removed[data-v-9a51654c]{background-color:#fef2f2;color:#f56c6c}.diff-context[data-v-9a51654c]{background-color:#f5f7fa}[data-v-9a51654c] .commit-detail-dialog{--el-dialog-margin-top: 7vh}.history-controls[data-v-9a51654c]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;position:sticky;top:52px;z-index:90;background-color:#fff;padding:5px 0;transition:box-shadow .3s ease,background-color .3s ease,padding .2s ease}.content-area:not(:hover) .history-controls[data-v-9a51654c]:not(:hover){box-shadow:0 2px 8px #0000000f}.history-stats[data-v-9a51654c]{display:flex;align-items:center}.record-count[data-v-9a51654c]{display:flex;align-items:center;height:24px;padding-left:8px;padding-right:8px;margin-left:8px}.record-count[data-v-9a51654c] .el-icon{margin-right:4px;font-size:12px}.filter-badge[data-v-9a51654c] .el-badge__content{background-color:#409eff}.filter-panel[data-v-9a51654c]{display:none}.log-table.has-filter[data-v-9a51654c],.log-table.has-sticky-controls[data-v-9a51654c],.log-table.has-sticky-filter[data-v-9a51654c]{margin-top:0!important}.filter-panel-header[data-v-9a51654c]{background-color:#f5f7fa;padding:10px 16px;border-bottom:1px solid #e4e7ed;position:sticky;top:36px;z-index:99;transition:all .3s ease;flex-shrink:0;margin-bottom:0;box-shadow:0 2px 8px #0000000d}.filter-panel-header .filter-form[data-v-9a51654c]{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;justify-content:space-between}.filter-panel-header .filter-item[data-v-9a51654c]{margin-right:0;flex:1;min-width:0}.filter-panel-header .filter-input[data-v-9a51654c]{width:100%}.filter-panel-header .filter-input.date-range[data-v-9a51654c]{width:100%;max-width:280px}.compact-label[data-v-9a51654c]{color:#909399;font-size:12px;margin-right:4px;white-space:nowrap;font-weight:700;border-right:1px solid #dcdfe6;padding-right:6px}.filter-action-button[data-v-9a51654c]{padding:8px 15px;border-radius:4px;transition:all .3s;min-width:60px}.filter-action-button[data-v-9a51654c]:hover{transform:translateY(-2px);box-shadow:0 2px 8px #0000001a}.filter-actions[data-v-9a51654c]{display:flex;align-items:center;gap:8px;white-space:nowrap;flex-shrink:0}.table-view-container[data-v-9a51654c]{display:flex;flex-direction:column;flex:1;min-height:400px}.log-table[data-v-9a51654c]{width:100%;height:100%;min-height:300px;flex:1}.load-more-container[data-v-9a51654c]{display:flex;flex-direction:column;align-items:center;padding:15px 0;border-top:1px dashed #ebeef5;gap:10px}.pagination-info[data-v-9a51654c]{font-size:13px;color:#909399;margin-bottom:5px}.loading-more[data-v-9a51654c]{display:flex;align-items:center;color:#909399;font-size:14px}.loading-spinner[data-v-9a51654c]{width:20px;height:20px;margin-right:10px;border:2px solid #dcdfe6;border-top-color:#409eff;border-radius:50%;animation:spinner-9a51654c 1s linear infinite}@keyframes spinner-9a51654c{to{transform:rotate(360deg)}}.load-more-button[data-v-9a51654c]{cursor:pointer;color:#409eff;font-size:14px;padding:6px 16px;border:1px solid #d9ecff;background-color:#ecf5ff;border-radius:4px;transition:all .3s}.load-more-button[data-v-9a51654c]:hover{background-color:#d9ecff}.no-more-data[data-v-9a51654c]{color:#909399;font-size:14px;font-style:italic;display:flex;flex-direction:column;align-items:center}.total-loaded[data-v-9a51654c]{font-size:12px;margin-top:5px;color:#c0c4cc}.context-menu[data-v-9a51654c]{position:fixed;background:#fff;border:1px solid #dcdfe6;border-radius:4px;box-shadow:0 2px 12px #0000001a;padding:8px 0;z-index:3000;min-width:180px}.context-menu-item[data-v-9a51654c]{padding:8px 16px;cursor:pointer;font-size:14px;display:flex;align-items:center}.context-menu-item[data-v-9a51654c]:hover{background-color:#f5f7fa}.context-menu-item i[data-v-9a51654c]{margin-right:8px}.refresh-button-animated[data-v-9a51654c]{animation:spin-9a51654c 1s linear}@keyframes spin-9a51654c{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-table .el-table__cell .cell[data-v-9a51654c]{word-break:break-all}.branch-graph-column[data-v-9a51654c]{padding:0!important;overflow:visible}.branch-graph-cell[data-v-9a51654c]{height:40px;width:100%;position:relative;padding:0;margin:0}.branch-graph-column .cell[data-v-9a51654c]{padding:0!important;height:100%;margin:0;overflow:visible}.el-table .branch-graph-column[data-v-9a51654c]{width:60px!important;padding:0!important}[data-v-9a51654c] .el-table .el-table__cell{padding:0!important}[data-v-9a51654c] .branch-graph-cell svg{display:block!important;width:100%!important;height:100%!important;overflow:visible!important;z-index:10!important}[data-v-9a51654c] .branch-graph-cell svg line,[data-v-9a51654c] .branch-graph-cell svg path{stroke-width:2!important}[data-v-9a51654c] .branch-graph-cell svg circle{r:6!important;stroke-width:2!important}.branch-graph-column[data-v-9a51654c]{min-width:60px!important;width:60px!important}.branch-graph-cell[data-v-9a51654c]{position:relative!important;overflow:visible!important;z-index:1!important}[data-v-9a51654c] .el-table--border .el-table__inner-wrapper tr{border:none!important}[data-v-9a51654c] .el-table--border .el-table__inner-wrapper td{border-right:none!important;border-bottom:none!important}[data-v-9a51654c] .el-table--border .el-table__inner-wrapper th{border-right:none!important}[data-v-9a51654c] .el-table--border,[data-v-9a51654c] .el-table--border .el-table__inner-wrapper{border:none!important}[data-v-9a51654c] .el-table--border:after,[data-v-9a51654c] .el-table--border:before,[data-v-9a51654c] .el-table__inner-wrapper:after,[data-v-9a51654c] .el-table__inner-wrapper:before{display:none!important}[data-v-9a51654c] .el-table tr{background-color:transparent!important}[data-v-9a51654c] .el-table--striped .el-table__body tr.el-table__row--striped td{background-color:#00000005!important}:deep(.el-table .el-table__cell .cell){word-break:break-all}body{font-family:Arial,sans-serif;margin:0;padding:0;background-color:#f5f5f5;overflow:hidden;height:100vh}.main-container{position:fixed;top:60px;bottom:60px;left:0;right:0;padding:10px;overflow:hidden}.grid-layout{display:grid;grid-template-columns:2fr 8px 3fr;grid-template-rows:1fr 8px 1fr;grid-template-areas:"git-status v-resizer commit-form" "h-resizer h-resizer h-resizer" "log-list log-list log-list";gap:10px;height:100%}.git-status-panel{grid-area:git-status;overflow:hidden;max-height:100%;padding:0}.commit-form-panel{grid-area:commit-form;overflow:hidden;max-height:100%;padding:0}.log-list-panel{grid-area:log-list;overflow:hidden;max-height:100%;padding:0}.card{background-color:#fff;border-radius:8px;box-shadow:0 4px 12px #0000000d;border:1px solid rgba(0,0,0,.03);height:100%;overflow:hidden;display:flex;flex-direction:column}.main-header{background-color:#24292e;color:#fff;padding:0 20px;display:flex;justify-content:space-between;align-items:center;position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 2px 10px #0003;height:60px;box-sizing:border-box}.header-left{display:flex;align-items:center;gap:10px;min-width:220px;flex:1}.logo{height:32px;width:auto}h1{margin:0;font-size:24px}.header-info{display:flex;align-items:center;gap:10px;justify-content:flex-end}#user-info{display:flex;align-items:center;background-color:#282c34b3;padding:6px 10px;border-radius:4px;border:1px solid rgba(255,255,255,.15);margin-right:10px;flex-shrink:0}.directory-selector{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:#282c34b3;border-radius:4px;padding:6px 10px;border:1px solid rgba(255,255,255,.15);box-shadow:0 2px 8px #00000026;flex-shrink:0}.directory-display{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.directory-path{font-family:monospace;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;background-color:#0003;padding:4px 8px;border-radius:3px;border-left:3px solid #409EFF;flex:1;min-width:0;max-width:500px}.branch-label,.user-label,.user-name{font-weight:700;margin-right:5px}.user-email{color:#e0e0e0}.branch-name{font-family:monospace}.status-box{background-color:#f6f8fa;border:1px solid #e1e4e8;border-radius:3px;padding:15px;white-space:pre-wrap;font-family:monospace;overflow-y:auto}.tips{margin-top:20px;padding:15px;background-color:#f5f7fa;border-radius:5px;border-left:4px solid #409eff}.tips h3{margin-top:0;font-size:16px;margin-bottom:10px}.code-block{background-color:#2d2d2d;color:#f8f8f2;font-family:monospace;padding:10px 15px;border-radius:4px;margin-bottom:10px}.loading-container{display:flex;justify-content:center;align-items:center;height:100%}.loading-card{width:300px;text-align:center;padding:30px}.loading-spinner{font-size:48px;margin-bottom:20px;color:#409eff}.loading-text{font-size:18px;color:#606266}.user-settings-btn{margin-left:10px}.user-warning{color:#e6a23c;font-weight:700}.main-footer{background-color:#24292e;color:#fff;padding:10px 20px;display:flex;justify-content:space-between;align-items:center;position:fixed;bottom:0;left:0;right:0;z-index:100;box-shadow:0 -2px 10px #0000001a;height:60px;box-sizing:border-box}@media (max-width: 768px){.grid-layout{grid-template-columns:1fr;grid-template-rows:auto auto auto auto auto;grid-template-areas:"git-status" "v-resizer" "commit-form" "h-resizer" "log-list";gap:10px}.vertical-resizer{height:10px;cursor:row-resize}.vertical-resizer:after{width:30px;height:4px}.git-status-panel,.commit-form-panel,.log-list-panel{padding:0;max-height:none}.git-status-panel,.commit-form-panel{max-height:30vh}.log-list-panel{max-height:40vh}}.logo[data-v-98ed32bc]{will-change:filter;transition:filter .3s}.logo[data-v-98ed32bc]:hover{filter:drop-shadow(0 0 2em #42b883aa)}.branch-info[data-v-98ed32bc]{display:flex;align-items:center;gap:10px}.branch-wrapper[data-v-98ed32bc]{display:flex;align-items:center;background-color:#ffffff26;border-radius:4px;padding:8px 12px;box-shadow:0 2px 4px #0003;transition:all .3s}.branch-wrapper[data-v-98ed32bc]:hover{background-color:#fff3}.branch-label[data-v-98ed32bc]{font-weight:700;margin-right:10px;color:#fff}.branch-select[data-v-98ed32bc]{width:200px;margin-right:10px}.create-branch-btn[data-v-98ed32bc]{background-color:#2ea44f;border-color:#2ea44f;transition:all .3s;box-shadow:0 2px 4px #0003}.create-branch-btn[data-v-98ed32bc]:hover{background-color:#3bbc63;border-color:#3bbc63;transform:translateY(-2px);box-shadow:0 4px 8px #0003}.footer-right[data-v-98ed32bc]{display:flex;align-items:center;gap:10px;color:#ffffffe6;font-size:13px;background-color:#ffffff1a;padding:8px 12px;border-radius:4px;box-shadow:0 2px 4px #0003}.repo-url-label[data-v-98ed32bc]{font-weight:700;margin-right:8px;color:#fff}.repo-url[data-v-98ed32bc]{color:#e6f7ff;font-family:monospace;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy-url-btn[data-v-98ed32bc]{transition:all .3s;background-color:#1890ff;border-color:#1890ff;box-shadow:0 2px 4px #0003}.copy-url-btn[data-v-98ed32bc]:hover{background-color:#40a9ff;border-color:#40a9ff;transform:translateY(-2px);box-shadow:0 4px 8px #0003}.vertical-resizer[data-v-98ed32bc]{grid-area:v-resizer;background-color:#e8e8e8;cursor:col-resize;transition:background-color .2s,box-shadow .2s;position:relative;z-index:10;border-radius:8px;box-shadow:0 0 3px #0000001a}.vertical-resizer[data-v-98ed32bc]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:50px;background-color:#a0a0a0;border-radius:4px;transition:background-color .2s,width .2s,box-shadow .2s}.vertical-resizer[data-v-98ed32bc]:hover,.vertical-resizer.active[data-v-98ed32bc]{background-color:#d0d0d0;box-shadow:0 0 5px #0003}.vertical-resizer[data-v-98ed32bc]:hover:after,.vertical-resizer.active[data-v-98ed32bc]:after{background-color:#409eff;width:6px;box-shadow:0 0 8px #409eff99}.horizontal-resizer[data-v-98ed32bc]{grid-area:h-resizer;background-color:#e8e8e8;cursor:row-resize;transition:background-color .2s,box-shadow .2s;position:relative;z-index:10;border-radius:8px;box-shadow:0 0 3px #0000001a}.horizontal-resizer[data-v-98ed32bc]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:50px;height:4px;background-color:#a0a0a0;border-radius:4px;transition:background-color .2s,height .2s,box-shadow .2s}.horizontal-resizer[data-v-98ed32bc]:hover,.horizontal-resizer.active[data-v-98ed32bc]{background-color:#d0d0d0;box-shadow:0 0 5px #0003}.horizontal-resizer[data-v-98ed32bc]:hover:after,.horizontal-resizer.active[data-v-98ed32bc]:after{background-color:#409eff;height:6px;box-shadow:0 0 8px #409eff99}.directory-selector[data-v-98ed32bc]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:#282c34b3;border-radius:4px;padding:8px 12px;margin-bottom:8px;border:1px solid rgba(255,255,255,.2);box-shadow:0 2px 8px #0003}.directory-display[data-v-98ed32bc]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.directory-path[data-v-98ed32bc]{font-family:monospace;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;background-color:#0003;padding:4px 8px;border-radius:3px;border-left:3px solid #409EFF;flex:1;min-width:0;max-width:350px}.directory-actions[data-v-98ed32bc]{display:flex;gap:4px;margin-left:8px}.dir-button[data-v-98ed32bc]{padding:6px;height:28px;width:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#409eff,#53a8ff);color:#fff;border:none;box-shadow:0 2px 4px #0003;transition:all .3s}.dir-button[data-v-98ed32bc]:hover{transform:translateY(-1px);box-shadow:0 3px 6px #0000004d;background:linear-gradient(135deg,#53a8ff,#66b1ff)}.dir-button.el-button--info[data-v-98ed32bc]{background:linear-gradient(135deg,#909399,#a6a9ad)}.dir-button.el-button--info[data-v-98ed32bc]:hover{background:linear-gradient(135deg,#a6a9ad,#c0c4cc)}.directory-icon[data-v-98ed32bc]{display:flex;justify-content:center;align-items:center;width:24px;height:24px;border-radius:3px;background-color:#409eff1a;color:#409eff;margin-right:2px}.directory-input-group[data-v-98ed32bc]{display:flex;align-items:center;gap:8px;width:100%}.recent-directories[data-v-98ed32bc]{display:flex;flex-wrap:wrap;gap:4px}.recent-dir-tag[data-v-98ed32bc]{cursor:pointer;background-color:#e6f7ff;border:1px solid #91d5ff;padding:4px 8px;border-radius:4px}.directory-browser[data-v-98ed32bc]{width:100%;height:400px;overflow:auto}.current-path[data-v-98ed32bc]{padding:10px;background-color:#f5f7fa;border-radius:4px;margin-bottom:10px;border:1px solid #e4e7ed;display:flex;align-items:center;width:100%;box-sizing:border-box}.path-label[data-v-98ed32bc]{font-weight:700;margin-right:5px;white-space:nowrap;flex-shrink:0}.path-value[data-v-98ed32bc]{font-family:monospace;word-break:break-all;flex:1;min-width:0;background-color:#fff;padding:5px 8px;border-radius:3px;border:1px solid #dcdfe6;box-shadow:inset 0 1px 2px #0000000d;width:100%}.directory-list[data-v-98ed32bc]{list-style:none!important;padding:0;margin:0;border:1px solid #e4e7ed;border-radius:4px;max-height:300px;overflow-y:auto;background-color:#fff;display:flex;flex-direction:column;width:100%;box-sizing:border-box}.directory-item[data-v-98ed32bc]{padding:10px 12px;border-bottom:1px solid #ebeef5;cursor:pointer;display:flex;align-items:center;transition:all .2s ease;position:relative;width:100%;box-sizing:border-box;list-style:none!important}.directory-item[data-v-98ed32bc]:hover{background-color:#ecf5ff}.directory-item[data-v-98ed32bc]:last-child{border-bottom:none}.parent-dir[data-v-98ed32bc]{background-color:#f5f7fa;font-weight:500}.dir-icon[data-v-98ed32bc]{margin-right:12px;display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.dir-name[data-v-98ed32bc]{display:flex;align-items:center;font-size:14px;line-height:1.4}.folder-icon[data-v-98ed32bc]{filter:drop-shadow(0 1px 2px rgba(0,0,0,.1));transition:all .2s ease}.directory-item:hover .folder-icon[data-v-98ed32bc]{transform:scale(1.1)}[data-v-98ed32bc] .directory-browser-dialog{border-radius:8px;overflow:hidden}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__header{background-color:#f5f7fa;padding:15px 20px;border-bottom:1px solid #e4e7ed;position:relative}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__title{color:#409eff;font-weight:500;font-size:18px}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__headerbtn{position:absolute;top:15px;right:15px;width:24px;height:24px;border-radius:50%;background-color:#0000000d;transition:all .3s;display:flex;align-items:center;justify-content:center}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__headerbtn:hover{background-color:#0000001a;transform:rotate(90deg)}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__headerbtn .el-message-box__close{color:#606266;font-weight:700;font-size:16px}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__headerbtn:hover .el-message-box__close{color:#409eff}[data-v-98ed32bc] .directory-browser-dialog .el-message-box__content{padding:20px}.el-message-box__message{width:100%}.directory-browser-dialog{border-radius:8px;overflow:hidden}.directory-browser-dialog .el-message-box__header{background-color:#f5f7fa;padding:15px 20px;border-bottom:1px solid #e4e7ed;position:relative}.directory-browser-dialog .el-message-box__title{color:#409eff;font-weight:500;font-size:18px}.directory-browser-dialog .el-message-box__headerbtn{position:absolute;top:15px;right:15px;width:24px;height:24px;border-radius:50%;background-color:#0000000d;transition:all .3s;display:flex;align-items:center;justify-content:center}.directory-browser-dialog .el-message-box__headerbtn:hover{background-color:#0000001a;transform:rotate(90deg)}.directory-browser-dialog .el-message-box__headerbtn .el-message-box__close{color:#606266;font-weight:700;font-size:16px}.directory-browser-dialog .el-message-box__headerbtn:hover .el-message-box__close{color:#409eff}.directory-browser-dialog .el-message-box__content{padding:20px}.directory-browser-dialog .el-message-box__btns{padding:10px 20px 15px;border-top:1px solid #e4e7ed}.directory-browser{width:100%;height:400px;overflow:auto}.current-path{padding:10px;background-color:#f5f7fa;border-radius:4px;margin-bottom:10px;border:1px solid #e4e7ed;display:flex;align-items:center;width:100%;box-sizing:border-box}.path-label{font-weight:700;margin-right:5px;white-space:nowrap;flex-shrink:0}.path-value{font-family:monospace;word-break:break-all;flex:1;min-width:0;background-color:#fff;padding:5px 8px;border-radius:3px;border:1px solid #dcdfe6;box-shadow:inset 0 1px 2px #0000000d;width:100%}.directory-list{list-style:none!important;padding:0;margin:0;border:1px solid #e4e7ed;border-radius:4px;max-height:300px;overflow-y:auto;background-color:#fff;display:flex;flex-direction:column;width:100%;box-sizing:border-box}.directory-item{padding:10px 12px;border-bottom:1px solid #ebeef5;cursor:pointer;display:flex;align-items:center;transition:all .2s ease;position:relative;width:100%;box-sizing:border-box;list-style:none!important}.directory-item:hover{background-color:#ecf5ff}.directory-item:last-child{border-bottom:none}.parent-dir{background-color:#f5f7fa;font-weight:500}.dir-icon{margin-right:12px;display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.dir-name{display:flex;align-items:center;font-size:14px;line-height:1.4}.folder-icon{filter:drop-shadow(0 1px 2px rgba(0,0,0,.1));transition:all .2s ease}.directory-item:hover .folder-icon{transform:scale(1.1)}*{margin:0;padding:0}div{box-sizing:border-box}
|
package/src/ui/public/index.html
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Zen-GitSync - Git同步工具</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-B7Bmz9T9.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vendor-Bm8yNvvz.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/vendor-Dp0FkvMe.css">
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DNVXEFTm.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="app"></div>
|
package/src/ui/server/index.js
CHANGED
|
@@ -398,6 +398,37 @@ async function startUIServer() {
|
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
400
|
|
|
401
|
+
// 在资源管理器/访达中打开当前目录
|
|
402
|
+
app.post('/api/open_directory', async (req, res) => {
|
|
403
|
+
try {
|
|
404
|
+
// 获取要打开的目录路径,如果没有提供,则使用当前目录
|
|
405
|
+
const directoryPath = req.body.path || process.cwd();
|
|
406
|
+
|
|
407
|
+
try {
|
|
408
|
+
// 检查目录是否存在
|
|
409
|
+
await fs.access(directoryPath);
|
|
410
|
+
|
|
411
|
+
// 使用open模块打开目录,自动处理不同操作系统
|
|
412
|
+
await open(directoryPath, { wait: false });
|
|
413
|
+
|
|
414
|
+
res.json({
|
|
415
|
+
success: true,
|
|
416
|
+
message: '已在文件管理器中打开目录'
|
|
417
|
+
});
|
|
418
|
+
} catch (error) {
|
|
419
|
+
res.status(400).json({
|
|
420
|
+
success: false,
|
|
421
|
+
error: `无法打开目录 "${directoryPath}": ${error.message}`
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
} catch (error) {
|
|
425
|
+
res.status(500).json({
|
|
426
|
+
success: false,
|
|
427
|
+
error: error.message
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
|
|
401
432
|
// 保存最近访问的目录
|
|
402
433
|
app.post('/api/save_recent_directory', async (req, res) => {
|
|
403
434
|
try {
|
|
@@ -767,6 +798,7 @@ async function startUIServer() {
|
|
|
767
798
|
const dateFrom = req.query.dateFrom || '';
|
|
768
799
|
const dateTo = req.query.dateTo || '';
|
|
769
800
|
const branch = req.query.branch ? req.query.branch.split(',') : [];
|
|
801
|
+
const withParents = req.query.with_parents === 'true';
|
|
770
802
|
|
|
771
803
|
// 构建Git命令选项
|
|
772
804
|
let commandOptions = [];
|
|
@@ -781,7 +813,7 @@ async function startUIServer() {
|
|
|
781
813
|
const branchRefs = branch.map(b => b.trim()).join(' ');
|
|
782
814
|
|
|
783
815
|
// 直接将分支名作为命令参数,并确保后面添加 -- 分隔符防止歧义
|
|
784
|
-
return executeGitLogCommand(res, branchRefs, author, message, dateFrom, dateTo, limit, skip, req.query.all === 'true');
|
|
816
|
+
return executeGitLogCommand(res, branchRefs, author, message, dateFrom, dateTo, limit, skip, req.query.all === 'true', withParents);
|
|
785
817
|
}
|
|
786
818
|
|
|
787
819
|
// 如果没有指定分支,则使用--all参数
|
|
@@ -825,11 +857,17 @@ async function startUIServer() {
|
|
|
825
857
|
// 合并所有命令选项
|
|
826
858
|
const options = [...commandOptions, limitOption].filter(Boolean).join(' ');
|
|
827
859
|
|
|
828
|
-
|
|
860
|
+
// 添加父提交信息的格式
|
|
861
|
+
let formatString = '%H|%an|%ae|%ad|%B|%D';
|
|
862
|
+
if (withParents) {
|
|
863
|
+
formatString = '%H|%an|%ae|%ad|%B|%D|%P';
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
console.log(`执行Git命令: git log --all --pretty=format:"${formatString}" --date=short ${options}`);
|
|
829
867
|
|
|
830
868
|
// 使用 git log 命令获取提交历史
|
|
831
869
|
let { stdout: logOutput } = await execGitCommand(
|
|
832
|
-
`git log --all --pretty=format:"
|
|
870
|
+
`git log --all --pretty=format:"${formatString}" --date=short ${options}`
|
|
833
871
|
);
|
|
834
872
|
|
|
835
873
|
// 获取总提交数量(考虑筛选条件)
|
|
@@ -858,7 +896,7 @@ async function startUIServer() {
|
|
|
858
896
|
totalCommits = 0;
|
|
859
897
|
}
|
|
860
898
|
|
|
861
|
-
processAndSendLogOutput(res, logOutput, totalCommits, page, limit);
|
|
899
|
+
processAndSendLogOutput(res, logOutput, totalCommits, page, limit, withParents);
|
|
862
900
|
} catch (error) {
|
|
863
901
|
console.error('获取Git日志失败:', error);
|
|
864
902
|
res.status(500).json({ error: '获取日志失败: ' + error.message });
|
|
@@ -866,7 +904,7 @@ async function startUIServer() {
|
|
|
866
904
|
});
|
|
867
905
|
|
|
868
906
|
// 抽取执行Git日志命令的函数
|
|
869
|
-
async function executeGitLogCommand(res, branchRefs, author, message, dateFrom, dateTo, limit, skip, isAll) {
|
|
907
|
+
async function executeGitLogCommand(res, branchRefs, author, message, dateFrom, dateTo, limit, skip, isAll, withParents = false) {
|
|
870
908
|
try {
|
|
871
909
|
// 构建命令选项
|
|
872
910
|
const commandOptions = [];
|
|
@@ -916,8 +954,14 @@ async function startUIServer() {
|
|
|
916
954
|
})
|
|
917
955
|
.join(' ');
|
|
918
956
|
|
|
957
|
+
// 添加父提交信息的格式
|
|
958
|
+
let formatString = '%H|%an|%ae|%ad|%B|%D';
|
|
959
|
+
if (withParents) {
|
|
960
|
+
formatString = '%H|%an|%ae|%ad|%B|%D|%P';
|
|
961
|
+
}
|
|
962
|
+
|
|
919
963
|
// 构建执行的命令
|
|
920
|
-
const command = `git log ${formattedBranchRefs} --pretty=format:"
|
|
964
|
+
const command = `git log ${formattedBranchRefs} --pretty=format:"${formatString}" --date=short ${options}`;
|
|
921
965
|
console.log(`执行Git命令(带分支引用): ${command}`);
|
|
922
966
|
|
|
923
967
|
// 执行命令
|
|
@@ -937,7 +981,7 @@ async function startUIServer() {
|
|
|
937
981
|
totalCommits = 0;
|
|
938
982
|
}
|
|
939
983
|
|
|
940
|
-
processAndSendLogOutput(res, logOutput, totalCommits, skip / limit + 1, limit);
|
|
984
|
+
processAndSendLogOutput(res, logOutput, totalCommits, skip / limit + 1, limit, withParents);
|
|
941
985
|
} catch (error) {
|
|
942
986
|
console.error('执行Git日志命令失败:', error);
|
|
943
987
|
res.status(500).json({ error: '获取日志失败: ' + error.message });
|
|
@@ -945,7 +989,7 @@ async function startUIServer() {
|
|
|
945
989
|
}
|
|
946
990
|
|
|
947
991
|
// 抽取处理输出并发送响应的函数
|
|
948
|
-
function processAndSendLogOutput(res, logOutput, totalCommits, page, limit) {
|
|
992
|
+
function processAndSendLogOutput(res, logOutput, totalCommits, page, limit, withParents = false) {
|
|
949
993
|
// 替换提交记录之间的换行符
|
|
950
994
|
logOutput = logOutput.replace(/\n(?=[a-f0-9]{40}\|)/g, "<<<RECORD_SEPARATOR>>>");
|
|
951
995
|
|
|
@@ -956,7 +1000,7 @@ async function startUIServer() {
|
|
|
956
1000
|
const data = logEntries.map(entry => {
|
|
957
1001
|
const parts = entry.split('|');
|
|
958
1002
|
if (parts.length >= 5) {
|
|
959
|
-
|
|
1003
|
+
const result = {
|
|
960
1004
|
hash: parts[0],
|
|
961
1005
|
author: parts[1],
|
|
962
1006
|
email: parts[2],
|
|
@@ -964,6 +1008,13 @@ async function startUIServer() {
|
|
|
964
1008
|
message: parts[4],
|
|
965
1009
|
branch: parts[5] || ''
|
|
966
1010
|
};
|
|
1011
|
+
|
|
1012
|
+
// 如果请求了父提交信息,添加到结果中
|
|
1013
|
+
if (withParents && parts[6]) {
|
|
1014
|
+
result.parents = parts[6].split(' ');
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
return result;
|
|
967
1018
|
}
|
|
968
1019
|
return null;
|
|
969
1020
|
}).filter(item => item !== null);
|
|
@@ -1244,6 +1295,36 @@ async function startUIServer() {
|
|
|
1244
1295
|
}
|
|
1245
1296
|
});
|
|
1246
1297
|
|
|
1298
|
+
// 重置到指定提交(hard)
|
|
1299
|
+
app.post('/api/reset-to-commit', async (req, res) => {
|
|
1300
|
+
try {
|
|
1301
|
+
const { hash } = req.body;
|
|
1302
|
+
|
|
1303
|
+
if (!hash) {
|
|
1304
|
+
return res.status(400).json({
|
|
1305
|
+
success: false,
|
|
1306
|
+
error: '缺少提交哈希参数'
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
console.log(`执行重置到指定提交操作: hash=${hash}`);
|
|
1311
|
+
|
|
1312
|
+
// 执行git reset --hard命令
|
|
1313
|
+
await execGitCommand(`git reset --hard ${hash}`);
|
|
1314
|
+
|
|
1315
|
+
res.json({
|
|
1316
|
+
success: true,
|
|
1317
|
+
message: `已成功重置到提交 ${hash}`
|
|
1318
|
+
});
|
|
1319
|
+
} catch (error) {
|
|
1320
|
+
console.error('重置到指定提交失败:', error);
|
|
1321
|
+
res.status(500).json({
|
|
1322
|
+
success: false,
|
|
1323
|
+
error: `重置到指定提交失败: ${error.message}`
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
|
|
1247
1328
|
// 添加清理Git锁定文件的接口
|
|
1248
1329
|
app.post('/api/remove-lock', async (req, res) => {
|
|
1249
1330
|
try {
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{d as Bt,r as c,o as tt,a as Zt,E as i,l as Kt,b as rt,c as $e,w as qe,e as _,f as p,F as he,g as e,h as t,i as _t,u as o,j as s,k as zt,m as Ct,n as Rt,p as Be,q as Dt,s as Gt,t as Qt,v as q,x as Z,y as ct,z as $,A as ut,B as es,C as B,D as At,G as Te,H as Et,I as dt,J as Ke,K as Mt,L as ts,M as St,N as Ye,O as De,P as wt,Q as Ie,T as Tt,R as jt,S as $t,U as Qe,V as nt,W as it,X as Pt,Y as ht,Z as ss,_ as lt,$ as as,a0 as ls,a1 as Ut,a2 as Ot,a3 as os,a4 as xt,a5 as ns,a6 as is,a7 as rs,a8 as Vt,a9 as cs,aa as us,ab as ds,ac as fs,ad as ps,ae as vs,af as ms,ag as gs,ah as Xe,ai as ys,aj as hs,ak as Lt,al as _s,am as ws,an as $s,ao as ke,ap as bs,aq as ks}from"./vendor-Bm8yNvvz.js";(function(){const g=document.createElement("link").relList;if(g&&g.supports&&g.supports("modulepreload"))return;for(const y of document.querySelectorAll('link[rel="modulepreload"]'))u(y);new MutationObserver(y=>{for(const E of y)if(E.type==="childList")for(const V of E.addedNodes)V.tagName==="LINK"&&V.rel==="modulepreload"&&u(V)}).observe(document,{childList:!0,subtree:!0});function k(y){const E={};return y.integrity&&(E.integrity=y.integrity),y.referrerPolicy&&(E.referrerPolicy=y.referrerPolicy),y.crossOrigin==="use-credentials"?E.credentials="include":y.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function u(y){if(y.ep)return;y.ep=!0;const E=k(y);fetch(y.href,E)}})();const gt=300,et=Bt("git",()=>{const me=c(""),g=c([]),k=c(""),u=c(""),y=c(!1),E=c(!1),V=c(!1),F=c(0),X=c(""),K=c(!1),O=c(!1),H=c(!1),L=c(!1),C=c(0),J=c(0),U=c(!1),I=c(""),j=c(0),ne=c(0);let w=null;const ee=c(!0),Y=c([]),W=c({staged:[],unstaged:[],untracked:[]}),te=c(""),oe=c([]),S=c(!1),m=c(!1),D=c(!1),z=c(!1),P=c(!1);function ie(){me.value="",g.value=[],k.value="",u.value="",y.value=!1,E.value=!1,V.value=!1,F.value=0,C.value=0,J.value=0,U.value=!1,I.value="",j.value=0,ne.value=0,O.value=!1,H.value=!1,L.value=!1,X.value="",K.value=!1,Y.value=[],W.value={staged:[],unstaged:[],untracked:[]},te.value="",oe.value=[],S.value=!1,m.value=!1,D.value=!1,z.value=!1,P.value=!1}async function se(){if(V.value)try{console.log("获取分支状态...");const n=await(await fetch("/api/branch-status")).json();n&&(C.value=n.ahead||0,J.value=n.behind||0,U.value=n.hasUpstream||!1,I.value=n.upstreamBranch||"",j.value=Date.now(),console.log(`分支状态更新:领先 ${C.value} 个提交,落后 ${J.value} 个提交,上游分支:${U.value?I.value:"无"}`))}catch(f){console.error("获取分支状态失败:",f),C.value=0,J.value=0,U.value=!1,I.value=""}}async function Ce(){const f=Date.now();if(f-F.value<1e3)return console.log("使用缓存的Git仓库状态:",V.value?"是":"不是"),V.value;try{const N=await(await fetch("/api/current_directory")).json();return V.value=N.isGitRepo===!0,F.value=f,console.log(`当前目录${V.value?"是":"不是"}Git仓库`),V.value}catch(n){return console.error("检查Git仓库状态失败:",n),V.value=!1,F.value=f,!1}}async function _e(){try{const n=await(await fetch("/api/branch")).json();n.branch&&(me.value=n.branch)}catch(f){console.error("获取分支信息失败:",f)}}async function b(){if(V.value)try{console.log("获取所有分支...");const n=await(await fetch("/api/branches")).json();n.branches&&Array.isArray(n.branches)&&(g.value=n.branches,ne.value=Date.now(),console.log(`获取到${n.branches.length}个分支`))}catch(f){console.error("获取所有分支信息失败:",f)}}async function ge(f){console.log("切换到分支:",f);try{y.value=!0;const N=await(await fetch("/api/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:f})})).json();return N.success?(i({message:`已切换到分支: ${f}`,type:"success"}),await _e(),await se(),!0):(i({message:`切换分支失败: ${N.error}`,type:"error"}),!1)}catch(n){return i({message:`切换分支失败: ${n.message}`,type:"error"}),!1}finally{y.value=!1}}async function be(){try{const n=await(await fetch("/api/user-info")).json();n.name&&n.email&&(k.value=n.name,u.value=n.email)}catch(f){console.error("获取用户信息失败:",f)}}async function ye(f,n){if(!f.trim())return i({message:"分支名称不能为空",type:"warning"}),!1;try{E.value=!0;const ae=await(await fetch("/api/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newBranchName:f,baseBranch:n||me.value})})).json();return ae.success?(i({message:`已创建并切换到分支: ${f}`,type:"success"}),await _e(),await se(),await b(),!0):(i({message:`创建分支失败: ${ae.error}`,type:"error"}),!1)}catch(N){return i({message:`创建分支失败: ${N.message}`,type:"error"}),!1}finally{E.value=!1}}async function Me(){try{const n=await(await fetch("/api/clear-user-config",{method:"POST"})).json();return n.success?(k.value="",u.value="",i({message:"已清除Git用户配置",type:"success"}),!0):(i({message:`清除配置失败: ${n.error}`,type:"error"}),!1)}catch(f){return i({message:`清除配置失败: ${f.message}`,type:"error"}),!1}}async function je(f,n){try{const ae=await(await fetch("/api/restore-user-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f,email:n})})).json();return ae.success?(k.value=f,u.value=n,i({message:"已恢复Git用户配置",type:"success"}),!0):(i({message:`恢复配置失败: ${ae.error}`,type:"error"}),!1)}catch(N){return i({message:`恢复配置失败: ${N.message}`,type:"error"}),!1}}async function Pe(){if(!V.value)return i({message:"当前目录不是Git仓库",type:"warning"}),!1;try{H.value=!0;const n=await(await fetch("/api/pull",{method:"POST"})).json();return n.success?(i({message:"拉取成功",type:"success"}),await se(),!0):(n.needsMerge?i({message:`需要合并更改: ${n.pullOutput||"存在冲突需要手动解决"}`,type:"warning",duration:5e3}):i({message:`拉取失败: ${n.error}`,type:"error"}),!1)}catch(f){return i({message:`拉取失败: ${f.message}`,type:"error"}),!1}finally{H.value=!1}}async function Ne(){if(!V.value)return i({message:"当前目录不是Git仓库",type:"warning"}),!1;try{L.value=!0;const n=await(await fetch("/api/fetch-all",{method:"POST"})).json();return n.success?(i({message:"获取所有远程分支信息成功",type:"success"}),await se(),!0):(i({message:`获取远程分支信息失败: ${n.error}`,type:"error"}),!1)}catch(f){return i({message:`获取远程分支信息失败: ${f.message}`,type:"error"}),!1}finally{L.value=!1}}function ze(){w&&w.disconnect();try{const f="http://localhost:3000";if(console.log("尝试连接Socket.IO服务器:",f),w=Kt(f,{reconnectionDelayMax:1e4,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3,timeout:2e4,autoConnect:!0,forceNew:!0,transports:["websocket","polling"]}),!w){console.error("Socket.IO初始化失败: socket为null");return}console.log("Socket.IO初始化成功,socket ID:",w.id||"未连接"),w.on("connect",()=>{console.log("成功连接到Socket.IO服务器"),ee.value&&w&&w.emit("start_monitoring")}),w.on("disconnect",n=>{console.log("与Socket.IO服务器断开连接:",n)}),w.on("git_status_update",n=>{ee.value&&(console.log("收到Git状态更新通知:",new Date().toLocaleTimeString()),n.status&&(te.value=n.status),n.porcelain!==void 0&&Ge(n.porcelain))}),w.on("monitoring_status",n=>{console.log("文件监控状态:",n.active?"已启动":"已停止")}),w.on("connect_error",n=>{console.error("Socket连接错误:",n.message)}),w.on("connect_timeout",()=>{console.error("Socket连接超时")}),w.on("reconnect",n=>{console.log(`Socket重连成功,尝试次数: ${n}`),ee.value&&(console.log("重连后重新发送start_monitoring请求"),w==null||w.emit("start_monitoring"))}),w.on("reconnect_attempt",n=>{console.log(`Socket尝试重连,第 ${n} 次尝试`)}),w.on("reconnect_error",n=>{console.error("Socket重连错误:",n.message)}),w.on("reconnect_failed",()=>{console.error("Socket重连失败,已达到最大重试次数")}),w&&!w.connected&&(console.log("Socket未连接,尝试手动连接..."),w.connect())}catch(f){console.error("Socket.IO连接初始化失败:",f)}}function Ve(){if(console.log("toggleAutoUpdate调用,当前值:",ee.value),!w){console.error("无法切换自动更新状态: socket连接不存在"),i.error("无法连接到服务器,自动更新可能不会生效"),console.log("尝试重新建立socket连接..."),ze(),localStorage.setItem("zen-gitsync-auto-update",ee.value.toString());return}try{ee.value?(console.log("发送start_monitoring命令..."),w.emit("start_monitoring"),i.success("自动更新已启用")):(console.log("发送stop_monitoring命令..."),w.emit("stop_monitoring"),i.info("自动更新已禁用")),localStorage.setItem("zen-gitsync-auto-update",ee.value.toString()),console.log("已保存自动更新设置到本地存储:",ee.value)}catch(f){console.error("切换自动更新状态时出错:",f),i.error(`切换自动更新失败: ${f.message}`)}}function Ge(f){if(f===void 0||f===""){oe.value=[];return}const n=f.split(`
|
|
2
|
-
`),N=[];for(const ae of n){const v=ae.match(/^([ MADRCU\?]{2})\s+(.+)$/);if(v){let r="";const x=v[1],T=x.charAt(0),le=x.charAt(1);T==="A"||T==="M"||T==="D"||T==="R"?r="added":T===" "&&le==="M"?r="modified":T===" "&&le==="D"?r="deleted":x==="??"?r="untracked":r="other",N.push({path:v[2],type:r})}}oe.value=N}async function Re(f=!0){if(!V.value){console.log("当前目录不是Git仓库,跳过加载提交历史");return}try{S.value=!0,console.log("开始加载提交历史...");const n=new Date().getTime(),ae=await(await fetch(`/api/log?page=1&_t=${n}`)).json();ae&&ae.data&&Array.isArray(ae.data)?(Y.value=[...ae.data],console.log(`提交历史加载完成,共 ${Y.value.length} 条记录`)):(console.warn("API返回的提交历史格式不正确:",ae),Y.value=[]),f&&i({message:"提交历史已更新",type:"success"})}catch(n){console.error("获取提交历史失败:",n),f&&i({message:`获取提交历史失败: ${n.message}`,type:"error"})}finally{S.value=!1}}async function we(){if(!V.value){console.log("当前目录不是Git仓库,跳过加载Git状态");return}try{m.value=!0;const n=await(await fetch("/api/status")).json();n.status&&(te.value=n.status,W.value={staged:n.status.staged||[],unstaged:n.status.unstaged||[],untracked:n.status.untracked||[]}),await Le()}catch(f){console.error("获取Git状态失败:",f),i({message:`获取Git状态失败: ${f.message}`,type:"error"})}finally{m.value=!1}}async function Le(){if(console.log("开始获取Git状态(porcelain格式)..."),!V.value){console.log("当前目录不是Git仓库,跳过加载Git状态");return}try{const n=await(await fetch("/api/status_porcelain")).json();n.status!==void 0?Ge(n.status):oe.value=[]}catch(f){console.error("获取Git状态(porcelain)失败:",f),i({message:`获取Git状态(porcelain)失败: ${f.message}`,type:"error"}),oe.value=[]}}async function h(){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{D.value=!0;const n=await(await fetch("/api/add",{method:"POST"})).json();return n.success?(i({message:"文件已添加到暂存区",type:"success"}),we(),!0):(i({message:`添加文件失败: ${n.error}`,type:"error"}),!1)}catch(f){return i({message:`添加文件失败: ${f.message}`,type:"error"}),!1}finally{D.value=!1}}async function l(f){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{D.value=!0;const N=await(await fetch("/api/add-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:f})})).json();return N.success?(i({message:"文件已暂存",type:"success"}),we(),!0):(i({message:`暂存文件失败: ${N.error}`,type:"error"}),!1)}catch(n){return i({message:`暂存文件失败: ${n.message}`,type:"error"}),!1}finally{D.value=!1}}async function M(f){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{P.value=!0;const N=await(await fetch("/api/unstage-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:f})})).json();return N.success?(i({message:"已取消暂存文件",type:"success"}),we(),!0):(i({message:`取消暂存失败: ${N.error}`,type:"error"}),!1)}catch(n){return i({message:`取消暂存失败: ${n.message}`,type:"error"}),!1}finally{P.value=!1}}function A(f){return new Promise(n=>setTimeout(n,f))}async function re(f,n=!1){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{z.value=!0;const ae=await(await fetch("/api/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:f,hasNewlines:f.includes(`
|
|
3
|
-
`),noVerify:n})})).json();return ae.success?(i({message:"提交成功",type:"success"}),we(),Re(),se(),!0):(i({message:`提交失败: ${ae.error}`,type:"error"}),!1)}catch(N){return i({message:`提交失败: ${N.message}`,type:"error"}),!1}finally{z.value=!1}}async function pe(){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{O.value=!0;const n=await(await fetch("/api/push",{method:"POST"})).json();return n.success?(i({message:"推送成功",type:"success"}),we(),Re(),se(),!0):(i({message:`推送失败: ${n.error}`,type:"error"}),!1)}catch(f){return i({message:`推送失败: ${f.message}`,type:"error"}),!1}finally{O.value=!1}}async function ce(f,n=!1){return await h()?(await A(gt),await re(f,n)):!1}async function de(f,n=!1){try{return!await h()||(await A(gt),!await re(f,n))?!1:(await A(gt),await pe())}catch(N){try{(await(await fetch("/api/remove-lock",{method:"POST"})).json()).success&&i({message:"已清理锁定文件,请重试操作",type:"warning"})}catch(ae){console.error("清理锁定文件失败:",ae)}return i({message:`操作失败: ${N.message}`,type:"error"}),we(),Re(),se(),!1}}async function Se(){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{P.value=!0;const n=await(await fetch("/api/reset-head",{method:"POST"})).json();return n.success?(i({message:"已重置暂存区",type:"success"}),we(),!0):(i({message:`重置暂存区失败: ${n.error}`,type:"error"}),!1)}catch(f){return i({message:`重置暂存区失败: ${f.message}`,type:"error"}),!1}finally{P.value=!1}}async function ve(f){if(!V.value)return i.warning("当前目录不是Git仓库"),!1;try{P.value=!0;const N=await(await fetch("/api/reset-to-remote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:f})})).json();return N.success?(i({message:`已重置分支 ${f} 到远程状态`,type:"success"}),we(),Re(),!0):(i({message:`重置分支失败: ${N.error}`,type:"error"}),!1)}catch(n){return i({message:`重置分支失败: ${n.message}`,type:"error"}),!1}finally{P.value=!1}}async function fe(){if(V.value)try{K.value=!0,console.log("获取远程仓库地址...");const n=await(await fetch("/api/remote-url")).json();n.success?(X.value=n.url||"",console.log(`获取到远程仓库地址: ${X.value}`)):(console.warn("获取远程仓库地址失败:",n.error),X.value="")}catch(f){console.error("获取远程仓库地址失败:",f),X.value=""}finally{K.value=!1}}async function He(){if(!X.value)return i({message:"没有可复制的远程仓库地址",type:"warning"}),!1;try{return await navigator.clipboard.writeText(X.value),i({message:"已复制远程仓库地址",type:"success"}),!0}catch(f){return console.error("复制远程仓库地址失败:",f),i({message:`复制失败: ${f.message}`,type:"error"}),!1}}return tt(()=>{const f=localStorage.getItem("zen-gitsync-auto-update");f!==null&&(ee.value=f==="true"),ze()}),Zt(()=>{w&&(w.disconnect(),w=null)}),{currentBranch:me,allBranches:g,userName:k,userEmail:u,isChangingBranch:y,isCreatingBranch:E,isGitRepo:V,lastCheckedTime:F,branchAhead:C,branchBehind:J,hasUpstream:U,upstreamBranch:I,lastBranchStatusTime:j,lastBranchesTime:ne,remoteUrl:X,isLoadingRemoteUrl:K,log:Y,status:W,statusText:te,fileList:oe,isLoadingLog:S,isLoadingStatus:m,isAddingFiles:D,isCommiting:z,isResetting:P,autoUpdateEnabled:ee,$reset:ie,checkGitRepo:Ce,getCurrentBranch:_e,getAllBranches:b,changeBranch:ge,getUserInfo:be,createBranch:ye,clearUserConfig:Me,restoreUserConfig:je,getBranchStatus:se,gitPull:Pe,gitFetchAll:Ne,isPushing:O,isGitPulling:H,isGitFetching:L,initSocketConnection:ze,toggleAutoUpdate:Ve,parseStatusPorcelain:Ge,fetchLog:Re,fetchStatus:we,fetchStatusPorcelain:Le,addToStage:h,addFileToStage:l,unstageFile:M,commitChanges:re,pushToRemote:pe,addAndCommit:ce,addCommitAndPush:de,resetHead:Se,resetToRemote:ve,getRemoteUrl:fe,copyRemoteUrl:He}}),Cs={class:"card"},Ss={class:"status-header"},Ts={class:"header-actions"},xs={class:"card-content"},Vs={key:0,class:"status-box"},Ls={key:1,class:"status-box-wrap"},Bs={key:0,class:"branch-status-info"},zs={class:"branch-sync-status"},Rs={class:"sync-status-content"},Ds={class:"status-badges"},Gs={class:"badge-content"},As={class:"badge-content"},Es={key:1,class:"file-list-container"},Ms={key:0,class:"file-group"},js={class:"file-list"},Ps=["onClick"],Us={class:"file-info"},Os={class:"file-path-container"},Fs={class:"file-name"},Is={class:"file-directory"},Ns={class:"file-actions"},Hs={key:1,class:"file-group"},Ws={class:"file-list"},Js=["onClick"],qs={class:"file-info"},Ys={class:"file-path-container"},Xs={class:"file-name"},Zs={class:"file-directory"},Ks={class:"file-actions"},Qs={key:2,class:"file-group"},ea={class:"file-list"},ta=["onClick"],sa={class:"file-info"},aa={class:"file-path-container"},la={class:"file-name"},oa={class:"file-directory"},na={class:"file-actions"},ia={key:2,class:"empty-status"},ra={class:"empty-icon"},ca={class:"diff-content"},ua=["innerHTML"],da={key:1,class:"no-diff"},fa={class:"file-navigation"},pa={class:"file-counter"},va=rt({__name:"GitStatus",props:{initialDirectory:{type:String,default:""}},setup(me,{expose:g}){const k=me,u=et(),y=$e(()=>u.isLoadingStatus),E=c(""),V=c(""),F=c(!1),X=c(!1),K=c(-1),O=c(k.initialDirectory||"");async function H(){try{if(!O.value){const m=await(await fetch("/api/current_directory")).json();O.value=m.directory||"未知目录"}if(!u.isGitRepo)return;await u.fetchStatus(),await u.getBranchStatus(),i({message:"Git 状态已刷新",type:"success"})}catch(S){i({message:"刷新失败: "+S.message,type:"error"})}}function L(S){if(!S)return"";const m=S.split(`
|
|
4
|
-
`);function D(z){return z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return m.map(z=>{const P=D(z);return z.startsWith("diff --git")?`<div class="diff-header">${P}</div>`:z.startsWith("---")?`<div class="diff-old-file">${P}</div>`:z.startsWith("+++")?`<div class="diff-new-file">${P}</div>`:z.startsWith("@@")?`<div class="diff-hunk-header">${P}</div>`:z.startsWith("+")?`<div class="diff-added">${P}</div>`:z.startsWith("-")?`<div class="diff-removed">${P}</div>`:`<div class="diff-context">${P}</div>`}).join("")}async function C(S){try{X.value=!0,E.value=S,K.value=u.fileList.findIndex(D=>D.path===S);const m=u.fileList[K.value];if(m&&m.type==="untracked"){try{const z=await(await fetch(`/api/file-content?file=${encodeURIComponent(S)}`)).json();z.success&&z.content?V.value=`diff --git a/${S} b/${S}
|
|
5
|
-
新文件: ${S}
|
|
6
|
-
--- /dev/null
|
|
7
|
-
+++ b/${S}
|
|
8
|
-
@@ -0,0 +1,${z.content.split(`
|
|
9
|
-
`).length} @@
|
|
10
|
-
`+z.content.split(`
|
|
11
|
-
`).map(P=>`+${P}`).join(`
|
|
12
|
-
`):V.value=`这是一个新文件,尚未被Git跟踪。
|
|
13
|
-
添加到暂存区后可以提交该文件。`}catch(D){console.error("获取未跟踪文件内容失败:",D),V.value=`这是一个新文件,尚未被Git跟踪。
|
|
14
|
-
添加到暂存区后可以提交该文件。`}F.value=!0}else{const z=await(await fetch(`/api/diff?file=${encodeURIComponent(S)}`)).json();V.value=z.diff||"没有变更",F.value=!0}}catch(m){i({message:"获取文件差异失败: "+m.message,type:"error"}),V.value="获取差异失败: "+m.message}finally{X.value=!1}}async function J(){if(u.fileList.length===0||K.value<=0)return;const S=K.value-1,m=u.fileList[S];await C(m.path)}async function U(){if(u.fileList.length===0||K.value>=u.fileList.length-1)return;const S=K.value+1,m=u.fileList[S];await C(m.path)}function I(S){C(S.path)}async function j(S){await u.addFileToStage(S)}async function ne(S){await u.unstageFile(S)}async function w(){await H()}async function ee(){try{await u.gitPull(),await H()}catch(S){console.error("拉取操作发生错误:",S)}}async function Y(){try{await u.gitFetchAll(),await H()}catch(S){console.error("获取远程分支信息操作发生错误:",S)}}async function W(S){try{await Ie.confirm(`确定要撤回文件 "${S}" 的所有修改吗?此操作无法撤销。`,"撤回修改",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const D=await(await fetch("/api/revert_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:S})})).json();D.success?(i.success("已撤回文件修改"),await H()):i.error(D.error?`撤回失败: ${D.error}`:"撤回文件修改失败,请重试")}catch(m){if(m==="cancel"||m.message==="cancel")return;const D=m.message||"未知错误";D!=="undefined"?i.error(`撤回文件修改失败: ${D}`):i.error("撤回文件修改失败,请重试")}}function te(S){const m=S.split("/");return m[m.length-1]}function oe(S){const m=S.split("/");return m.length<=1?"":m.slice(0,-1).join("/")}return tt(()=>{H()}),qe(()=>u.autoUpdateEnabled,(S,m)=>{console.log(`自动更新状态变更: ${m} -> ${S}`),u.toggleAutoUpdate()},{immediate:!1}),g({refreshStatus:w}),(S,m)=>{const D=zt,z=_t,P=Be,ie=ut,se=ct,Ce=dt,_e=Mt;return p(),_(he,null,[e("div",Cs,[e("div",Ss,[m[2]||(m[2]=e("h2",null,"Git 状态",-1)),e("div",Ts,[t(z,{content:o(u).autoUpdateEnabled?"禁用自动更新文件状态":"启用自动更新文件状态",placement:"top","hide-after":1e3},{default:s(()=>[t(D,{modelValue:o(u).autoUpdateEnabled,"onUpdate:modelValue":m[0]||(m[0]=b=>o(u).autoUpdateEnabled=b),style:{"--el-switch-on-color":"#67C23A","--el-switch-off-color":"#909399","margin-right":"10px"},"inline-prompt":"","active-icon":o(Rt),"inactive-icon":o(Ct),class:"auto-update-switch"},null,8,["modelValue","active-icon","inactive-icon"])]),_:1},8,["content"]),t(z,{content:"Git Pull (拉取远程更新)",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"primary",icon:o(Dt),circle:"",size:"small",onClick:ee,loading:o(u).isGitPulling,disabled:!o(u).hasUpstream},null,8,["icon","loading","disabled"])]),_:1}),t(z,{content:"Git Fetch All (获取所有远程分支)",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"info",icon:o(Gt),circle:"",size:"small",onClick:Y,loading:o(u).isGitFetching},null,8,["icon","loading"])]),_:1}),t(z,{content:"刷新状态",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"primary",icon:o(Qt),circle:"",size:"small",onClick:w,loading:y.value},null,8,["icon","loading"])]),_:1})])]),e("div",xs,[o(u).isGitRepo?(p(),_("div",Ls,[o(u).hasUpstream&&(o(u).branchAhead>0||o(u).branchBehind>0)?(p(),_("div",Bs,[e("div",zs,[e("div",Rs,[t(z,{content:"本地分支与远程分支的状态对比",placement:"top"},{default:s(()=>[e("div",Ds,[o(u).branchAhead>0?(p(),Z(se,{key:0,size:"small",type:"warning",class:"status-badge"},{default:s(()=>[e("span",Gs,[t(ie,null,{default:s(()=>[t(o(es))]),_:1}),$(" 你的分支领先 'origin/"+B(o(u).currentBranch)+"' "+B(o(u).branchAhead)+" 个提交 ",1)])]),_:1})):q("",!0),o(u).branchBehind>0?(p(),Z(se,{key:1,size:"small",type:"info",class:"status-badge"},{default:s(()=>[e("span",As,[t(ie,null,{default:s(()=>[t(o(At))]),_:1}),$(" 你的分支落后 'origin/"+B(o(u).currentBranch)+"' "+B(o(u).branchBehind)+" 个提交 ",1)])]),_:1})):q("",!0)])]),_:1})])])])):q("",!0),o(u).fileList.length?(p(),_("div",Es,[o(u).fileList.some(b=>b.type==="added")?(p(),_("div",Ms,[m[5]||(m[5]=e("div",{class:"file-group-header"},"已暂存的更改",-1)),e("div",js,[(p(!0),_(he,null,Te(o(u).fileList.filter(b=>b.type==="added"),b=>(p(),_("div",{key:b.path,class:"file-item",onClick:ge=>I(b)},[e("div",Us,[e("div",Os,[e("span",Fs,B(te(b.path)),1),e("span",Is,B(oe(b.path)),1)])]),e("div",Ns,[t(z,{content:"取消暂存",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"warning",size:"small",circle:"",onClick:Ye(ge=>ne(b.path),["stop"])},{default:s(()=>m[4]||(m[4]=[$("-")])),_:2},1032,["onClick"])]),_:2},1024)])],8,Ps))),128))])])):q("",!0),o(u).fileList.some(b=>b.type==="modified"||b.type==="deleted")?(p(),_("div",Hs,[m[7]||(m[7]=e("div",{class:"file-group-header"},"未暂存的更改",-1)),e("div",Ws,[(p(!0),_(he,null,Te(o(u).fileList.filter(b=>b.type==="modified"||b.type==="deleted"),b=>(p(),_("div",{key:b.path,class:"file-item",onClick:ge=>I(b)},[e("div",qs,[e("div",{class:De(["file-status-indicator",b.type])},null,2),e("div",Ys,[e("span",Xs,B(te(b.path)),1),e("span",Zs,B(oe(b.path)),1)])]),e("div",Ks,[t(z,{content:"添加到暂存区",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"success",size:"small",circle:"",onClick:Ye(ge=>j(b.path),["stop"])},{default:s(()=>m[6]||(m[6]=[$("+")])),_:2},1032,["onClick"])]),_:2},1024),t(z,{content:"撤回修改",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"danger",size:"small",icon:o(wt),circle:"",onClick:Ye(ge=>W(b.path),["stop"])},null,8,["icon","onClick"])]),_:2},1024)])],8,Js))),128))])])):q("",!0),o(u).fileList.some(b=>b.type==="untracked")?(p(),_("div",Qs,[m[10]||(m[10]=e("div",{class:"file-group-header"},"未跟踪的文件",-1)),e("div",ea,[(p(!0),_(he,null,Te(o(u).fileList.filter(b=>b.type==="untracked"),b=>(p(),_("div",{key:b.path,class:"file-item",onClick:ge=>I(b)},[e("div",sa,[m[8]||(m[8]=e("div",{class:"file-status-indicator untracked"},null,-1)),e("div",aa,[e("span",la,B(te(b.path)),1),e("span",oa,B(oe(b.path)),1)])]),e("div",na,[t(z,{content:"添加到暂存区",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"success",size:"small",circle:"",onClick:Ye(ge=>j(b.path),["stop"])},{default:s(()=>m[9]||(m[9]=[$("+")])),_:2},1032,["onClick"])]),_:2},1024),t(z,{content:"删除文件",placement:"top","hide-after":1e3},{default:s(()=>[t(P,{type:"danger",size:"small",icon:o(Ct),circle:"",onClick:Ye(ge=>W(b.path),["stop"])},null,8,["icon","onClick"])]),_:2},1024)])],8,ta))),128))])])):q("",!0)])):o(u).isGitRepo?(p(),_("div",ia,[e("div",ra,[t(ie,null,{default:s(()=>[t(o(Et))]),_:1})]),m[11]||(m[11]=e("div",{class:"empty-text"},"没有检测到任何更改",-1)),m[12]||(m[12]=e("div",{class:"empty-subtext"},"工作区是干净的",-1))])):q("",!0)])):(p(),_("div",Vs,m[3]||(m[3]=[e("div",{class:"empty-status"},[e("p",null,"当前目录不是Git仓库")],-1)])))])]),t(Ce,{modelValue:F.value,"onUpdate:modelValue":m[1]||(m[1]=b=>F.value=b),title:`文件差异: ${E.value}`,width:"80%","destroy-on-close":"",class:"diff-dialog"},{footer:s(()=>[e("div",fa,[t(P,{type:"primary",icon:o(ts),onClick:J,disabled:K.value<=0||o(u).fileList.length===0,plain:"",class:"nav-button"},{default:s(()=>m[13]||(m[13]=[$(" 上一个文件 ")])),_:1},8,["icon","disabled"]),e("div",pa,[t(se,{type:"info",effect:"plain",class:"counter-tag"},{default:s(()=>[$(B(K.value+1)+" / "+B(o(u).fileList.length),1)]),_:1})]),t(P,{type:"primary",icon:o(St),onClick:U,disabled:K.value>=o(u).fileList.length-1||o(u).fileList.length===0,plain:"",class:"nav-button"},{icon:s(()=>[t(ie,{class:"el-icon--right"},{default:s(()=>[t(o(St))]),_:1})]),default:s(()=>[m[14]||(m[14]=$(" 下一个文件 "))]),_:1},8,["icon","disabled"])])]),default:s(()=>[Ke((p(),_("div",ca,[V.value?(p(),_("div",{key:0,innerHTML:L(V.value),class:"diff-formatted"},null,8,ua)):(p(),_("div",da,"该文件没有差异或是新文件"))])),[[_e,X.value]])]),_:1},8,["modelValue","title"])],64)}}}),ft=(me,g)=>{const k=me.__vccOpts||me;for(const[u,y]of g)k[u]=y;return k},ma=ft(va,[["__scopeId","data-v-2d84b59e"]]),Ft=Bt("config",()=>{const me=c(""),g=c([]),k=c([]),u=c([]),y=c(!1),E=c(!1),V=$e(()=>({defaultCommitMessage:me.value,descriptionTemplates:g.value,scopeTemplates:k.value,messageTemplates:u.value}));async function F(){if(E.value&&!y.value)return console.log("使用缓存的配置信息"),V.value;try{y.value=!0,console.log("加载配置信息...");const C=await(await fetch("/api/config/getConfig")).json();return me.value=C.defaultCommitMessage||"",g.value=C.descriptionTemplates||[],k.value=C.scopeTemplates||[],u.value=C.messageTemplates||[],E.value=!0,console.log("配置信息加载完成"),V.value}catch(L){return console.error("加载配置失败:",L),i.error(`加载配置失败: ${L.message}`),null}finally{y.value=!1}}async function X(L){try{const J=await(await fetch("/api/config/saveDefaultMessage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultCommitMessage:L})})).json();return J.success?(me.value=L,i.success("默认提交信息已保存"),!0):(i.error(`保存失败: ${J.error}`),!1)}catch(C){return i.error(`保存失败: ${C.message}`),!1}}async function K(L,C){try{const U=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:L,type:C})})).json();return U.success?(C==="description"?g.value.includes(L)||g.value.push(L):C==="scope"?k.value.includes(L)||k.value.push(L):C==="message"&&(u.value.includes(L)||u.value.push(L)),i.success("模板已保存"),!0):(i.error(`保存模板失败: ${U.error}`),!1)}catch(J){return i.error(`保存模板失败: ${J.message}`),!1}}async function O(L,C){try{const U=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:L,type:C})})).json();return U.success?(C==="description"?g.value=g.value.filter(I=>I!==L):C==="scope"?k.value=k.value.filter(I=>I!==L):C==="message"&&(u.value=u.value.filter(I=>I!==L)),i.success("模板已删除"),!0):(i.error(`删除模板失败: ${U.error}`),!1)}catch(J){return i.error(`删除模板失败: ${J.message}`),!1}}async function H(L,C,J){try{const I=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:L,newTemplate:C,type:J})})).json();if(I.success){if(J==="description"){const j=g.value.indexOf(L);j!==-1&&(g.value[j]=C)}else if(J==="scope"){const j=k.value.indexOf(L);j!==-1&&(k.value[j]=C)}else if(J==="message"){const j=u.value.indexOf(L);j!==-1&&(u.value[j]=C)}return i.success("模板已更新"),!0}else return i.error(`更新模板失败: ${I.error}`),!1}catch(U){return i.error(`更新模板失败: ${U.message}`),!1}}return{defaultCommitMessage:me,descriptionTemplates:g,scopeTemplates:k,messageTemplates:u,isLoading:y,isLoaded:E,config:V,loadConfig:F,saveDefaultMessage:X,saveTemplate:K,deleteTemplate:O,updateTemplate:H}}),ga={key:0,class:"pushing-indicator"},ya={key:0,class:"push-success-indicator"},ha={class:"card-content"},_a={class:"layout-container"},wa={key:0,class:"git-config-warning"},$a={class:"commit-section"},ba={class:"commit-options"},ka={class:"options-row"},Ca={class:"commit-mode-toggle"},Sa={class:"no-verify-toggle"},Ta={key:0,class:"commit-form"},xa={class:"description-container"},Va={class:"input-actions"},La={class:"preview-section"},Ba={class:"preview-content code-command"},za={key:1,class:"standard-commit-form"},Ra={class:"standard-commit-header"},Da={class:"type-scope-container"},Ga={class:"scope-wrapper"},Aa={class:"description-container"},Ea={class:"advanced-fields"},Ma={class:"preview-section"},ja={class:"preview-content"},Pa={class:"preview-content code-command"},Ua={class:"actions-section"},Oa={class:"action-groups"},Fa={class:"operations-wrapper"},Ia={class:"action-group"},Na={class:"group-buttons"},Ha={key:0},Wa={key:0},Ja={key:0},qa={key:0},Ya={class:"action-group"},Xa={class:"group-buttons"},Za={class:"action-group reset-group"},Ka={class:"group-buttons"},Qa={key:0},el={class:"template-container"},tl={class:"template-form"},sl={class:"template-form-buttons"},al={class:"template-list"},ll={class:"template-content"},ol={class:"template-actions"},nl={class:"template-container"},il={class:"template-form"},rl={class:"template-form-buttons"},cl={class:"template-list"},ul={class:"template-content"},dl={class:"template-actions"},fl={class:"template-container message-template-container"},pl={class:"template-form"},vl={class:"template-form-buttons"},ml={class:"templates-container"},gl={class:"message-templates-list"},yl={class:"templates-scroll-area"},hl={class:"template-content"},_l={class:"template-actions"},wl={class:"current-default-message"},$l={class:"default-message-content"},bl={class:"message-help-text"},kl=rt({__name:"CommitForm",setup(me){const g=et(),k=Ft(),u=c(""),y=c(!1),E=c("输入提交信息..."),V=c(""),F=c(!1),X=c("feat"),K=c(""),O=c(""),H=c(""),L=c(""),C=c([]),J=c(!1),U=c(""),I=c(!1),j=c(""),ne=c(-1),w=c([]),ee=c(!1),Y=c(""),W=c(!1),te=c(""),oe=c(-1),S=c(!1),m=c(""),D=c(!1),z=c(!1),P=[{value:"feat",label:"feat: 新功能"},{value:"fix",label:"fix: 修复bug"},{value:"docs",label:"docs: 文档修改"},{value:"style",label:"style: 样式修改"},{value:"refactor",label:"refactor: 代码重构"},{value:"test",label:"test: 测试代码"},{value:"chore",label:"chore: 构建/工具修改"}],ie=c([]),se=c(!1),Ce=c(""),_e=c(-1);qe(F,d=>{localStorage.setItem("zen-gitsync-standard-commit",d.toString())}),qe(D,d=>{localStorage.setItem("zen-gitsync-skip-hooks",d.toString())});const b=$e(()=>{if(!F.value)return u.value||V.value;let d=`${X.value||""}`;return K.value&&(d+=`(${K.value})`),d+=`: ${O.value}`,H.value&&(d+=`
|
|
15
|
-
|
|
16
|
-
${H.value}`),L.value&&(d+=`
|
|
17
|
-
|
|
18
|
-
${L.value}`),d}),ge=$e(()=>{let d=`git commit -m "${b.value}"`;return D.value&&(d+=" --no-verify"),d});function be(){const d=k.config;d&&(E.value=`输入提交信息 (默认: ${d.defaultCommitMessage})`,V.value=d.defaultCommitMessage||"",d.descriptionTemplates&&Array.isArray(d.descriptionTemplates)&&(C.value=d.descriptionTemplates),d.scopeTemplates&&Array.isArray(d.scopeTemplates)&&(w.value=d.scopeTemplates),d.messageTemplates&&Array.isArray(d.messageTemplates)&&(ie.value=d.messageTemplates))}async function ye(){if(!U.value.trim()){i({message:"请输入模板内容",type:"warning"});return}try{if(I.value)await Me();else{if(C.value.includes(U.value)){i({message:"该模板已存在",type:"warning"});return}await k.saveTemplate(U.value,"description")&&(C.value.includes(U.value)||C.value.push(U.value),C.value=[...C.value],U.value="")}}catch(d){i({message:`保存模板失败: ${d.message}`,type:"error"})}}async function Me(){if(!U.value.trim()){i({message:"请输入模板内容",type:"warning"});return}try{if(await k.updateTemplate(j.value,U.value,"description")){const a=C.value.indexOf(j.value);a!==-1&&(C.value[a]=U.value),C.value=[...C.value],I.value=!1,j.value="",ne.value=-1,U.value=""}}catch(d){i({message:`更新模板失败: ${d.message}`,type:"error"})}}function je(d,a){I.value=!0,j.value=d,ne.value=a,U.value=d}function Pe(){I.value=!1,j.value="",ne.value=-1,U.value=""}async function Ne(){if(!Y.value.trim()){i({message:"请输入模板内容",type:"warning"});return}try{if(W.value)await ze();else{if(w.value.includes(Y.value)){i({message:"该模板已存在",type:"warning"});return}await k.saveTemplate(Y.value,"scope")&&(w.value.includes(Y.value)||w.value.push(Y.value),w.value=[...w.value],Y.value="")}}catch(d){i({message:`保存模板失败: ${d.message}`,type:"error"})}}async function ze(){if(!Y.value.trim()){i({message:"请输入模板内容",type:"warning"});return}try{if(await k.updateTemplate(te.value,Y.value,"scope")){const a=w.value.indexOf(te.value);a!==-1&&(w.value[a]=Y.value),w.value=[...w.value],W.value=!1,te.value="",oe.value=-1,Y.value=""}}catch(d){i({message:`更新模板失败: ${d.message}`,type:"error"})}}function Ve(d,a){W.value=!0,te.value=d,oe.value=a,Y.value=d}function Ge(){W.value=!1,te.value="",oe.value=-1,Y.value=""}async function Re(d){try{if(await Ie.confirm(`确定要删除描述模板 "${d}" 吗?`,"删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await k.deleteTemplate(d,"description")){const Ae=C.value.indexOf(d);Ae!==-1&&C.value.splice(Ae,1),C.value=[...C.value]}}catch(a){if(a==="cancel")return;i({message:`删除模板失败: ${a.message}`,type:"error"})}}async function we(d){try{if(await Ie.confirm(`确定要删除作用域模板 "${d}" 吗?`,"删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await k.deleteTemplate(d,"scope")){const Ae=w.value.indexOf(d);Ae!==-1&&w.value.splice(Ae,1),w.value=[...w.value]}}catch(a){if(a==="cancel")return;i({message:`删除模板失败: ${a.message}`,type:"error"})}}function Le(d){O.value=d,J.value=!1}function h(d){K.value=d,ee.value=!1}function l(){J.value=!0}function M(){ee.value=!0}async function A(){try{await g.addToStage()&&g.fetchStatus()}catch(d){i({message:`添加文件失败: ${d.message}`,type:"error"})}}async function re(){if(!b.value.trim()){i({message:"提交信息不能为空",type:"warning"});return}try{await g.commitChanges(b.value,D.value)&&(f(),g.fetchStatus(),g.fetchLog(),g.getBranchStatus())}catch(d){i({message:`提交失败: ${d.message}`,type:"error"})}}function pe(){y.value=!0,setTimeout(()=>{y.value=!1},2e3)}async function ce(){try{await g.pushToRemote(),pe(),g.getBranchStatus()}catch(d){i({message:`推送失败: ${d.message}`,type:"error"})}finally{}}async function de(){try{await g.gitPull(),await g.fetchStatus()}catch(d){i({message:`拉取失败: ${d.message}`,type:"error"})}finally{}}async function Se(){try{await g.gitFetchAll(),await g.fetchStatus()}catch(d){i({message:`获取远程分支信息失败: ${d.message}`,type:"error"})}finally{}}async function ve(){if(!b.value.trim()){i({message:"提交信息不能为空",type:"warning"});return}try{await g.addAndCommit(b.value,D.value),f(),g.fetchStatus(),g.fetchLog()}catch(d){i({message:`暂存并提交失败: ${d.message}`,type:"error"})}}async function fe(){if(!b.value.trim()){i({message:"提交信息不能为空",type:"warning"});return}try{await g.addCommitAndPush(b.value,D.value),f(),pe()}catch(d){i({message:`暂存、提交并推送失败: ${d.message}`,type:"error"})}}async function He(){try{await Ie.confirm(`确定要重置当前分支 "${g.currentBranch}" 到远程状态吗?这将丢失所有未推送的提交和本地更改。`,"重置到远程分支",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await g.resetToRemote(g.currentBranch)&&(g.fetchStatus(),g.fetchLog())}catch(d){d!=="cancel"&&i({message:`重置到远程分支失败: ${d.message}`,type:"error"})}}function f(){u.value="",O.value="",H.value="",L.value=""}function n(){m.value=V.value,S.value=!0}async function N(){if(!m.value.trim()){i({message:"请输入默认提交信息",type:"warning"});return}try{await k.saveDefaultMessage(m.value)&&(V.value=m.value,E.value=`输入提交信息 (默认: ${m.value})`,S.value=!1)}catch(d){i({message:`保存默认提交信息失败: ${d.message}`,type:"error"})}}const ae=$e(()=>g.fileList.some(d=>["modified","deleted","untracked"].includes(d.type))),v=$e(()=>g.fileList.filter(d=>["modified","deleted","untracked"].includes(d.type)).length),r=$e(()=>g.fileList.filter(d=>d.type==="added").length),x=$e(()=>r.value>0),T=$e(()=>g.fileList.length>0),le=$e(()=>g.branchAhead>0),ue=$e(()=>g.branchBehind>0),xe=$e(()=>g.hasUpstream&&(le.value||x.value&&b.value.trim())),G=$e(()=>x.value),Je=$e(()=>g.hasUpstream&&(le.value||ue.value||T.value));async function pt(){if(!m.value.trim()){i({message:"请输入模板内容",type:"warning"});return}try{if(se.value)await Nt();else{if(ie.value.includes(m.value)){i({message:"该模板已存在",type:"warning"});return}ie.value.push(m.value);const a=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:m.value,type:"message"})})).json();a.success?(i({message:"提交信息模板保存成功!",type:"success"}),m.value=""):i({message:"模板保存失败: "+a.error,type:"error"})}}catch(d){i({message:"模板保存失败: "+d.message,type:"error"})}}async function Nt(){try{if(_e.value>=0){const d=Ce.value,a=m.value;ie.value[_e.value]=a;const We=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:d,newTemplate:a,type:"message"})})).json();We.success?(i({message:"提交信息模板更新成功!",type:"success"}),se.value=!1,Ce.value="",_e.value=-1,m.value=""):i({message:"模板更新失败: "+We.error,type:"error"})}}catch(d){i({message:"模板更新失败: "+d.message,type:"error"})}}function Ht(d,a){se.value=!0,Ce.value=d,_e.value=a,m.value=d}function Wt(){se.value=!1,Ce.value="",_e.value=-1,m.value=""}async function Jt(d){try{const a=ie.value.indexOf(d);a!==-1&&ie.value.splice(a,1);const We=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:d,type:"message"})})).json();We.success?i({message:"提交信息模板删除成功!",type:"success"}):i({message:"模板删除失败: "+We.error,type:"error"})}catch(a){i({message:"模板删除失败: "+a.message,type:"error"})}}function qt(d){u.value=d,m.value=d}return tt(async()=>{const d=localStorage.getItem("zen-gitsync-standard-commit");d!==null&&(F.value=d==="true");const a=localStorage.getItem("zen-gitsync-skip-hooks");a!==null&&(D.value=a==="true"),qe(()=>k.config,be,{immediate:!0}),k.config||await k.loadConfig()}),(d,a)=>{const Ae=ut,We=jt,bt=zt,Ee=_t,Ue=$t,Q=Be,Yt=nt,Xt=it,st=Ut,vt=os,at=Ot,mt=dt,kt=ct;return p(),_("div",{class:De(["card",{"is-pushing":o(g).isPushing}])},[a[58]||(a[58]=e("div",{class:"card-header"},[e("h2",null,"提交更改")],-1)),t(Tt,{name:"el-fade-in-linear"},{default:s(()=>[o(g).isPushing?(p(),_("div",ga,a[15]||(a[15]=[e("div",{class:"pushing-spinner"},[e("svg",{viewBox:"0 0 50 50",class:"circular"},[e("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})])],-1),e("div",{class:"pushing-text"},"正在推送...",-1)]))):q("",!0)]),_:1}),t(Tt,{name:"el-fade-in-linear"},{default:s(()=>[y.value?(p(),_("div",ya,[t(Ae,{class:"push-success-icon"},{default:s(()=>[t(o(Rt))]),_:1}),a[16]||(a[16]=e("div",{class:"push-success-text"},"推送成功!",-1))])):q("",!0)]),_:1}),e("div",ha,[e("div",_a,[o(g).userName===""||o(g).userEmail===""?(p(),_("div",wa,[t(We,{title:"Git用户信息未配置",type:"warning",closable:!1,"show-icon":""},{default:s(()=>a[17]||(a[17]=[e("p",null,"您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:",-1),e("pre",{class:"config-command"},`git config --global user.name "Your Name"
|
|
19
|
-
git config --global user.email "your.email@example.com"`,-1)])),_:1})])):(p(),_(he,{key:1},[e("div",$a,[e("div",ba,[e("div",ka,[e("div",Ca,[t(bt,{modelValue:F.value,"onUpdate:modelValue":a[0]||(a[0]=R=>F.value=R),"active-text":"标准化提交","inactive-text":"普通提交"},null,8,["modelValue"])]),e("div",Sa,[t(Ee,{content:"跳过 Git 钩子检查 (--no-verify)",placement:"top"},{default:s(()=>[t(bt,{modelValue:D.value,"onUpdate:modelValue":a[1]||(a[1]=R=>D.value=R),"active-text":"跳过钩子 (--no-verify)"},null,8,["modelValue"])]),_:1})])])]),F.value?(p(),_("div",za,[e("div",Ra,[e("div",Da,[t(Xt,{modelValue:X.value,"onUpdate:modelValue":a[3]||(a[3]=R=>X.value=R),placeholder:"提交类型",class:"type-select",clearable:""},{default:s(()=>[(p(),_(he,null,Te(P,R=>t(Yt,{key:R.value,label:R.label,value:R.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),e("div",Ga,[t(Ue,{modelValue:K.value,"onUpdate:modelValue":a[4]||(a[4]=R=>K.value=R),placeholder:"作用域(可选)",class:"scope-input",clearable:""},null,8,["modelValue"]),t(Q,{type:"primary",icon:o(Qe),circle:"",size:"small",class:"settings-button",onClick:M},null,8,["icon"])])]),e("div",Aa,[t(Ue,{modelValue:O.value,"onUpdate:modelValue":a[5]||(a[5]=R=>O.value=R),placeholder:"简短描述(必填)",class:"description-input",clearable:""},null,8,["modelValue"]),t(Q,{type:"primary",icon:o(Qe),circle:"",size:"small",class:"settings-button",onClick:l},null,8,["icon"])])]),e("div",{class:"advanced-options-toggle",onClick:a[6]||(a[6]=R=>z.value=!z.value)},[e("span",null,B(z.value?"收起":"正文及页脚"),1),t(Ae,{class:De(["toggle-icon",{"is-active":z.value}])},{default:s(()=>[t(o(At))]),_:1},8,["class"])]),Ke(e("div",Ea,[t(Ue,{modelValue:H.value,"onUpdate:modelValue":a[7]||(a[7]=R=>H.value=R),type:"textarea",rows:4,placeholder:"正文(可选):详细描述本次提交的内容和原因",class:"body-input",clearable:""},null,8,["modelValue"]),t(Ue,{modelValue:L.value,"onUpdate:modelValue":a[8]||(a[8]=R=>L.value=R),placeholder:"页脚(可选):如 Closes #123",class:"footer-input",clearable:""},null,8,["modelValue"])],512),[[Pt,z.value]]),e("div",Ma,[a[19]||(a[19]=e("div",{class:"preview-title"},"提交信息预览:",-1)),e("pre",ja,B(b.value),1),a[20]||(a[20]=e("div",{class:"preview-title",style:{"margin-top":"10px"}},"Git提交命令预览:",-1)),e("pre",Pa,B(ge.value),1)])])):(p(),_("div",Ta,[e("div",xa,[t(Ue,{modelValue:u.value,"onUpdate:modelValue":a[2]||(a[2]=R=>u.value=R),placeholder:E.value,type:"textarea",rows:6,resize:"none",class:"commit-message-input"},null,8,["modelValue","placeholder"]),e("div",Va,[t(Q,{type:"primary",icon:o(Qe),circle:"",size:"small",class:"settings-button",onClick:n},null,8,["icon"])])]),e("div",La,[a[18]||(a[18]=e("div",{class:"preview-title"},"Git提交命令预览:",-1)),e("pre",Ba,'git commit -m "'+B(b.value||"<提交信息>")+'"'+B(D.value?" --no-verify":""),1)])]))]),e("div",Ua,[a[33]||(a[33]=e("h3",null,"Git 操作",-1)),e("div",Oa,[e("div",Fa,[e("div",Ia,[a[26]||(a[26]=e("div",{class:"group-title"},"基础操作",-1)),e("div",Na,[t(Ee,{content:ae.value?`暂存${v.value}个待更改文件`:"git add .",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"primary",onClick:A,loading:o(g).isAddingFiles,disabled:!ae.value,class:"action-button"},{default:s(()=>[a[21]||(a[21]=$(" 暂存更改 ")),v.value>0?(p(),_("span",Ha,"("+B(v.value)+")",1)):q("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),t(Ee,{content:x.value?`提交${r.value}个已暂存文件`:"git commit",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"primary",onClick:re,loading:o(g).isLoadingStatus,disabled:!x.value||!b.value.trim(),class:"action-button"},{default:s(()=>[a[22]||(a[22]=$(" 提交 ")),r.value>0?(p(),_("span",Wa,"("+B(r.value)+")",1)):q("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),t(Ee,{content:le.value?`推送${o(g).branchAhead}个本地提交`:"git push",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"primary",icon:o(ss),onClick:ce,loading:o(g).isPushing,disabled:!xe.value,class:De(["action-button","push-button",{"is-loading":o(g).isPushing}]),style:ht(le.value?{backgroundColor:"#67c23a !important",borderColor:"#67c23a !important"}:{})},{default:s(()=>[a[23]||(a[23]=$(" 推送 ")),le.value?(p(),_("span",Ja,"("+B(o(g).branchAhead)+")",1)):q("",!0)]),_:1},8,["icon","loading","disabled","class","style"])]),_:1},8,["content"]),t(Ee,{content:ue.value?`拉取${o(g).branchBehind}个远程提交`:"git pull",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"primary",icon:o(Dt),onClick:de,loading:o(g).isGitPulling,disabled:!o(g).hasUpstream,class:"action-button",style:ht(ue.value?{color:"white",backgroundColor:"#E6A23C",borderColor:"#E6A23C"}:{})},{default:s(()=>[a[24]||(a[24]=$(" 拉取 ")),ue.value?(p(),_("span",qa,"("+B(o(g).branchBehind)+")",1)):q("",!0)]),_:1},8,["icon","loading","disabled","style"])]),_:1},8,["content"]),t(Ee,{content:"git fetch --all",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"info",icon:o(Gt),onClick:Se,loading:o(g).isGitFetching,class:"action-button"},{default:s(()=>a[25]||(a[25]=[$(" 获取所有远程分支 ")])),_:1},8,["icon","loading"])]),_:1})])]),e("div",Ya,[a[29]||(a[29]=e("div",{class:"group-title"},"组合操作",-1)),e("div",Xa,[t(Ee,{content:"git add + git commit",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"primary",icon:o(lt),onClick:ve,loading:o(g).isAddingFiles||o(g).isCommiting,disabled:!ae.value||!b.value.trim(),class:"action-button"},{default:s(()=>a[27]||(a[27]=[$(" 暂存并提交 ")])),_:1},8,["icon","loading","disabled"])]),_:1}),t(Ee,{content:"git add + git commit + git push",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"success",icon:o(as),onClick:fe,loading:o(g).isAddingFiles||o(g).isCommiting||o(g).isPushing,disabled:!T.value||!b.value.trim()||!o(g).hasUpstream,class:De(["action-button","one-click-push",{"is-loading":o(g).isAddingFiles||o(g).isCommiting||o(g).isPushing}])},{default:s(()=>a[28]||(a[28]=[$(" 一键推送 ")])),_:1},8,["icon","loading","disabled","class"])]),_:1})])])]),e("div",Za,[a[32]||(a[32]=e("div",{class:"group-title"},"重置操作",-1)),e("div",Ka,[t(Ee,{content:G.value?`撤销${r.value}个已暂存文件`:"git reset HEAD",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"warning",icon:o(wt),onClick:o(g).resetHead,loading:o(g).isResetting,disabled:!G.value,class:"action-button reset-button"},{default:s(()=>[a[30]||(a[30]=$(" 重置暂存区 ")),r.value>0?(p(),_("span",Qa,"("+B(r.value)+")",1)):q("",!0)]),_:1},8,["icon","onClick","loading","disabled"])]),_:1},8,["content"]),t(Ee,{content:"git reset --hard origin/branch",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:s(()=>[t(Q,{type:"danger",icon:o(ls),onClick:He,loading:o(g).isResetting,disabled:!Je.value,class:"action-button danger-button"},{default:s(()=>a[31]||(a[31]=[$(" 重置到远程 ")])),_:1},8,["icon","loading","disabled"])]),_:1})])])])])],64))]),t(mt,{title:"简短描述模板设置",modelValue:J.value,"onUpdate:modelValue":a[10]||(a[10]=R=>J.value=R),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"template-dialog"},{default:s(()=>[e("div",el,[e("div",tl,[t(Ue,{modelValue:U.value,"onUpdate:modelValue":a[9]||(a[9]=R=>U.value=R),placeholder:I.value?"编辑模板内容":"输入新模板内容",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",sl,[I.value?(p(),Z(Q,{key:0,onClick:Pe},{default:s(()=>a[34]||(a[34]=[$("取消")])),_:1})):q("",!0),t(Q,{type:"primary",onClick:ye,disabled:!U.value.trim()},{default:s(()=>[$(B(I.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"])])]),e("div",al,[a[38]||(a[38]=e("h3",null,"已保存模板",-1)),C.value.length===0?(p(),Z(st,{key:0,description:"暂无保存的模板"})):q("",!0),(p(!0),_(he,null,Te(C.value,(R,Oe)=>(p(),Z(at,{key:Oe,class:"template-item"},{default:s(()=>[t(vt,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:s(()=>[e("div",ll,B(R),1),e("div",ol,[t(Q,{type:"primary",size:"small",onClick:Fe=>Le(R)},{default:s(()=>a[35]||(a[35]=[$("使用")])),_:2},1032,["onClick"]),t(Q,{type:"warning",size:"small",icon:o(lt),onClick:Fe=>je(R,Oe)},{default:s(()=>a[36]||(a[36]=[$("编辑")])),_:2},1032,["icon","onClick"]),t(Q,{type:"danger",size:"small",onClick:Fe=>Re(R)},{default:s(()=>a[37]||(a[37]=[$("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])])]),_:1},8,["modelValue"]),t(mt,{title:"作用域模板设置",modelValue:ee.value,"onUpdate:modelValue":a[12]||(a[12]=R=>ee.value=R),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"template-dialog"},{default:s(()=>[e("div",nl,[e("div",il,[t(Ue,{modelValue:Y.value,"onUpdate:modelValue":a[11]||(a[11]=R=>Y.value=R),placeholder:W.value?"编辑作用域模板内容":"输入新作用域模板",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",rl,[W.value?(p(),Z(Q,{key:0,onClick:Ge},{default:s(()=>a[39]||(a[39]=[$("取消")])),_:1})):q("",!0),t(Q,{type:"primary",onClick:Ne,disabled:!Y.value.trim()},{default:s(()=>[$(B(W.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"])])]),e("div",cl,[a[43]||(a[43]=e("h3",null,"已保存作用域",-1)),w.value.length===0?(p(),Z(st,{key:0,description:"暂无保存的作用域"})):q("",!0),(p(!0),_(he,null,Te(w.value,(R,Oe)=>(p(),Z(at,{key:Oe,class:"template-item"},{default:s(()=>[t(vt,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:s(()=>[e("div",ul,B(R),1),e("div",dl,[t(Q,{type:"primary",size:"small",onClick:Fe=>h(R)},{default:s(()=>a[40]||(a[40]=[$("使用")])),_:2},1032,["onClick"]),t(Q,{type:"warning",size:"small",icon:o(lt),onClick:Fe=>Ve(R,Oe)},{default:s(()=>a[41]||(a[41]=[$("编辑")])),_:2},1032,["icon","onClick"]),t(Q,{type:"danger",size:"small",onClick:Fe=>we(R)},{default:s(()=>a[42]||(a[42]=[$("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])])]),_:1},8,["modelValue"]),t(mt,{title:"默认提交信息设置",modelValue:S.value,"onUpdate:modelValue":a[14]||(a[14]=R=>S.value=R),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"message-template-dialog"},{default:s(()=>[e("div",fl,[e("div",pl,[t(Ue,{modelValue:m.value,"onUpdate:modelValue":a[13]||(a[13]=R=>m.value=R),placeholder:se.value?"编辑模板内容":"输入新模板内容",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",vl,[se.value?(p(),Z(Q,{key:0,onClick:Wt},{default:s(()=>a[44]||(a[44]=[$("取消")])),_:1})):q("",!0),t(Q,{type:"primary",onClick:pt,disabled:!m.value.trim()},{default:s(()=>[$(B(se.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"]),t(Q,{type:"success",onClick:N,disabled:!m.value.trim()},{default:s(()=>a[45]||(a[45]=[$(" 设为默认提交信息 ")])),_:1},8,["disabled"])])]),e("div",ml,[e("div",gl,[a[49]||(a[49]=e("h3",null,"已保存模板",-1)),e("div",yl,[ie.value.length===0?(p(),Z(st,{key:0,description:"暂无保存的模板"})):q("",!0),(p(!0),_(he,null,Te(ie.value,(R,Oe)=>(p(),Z(at,{key:Oe,class:"template-item"},{default:s(()=>[t(vt,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:s(()=>[e("div",hl,B(R),1),e("div",_l,[t(Q,{type:"primary",size:"small",onClick:Fe=>qt(R)},{default:s(()=>a[46]||(a[46]=[$("使用")])),_:2},1032,["onClick"]),t(Q,{type:"warning",size:"small",icon:o(lt),onClick:Fe=>Ht(R,Oe)},{default:s(()=>a[47]||(a[47]=[$("编辑")])),_:2},1032,["icon","onClick"]),t(Q,{type:"danger",size:"small",onClick:Fe=>Jt(R)},{default:s(()=>a[48]||(a[48]=[$("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])]),e("div",wl,[a[57]||(a[57]=e("h3",null,"当前默认提交信息",-1)),V.value?(p(),Z(at,{key:0,class:"default-message-card"},{default:s(()=>[e("div",$l,B(V.value),1)]),_:1})):(p(),Z(st,{key:1,description:"尚未设置默认提交信息","image-size":100})),e("div",bl,[a[55]||(a[55]=e("h4",null,"关于默认提交信息",-1)),a[56]||(a[56]=e("p",null,"默认提交信息将在未输入提交信息时自动使用。",-1)),e("p",null,[a[52]||(a[52]=$("你可以通过点击左侧模板的")),t(kt,{size:"small",type:"primary"},{default:s(()=>a[50]||(a[50]=[$("使用")])),_:1}),a[53]||(a[53]=$("按钮先选择喜欢的模板,然后点击上方")),t(kt,{size:"small",type:"success"},{default:s(()=>a[51]||(a[51]=[$("设为默认提交信息")])),_:1}),a[54]||(a[54]=$("按钮保存。"))])])])])])]),_:1},8,["modelValue"])])],2)}}}),Cl=ft(kl,[["__scopeId","data-v-168d7529"]]),Sl={class:"card"},Tl={key:0,class:"refresh-notification"},xl={class:"log-header"},Vl={class:"log-actions"},Ll={key:1,class:"filter-panel-header"},Bl={class:"filter-form"},zl={class:"filter-item"},Rl={class:"filter-item"},Dl={class:"filter-item"},Gl={class:"filter-item"},Al={class:"filter-actions"},El={key:0},Ml={key:1,class:"content-area-content"},jl={key:0,class:"graph-view"},Pl={key:0,class:"commit-count"},Ul={class:"graph-controls"},Ol={class:"zoom-controls"},Fl={class:"scale-info"},Il={key:1,class:"table-view-container"},Nl=["onClick"],Hl={class:"author-name"},Wl={key:0,class:"branch-container"};const Jl={class:"commit-detail-container"},ql={key:0,class:"commit-info"},Yl={class:"commit-info-header"},Xl={class:"info-item"},Zl={class:"item-value"},Kl={class:"info-item"},Ql={class:"item-value"},eo={class:"info-item"},to={class:"item-value"},so={class:"commit-message-container"},ao=["innerHTML"],lo={class:"commit-files-diff"},oo={class:"files-list"},no={key:1},io=["onClick"],ro={class:"file-diff"},co={key:0},uo={key:1},fo=["innerHTML"],Ze=.5,ot=1.5,yt=.1,po=rt({__name:"LogList",setup(me,{expose:g}){const k=et();let u=[];const y=c(u),E=c(""),V=c(!1),F=$e(()=>k.isLoadingLog||V.value),X=c(!1),K=c(0),O=c(!1),H=c(null),L=c(1),C=c(!0),J=c(!1),U=c(null),I=c(!1),j=c(null),ne=c([]),w=c(""),ee=c(!1),Y=c(""),W=c(1),te=c(!1),oe=c(!1),S=c([]),m=c(""),D=c(null),z=c([]),P=c([]),ie=c([]),se=c(!1),Ce=c(0),_e=c(0),b=c(null),ge=$e(()=>y.value);async function be(v=!1,r=1){if(!et().isGitRepo){E.value="当前目录不是Git仓库";return}try{r>1?J.value=!0:V.value=!0,console.log(`加载提交历史: page=${r}, all=${v}`);const T=new URLSearchParams;T.append("page",r.toString()),T.append("all",v.toString()),S.value.length>0&&T.append("author",S.value.join(",")),P.value.length>0&&T.append("branch",P.value.join(",")),m.value&&T.append("message",m.value),D.value&&Array.isArray(D.value)&&D.value.length===2&&(T.append("dateFrom",D.value[0]),T.append("dateTo",D.value[1])),T.append("_t",Date.now().toString());const ue=await(await fetch(`/api/log?${T.toString()}`)).json();if(!ue||!ue.data||!Array.isArray(ue.data)){console.error("API返回的数据格式不正确:",ue),E.value="加载提交历史失败: 服务器返回数据格式不正确";return}const xe=r>1;xe?ue.data.forEach(G=>u.push(G)):(u.length=0,ue.data.forEach(G=>u.push(G))),y.value=[...u],L.value=r,K.value=ue.total||u.length,C.value=ue.hasMore===!0,C.value||console.log("已加载所有提交记录"),xe||(te.value=!0,setTimeout(()=>{te.value=!1},2e3)),!xe&&O.value&&setTimeout(ye,0),E.value=""}catch(T){E.value="加载提交历史失败: "+(T instanceof Error?T.message:String(T)),console.error("加载日志失败:",T),r>1&&(C.value=!1)}finally{r>1?J.value=!1:V.value=!1}}async function ye(){if(console.log(`开始渲染图表...数据长度: ${u.length}`),!H.value){console.error("图表容器未找到");return}if(u.length===0){console.error("没有日志数据可渲染");return}try{H.value.innerHTML="",console.log(`创建gitgraph实例,分支: ${k.currentBranch||"main"}`);const v=hs(H.value,{orientation:"vertical-reverse",template:"metro",author:"提交者 <committer@example.com>"}),r={},x=v.branch(k.currentBranch||"main");r[k.currentBranch||"main"]=x,console.log(`开始创建提交图...共${u.length}条提交`),u.forEach((T,le)=>{let ue=x;if(T.branch){const xe=Pe(T.branch.split(",")[0]);r[xe]||(r[xe]=v.branch(xe)),ue=r[xe]}ue.commit({hash:T.hash,subject:T.message,author:`${T.author} <${T.email}>`}),le%10===0&&console.log(`已渲染 ${le+1}/${u.length} 个提交`)}),console.log("图表渲染完成"),setTimeout(()=>{A()},100)}catch(v){console.error("渲染图表失败:",v),E.value="渲染图表失败: "+(v instanceof Error?v.message:String(v))}}function Me(){O.value=!O.value,O.value&&u.length>0&&setTimeout(ye,0)}function je(){be(!X.value)}function Pe(v){return v.includes("HEAD -> ")?v.replace("HEAD -> ",""):v.includes("origin/")?v:v.trim()}function Ne(v){return v.includes("HEAD")?"success":v.includes("origin/")?"warning":"info"}const ze=c(null),Ve=c(null);function Ge(v){if(O.value||!C.value||J.value||F.value)return;const r=v.target,{scrollTop:x,scrollHeight:T,clientHeight:le}=r,ue=T-x-le;console.log("表格滚动:",{scrollTop:x,scrollHeight:T,clientHeight:le,scrollDistance:ue}),ue<=20&&(console.log("已滚动到底部,加载更多数据"),Se())}function Re(){ze.value&&(Ve.value=ze.value.$el.querySelector(".el-table__body-wrapper"),Ve.value?(console.log("添加表格滚动监听"),Ve.value.addEventListener("scroll",Ge,!0)):console.error("未找到表格的body-wrapper元素"))}function we(){Ve.value&&(console.log("移除表格滚动监听"),Ve.value.removeEventListener("scroll",Ge,!0),Ve.value=null)}tt(()=>{k.isGitRepo?(k.log.length>0?(console.log("使用已加载的日志数据"),u.length=0,k.log.forEach(v=>u.push(v)),K.value=k.log.length,O.value&&setTimeout(()=>{console.log(`准备渲染图表,数据长度: ${u.length}`),ye()},100)):(console.log("初始加载日志数据"),be()),He()):E.value="当前目录不是Git仓库",xt(()=>{setTimeout(()=>{Re()},500)})}),qe(()=>k.allBranches,v=>{v&&v.length>0?(ie.value=[...v].sort(),console.log(`分支数据更新,共 ${ie.value.length} 个分支`)):(ie.value=[],console.warn("gitStore 中没有分支数据"))},{immediate:!0}),ns(()=>{we(),U.value!==null&&(window.clearInterval(U.value),U.value=null)});async function Le(){await k.fetchLog(!0),u.length=0,k.log.forEach(v=>u.push(v)),y.value=[...u],K.value=k.log.length,L.value=1,C.value=!1,te.value=!0,setTimeout(()=>{te.value=!1},2e3),O.value&&(await xt(),ye())}qe(()=>k.log,v=>{console.log("监听到gitStore.log变化,更新图表数据");try{u.length=0,Array.isArray(v)&&v.forEach(r=>r&&u.push(r)),K.value=u.length,L.value=1,y.value=[...u],te.value=!0,setTimeout(()=>{te.value=!1},2e3),console.log(`数据更新完成,共${y.value.length}条记录,准备渲染图表`),O.value&&u.length>0&&setTimeout(ye,0)}catch(r){console.error("更新日志数据失败:",r)}},{immediate:!0}),g({refreshLog:Le});function h(){W.value<ot&&(W.value=Math.min(ot,W.value+yt),M())}function l(){W.value>Ze&&(W.value=Math.max(Ze,W.value-yt),M())}function M(){if(!H.value)return;const v=H.value.querySelector("svg");v&&(v.style.transform=`scale(${W.value})`,v.style.transformOrigin="top left")}function A(){if(!H.value)return;const v=H.value.querySelector("svg");if(!v)return;const r=v.getBoundingClientRect().width/W.value,x=H.value.clientWidth;r>x?W.value=Math.max(Ze,x/r):W.value=1,M()}async function re(v){if(v){j.value=v,I.value=!0,ee.value=!0,ne.value=[],w.value="",Y.value="",console.log("提交详情对象:",JSON.stringify(v,null,2)),console.log("哈希值类型和长度:",typeof v.hash,v.hash?v.hash.length:0),console.log("提交信息类型和长度:",typeof v.message,v.message?v.message.length:0),console.log("提交分支:",v.branch);try{if(console.log(`获取提交详情: ${v.hash}`),!v.hash||v.hash.length<7){console.error("无效的提交哈希值:",v.hash),w.value="无效的提交哈希值",ee.value=!1;return}const r=await fetch(`/api/commit-files?hash=${v.hash}`);console.log("API响应状态: ",r.status);const x=await r.json();console.log("文件列表数据: ",x),x.success&&Array.isArray(x.files)?(ne.value=x.files,ne.value.length>0?await pe(v.hash,ne.value[0]):(console.log("没有找到变更文件"),w.value="该提交没有变更文件")):(console.error("获取提交文件列表失败:",x.error||"未知错误"),w.value=`获取文件列表失败: ${x.error||"未知错误"}`)}catch(r){console.error("获取提交详情失败:",r),w.value=`获取提交详情失败: ${r.message}`}finally{ee.value=!1}}}async function pe(v,r){ee.value=!0,Y.value=r;try{console.log(`获取文件差异: hash=${v}, file=${r}`);const x=await fetch(`/api/commit-file-diff?hash=${v}&file=${encodeURIComponent(r)}`);console.log("差异API响应状态: ",x.status);const T=await x.json();console.log("差异数据: ",T.success,typeof T.diff),T.success?w.value=T.diff||"没有变更内容":(console.error("获取差异失败: ",T.error),w.value=`获取差异失败: ${T.error||"未知错误"}`)}catch(x){console.error("获取文件差异失败:",x),w.value=`获取差异失败: ${x.message}`}finally{ee.value=!1}}function ce(v){if(!v)return"";const r=v.split(`
|
|
20
|
-
`);function x(T){return T.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return r.map(T=>{const le=x(T);return T.startsWith("diff --git")?`<div class="diff-header">${le}</div>`:T.startsWith("---")?`<div class="diff-old-file">${le}</div>`:T.startsWith("+++")?`<div class="diff-new-file">${le}</div>`:T.startsWith("@@")?`<div class="diff-hunk-header">${le}</div>`:T.startsWith("+")?`<div class="diff-added">${le}</div>`:T.startsWith("-")?`<div class="diff-removed">${le}</div>`:`<div class="diff-context">${le}</div>`}).join("")}function de(v){return v?(console.log("格式化前的提交信息:",v),console.log("提交信息中的换行符数量:",(v.match(/\n/g)||[]).length),v.trim()):"(无提交信息)"}function Se(){!C.value||J.value||F.value||(console.log(`加载更多日志,页码: ${L.value+1}`),be(X.value,L.value+1))}function ve(){S.value=[],P.value=[],m.value="",D.value=null,L.value=1,be(X.value,1)}function fe(){L.value=1,be(X.value,1)}async function He(){try{console.log("获取所有可用作者...");const r=await(await fetch("/api/authors")).json();r.success&&Array.isArray(r.authors)?(z.value=r.authors.sort(),console.log(`获取到${z.value.length}位作者`)):(console.warn("从API获取作者列表失败,将从现有日志中提取作者列表"),f())}catch(v){console.error("获取作者列表失败:",v),f()}}function f(){const v=new Set;y.value.forEach(r=>{r.author&&v.add(r.author)}),z.value=Array.from(v).sort(),console.log(`从现有日志中提取了${z.value.length}位作者`)}function n(v,r,x){console.log("handleContextMenu",v,r,x),x.preventDefault(),Ce.value=x.clientY,_e.value=x.clientX,b.value=v,se.value=!0;const T=()=>{se.value=!1,document.removeEventListener("click",T)};setTimeout(()=>{document.addEventListener("click",T)},0)}async function N(v){if(v)try{await Ie.confirm(`确定要撤销提交 ${v.hash.substring(0,7)} 吗?这将创建一个新的提交来撤销这次提交的更改。`,"撤销提交确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const x=await(await fetch("/api/revert-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:v.hash})})).json();x.success?(i.success(x.message||"已成功撤销提交"),Le(),k.fetchStatus(),k.getBranchStatus()):i.error(x.error||"撤销提交失败")}catch(r){r!=="cancel"&&(console.error("撤销提交出错:",r),i.error("撤销提交失败: "+(r.message||r)))}}async function ae(v){if(v)try{await Ie.confirm(`确定要将提交 ${v.hash.substring(0,7)} Cherry-Pick 到当前分支吗?`,"Cherry-Pick确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const x=await(await fetch("/api/cherry-pick-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:v.hash})})).json();x.success?(i.success(x.message||"已成功Cherry-Pick提交"),Le(),k.fetchStatus(),k.getBranchStatus()):i.error(x.error||"Cherry-Pick提交失败")}catch(r){r!=="cancel"&&(console.error("Cherry-Pick提交出错:",r),i.error("Cherry-Pick提交失败: "+(r.message||r)))}}return(v,r)=>{var xe;const x=ut,T=_t,le=Ut,ue=Mt;return p(),_(he,null,[e("div",Sl,[te.value?(p(),_("div",Tl," 提交历史已刷新 ")):q("",!0),e("div",xl,[r[12]||(r[12]=e("div",{class:"header-left"},[e("h2",null,"提交历史")],-1)),e("div",Vl,[O.value?q("",!0):(p(),Z(o(Be),{key:0,type:oe.value?"primary":"default",size:"small",onClick:r[0]||(r[0]=G=>oe.value=!oe.value),class:De(["action-button filter-button",{"active-filter":oe.value}])},{icon:s(()=>[t(x,null,{default:s(()=>[t(o(rs))]),_:1})]),default:s(()=>[r[11]||(r[11]=$(" 筛选 ")),ge.value.length!==y.value.length?(p(),Z(o(is),{key:0,value:ge.value.length,class:"filter-badge"},null,8,["value"])):q("",!0)]),_:1},8,["type","class"])),t(o(Be),{type:"primary",size:"small",onClick:Me,class:De(["action-button view-mode-button",{"active-view":O.value}])},{icon:s(()=>[t(x,null,{default:s(()=>[(p(),Z(Vt(O.value?o(Et):o(cs))))]),_:1})]),default:s(()=>[$(" "+B(O.value?"表格视图":"图表视图"),1)]),_:1},8,["class"]),t(o(Be),{type:"success",size:"small",onClick:je,loading:F.value,class:De(["action-button commit-display-button",{"active-commits":X.value}])},{icon:s(()=>[t(x,null,{default:s(()=>[(p(),Z(Vt(X.value?o(us):o(ds))))]),_:1})]),default:s(()=>[$(" "+B(X.value?"显示分页加载":"显示所有提交"),1)]),_:1},8,["loading","class"]),t(o(Be),{circle:"",size:"small",onClick:r[1]||(r[1]=G=>Le()),class:De([{"refresh-button-animated":te.value},"action-button refresh-button"])},{default:s(()=>[F.value?(p(),Z(x,{key:1},{default:s(()=>[t(o(fs))]),_:1})):(p(),Z(x,{key:0},{default:s(()=>[t(o(wt))]),_:1}))]),_:1},8,["class"])])]),oe.value&&!O.value?(p(),_("div",Ll,[e("div",Bl,[e("div",zl,[t(o(it),{modelValue:S.value,"onUpdate:modelValue":r[2]||(r[2]=G=>S.value=G),placeholder:"选择作者",multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{prefix:s(()=>r[13]||(r[13]=[e("span",{class:"compact-label"},"作者",-1)])),default:s(()=>[(p(!0),_(he,null,Te(z.value,G=>(p(),Z(o(nt),{key:G,label:G,value:G},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e("div",Rl,[t(o(it),{modelValue:P.value,"onUpdate:modelValue":r[3]||(r[3]=G=>P.value=G),placeholder:"选择分支",multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{prefix:s(()=>r[14]||(r[14]=[e("span",{class:"compact-label"},"分支",-1)])),default:s(()=>[(p(!0),_(he,null,Te(ie.value,G=>(p(),Z(o(nt),{key:G,label:G,value:G},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e("div",Dl,[t(o($t),{modelValue:m.value,"onUpdate:modelValue":r[4]||(r[4]=G=>m.value=G),placeholder:"提交信息关键词",clearable:"",class:"filter-input",size:"small"},{prefix:s(()=>r[15]||(r[15]=[e("span",{class:"compact-label"},"信息",-1)])),_:1},8,["modelValue"])]),e("div",Gl,[t(o(ps),{modelValue:D.value,"onUpdate:modelValue":r[5]||(r[5]=G=>D.value=G),type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",class:"filter-input date-range",size:"small"},{prefix:s(()=>r[16]||(r[16]=[e("span",{class:"compact-label"},"日期",-1)])),_:1},8,["modelValue"])]),e("div",Al,[t(o(Be),{type:"primary",size:"small",onClick:fe,class:"filter-action-button"},{default:s(()=>r[17]||(r[17]=[$("应用")])),_:1}),t(o(Be),{type:"info",size:"small",onClick:ve,class:"filter-action-button"},{default:s(()=>r[18]||(r[18]=[$("重置")])),_:1})])])])):q("",!0),e("div",{class:De(["content-area",{"with-filter":oe.value&&!O.value}])},[E.value?(p(),_("div",El,B(E.value),1)):(p(),_("div",Ml,[O.value?(p(),_("div",jl,[o(u).length>0?(p(),_("div",Pl," 显示 "+B(o(u).length)+" 条提交记录 "+B(X.value?"(全部)":"(分页加载,每页100条)"),1)):q("",!0),e("div",Ul,[e("div",Ol,[t(o(Be),{type:"primary",circle:"",size:"small",onClick:l,disabled:W.value<=Ze},{default:s(()=>[t(x,null,{default:s(()=>[t(o(vs))]),_:1})]),_:1},8,["disabled"]),t(o(ms),{modelValue:W.value,"onUpdate:modelValue":r[6]||(r[6]=G=>W.value=G),min:Ze,max:ot,step:yt,onChange:M,class:"zoom-slider"},null,8,["modelValue"]),t(o(Be),{type:"primary",circle:"",size:"small",onClick:h,disabled:W.value>=ot},{default:s(()=>[t(x,null,{default:s(()=>[t(o(gs))]),_:1})]),_:1},8,["disabled"]),t(o(Be),{type:"primary",size:"small",onClick:A},{default:s(()=>r[19]||(r[19]=[$(" 自适应大小 ")])),_:1})]),e("div",Fl," 缩放: "+B(Math.round(W.value*100))+"% ",1)]),e("div",{ref_key:"graphContainer",ref:H,class:"graph-container"},null,512)])):(p(),_("div",Il,[Ke((p(),Z(o(ys),{ref_key:"tableRef",ref:ze,data:ge.value,stripe:"",border:"",class:"log-table","empty-text":F.value?"加载中...":"没有匹配的提交记录",height:"500",onRowContextmenu:n},{default:s(()=>[t(o(Xe),{label:"提交哈希",width:"100",resizable:""},{default:s(G=>[e("span",{class:"commit-hash",onClick:Je=>re(G.row)},B(G.row.hash.substring(0,7)),9,Nl)]),_:1}),t(o(Xe),{prop:"date",label:"日期",width:"120",resizable:""}),t(o(Xe),{label:"作者",width:"120",resizable:""},{default:s(G=>[t(T,{content:G.row.email,placement:"top","hide-after":1e3},{default:s(()=>[e("span",Hl,B(G.row.author),1)]),_:2},1032,["content"])]),_:1}),t(o(Xe),{label:"分支",width:"180",resizable:""},{default:s(G=>[G.row.branch?(p(),_("div",Wl,[(p(!0),_(he,null,Te(G.row.branch.split(","),(Je,pt)=>(p(),Z(o(ct),{key:pt,size:"small",type:Ne(Je),class:"branch-tag"},{default:s(()=>[$(B(Pe(Je)),1)]),_:2},1032,["type"]))),128))])):q("",!0)]),_:1}),t(o(Xe),{prop:"message",label:"提交信息","min-width":"250"})]),_:1},8,["data","empty-text"])),[[ue,F.value]]),(X.value,q("",!0))]))]))],2),t(o(dt),{modelValue:I.value,"onUpdate:modelValue":r[7]||(r[7]=G=>I.value=G),title:`提交详情: ${(xe=j.value)!=null&&xe.hash?j.value.hash.substring(0,7):"未知"}`,width:"80%","destroy-on-close":"",class:"commit-detail-dialog"},{default:s(()=>[Ke((p(),_("div",Jl,[j.value?(p(),_("div",ql,[e("div",Yl,[e("div",Xl,[r[23]||(r[23]=e("span",{class:"item-label"},"哈希:",-1)),e("span",Zl,B(j.value.hash),1)]),e("div",Kl,[r[24]||(r[24]=e("span",{class:"item-label"},"作者:",-1)),e("span",Ql,B(j.value.author)+" <"+B(j.value.email)+">",1)]),e("div",eo,[r[25]||(r[25]=e("span",{class:"item-label"},"日期:",-1)),e("span",to,B(j.value.date),1)])]),e("div",so,[r[26]||(r[26]=e("div",{class:"message-label"},"提交信息:",-1)),e("div",{class:"message-content",innerHTML:de(j.value.message).replace(/\n/g,"<br>")},null,8,ao)])])):q("",!0),e("div",lo,[e("div",oo,[r[27]||(r[27]=e("h3",null,"变更文件",-1)),ne.value.length===0?(p(),Z(le,{key:0,description:"没有找到变更文件"})):(p(),_("ul",no,[(p(!0),_(he,null,Te(ne.value,G=>(p(),_("li",{key:G,class:De({"active-file":G===Y.value}),onClick:Je=>pe(j.value.hash,G)},B(G),11,io))),128))]))]),e("div",ro,[Y.value?(p(),_("h3",co,"文件差异: "+B(Y.value),1)):(p(),_("h3",uo,"文件差异")),!w.value&&!ee.value?(p(),Z(le,{key:2,description:"选择文件查看差异"})):w.value?(p(),_("div",{key:3,innerHTML:ce(w.value),class:"diff-content"},null,8,fo)):q("",!0)])])])),[[ue,ee.value]])]),_:1},8,["modelValue","title"])]),r[33]||(r[33]=$()),Ke(e("div",{class:"context-menu",style:ht({top:Ce.value+"px",left:_e.value+"px"})},[e("div",{class:"context-menu-item",onClick:r[8]||(r[8]=G=>re(b.value))},r[28]||(r[28]=[e("i",{class:"el-icon-view"},null,-1),$(" 查看详情 ")])),r[31]||(r[31]=$()),e("div",{class:"context-menu-item",onClick:r[9]||(r[9]=G=>N(b.value))},r[29]||(r[29]=[e("i",{class:"el-icon-delete"},null,-1),$(" 撤销提交 (Revert) ")])),r[32]||(r[32]=$()),e("div",{class:"context-menu-item",onClick:r[10]||(r[10]=G=>ae(b.value))},r[30]||(r[30]=[e("i",{class:"el-icon-edit"},null,-1),$(" Cherry-Pick 到当前分支 ")]))],4),[[Pt,se.value]])],64)}}}),vo=ft(po,[["__scopeId","data-v-7d18f399"]]),mo="data:image/svg+xml,%3csvg%20width='200'%20height='200'%20viewBox='0%200%20200%20200'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20主分支%20--%3e%3cline%20x1='40'%20y1='40'%20x2='40'%20y2='160'%20stroke='%2334495e'%20stroke-width='8'%20stroke-linecap='round'%20/%3e%3c!--%20特性分支%20--%3e%3cpath%20d='M40,70%20C60,70%2080,90%2080,110%20L80,130'%20stroke='%233498db'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20开发分支%20--%3e%3cpath%20d='M40,100%20C60,100%20100,110%20100,130%20L100,160'%20stroke='%232ecc71'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20修复分支%20--%3e%3cpath%20d='M40,130%20C60,130%20120,140%20120,160'%20stroke='%23e74c3c'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20合并点%20--%3e%3cpath%20d='M80,130%20C80,145%2060,145%2040,145'%20stroke='%233498db'%20stroke-width='8'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%20/%3e%3c!--%20节点%20--%3e%3ccircle%20cx='40'%20cy='40'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='70'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='100'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='130'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='145'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='40'%20cy='160'%20r='10'%20fill='%2334495e'%20/%3e%3ccircle%20cx='80'%20cy='130'%20r='10'%20fill='%233498db'%20/%3e%3ccircle%20cx='100'%20cy='160'%20r='10'%20fill='%232ecc71'%20/%3e%3ccircle%20cx='120'%20cy='160'%20r='10'%20fill='%23e74c3c'%20/%3e%3c/svg%3e",go={class:"main-header"},yo={class:"header-left"},ho=["src"],_o={class:"header-info"},wo={key:0,id:"user-info"},$o={class:"user-name"},bo={class:"user-email"},ko={key:1,id:"user-info"},Co={class:"directory-selector"},So={class:"directory-display"},To={class:"directory-icon"},xo=["title"],Vo={class:"directory-actions"},Lo={class:"main-container"},Bo={key:0,class:"loading-container"},zo={class:"loading-spinner"},Ro={key:1,class:"grid-layout"},Do={class:"git-status-panel"},Go={key:0,class:"commit-form-panel"},Ao={key:0,class:"card"},Eo={class:"tips"},Mo={key:1,class:"commit-form-panel"},jo={key:2,class:"log-list-panel"},Po={class:"dialog-footer"},Uo={class:"main-footer"},Oo={key:0,class:"branch-info"},Fo={class:"branch-wrapper"},Io={key:1,class:"footer-right"},No={class:"repo-url"},Ho={class:"dialog-footer"},Wo={class:"directory-input-group"},Jo={class:"recent-directories"},qo={class:"dialog-footer"},Yo=rt({__name:"App",setup(me){const g=c(""),k=c(null),u=c(null),y=et(),E=Ft(),V=c(!1),F=c("");function X(){E.config&&(g.value=`默认提交信息: ${E.config.defaultCommitMessage}`)}async function K(){try{const l=await(await fetch("/api/current_directory")).json();return F.value=l.directory||"未知目录",l}catch(h){return console.error("获取当前目录失败:",h),{directory:"未知目录",isGitRepo:!1}}}tt(async()=>{console.log("---------- 页面初始化开始 ----------");try{const h=await K();E.isLoaded||await E.loadConfig(),X(),y.isGitRepo=h.isGitRepo===!0,y.lastCheckedTime=Date.now(),y.isGitRepo?await Promise.all([y.getCurrentBranch(),y.getAllBranches(),y.getUserInfo(),y.getRemoteUrl()]):i.warning("当前目录不是Git仓库,部分功能将不可用")}catch(h){console.error("初始化失败:",h)}finally{V.value=!0,console.log("---------- 页面初始化完成 ----------"),setTimeout(()=>{P()},100)}});const O=c(!1),H=c(""),L=c("");async function C(){await y.createBranch(H.value,L.value)&&(O.value=!1,H.value="",u.value&&u.value.refreshStatus(),k.value&&k.value.refreshLog())}function J(){L.value=y.currentBranch,O.value=!0}async function U(h){await y.changeBranch(h)&&(u.value&&u.value.refreshStatus(),k.value&&k.value.refreshLog())}const I=c(!1),j=c(""),ne=c("");function w(){j.value=y.userName,ne.value=y.userEmail,I.value=!0}async function ee(){if(!j.value||!ne.value){i.warning("用户名和邮箱不能为空");return}await y.restoreUserConfig(j.value,ne.value)&&(I.value=!1)}async function Y(){await y.clearUserConfig()&&(j.value="",ne.value="")}let W=!1,te=!1,oe=0,S=0,m="",D="";function z(){const h=document.querySelector(".grid-layout");if(!h)return;const l=getComputedStyle(h).gridTemplateColumns.split(" "),M=getComputedStyle(h).gridTemplateRows.split(" ");if(l.length>=3&&M.length>=3){const A=parseFloat(l[0]),re=parseFloat(l[2]),pe=A+re,ce=A/pe,de=parseFloat(M[0]),Se=parseFloat(M[2]),ve=de+Se,fe=de/ve;localStorage.setItem("zen-gitsync-layout-left-ratio",ce.toString()),localStorage.setItem("zen-gitsync-layout-top-ratio",fe.toString()),console.log(`布局比例已保存 - 左侧: ${(ce*100).toFixed(0)}%, 上方: ${(fe*100).toFixed(0)}%`)}}function P(){const h=document.querySelector(".grid-layout");if(!h)return;const l=localStorage.getItem("zen-gitsync-layout-left-ratio"),M=localStorage.getItem("zen-gitsync-layout-top-ratio");if(l){const A=parseFloat(l),re=1-A;h.style.gridTemplateColumns=`${A}fr 8px ${re}fr`,console.log(`已恢复左侧比例: ${(A*100).toFixed(0)}%`)}else h.style.gridTemplateColumns="1fr 8px 3fr";if(M){const A=parseFloat(M),re=1-A;h.style.gridTemplateRows=`${A}fr 8px ${re}fr`,console.log(`已恢复上方比例: ${(A*100).toFixed(0)}%`)}}function ie(h){var M;W=!0,oe=h.clientX;const l=document.querySelector(".grid-layout");m=getComputedStyle(l).gridTemplateColumns,(M=document.getElementById("v-resizer"))==null||M.classList.add("active"),document.addEventListener("mousemove",se),document.addEventListener("mouseup",Ce),h.preventDefault()}function se(h){if(!W)return;const l=document.querySelector(".grid-layout"),M=h.clientX-oe,A=m.split(" ");if(A.length>=3){const re=parseFloat(A[0]),pe=parseFloat(A[2]),ce=re+pe,de=(re+M/l.clientWidth*ce)/ce,Se=1-de,ve=.1,fe=.5;de<ve?l.style.gridTemplateColumns=`${ve}fr 8px ${1-ve}fr`:de>fe?l.style.gridTemplateColumns=`${fe}fr 8px ${1-fe}fr`:l.style.gridTemplateColumns=`${de}fr 8px ${Se}fr`}}function Ce(){var h;W=!1,(h=document.getElementById("v-resizer"))==null||h.classList.remove("active"),document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",Ce),z()}function _e(h){var M;te=!0,S=h.clientY;const l=document.querySelector(".grid-layout");D=getComputedStyle(l).gridTemplateRows,(M=document.getElementById("h-resizer"))==null||M.classList.add("active"),document.addEventListener("mousemove",b),document.addEventListener("mouseup",ge),h.preventDefault()}function b(h){if(!te)return;const l=document.querySelector(".grid-layout"),M=h.clientY-S,A=D.split(" ");if(A.length>=3){const re=parseFloat(A[0]),pe=parseFloat(A[2]),ce=re+pe,de=(re+M/l.clientHeight*ce)/ce,Se=1-de,ve=.2,fe=.8;de<ve?l.style.gridTemplateRows=`${ve}fr 8px ${1-ve}fr`:de>fe?l.style.gridTemplateRows=`${fe}fr 8px ${1-fe}fr`:l.style.gridTemplateRows=`${de}fr 8px ${Se}fr`}}function ge(){var h;te=!1,(h=document.getElementById("h-resizer"))==null||h.classList.remove("active"),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",ge),z()}const be=c(!1),ye=c(""),Me=c(!1),je=c([]);async function Pe(){if(!F.value){i.warning("当前目录路径为空");return}try{await navigator.clipboard.writeText(F.value),i.success("已复制目录路径")}catch(h){console.error("复制目录路径失败:",h),i.error(`复制失败: ${h.message}`)}}function Ne(){ye.value=F.value,be.value=!0,ze()}async function ze(){try{const l=await(await fetch("/api/recent_directories")).json();l.success&&Array.isArray(l.directories)&&(je.value=l.directories)}catch(h){console.error("获取最近目录失败:",h)}}async function Ve(){if(!ye.value){i.warning("目录路径不能为空");return}try{Me.value=!0;const l=await(await fetch("/api/change_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ye.value})})).json();l.success?(i.success("已切换工作目录"),F.value=l.directory,be.value=!1,await Ge(l.directory),y.isGitRepo=l.isGitRepo,l.isGitRepo?(await Promise.all([y.getCurrentBranch(),y.getAllBranches(),y.getUserInfo(),y.getRemoteUrl()]),u.value&&u.value.refreshStatus(),k.value&&k.value.refreshLog()):(i.warning("当前目录不是Git仓库,部分功能将不可用"),y.$reset())):i.error(l.error||"切换目录失败")}catch(h){i.error(`切换目录失败: ${h.message}`)}finally{Me.value=!1}}async function Ge(h){try{await fetch("/api/save_recent_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:h})})}catch(l){console.error("保存最近目录失败:",l)}}async function Re(){try{const l=await(await fetch("/api/browse_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPath:ye.value||F.value})})).json();l.success?we(l):l.error&&i.error(l.error)}catch(h){console.error("浏览目录失败:",h),i.error(`浏览目录失败: ${h.message}`)}}function we(h){!h||!h.items||Ie.alert(ke("div",{class:"directory-browser"},[ke("div",{class:"current-path"},[ke("span",{class:"path-label"},"当前路径: "),ke("span",{class:"path-value"},h.path)]),ke("div",{class:"directory-list"},[h.parentPath?ke("div",{class:"directory-item parent-dir",onClick:()=>{Le(h.parentPath)}},[ke("span",{class:"dir-icon"},ke("svg",{class:"folder-icon",viewBox:"0 0 24 24",width:"20",height:"20",style:{fill:"#E6A23C"}},[ke("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})])),ke("span",{class:"dir-name"},"返回上级目录")]):null,...h.items.map(l=>ke("div",{class:"directory-item",onClick:()=>{Le(l.path)}},[ke("span",{class:"dir-icon"},ke("svg",{class:"folder-icon",viewBox:"0 0 24 24",width:"20",height:"20",style:{fill:"#409EFF"}},[ke("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})])),ke("span",{class:"dir-name"},l.name)]))])]),"浏览并选择目录",{confirmButtonText:"使用当前目录",customClass:"directory-browser-dialog",callback:l=>{l==="confirm"&&(ye.value=h.path)}})}async function Le(h){try{Ie.close(),setTimeout(async()=>{try{const M=await(await fetch("/api/browse_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPath:h})})).json();M.success?we(M):M.error&&i.error(M.error)}catch(l){console.error("浏览目录失败:",l),i.error(`浏览目录失败: ${l.message}`)}},100)}catch(l){console.error("处理目录选择时出错:",l),i.error(`处理目录选择时出错: ${l.message}`)}}return(h,l)=>{const M=ut,A=Be,re=Ot,pe=$t,ce=ws,de=nt,Se=it,ve=_s,fe=dt,He=jt,f=ct;return p(),_(he,null,[e("header",go,[e("div",yo,[e("img",{src:o(mo),alt:"Zen GitSync Logo",class:"logo"},null,8,ho),l[14]||(l[14]=e("h1",null,"Zen GitSync UI",-1))]),e("div",_o,[o(y).userName&&o(y).userEmail?(p(),_("div",wo,[l[15]||(l[15]=e("span",{class:"user-label"},"用户:",-1)),e("span",$o,B(o(y).userName),1),e("span",bo,"<"+B(o(y).userEmail)+">",1),t(A,{type:"primary",size:"small",onClick:w,class:"user-settings-btn",circle:""},{default:s(()=>[t(M,null,{default:s(()=>[t(o(Qe))]),_:1})]),_:1})])):(p(),_("div",ko,[l[16]||(l[16]=e("span",{class:"user-label"},"用户: ",-1)),l[17]||(l[17]=e("span",{class:"user-warning"},"未配置",-1)),t(A,{type:"primary",size:"small",onClick:w,class:"user-settings-btn",circle:""},{default:s(()=>[t(M,null,{default:s(()=>[t(o(Qe))]),_:1})]),_:1})])),e("div",Co,[e("div",So,[e("div",To,[t(M,null,{default:s(()=>[t(o(Lt))]),_:1})]),e("div",{class:"directory-path",title:F.value},B(F.value),9,xo)]),e("div",Vo,[t(A,{type:"primary",size:"small",onClick:Ne,class:"dir-button",circle:""},{default:s(()=>[t(M,null,{default:s(()=>l[18]||(l[18]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192H128zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32z"})],-1)])),_:1})]),_:1}),t(A,{type:"info",size:"small",onClick:Pe,class:"dir-button",circle:""},{default:s(()=>[t(M,null,{default:s(()=>l[19]||(l[19]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64h64z"}),e("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64H384zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64z"})],-1)])),_:1})]),_:1})])])])]),e("main",Lo,[V.value?(p(),_("div",Ro,[e("div",Do,[t(ma,{ref_key:"gitStatusRef",ref:u,"initial-directory":F.value},null,8,["initial-directory"])]),e("div",{class:"vertical-resizer",id:"v-resizer",onMousedown:ie},null,32),o(y).isGitRepo?(p(),_("div",Go,[!o(y).userName||!o(y).userEmail?(p(),_("div",Ao,[l[25]||(l[25]=e("h2",null,"Git用户未配置",-1)),l[26]||(l[26]=e("p",null,"请先配置Git用户信息才能进行提交操作。",-1)),e("div",Eo,[l[23]||(l[23]=e("h3",null,"您可以通过以下方式配置:",-1)),l[24]||(l[24]=e("ol",null,[e("li",null,"点击右上角的设置按钮,配置用户名和邮箱"),e("li",null,"或者使用命令行配置:"),e("div",{class:"code-block"},[$(' git config --global user.name "您的用户名"'),e("br"),$(' git config --global user.email "您的邮箱" ')])],-1)),t(A,{type:"primary",onClick:w},{default:s(()=>l[22]||(l[22]=[$(" 立即配置 ")])),_:1})])])):(p(),Z(Cl,{key:1}))])):(p(),_("div",Mo,l[27]||(l[27]=[e("div",{class:"card",style:{padding:"20px"}},[e("h2",null,"Git仓库初始化"),e("p",null,"当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。"),e("div",{class:"tips"},[e("h3",null,"可以使用以下命令初始化仓库:"),e("div",{class:"code-block"},"git init")])],-1)]))),e("div",{class:"horizontal-resizer",id:"h-resizer",onMousedown:_e},null,32),o(y).isGitRepo?(p(),_("div",jo,[t(vo,{ref_key:"logListRef",ref:k},null,512)])):q("",!0),t(fe,{modelValue:O.value,"onUpdate:modelValue":l[3]||(l[3]=n=>O.value=n),title:"创建新分支",width:"30%","destroy-on-close":""},{footer:s(()=>[e("span",Po,[t(A,{onClick:l[2]||(l[2]=n=>O.value=!1)},{default:s(()=>l[28]||(l[28]=[$("取消")])),_:1}),t(A,{type:"primary",onClick:C,loading:o(y).isCreatingBranch},{default:s(()=>l[29]||(l[29]=[$(" 创建 ")])),_:1},8,["loading"])])]),default:s(()=>[t(ve,{model:{newBranchName:H.value,selectedBaseBranch:L.value}},{default:s(()=>[t(ce,{label:"新分支名称"},{default:s(()=>[t(pe,{modelValue:H.value,"onUpdate:modelValue":l[0]||(l[0]=n=>H.value=n),placeholder:"请输入新分支名称"},null,8,["modelValue"])]),_:1}),t(ce,{label:"基于分支"},{default:s(()=>[t(Se,{modelValue:L.value,"onUpdate:modelValue":l[1]||(l[1]=n=>L.value=n),placeholder:"选择基础分支",style:{width:"100%"}},{default:s(()=>[(p(!0),_(he,null,Te(o(y).allBranches,n=>(p(),Z(de,{key:n,label:n,value:n},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])):(p(),_("div",Bo,[t(re,{class:"loading-card"},{default:s(()=>[e("div",zo,[t(M,{class:"is-loading"},{default:s(()=>l[20]||(l[20]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})],-1)])),_:1})]),l[21]||(l[21]=e("div",{class:"loading-text"},"加载中...",-1))]),_:1})]))]),e("footer",Uo,[o(y).currentBranch?(p(),_("div",Oo,[e("div",Fo,[l[31]||(l[31]=e("span",{class:"branch-label"},"当前分支:",-1)),t(Se,{modelValue:o(y).currentBranch,"onUpdate:modelValue":l[4]||(l[4]=n=>o(y).currentBranch=n),size:"small",onChange:U,loading:o(y).isChangingBranch,class:"branch-select"},{default:s(()=>[(p(!0),_(he,null,Te(o(y).allBranches,n=>(p(),Z(de,{key:n,label:n,value:n},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"]),t(A,{type:"primary",size:"small",onClick:J,class:"create-branch-btn"},{default:s(()=>[t(M,null,{default:s(()=>[t(o($s))]),_:1}),l[30]||(l[30]=$(" 新建分支 "))]),_:1})])])):q("",!0),o(y).remoteUrl?(p(),_("div",Io,[l[33]||(l[33]=e("span",{class:"repo-url-label"},"远程仓库:",-1)),e("span",No,B(o(y).remoteUrl),1),t(A,{type:"primary",circle:"",size:"small",onClick:l[5]||(l[5]=n=>o(y).copyRemoteUrl()),class:"copy-url-btn",title:"复制仓库地址"},{default:s(()=>[t(M,null,{default:s(()=>l[32]||(l[32]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64h64z"}),e("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64H384zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64z"})],-1)])),_:1})]),_:1})])):q("",!0)]),t(fe,{modelValue:I.value,"onUpdate:modelValue":l[9]||(l[9]=n=>I.value=n),title:"Git用户设置",width:"30%","destroy-on-close":""},{footer:s(()=>[e("span",Ho,[t(A,{type:"danger",onClick:Y},{default:s(()=>l[35]||(l[35]=[$(" 清除配置 ")])),_:1}),t(A,{onClick:l[8]||(l[8]=n=>I.value=!1)},{default:s(()=>l[36]||(l[36]=[$("取消")])),_:1}),t(A,{type:"primary",onClick:ee},{default:s(()=>l[37]||(l[37]=[$(" 保存 ")])),_:1})])]),default:s(()=>[t(ve,null,{default:s(()=>[t(ce,{label:"用户名"},{default:s(()=>[t(pe,{modelValue:j.value,"onUpdate:modelValue":l[6]||(l[6]=n=>j.value=n),placeholder:"请输入Git用户名"},null,8,["modelValue"])]),_:1}),t(ce,{label:"邮箱"},{default:s(()=>[t(pe,{modelValue:ne.value,"onUpdate:modelValue":l[7]||(l[7]=n=>ne.value=n),placeholder:"请输入Git邮箱"},null,8,["modelValue"])]),_:1}),t(ce,null,{default:s(()=>[t(He,{type:"info",closable:!1,"show-icon":""},{default:s(()=>l[34]||(l[34]=[$(" 这些设置将影响全局Git配置,对所有Git仓库生效。 ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),t(fe,{modelValue:be.value,"onUpdate:modelValue":l[13]||(l[13]=n=>be.value=n),title:"切换工作目录",width:"50%","destroy-on-close":""},{footer:s(()=>[e("span",qo,[t(A,{onClick:l[11]||(l[11]=n=>be.value=!1)},{default:s(()=>l[39]||(l[39]=[$("取消")])),_:1}),t(A,{type:"primary",onClick:l[12]||(l[12]=n=>Ve()),loading:Me.value},{default:s(()=>l[40]||(l[40]=[$(" 切换 ")])),_:1},8,["loading"])])]),default:s(()=>[t(ve,null,{default:s(()=>[t(ce,{label:"目录路径"},{default:s(()=>[e("div",Wo,[t(pe,{modelValue:ye.value,"onUpdate:modelValue":l[10]||(l[10]=n=>ye.value=n),placeholder:"请输入目录路径"},null,8,["modelValue"]),t(A,{type:"primary",onClick:Re},{default:s(()=>[t(M,null,{default:s(()=>[t(o(Lt))]),_:1}),l[38]||(l[38]=$(" 浏览 "))]),_:1})])]),_:1}),je.value.length>0?(p(),Z(ce,{key:0,label:"常用目录"},{default:s(()=>[e("div",Jo,[(p(!0),_(he,null,Te(je.value,(n,N)=>(p(),Z(f,{key:N,class:"recent-dir-tag",onClick:ae=>ye.value=n,effect:"plain"},{default:s(()=>[$(B(n),1)]),_:2},1032,["onClick"]))),128))])]),_:1})):q("",!0)]),_:1})]),_:1},8,["modelValue"])],64)}}}),Xo=ft(Yo,[["__scopeId","data-v-d5439bf5"]]),It=bs(Xo);It.use(ks());It.mount("#app");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.card[data-v-2d84b59e]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;border:1px solid rgba(0,0,0,.03);height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden}.status-header[data-v-2d84b59e]{display:flex;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid #f0f0f0}.status-header h2[data-v-2d84b59e]{margin:0;font-size:16px;font-weight:500;color:#303133}.header-actions[data-v-2d84b59e]{display:flex;align-items:center}.card-content[data-v-2d84b59e]{padding:15px;overflow-y:auto;flex:1;display:flex;flex-direction:column}.current-directory[data-v-2d84b59e]{display:none}.status-box[data-v-2d84b59e]{white-space:pre-wrap;font-family:monospace;background-color:#f8f9fa;padding:16px;border-radius:6px;margin-bottom:20px;max-height:200px;overflow-y:auto;border:1px solid #f0f0f0;font-size:14px;line-height:1.5}.file-list-container[data-v-2d84b59e]{flex:1;overflow:hidden;display:flex;flex-direction:column;margin-bottom:0;gap:12px;height:auto;min-height:100px}.file-group[data-v-2d84b59e]{background-color:#f8f9fa;border-radius:6px;overflow:hidden;border:1px solid #ebeef5;margin-bottom:12px;display:flex;flex-direction:column}.file-group[data-v-2d84b59e]{flex:0 1 auto}.file-group[data-v-2d84b59e]:last-child{margin-bottom:0;flex:1 1 auto}.file-group-header[data-v-2d84b59e]{font-size:14px;font-weight:700;padding:8px 12px;background-color:#f0f2f5;color:#606266;border-bottom:1px solid #ebeef5;flex-shrink:0}.file-list[data-v-2d84b59e]{overflow-y:auto;min-height:40px;max-height:200px;flex-grow:1;padding:0;margin:0;scrollbar-width:thin;scrollbar-color:rgba(144,147,153,.3) transparent}.file-list[data-v-2d84b59e]::-webkit-scrollbar{width:6px;height:6px}.file-list[data-v-2d84b59e]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:4px}.file-list[data-v-2d84b59e]::-webkit-scrollbar-thumb:hover{background-color:#90939980}.file-list[data-v-2d84b59e]::-webkit-scrollbar-track{background-color:transparent}.file-list[data-v-2d84b59e]:empty{display:none}.file-list[data-v-2d84b59e]:has(.empty-file-group){overflow-y:hidden}.empty-file-container[data-v-2d84b59e]{overflow-y:hidden!important;display:flex;flex-direction:column;align-items:stretch;flex:1}.empty-file-group[data-v-2d84b59e]{padding:16px;text-align:center;color:#909399;font-size:13px;font-style:italic;display:flex;align-items:center;justify-content:center;min-height:50px;background-color:#f8f9fa;border-radius:4px;margin:8px}.file-group[data-v-2d84b59e]:nth-child(1){flex:0 1 auto}.file-group[data-v-2d84b59e]:nth-child(2){flex:0 1 auto}.file-group[data-v-2d84b59e]:nth-child(3){flex:1 1 auto}.file-item[data-v-2d84b59e]{padding:8px 12px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ebeef5;cursor:pointer;transition:background-color .2s}.file-item[data-v-2d84b59e]:last-child{border-bottom:none}.file-item[data-v-2d84b59e]:hover{background-color:#ecf5ff}.file-info[data-v-2d84b59e]{display:flex;align-items:center;flex-grow:1;overflow:hidden;white-space:nowrap;gap:8px}.file-status-indicator[data-v-2d84b59e]{width:6px;height:6px;border-radius:50%;background-color:#409eff;flex-shrink:0}.file-status-indicator.added[data-v-2d84b59e]{background-color:#67c23a}.file-status-indicator.modified[data-v-2d84b59e]{background-color:#409eff}.file-status-indicator.deleted[data-v-2d84b59e]{background-color:#f56c6c}.file-status-indicator.untracked[data-v-2d84b59e]{background-color:#e6a23c}.file-path-container[data-v-2d84b59e]{display:flex;flex-direction:column;overflow:hidden}.file-name[data-v-2d84b59e]{font-weight:500;color:#303133;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.file-directory[data-v-2d84b59e]{font-size:12px;color:#909399;max-width:200px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.file-actions[data-v-2d84b59e]{display:flex;gap:5px;opacity:0;transition:opacity .2s}.file-item:hover .file-actions[data-v-2d84b59e]{opacity:1}.empty-status[data-v-2d84b59e]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;background-color:#f9f9f9;border-radius:8px;height:100%}.empty-icon[data-v-2d84b59e]{width:60px;height:60px;display:flex;align-items:center;justify-content:center;background-color:#ebeef5;border-radius:50%;margin-bottom:15px;font-size:24px;color:#909399;animation:pulse-2d84b59e 2s infinite ease-in-out}@keyframes pulse-2d84b59e{0%{transform:scale(1);opacity:.7}50%{transform:scale(1.05);opacity:1}to{transform:scale(1);opacity:.7}}.empty-text[data-v-2d84b59e]{font-size:16px;font-weight:500;color:#606266;margin-bottom:5px}.empty-subtext[data-v-2d84b59e]{font-size:14px;color:#909399;margin-bottom:20px}.status-box-wrap[data-v-2d84b59e]{height:100%}.branch-status-info[data-v-2d84b59e]{margin-bottom:15px;background-color:#f8f9fa;border-radius:8px;overflow:hidden;border:1px solid #ebeef5}.branch-sync-status[data-v-2d84b59e]{display:flex;align-items:center;padding:12px 15px;border-left:3px solid #e6a23c;margin-bottom:0;background-color:#fdf6ec}.git-status-message[data-v-2d84b59e],.branch-info[data-v-2d84b59e]{display:none}.card-content[data-v-2d84b59e]:empty{display:flex;align-items:center;justify-content:center;background-color:#f8f9fa;border-radius:6px;border:1px dashed #dcdfe6;color:#909399;height:100%}.card-content[data-v-2d84b59e]:empty:after{content:"没有Git状态信息可显示";font-size:14px}.browser-current-path[data-v-2d84b59e]{font-family:monospace;margin-bottom:15px;padding:10px;background-color:#f5f7fa;border-radius:6px;overflow-x:auto;white-space:nowrap;border:1px solid #ebeef5}.browser-error[data-v-2d84b59e]{color:#f56c6c;margin:10px 0;padding:10px;background-color:#fef0f0;border-radius:4px;border-left:3px solid #f56c6c}.browser-nav[data-v-2d84b59e]{display:flex;gap:10px;margin-bottom:10px}.no-padding-left[data-v-2d84b59e]{padding-left:12px}.directory-browser[data-v-2d84b59e]{height:400px;border:1px solid #ebeef5;border-radius:6px;overflow:hidden;display:flex;flex-direction:column}.directory-items-container[data-v-2d84b59e]{flex:1;overflow-y:auto;background-color:#f8f9fa;padding:10px}.directory-items[data-v-2d84b59e]{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.directory-item[data-v-2d84b59e]{display:flex;align-items:center;padding:8px;cursor:pointer;border-radius:4px;background-color:#fff;border:1px solid #ebeef5;transition:all .2s;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;gap:5px}.directory-item[data-v-2d84b59e]:hover{background-color:#ecf5ff;border-color:#c6e2ff}.directory-item.directory[data-v-2d84b59e]{background-color:#f0f7ff;color:#409eff}.directory-item .el-icon[data-v-2d84b59e]{margin-right:5px;flex-shrink:0}.directory-item.directory .el-icon[data-v-2d84b59e]{color:#409eff}.directory-item.file .el-icon[data-v-2d84b59e]{color:#909399}.directory-buttons[data-v-2d84b59e]{display:flex;gap:10px;margin-top:10px}.sync-status-content[data-v-2d84b59e]{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.status-badges[data-v-2d84b59e]{display:flex;flex-direction:column;gap:8px;width:100%}.status-badge[data-v-2d84b59e]{display:flex;align-items:center;width:100%}.status-badge.el-tag--warning[data-v-2d84b59e]{background-color:#fdf6ec;border-color:#faecd8}.status-badge.el-tag--info[data-v-2d84b59e]{background-color:#f4f4f5;border-color:#e9e9eb}.badge-content[data-v-2d84b59e]{display:flex;align-items:center;gap:6px;font-size:13px}.diff-dialog[data-v-2d84b59e]{height:calc(100vh - 150px)}.diff-dialog-header[data-v-2d84b59e]{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #ebeef5;background-color:#f9f9fb}.file-title[data-v-2d84b59e]{display:flex;align-items:center;font-size:16px;font-weight:500;color:#303133;gap:10px;overflow:hidden}.file-icon[data-v-2d84b59e]{color:#409eff;font-size:20px}.file-path[data-v-2d84b59e]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:monospace}.diff-content[data-v-2d84b59e]{flex:1;overflow-y:auto;padding:10px 20px;background-color:#fafafa}[data-v-2d84b59e] .el-dialog__body{height:calc(100vh - 320px);overflow:auto}.diff-formatted[data-v-2d84b59e]{font-family:Consolas,Courier New,monospace;font-size:14px;line-height:1.5;white-space:pre-wrap;padding-bottom:20px}.no-diff[data-v-2d84b59e]{display:flex;align-items:center;justify-content:center;height:100%;color:#909399;font-size:14px}.file-navigation[data-v-2d84b59e]{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;border-top:1px solid #ebeef5;background-color:#f9f9fb}.counter-tag[data-v-2d84b59e]{font-family:monospace;font-size:14px;padding:6px 12px;min-width:80px;text-align:center}.nav-button[data-v-2d84b59e]{min-width:120px}.diff-formatted[data-v-2d84b59e]::-webkit-scrollbar,.diff-content[data-v-2d84b59e]::-webkit-scrollbar{width:6px;height:6px}.diff-formatted[data-v-2d84b59e]::-webkit-scrollbar-thumb,.diff-content[data-v-2d84b59e]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:4px}.diff-formatted[data-v-2d84b59e]::-webkit-scrollbar-thumb:hover,.diff-content[data-v-2d84b59e]::-webkit-scrollbar-thumb:hover{background-color:#90939980}.diff-formatted[data-v-2d84b59e]::-webkit-scrollbar-track,.diff-content[data-v-2d84b59e]::-webkit-scrollbar-track{background-color:transparent}.diff-formatted[data-v-2d84b59e],.diff-content[data-v-2d84b59e]{scrollbar-width:thin;scrollbar-color:rgba(144,147,153,.3) transparent}.diff-header{font-weight:700;background-color:#e6f1fc;padding:5px;margin:8px 0;border-radius:4px;color:#0366d6;border-bottom:1px solid #c8e1ff}.diff-old-file,.diff-new-file{color:#586069;padding:2px 5px;font-family:monospace}.diff-old-file{color:#cb2431}.diff-new-file{color:#22863a}.diff-hunk-header{color:#6f42c1;background-color:#f1f8ff;padding:2px 5px;margin:5px 0;border-radius:3px;font-family:monospace}.diff-added{background-color:#e6ffed;color:#22863a;padding:0 5px;border-left:4px solid #22863a;font-family:monospace;display:block;margin:2px 0}.diff-removed{background-color:#ffeef0;color:#cb2431;padding:0 5px;border-left:4px solid #cb2431;font-family:monospace;display:block;margin:2px 0}.diff-context{color:#444;padding:0 5px;font-family:monospace;display:block;margin:2px 0;background-color:#fafbfc}.auto-update-switch .el-switch__core{transition:all .3s ease-in-out;box-shadow:0 2px 5px #0000001a}.auto-update-switch .el-switch__core:hover{box-shadow:0 2px 8px #0003}.auto-update-switch.is-checked .el-switch__core{box-shadow:0 2px 5px #67c23a4d}.auto-update-switch.is-checked .el-switch__core:hover{box-shadow:0 2px 8px #67c23a80}@keyframes snakeBorder-168d7529{0%,to{border-top:2px solid #409EFF;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent}25%{border-top:2px solid #409EFF;border-right:2px solid #67C23A;border-bottom:2px solid transparent;border-left:2px solid transparent}50%{border-top:2px solid transparent;border-right:2px solid #67C23A;border-bottom:2px solid #409EFF;border-left:2px solid transparent}75%{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid #409EFF;border-left:2px solid #67C23A}}@keyframes glowPulse-168d7529{0%,to{box-shadow:0 0 8px #409eff66}50%{box-shadow:0 0 12px #67c23a80}}.card[data-v-168d7529]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;border:1px solid rgba(0,0,0,.03);height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden;position:relative}.card-header[data-v-168d7529]{padding:8px 16px;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;align-items:center}.card-header h2[data-v-168d7529]{margin:0;font-size:16px;font-weight:500;color:#303133}.card-content[data-v-168d7529]{padding:15px;overflow-y:auto;flex:1}.layout-container[data-v-168d7529]{display:flex;flex-direction:column;gap:15px;height:100%}.commit-section[data-v-168d7529]{flex:1;min-width:0}.actions-section[data-v-168d7529]{width:100%;flex-shrink:0}.actions-section h3[data-v-168d7529]{margin-top:0;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #dcdfe6;font-size:16px;color:#303133;font-weight:500}.operations-wrapper[data-v-168d7529]{display:flex;gap:10px}.action-groups[data-v-168d7529]{display:flex;flex-direction:column;gap:12px}.action-group[data-v-168d7529]{background-color:#f9f9f9;border-radius:6px;padding:8px 10px;box-shadow:0 1px 3px #0000000d;border-left:3px solid #409EFF;flex:1}.action-group[data-v-168d7529]:nth-child(2){border-left-color:#e6a23c}.action-group[data-v-168d7529]:nth-child(3){border-left-color:#909399}.group-title[data-v-168d7529]{font-size:13px;font-weight:700;margin-bottom:8px;color:#606266;text-align:left;display:block;position:relative;padding-left:6px;border-bottom:1px solid rgba(0,0,0,.06);padding-bottom:6px}.group-buttons[data-v-168d7529]{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;padding:0}.action-button[data-v-168d7529]{font-size:14px;font-weight:500;flex:1;min-width:100px;border-radius:4px;height:36px;padding:0 10px}.action-button[data-v-168d7529]:hover{transform:translateY(-1px);box-shadow:0 2px 5px #00000026}.action-button[data-v-168d7529]:active{transform:translateY(0)}.command-text[data-v-168d7529],.command-text-long[data-v-168d7529]{display:none}.standard-commit-form[data-v-168d7529]{display:flex;flex-direction:column;gap:15px;margin-bottom:15px}.standard-commit-header[data-v-168d7529]{display:flex;flex-direction:column;gap:10px;width:100%}.type-scope-container[data-v-168d7529]{display:flex;gap:10px;width:100%;margin-bottom:10px}.type-select[data-v-168d7529]{width:35%}.scope-wrapper[data-v-168d7529]{display:flex;align-items:center;gap:5px;width:65%}.description-container[data-v-168d7529]{display:flex;align-items:center;gap:5px;width:100%}.scope-input[data-v-168d7529],.description-input[data-v-168d7529]{flex-grow:1}.settings-button[data-v-168d7529]{flex-shrink:0}.preview-section[data-v-168d7529]{background-color:#f5f7fa;padding:10px;border-radius:4px}.preview-title[data-v-168d7529]{font-weight:700;margin-bottom:5px}.preview-content[data-v-168d7529]{white-space:pre-wrap;font-family:monospace;margin:0;padding:10px;background-color:#ebeef5;border-radius:4px}.template-container[data-v-168d7529]{display:flex;flex-direction:column;height:calc(85vh - 100px);overflow-y:auto;padding:5px}.template-form[data-v-168d7529]{margin-bottom:20px;background-color:#f8f9fa;padding:15px;border-radius:6px;border:1px solid #ebeef5}.template-form-buttons[data-v-168d7529]{display:flex;gap:10px;margin-top:12px;justify-content:flex-end}.template-input[data-v-168d7529]{flex-grow:1}.template-list[data-v-168d7529]{overflow-y:auto;height:100%}.template-list h3[data-v-168d7529]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.template-item[data-v-168d7529]{margin-bottom:10px;transition:all .2s ease;border:1px solid #ebeef5}.template-item[data-v-168d7529]:hover{background-color:#f5f7fa;transform:translateY(-2px);box-shadow:0 2px 12px #0000001a}.template-content[data-v-168d7529]{flex-grow:1;margin-right:10px;word-break:break-all;padding:5px 0;color:#303133;font-weight:500}.template-actions[data-v-168d7529]{display:flex;gap:8px;justify-content:flex-end;min-width:180px;flex-shrink:0}.options-row[data-v-168d7529]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.code-command[data-v-168d7529]{background-color:#2d2d2d;color:#f8f8f2;font-family:Courier New,Courier,monospace;padding:10px;border-radius:4px;overflow-x:auto;white-space:pre;font-size:14px}@media (min-width: 768px){.layout-container[data-v-168d7529]{flex-direction:row}.commit-section[data-v-168d7529]{flex:3}.actions-section[data-v-168d7529]{width:320px}.operations-wrapper[data-v-168d7529]{flex-direction:column}}.git-config-warning[data-v-168d7529]{width:100%}.config-command[data-v-168d7529]{background-color:#2d2d2d;color:#f8f8f2;font-family:Courier New,Courier,monospace;padding:10px;border-radius:4px;margin-top:10px;white-space:pre}@keyframes pushing-pulse-168d7529{0%{box-shadow:0 0 #67c23a66}70%{box-shadow:0 0 0 15px #67c23a00}to{box-shadow:0 0 #67c23a00}}@keyframes pushing-border-168d7529{0%{border-color:#67c23a}50%{border-color:#85ce61}to{border-color:#67c23a}}.card.is-pushing[data-v-168d7529]{animation:pushing-border-168d7529 1.5s infinite ease-in-out;box-shadow:0 4px 12px #0000001a;transition:all .3s ease}.push-button[data-v-168d7529]{background-color:#67c23a;border-color:#67c23a}.push-button[data-v-168d7529]:hover{background-color:#85ce61;border-color:#85ce61}.push-button.is-loading[data-v-168d7529],.push-button.is-loading[data-v-168d7529]:hover,.push-button.is-loading[data-v-168d7529]:focus{animation:pushing-pulse-168d7529 1.5s infinite;background-color:#67c23a!important;border-color:#67c23a!important}.el-button.push-button.is-loading .el-loading-spinner[data-v-168d7529]{color:#fff!important}@keyframes one-click-push-glow-168d7529{0%{box-shadow:0 0 5px #67c23a80}50%{box-shadow:0 0 20px #67c23acc}to{box-shadow:0 0 5px #67c23a80}}.action-button.one-click-push[data-v-168d7529]{position:relative;overflow:hidden}.action-button.one-click-push.is-loading[data-v-168d7529],.action-button.one-click-push.is-loading[data-v-168d7529]:hover{animation:one-click-push-glow-168d7529 1.5s infinite;background-color:#67c23a!important;border-color:#67c23a!important}@keyframes push-success-168d7529{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.push-success-indicator[data-v-168d7529]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#fff;border-radius:12px;padding:20px 30px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;align-items:center;justify-content:center;animation:push-success-168d7529 .5s ease-out;z-index:9999;width:200px;height:200px}.push-success-icon[data-v-168d7529]{font-size:64px;color:#67c23a;margin-bottom:16px;animation:bounce-168d7529 .8s ease-in-out}@keyframes bounce-168d7529{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-20px)}60%{transform:translateY(-10px)}}.push-success-text[data-v-168d7529]{font-size:20px;font-weight:700;color:#303133;text-align:center}.reset-button[data-v-168d7529]{background-color:#909399;border-color:#909399}.reset-button[data-v-168d7529]:hover{background-color:#a6a9ad;border-color:#a6a9ad}.el-button+.el-button[data-v-168d7529]{margin-left:0}.pushing-indicator[data-v-168d7529]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#409eff;border-radius:12px;padding:20px 30px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;width:200px;height:200px;color:#fff}.pushing-spinner[data-v-168d7529]{margin-bottom:16px}.pushing-text[data-v-168d7529]{font-size:20px;font-weight:700;text-align:center}.circular[data-v-168d7529]{height:64px;width:64px;animation:pushing-rotate-168d7529 2s linear infinite}.path[data-v-168d7529]{stroke:#fff;stroke-width:4;stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0;animation:pushing-dash-168d7529 1.5s ease-in-out infinite}@keyframes pushing-rotate-168d7529{to{transform:rotate(360deg)}}@keyframes pushing-dash-168d7529{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.message-template-container[data-v-168d7529]{display:flex;flex-direction:column;height:calc(100vh - 278px);overflow:hidden}.templates-container[data-v-168d7529]{display:flex;gap:20px;margin-top:15px;flex:1;overflow:hidden}.message-templates-list[data-v-168d7529]{flex:3;display:flex;flex-direction:column;border-right:1px solid #ebeef5;padding-right:15px;height:calc(100vh - 432px)}.message-templates-list h3[data-v-168d7529]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.current-default-message[data-v-168d7529]{flex:2;display:flex;flex-direction:column;gap:15px;padding-left:15px}.current-default-message h3[data-v-168d7529]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.templates-scroll-area[data-v-168d7529]{overflow-y:auto;padding-right:5px;flex:1}.default-message-card[data-v-168d7529]{margin-bottom:15px;box-shadow:0 2px 8px #00000014;border-radius:4px;transition:all .3s ease}.default-message-card[data-v-168d7529]:hover{box-shadow:0 4px 12px #0000001f}.default-message-content[data-v-168d7529]{padding:12px 15px;background-color:#f0f9eb;border-left:3px solid #67c23a;font-weight:500;word-break:break-all;min-height:60px;display:flex;align-items:center;border-radius:0 4px 4px 0;color:#303133}.message-help-text[data-v-168d7529]{background-color:#f8f9fa;border-radius:4px;padding:15px;font-size:14px;color:#606266;border-left:3px solid #909399;margin-top:auto;box-shadow:0 2px 8px #0000000d}.message-help-text h4[data-v-168d7529]{margin-top:0;margin-bottom:10px;color:#303133;font-size:15px}.message-help-text p[data-v-168d7529]{margin:8px 0;line-height:1.5}.advanced-options-toggle[data-v-168d7529]{display:flex;align-items:center;justify-content:center;padding:8px 0;background-color:#f5f7fa;border-radius:4px;cursor:pointer;transition:all .3s ease;-webkit-user-select:none;user-select:none}.advanced-options-toggle[data-v-168d7529]:hover{background-color:#ebeef5;color:#409eff}.toggle-icon[data-v-168d7529]{margin-left:8px;transition:transform .3s ease}.toggle-icon.is-active[data-v-168d7529]{transform:rotate(180deg)}.advanced-fields[data-v-168d7529]{margin-top:10px;display:flex;flex-direction:column;gap:15px;animation:fade-in-168d7529 .3s ease-in-out}@keyframes fade-in-168d7529{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.git-cmd-tooltip{font-family:Consolas,Courier New,monospace!important;font-size:13px!important;font-weight:500!important;color:#303133!important;background-color:#f5f7fa!important;border:1px solid #dcdfe6!important;border-radius:4px!important;padding:8px 12px!important;box-shadow:0 2px 12px #0000001a!important}.template-dialog .el-dialog__header,.message-template-dialog .el-dialog__header{padding:15px 20px;margin-right:0;border-bottom:1px solid #ebeef5;background-color:#f8f9fa}.template-dialog .el-dialog__title,.message-template-dialog .el-dialog__title{font-size:16px;font-weight:600;color:#303133}.template-dialog .el-dialog__body,.message-template-dialog .el-dialog__body{padding:20px}.template-dialog .el-dialog__headerbtn,.message-template-dialog .el-dialog__headerbtn{top:15px;right:20px}.template-dialog .el-input__inner,.message-template-dialog .el-input__inner{height:40px;line-height:40px}.template-dialog .el-button,.message-template-dialog .el-button{border-radius:4px;font-weight:500}.template-dialog .el-card,.message-template-dialog .el-card{border-radius:4px;overflow:hidden}.template-dialog .el-card__body,.message-template-dialog .el-card__body{padding:12px 15px}.template-dialog .el-empty__image,.message-template-dialog .el-empty__image{width:80px;height:80px}.card[data-v-7d18f399]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;height:100%;width:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.03);overflow:hidden}.log-header[data-v-7d18f399]{display:flex;justify-content:space-between;align-items:center;margin-bottom:0;padding:8px 16px;background-color:#fff;border-bottom:1px solid #f0f0f0;position:sticky;top:0;z-index:100;flex-shrink:0}.header-left[data-v-7d18f399]{display:flex;align-items:center;gap:8px}.log-header h2[data-v-7d18f399]{margin:0;font-size:16px;font-weight:500}.log-actions[data-v-7d18f399]{display:flex;gap:8px}.action-button[data-v-7d18f399]{transition:all .3s ease;border-radius:6px;border:1px solid transparent;box-shadow:0 2px 4px #0000001a;font-weight:500;padding:8px 16px;min-width:120px;display:flex;align-items:center;justify-content:center;gap:6px}.action-button[data-v-7d18f399]:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.filter-button[data-v-7d18f399]{background:linear-gradient(135deg,#e6a23c,#f0c78a);color:#fff;min-width:90px}.filter-button.active-filter[data-v-7d18f399]{background:linear-gradient(135deg,#d48806,#e6a23c)}.filter-button .filter-badge[data-v-7d18f399] .el-badge__content{background-color:#f56c6c;color:#fff;border:2px solid white;box-shadow:0 0 0 1px #e6a23c}.view-mode-button[data-v-7d18f399]{background:linear-gradient(135deg,#409eff,#53a8ff);color:#fff}.view-mode-button.active-view[data-v-7d18f399]{background:linear-gradient(135deg,#1890ff,#096dd9)}.commit-display-button[data-v-7d18f399]{background:linear-gradient(135deg,#67c23a,#85ce61);color:#fff}.commit-display-button.active-commits[data-v-7d18f399]{background:linear-gradient(135deg,#52c41a,#389e0d)}.refresh-button[data-v-7d18f399]{background:linear-gradient(135deg,#909399,#c0c4cc);color:#fff;min-width:unset;padding:0;border-radius:50%}.refresh-button[data-v-7d18f399]:hover{background:linear-gradient(135deg,#606266,#909399)}.content-area[data-v-7d18f399]{padding:10px 0;flex:1;min-height:100px;height:calc(100% - 52px);display:flex;flex-direction:column}.content-area-content[data-v-7d18f399]{height:100%}.content-area.with-filter[data-v-7d18f399]{height:calc(100% - 112px)}.content-area>div[data-v-7d18f399]{flex:1;display:flex;flex-direction:column}.el-table[data-v-7d18f399]{--el-table-border-color: #f0f0f0;--el-table-header-bg-color: #f8f9fa;border-radius:4px;overflow:hidden}.log-actions[data-v-7d18f399]{display:flex;gap:12px}.branch-container[data-v-7d18f399]{display:flex;flex-wrap:wrap;gap:4px}.branch-tag[data-v-7d18f399]{margin-right:4px}.commit-count[data-v-7d18f399]{margin-bottom:10px;font-size:14px;color:#606266;text-align:right}.graph-view[data-v-7d18f399]{width:100%;flex:1;display:flex;flex-direction:column;overflow-y:auto}.graph-container[data-v-7d18f399]{width:100%;flex:1;min-height:500px;border:1px solid #ebeef5;border-radius:4px;padding:10px;background-color:#fff;position:relative}.graph-container svg[data-v-7d18f399]{transform-origin:top left;transition:transform .2s ease}.graph-controls[data-v-7d18f399]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.zoom-controls[data-v-7d18f399]{display:flex;gap:8px}.zoom-slider[data-v-7d18f399]{width:200px}.scale-info[data-v-7d18f399]{font-size:14px;color:#606266}.refresh-notification[data-v-7d18f399]{background-color:#f0f9eb;color:#67c23a;padding:10px 15px;border-radius:8px;font-size:14px;border-left:4px solid #67c23a;animation:fadeOut-7d18f399 2s forwards;position:fixed;top:20px;right:20px;z-index:9999;box-shadow:0 4px 12px #0000001a;max-width:300px;text-align:center}@keyframes fadeOut-7d18f399{0%{opacity:0;transform:translateY(-20px)}20%{opacity:1;transform:translateY(0)}80%{opacity:1}to{opacity:0}}.author-name[data-v-7d18f399]{cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:100%}.commit-hash[data-v-7d18f399]{cursor:pointer;color:#409eff;font-family:monospace}.commit-hash[data-v-7d18f399]:hover{text-decoration:underline}.commit-detail-container[data-v-7d18f399]{display:flex;flex-direction:column;gap:20px}.commit-info[data-v-7d18f399]{padding:12px;background-color:#f5f7fa;border-radius:8px;font-size:14px;display:flex;flex-direction:column;gap:12px}.commit-info-header[data-v-7d18f399]{display:flex;flex-wrap:wrap;gap:15px;align-items:center;background-color:#fff;padding:10px;border-radius:4px;border:1px solid #e4e7ed}.info-item[data-v-7d18f399]{display:flex;align-items:center;gap:5px}.item-label[data-v-7d18f399]{font-weight:700;color:#606266;white-space:nowrap}.item-value[data-v-7d18f399]{color:#333;word-break:break-all}.commit-message-container[data-v-7d18f399]{display:flex;flex-direction:column;gap:5px}.message-label[data-v-7d18f399]{font-weight:700;color:#606266}.message-content[data-v-7d18f399]{background-color:#fff;padding:12px;border-radius:4px;font-family:monospace;white-space:pre-wrap;line-height:1.5;border:1px solid #e4e7ed;border-left:4px solid #409EFF}.commit-files-diff[data-v-7d18f399]{margin-top:5px;display:flex;gap:20px;height:60vh}.files-list[data-v-7d18f399]{width:25%;overflow-y:auto;background-color:#f5f7fa;border-radius:8px;padding:10px}.files-list h3[data-v-7d18f399]{margin-top:0;padding-bottom:10px;border-bottom:1px solid #dcdfe6;font-size:16px}.files-list ul[data-v-7d18f399]{list-style:none;padding:0;margin:0}.files-list li[data-v-7d18f399]{padding:8px 10px;cursor:pointer;border-radius:4px;margin-bottom:5px;font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.files-list li[data-v-7d18f399]:hover{background-color:#ecf5ff}.files-list li.active-file[data-v-7d18f399]{background-color:#409eff;color:#fff}.file-diff[data-v-7d18f399]{flex:1;display:flex;flex-direction:column;background-color:#f5f7fa;border-radius:8px;padding:10px;overflow:hidden}.file-diff h3[data-v-7d18f399]{margin-top:0;padding-bottom:10px;border-bottom:1px solid #dcdfe6;font-size:16px}.diff-content[data-v-7d18f399]{flex:1;overflow-y:auto;background-color:#fff;padding:10px;border-radius:4px;font-family:monospace;font-size:13px;line-height:1.5}.diff-header[data-v-7d18f399]{font-weight:700;color:#409eff}.diff-old-file[data-v-7d18f399]{color:#e6a23c}.diff-new-file[data-v-7d18f399]{color:#67c23a}.diff-hunk-header[data-v-7d18f399]{font-weight:700;color:#409eff}.diff-added[data-v-7d18f399]{background-color:#f0f9eb;color:#67c23a}.diff-removed[data-v-7d18f399]{background-color:#fef2f2;color:#f56c6c}.diff-context[data-v-7d18f399]{background-color:#f5f7fa}[data-v-7d18f399] .commit-detail-dialog{--el-dialog-margin-top: 7vh}.history-controls[data-v-7d18f399]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;position:sticky;top:52px;z-index:90;background-color:#fff;padding:5px 0;transition:box-shadow .3s ease,background-color .3s ease,padding .2s ease}.content-area:not(:hover) .history-controls[data-v-7d18f399]:not(:hover){box-shadow:0 2px 8px #0000000f}.history-stats[data-v-7d18f399]{display:flex;align-items:center}.record-count[data-v-7d18f399]{display:flex;align-items:center;height:24px;padding-left:8px;padding-right:8px;margin-left:8px}.record-count[data-v-7d18f399] .el-icon{margin-right:4px;font-size:12px}.filter-badge[data-v-7d18f399] .el-badge__content{background-color:#409eff}.filter-panel[data-v-7d18f399]{display:none}.log-table.has-filter[data-v-7d18f399],.log-table.has-sticky-controls[data-v-7d18f399],.log-table.has-sticky-filter[data-v-7d18f399]{margin-top:0!important}.filter-panel-header[data-v-7d18f399]{background-color:#f5f7fa;padding:10px 16px;border-bottom:1px solid #e4e7ed;position:sticky;top:36px;z-index:99;transition:all .3s ease;flex-shrink:0;margin-bottom:0;box-shadow:0 2px 8px #0000000d}.filter-panel-header .filter-form[data-v-7d18f399]{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;justify-content:space-between}.filter-panel-header .filter-item[data-v-7d18f399]{margin-right:0;flex:1;min-width:0}.filter-panel-header .filter-input[data-v-7d18f399]{width:100%}.filter-panel-header .filter-input.date-range[data-v-7d18f399]{width:100%;max-width:280px}.compact-label[data-v-7d18f399]{color:#909399;font-size:12px;margin-right:4px;white-space:nowrap;font-weight:700;border-right:1px solid #dcdfe6;padding-right:6px}.filter-action-button[data-v-7d18f399]{padding:8px 15px;border-radius:4px;transition:all .3s;min-width:60px}.filter-action-button[data-v-7d18f399]:hover{transform:translateY(-2px);box-shadow:0 2px 8px #0000001a}.filter-actions[data-v-7d18f399]{display:flex;align-items:center;gap:8px;white-space:nowrap;flex-shrink:0}.el-table .el-table__cell .cell[data-v-7d18f399]{word-break:break-all}.table-view-container[data-v-7d18f399]{display:flex;flex-direction:column;flex:1;min-height:400px}.log-table[data-v-7d18f399]{width:100%;height:100%;min-height:300px;flex:1}.load-more-container[data-v-7d18f399]{display:flex;flex-direction:column;align-items:center;padding:15px 0;border-top:1px dashed #ebeef5;gap:10px}.pagination-info[data-v-7d18f399]{font-size:13px;color:#909399;margin-bottom:5px}.loading-more[data-v-7d18f399]{display:flex;align-items:center;color:#909399;font-size:14px}.loading-spinner[data-v-7d18f399]{width:20px;height:20px;margin-right:10px;border:2px solid #dcdfe6;border-top-color:#409eff;border-radius:50%;animation:spinner-7d18f399 1s linear infinite}@keyframes spinner-7d18f399{to{transform:rotate(360deg)}}.load-more-button[data-v-7d18f399]{cursor:pointer;color:#409eff;font-size:14px;padding:6px 16px;border:1px solid #d9ecff;background-color:#ecf5ff;border-radius:4px;transition:all .3s}.load-more-button[data-v-7d18f399]:hover{background-color:#d9ecff}.no-more-data[data-v-7d18f399]{color:#909399;font-size:14px;font-style:italic;display:flex;flex-direction:column;align-items:center}.total-loaded[data-v-7d18f399]{font-size:12px;margin-top:5px;color:#c0c4cc}.context-menu[data-v-7d18f399]{position:fixed;background:#fff;border:1px solid #dcdfe6;border-radius:4px;box-shadow:0 2px 12px #0000001a;padding:8px 0;z-index:3000;min-width:180px}.context-menu-item[data-v-7d18f399]{padding:8px 16px;cursor:pointer;font-size:14px;display:flex;align-items:center}.context-menu-item[data-v-7d18f399]:hover{background-color:#f5f7fa}.context-menu-item i[data-v-7d18f399]{margin-right:8px}.refresh-button-animated[data-v-7d18f399]{animation:spin-7d18f399 1s linear}@keyframes spin-7d18f399{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-table .el-table__cell .cell[data-v-7d18f399],.el-table .el-table__cell .cell{word-break:break-all}body{font-family:Arial,sans-serif;margin:0;padding:0;background-color:#f5f5f5;overflow:hidden;height:100vh}.main-container{position:fixed;top:60px;bottom:60px;left:0;right:0;padding:10px;overflow:hidden}.grid-layout{display:grid;grid-template-columns:2fr 8px 3fr;grid-template-rows:1fr 8px 1fr;grid-template-areas:"git-status v-resizer commit-form" "h-resizer h-resizer h-resizer" "log-list log-list log-list";gap:10px;height:100%}.git-status-panel{grid-area:git-status;overflow:hidden;max-height:100%;padding:0}.commit-form-panel{grid-area:commit-form;overflow:hidden;max-height:100%;padding:0}.log-list-panel{grid-area:log-list;overflow:hidden;max-height:100%;padding:0}.card{background-color:#fff;border-radius:8px;box-shadow:0 4px 12px #0000000d;border:1px solid rgba(0,0,0,.03);height:100%;overflow:hidden;display:flex;flex-direction:column}.main-header{background-color:#24292e;color:#fff;padding:0 20px;display:flex;justify-content:space-between;align-items:center;position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 2px 10px #0003;height:60px;box-sizing:border-box}.header-left{display:flex;align-items:center;gap:10px;min-width:220px;flex:1}.logo{height:32px;width:auto}h1{margin:0;font-size:24px}.header-info{display:flex;align-items:center;gap:10px;justify-content:flex-end}#user-info{display:flex;align-items:center;background-color:#282c34b3;padding:6px 10px;border-radius:4px;border:1px solid rgba(255,255,255,.15);margin-right:10px;flex-shrink:0}.directory-selector{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:#282c34b3;border-radius:4px;padding:6px 10px;border:1px solid rgba(255,255,255,.15);box-shadow:0 2px 8px #00000026;flex-shrink:0}.directory-display{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.directory-path{font-family:monospace;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;background-color:#0003;padding:4px 8px;border-radius:3px;border-left:3px solid #409EFF;flex:1;min-width:0;max-width:500px}.branch-label,.user-label,.user-name{font-weight:700;margin-right:5px}.user-email{color:#e0e0e0}.branch-name{font-family:monospace}.status-box{background-color:#f6f8fa;border:1px solid #e1e4e8;border-radius:3px;padding:15px;white-space:pre-wrap;font-family:monospace;overflow-y:auto}.tips{margin-top:20px;padding:15px;background-color:#f5f7fa;border-radius:5px;border-left:4px solid #409eff}.tips h3{margin-top:0;font-size:16px;margin-bottom:10px}.code-block{background-color:#2d2d2d;color:#f8f8f2;font-family:monospace;padding:10px 15px;border-radius:4px;margin-bottom:10px}.loading-container{display:flex;justify-content:center;align-items:center;height:100%}.loading-card{width:300px;text-align:center;padding:30px}.loading-spinner{font-size:48px;margin-bottom:20px;color:#409eff}.loading-text{font-size:18px;color:#606266}.user-settings-btn{margin-left:10px}.user-warning{color:#e6a23c;font-weight:700}.main-footer{background-color:#24292e;color:#fff;padding:10px 20px;display:flex;justify-content:space-between;align-items:center;position:fixed;bottom:0;left:0;right:0;z-index:100;box-shadow:0 -2px 10px #0000001a;height:60px;box-sizing:border-box}@media (max-width: 768px){.grid-layout{grid-template-columns:1fr;grid-template-rows:auto auto auto auto auto;grid-template-areas:"git-status" "v-resizer" "commit-form" "h-resizer" "log-list";gap:10px}.vertical-resizer{height:10px;cursor:row-resize}.vertical-resizer:after{width:30px;height:4px}.git-status-panel,.commit-form-panel,.log-list-panel{padding:0;max-height:none}.git-status-panel,.commit-form-panel{max-height:30vh}.log-list-panel{max-height:40vh}}.logo[data-v-d5439bf5]{will-change:filter;transition:filter .3s}.logo[data-v-d5439bf5]:hover{filter:drop-shadow(0 0 2em #42b883aa)}.branch-info[data-v-d5439bf5]{display:flex;align-items:center;gap:10px}.branch-wrapper[data-v-d5439bf5]{display:flex;align-items:center;background-color:#ffffff26;border-radius:4px;padding:8px 12px;box-shadow:0 2px 4px #0003;transition:all .3s}.branch-wrapper[data-v-d5439bf5]:hover{background-color:#fff3}.branch-label[data-v-d5439bf5]{font-weight:700;margin-right:10px;color:#fff}.branch-select[data-v-d5439bf5]{width:200px;margin-right:10px}.create-branch-btn[data-v-d5439bf5]{background-color:#2ea44f;border-color:#2ea44f;transition:all .3s;box-shadow:0 2px 4px #0003}.create-branch-btn[data-v-d5439bf5]:hover{background-color:#3bbc63;border-color:#3bbc63;transform:translateY(-2px);box-shadow:0 4px 8px #0003}.footer-right[data-v-d5439bf5]{display:flex;align-items:center;gap:10px;color:#ffffffe6;font-size:13px;background-color:#ffffff1a;padding:8px 12px;border-radius:4px;box-shadow:0 2px 4px #0003}.repo-url-label[data-v-d5439bf5]{font-weight:700;margin-right:8px;color:#fff}.repo-url[data-v-d5439bf5]{color:#e6f7ff;font-family:monospace;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy-url-btn[data-v-d5439bf5]{transition:all .3s;background-color:#1890ff;border-color:#1890ff;box-shadow:0 2px 4px #0003}.copy-url-btn[data-v-d5439bf5]:hover{background-color:#40a9ff;border-color:#40a9ff;transform:translateY(-2px);box-shadow:0 4px 8px #0003}.vertical-resizer[data-v-d5439bf5]{grid-area:v-resizer;background-color:#e8e8e8;cursor:col-resize;transition:background-color .2s,box-shadow .2s;position:relative;z-index:10;border-radius:8px;box-shadow:0 0 3px #0000001a}.vertical-resizer[data-v-d5439bf5]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:50px;background-color:#a0a0a0;border-radius:4px;transition:background-color .2s,width .2s,box-shadow .2s}.vertical-resizer[data-v-d5439bf5]:hover,.vertical-resizer.active[data-v-d5439bf5]{background-color:#d0d0d0;box-shadow:0 0 5px #0003}.vertical-resizer[data-v-d5439bf5]:hover:after,.vertical-resizer.active[data-v-d5439bf5]:after{background-color:#409eff;width:6px;box-shadow:0 0 8px #409eff99}.horizontal-resizer[data-v-d5439bf5]{grid-area:h-resizer;background-color:#e8e8e8;cursor:row-resize;transition:background-color .2s,box-shadow .2s;position:relative;z-index:10;border-radius:8px;box-shadow:0 0 3px #0000001a}.horizontal-resizer[data-v-d5439bf5]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:50px;height:4px;background-color:#a0a0a0;border-radius:4px;transition:background-color .2s,height .2s,box-shadow .2s}.horizontal-resizer[data-v-d5439bf5]:hover,.horizontal-resizer.active[data-v-d5439bf5]{background-color:#d0d0d0;box-shadow:0 0 5px #0003}.horizontal-resizer[data-v-d5439bf5]:hover:after,.horizontal-resizer.active[data-v-d5439bf5]:after{background-color:#409eff;height:6px;box-shadow:0 0 8px #409eff99}.directory-selector[data-v-d5439bf5]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:#282c34b3;border-radius:4px;padding:8px 12px;margin-bottom:8px;border:1px solid rgba(255,255,255,.2);box-shadow:0 2px 8px #0003}.directory-display[data-v-d5439bf5]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.directory-path[data-v-d5439bf5]{font-family:monospace;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;background-color:#0003;padding:4px 8px;border-radius:3px;border-left:3px solid #409EFF;flex:1;min-width:0;max-width:350px}.directory-actions[data-v-d5439bf5]{display:flex;gap:4px;margin-left:8px}.dir-button[data-v-d5439bf5]{padding:6px;height:28px;width:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#409eff,#53a8ff);color:#fff;border:none;box-shadow:0 2px 4px #0003;transition:all .3s}.dir-button[data-v-d5439bf5]:hover{transform:translateY(-1px);box-shadow:0 3px 6px #0000004d;background:linear-gradient(135deg,#53a8ff,#66b1ff)}.dir-button.el-button--info[data-v-d5439bf5]{background:linear-gradient(135deg,#909399,#a6a9ad)}.dir-button.el-button--info[data-v-d5439bf5]:hover{background:linear-gradient(135deg,#a6a9ad,#c0c4cc)}.directory-icon[data-v-d5439bf5]{display:flex;justify-content:center;align-items:center;width:24px;height:24px;border-radius:3px;background-color:#409eff1a;color:#409eff;margin-right:2px}.directory-input-group[data-v-d5439bf5]{display:flex;align-items:center;gap:8px;width:100%}.recent-directories[data-v-d5439bf5]{display:flex;flex-wrap:wrap;gap:4px}.recent-dir-tag[data-v-d5439bf5]{cursor:pointer;background-color:#e6f7ff;border:1px solid #91d5ff;padding:4px 8px;border-radius:4px}.directory-browser[data-v-d5439bf5]{width:100%;height:400px;overflow:auto}.current-path[data-v-d5439bf5]{padding:10px;background-color:#f5f7fa;border-radius:4px;margin-bottom:10px;border:1px solid #e4e7ed;display:flex;align-items:center;width:100%;box-sizing:border-box}.path-label[data-v-d5439bf5]{font-weight:700;margin-right:5px;white-space:nowrap;flex-shrink:0}.path-value[data-v-d5439bf5]{font-family:monospace;word-break:break-all;flex:1;min-width:0;background-color:#fff;padding:5px 8px;border-radius:3px;border:1px solid #dcdfe6;box-shadow:inset 0 1px 2px #0000000d;width:100%}.directory-list[data-v-d5439bf5]{list-style:none!important;padding:0;margin:0;border:1px solid #e4e7ed;border-radius:4px;max-height:300px;overflow-y:auto;background-color:#fff;display:flex;flex-direction:column;width:100%;box-sizing:border-box}.directory-item[data-v-d5439bf5]{padding:10px 12px;border-bottom:1px solid #ebeef5;cursor:pointer;display:flex;align-items:center;transition:all .2s ease;position:relative;width:100%;box-sizing:border-box;list-style:none!important}.directory-item[data-v-d5439bf5]:hover{background-color:#ecf5ff}.directory-item[data-v-d5439bf5]:last-child{border-bottom:none}.parent-dir[data-v-d5439bf5]{background-color:#f5f7fa;font-weight:500}.dir-icon[data-v-d5439bf5]{margin-right:12px;display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.dir-name[data-v-d5439bf5]{display:flex;align-items:center;font-size:14px;line-height:1.4}.folder-icon[data-v-d5439bf5]{filter:drop-shadow(0 1px 2px rgba(0,0,0,.1));transition:all .2s ease}.directory-item:hover .folder-icon[data-v-d5439bf5]{transform:scale(1.1)}[data-v-d5439bf5] .directory-browser-dialog{border-radius:8px;overflow:hidden}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__header{background-color:#f5f7fa;padding:15px 20px;border-bottom:1px solid #e4e7ed;position:relative}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__title{color:#409eff;font-weight:500;font-size:18px}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__headerbtn{position:absolute;top:15px;right:15px;width:24px;height:24px;border-radius:50%;background-color:#0000000d;transition:all .3s;display:flex;align-items:center;justify-content:center}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__headerbtn:hover{background-color:#0000001a;transform:rotate(90deg)}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__headerbtn .el-message-box__close{color:#606266;font-weight:700;font-size:16px}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__headerbtn:hover .el-message-box__close{color:#409eff}[data-v-d5439bf5] .directory-browser-dialog .el-message-box__content{padding:20px}.el-message-box__message{width:100%}.directory-browser-dialog{border-radius:8px;overflow:hidden}.directory-browser-dialog .el-message-box__header{background-color:#f5f7fa;padding:15px 20px;border-bottom:1px solid #e4e7ed;position:relative}.directory-browser-dialog .el-message-box__title{color:#409eff;font-weight:500;font-size:18px}.directory-browser-dialog .el-message-box__headerbtn{position:absolute;top:15px;right:15px;width:24px;height:24px;border-radius:50%;background-color:#0000000d;transition:all .3s;display:flex;align-items:center;justify-content:center}.directory-browser-dialog .el-message-box__headerbtn:hover{background-color:#0000001a;transform:rotate(90deg)}.directory-browser-dialog .el-message-box__headerbtn .el-message-box__close{color:#606266;font-weight:700;font-size:16px}.directory-browser-dialog .el-message-box__headerbtn:hover .el-message-box__close{color:#409eff}.directory-browser-dialog .el-message-box__content{padding:20px}.directory-browser-dialog .el-message-box__btns{padding:10px 20px 15px;border-top:1px solid #e4e7ed}.directory-browser{width:100%;height:400px;overflow:auto}.current-path{padding:10px;background-color:#f5f7fa;border-radius:4px;margin-bottom:10px;border:1px solid #e4e7ed;display:flex;align-items:center;width:100%;box-sizing:border-box}.path-label{font-weight:700;margin-right:5px;white-space:nowrap;flex-shrink:0}.path-value{font-family:monospace;word-break:break-all;flex:1;min-width:0;background-color:#fff;padding:5px 8px;border-radius:3px;border:1px solid #dcdfe6;box-shadow:inset 0 1px 2px #0000000d;width:100%}.directory-list{list-style:none!important;padding:0;margin:0;border:1px solid #e4e7ed;border-radius:4px;max-height:300px;overflow-y:auto;background-color:#fff;display:flex;flex-direction:column;width:100%;box-sizing:border-box}.directory-item{padding:10px 12px;border-bottom:1px solid #ebeef5;cursor:pointer;display:flex;align-items:center;transition:all .2s ease;position:relative;width:100%;box-sizing:border-box;list-style:none!important}.directory-item:hover{background-color:#ecf5ff}.directory-item:last-child{border-bottom:none}.parent-dir{background-color:#f5f7fa;font-weight:500}.dir-icon{margin-right:12px;display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.dir-name{display:flex;align-items:center;font-size:14px;line-height:1.4}.folder-icon{filter:drop-shadow(0 1px 2px rgba(0,0,0,.1));transition:all .2s ease}.directory-item:hover .folder-icon{transform:scale(1.1)}*{margin:0;padding:0}div{box-sizing:border-box}
|