zen-gitsync 2.4.12 → 2.4.13
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-CVjWGN3c.js +46 -0
- package/src/ui/public/assets/index-CwJ6ny4v.css +1 -0
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/index.js +130 -0
- package/src/ui/public/assets/index-BFihJBzC.js +0 -46
- package/src/ui/public/assets/index-CK7Vijoe.css +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import{c as To,d as Fe,a as g,o as c,b as Eo,e as s,f as ks,r as u,w as Ge,g as se,E as r,h as at,i as Ws,l as Lo,j as Qt,k as ws,m as q,n as W,p as $e,u as t,q as a,s as o,t as Je,v as xe,x as _s,y as Wt,z as qs,F as Be,A as Re,B as i,C as Go,D as Ks,G as ut,H as ge,I as Lt,J as Po,K as dt,L as Vo,M as xo,N as ht,O as Bs,P as qt,Q as Ro,R as Io,S as gt,T as X,U as $s,V as Xe,W as ot,X as xt,Y as Mo,Z as Zt,_ as Xt,$ as Qs,a0 as We,a1 as Ue,a2 as Fs,a3 as ct,a4 as bs,a5 as bt,a6 as zo,a7 as es,a8 as vt,a9 as Rt,aa as Zs,ab as Ss,ac as wt,ad as Gt,ae as Xs,af as As,ag as Ds,ah as eo,ai as Oo,aj as rt,ak as kt,al as jo,am as Ct,an as Uo,ao as No,ap as Jo,aq as to,ar as Kt,as as so,at as Ho,au as Pt,av as Vt,aw as Nt,ax as Yo,ay as Wo,az as zs,aA as qo,aB as Ko,aC as Qo,aD as Zo,aE as Dt,aF as Xo,aG as ea,aH as ta,aI as sa,aJ as ps,aK as oa,aL as aa,aM as oo,aN as na,aO as la,aP as ia,aQ as ra,aR as ca,aS as Os,aT as js,aU as ua,aV as da,aW as fa}from"./vendor-DJt7ABTC.js";(function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))l(p);new MutationObserver(p=>{for(const d of p)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&l(m)}).observe(document,{childList:!0,subtree:!0});function n(p){const d={};return p.integrity&&(d.integrity=p.integrity),p.referrerPolicy&&(d.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?d.credentials="include":p.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(p){if(p.ep)return;p.ep=!0;const d=n(p);fetch(p.href,d)}})();const pa={"@F13B4:编辑项目配置":"编辑项目配置","@F13B4:国际化测试":"国际化测试","@F13B4:Git 操作":"Git 操作","@F13B4:用户设置":"用户设置","@F13B4:创建新分支":"创建新分支","@F13B4:请输入新分支名称":"请输入新分支名称","@F13B4:选择基础分支":"选择基础分支","@F13B4:当前分支":"当前分支","@F13B4:复制仓库地址":"复制仓库地址","@F13B4:切换到浅色主题":"切换到浅色主题","@F13B4:切换到深色主题":"切换到深色主题","@F13B4:未知目录":"未知目录","@F13B4:---------- 页面初始化开始 ----------":"---------- 页面初始化开始 ----------","@F13B4:当前目录不是Git仓库,部分功能将不可用":"当前目录不是Git仓库,部分功能将不可用","@F13B4:---------- 页面初始化完成 ----------":"---------- 页面初始化完成 ----------","@F13B4:默认提交信息: ":"默认提交信息: ","@F13B4:布局比例已保存 - 左侧: ":"布局比例已保存 - 左侧: ","@F13B4:%, 上方: ":"%, 上方: ","@F13B4:底部布局比例已保存 - 左侧: ":"底部布局比例已保存 - 左侧: ","@F13B4:已恢复左侧比例: ":"已恢复左侧比例: ","@F13B4:已恢复上方比例: ":"已恢复上方比例: ","@F13B4:用户: ":"用户: ","@F13B4:未配置":"未配置","@F13B4:关闭测试":"关闭测试","@F13B4:加载中...":"加载中...","@F13B4:用户未配置":"用户未配置","@F13B4:请先配置Git用户信息才能进行提交操作。":"请先配置Git用户信息才能进行提交操作。","@F13B4:您可以通过以下方式配置:":"您可以通过以下方式配置:","@F13B4:点击右上角的设置按钮,配置用户名和邮箱":"点击右上角的设置按钮,配置用户名和邮箱","@F13B4:或者使用命令行配置:":"或者使用命令行配置:",'@F13B4:--global user.name "您的用户名"':'--global user.name "您的用户名"','@F13B4:--global user.email "您的邮箱"':'--global user.email "您的邮箱"',"@F13B4:立即配置":"立即配置","@F13B4:仓库初始化":"仓库初始化","@F13B4:当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。":"当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。","@F13B4:可以使用以下命令初始化仓库:":"可以使用以下命令初始化仓库:","@F13B4:新分支名称":"新分支名称","@F13B4:基于分支":"基于分支","@F13B4:取消":"取消","@F13B4:创建":"创建","@F13B4:远程仓库:":"远程仓库:","@76A11:没有已暂存的更改":"没有已暂存的更改","@76A11:请输入提交信息":"请输入提交信息","@76A11:提交":"提交","@76A11:个已暂存文件":"个已暂存文件","@F4137:当前分支没有上游分支":"当前分支没有上游分支","@F4137:没有需要推送的提交":"没有需要推送的提交","@F4137:有未提交的暂存更改,请先提交":"有未提交的暂存更改,请先提交","@F4137:推送":"推送","@F4137:个本地提交":"个本地提交","@2E184:一键推送所有":"一键推送所有","@2E184:暂存 + 提交 + 推送":"暂存 + 提交 + 推送","@29974:没有需要暂存的更改":"没有需要暂存的更改","@29974:暂存":"暂存","@29974:个未暂存文件(逐个添加)":"个未暂存文件(逐个添加)","@29974:暂存所有更改(git add .)":"暂存所有更改(git add .)","@29974:暂存更改":"暂存更改","@CF05E:当前路径":"当前路径","@CF05E:退出全屏":"退出全屏","@CF05E:全屏显示":"全屏显示","@CF05E:收起":"收起","@CF05E:展开":"展开","@CF05E:收起输出":"收起输出","@CF05E:展开输出":"展开输出","@CF05E:无输出内容":"无输出内容","@CF05E:自定义指令执行":"自定义指令执行","@CF05E:执行":"执行","@803A9:确定":"确定","@803A9:取消":"取消","@67CE7:在资源管理器中打开":"在资源管理器中打开","@67CE7:切换工作目录":"切换工作目录","@67CE7:请输入目录路径":"请输入目录路径","@67CE7:当前目录不是Git仓库,部分功能将不可用":"当前目录不是Git仓库,部分功能将不可用","@67CE7:打开目录失败: ":"打开目录失败: ","@67CE7:切换目录失败: ":"切换目录失败: ","@67CE7:浏览目录失败: ":"浏览目录失败: ","@67CE7:处理目录选择时出错: ":"处理目录选择时出错: ","@67CE7:目录路径":"目录路径","@67CE7:浏览":"浏览","@67CE7:常用目录":"常用目录","@67CE7:取消":"取消","@67CE7:切换":"切换","@67CE7:打开终端失败: ":"打开终端失败: ","@NPM01:NPM 脚本":"NPM 脚本","@NPM01:个包":"个包","@NPM01:正在扫描项目中的 npm 脚本...":"正在扫描项目中的 npm 脚本...","@NPM01:当前项目中未找到包含 scripts 的 package.json":"当前项目中未找到包含 scripts 的 package.json","@NPM01:个脚本":"个脚本","@NPM01:已在新终端中执行":"已在新终端中执行","@NPM01:加载npm脚本失败":"加载npm脚本失败","@NPM01:执行脚本失败":"执行脚本失败","@0883F:处理中...":"处理中...","@0883F:解锁文件":"解锁文件","@0883F:锁定文件":"锁定文件","@0883F:取消暂存":"取消暂存","@0883F:添加到暂存区":"添加到暂存区","@0883F:撤回修改":"撤回修改","@0883F:删除文件":"删除文件","@E80AC:搜索文件名或路径...":"搜索文件名或路径...","@E80AC:没有找到匹配的文件":"没有找到匹配的文件","@E80AC:该文件已被锁定,提交时会被跳过":"该文件已被锁定,提交时会被跳过","@E80AC:复制文件路径":"复制文件路径","@E80AC:用VSCode打开文件":"用VSCode打开文件","@E80AC:该文件没有差异内容":"该文件没有差异内容","@E80AC:请选择文件查看差异":"请选择文件查看差异","@E80AC:没有找到变更文件":"没有找到变更文件","@E80AC:请先选择一个文件":"请先选择一个文件","@E80AC:文件路径已复制到剪贴板":"文件路径已复制到剪贴板","@E80AC:复制失败":"复制失败","@E80AC:在系统默认编辑器中打开文件":"在系统默认编辑器中打开文件","@E80AC:打开该提交时的文件版本":"打开该提交时的文件版本","@E80AC:打开该stash中的文件版本":"打开该stash中的文件版本","@E80AC:打开文件":"打开文件","@E80AC:变更文件":"变更文件","@E80AC:文件差异":"文件差异","@E80AC:列表视图":"列表视图","@E80AC:树状视图":"树状视图","@34292:Git命令预览:":"Git命令预览:","@34292:复制命令":"复制命令","@34292:没有可复制的命令内容":"没有可复制的命令内容","@34292:命令已复制到剪贴板":"命令已复制到剪贴板","@34292:复制失败: ":"复制失败: ","@42BB9:Git 全局设置":"Git 全局设置","@42BB9:正在加载配置...":"正在加载配置...","@42BB9:用户名":"用户名","@42BB9:请输入 Git 用户名":"请输入 Git 用户名","@42BB9:邮箱地址":"邮箱地址","@42BB9:请输入 Git 邮箱地址":"请输入 Git 邮箱地址","@42BB9:首次 git push 时,自动为当前分支创建远程同名分支并建立跟踪关系(等同于 push -u)。":"首次 git push 时,自动为当前分支创建远程同名分支并建立跟踪关系(等同于 push -u)。","@42BB9:merge (默认)":"merge (默认)","@42BB9:rebase(保留合并)":"rebase(保留合并)","@42BB9:在 git fetch 时自动 prune,移除已在远程删除但本地仍保留的远程分支引用。":"在 git fetch 时自动 prune,移除已在远程删除但本地仍保留的远程分支引用。","@42BB9:新建仓库时(git init)默认创建的分支名,常见为 main 或 master。":"新建仓库时(git init)默认创建的分支名,常见为 main 或 master。","@42BB9:例如: main":"例如: main","@42BB9:已保存变更的 Git 配置":"已保存变更的 Git 配置","@42BB9:用户名和邮箱不能为空":"用户名和邮箱不能为空","@42BB9:没有需要保存的变更":"没有需要保存的变更","@42BB9:设置 ":"设置 ","@42BB9: 失败":" 失败","@42BB9:全局配置":"全局配置","@42BB9:这些设置将影响全局 Git 配置,对所有 Git 仓库生效":"这些设置将影响全局 Git 配置,对所有 Git 仓库生效","@42BB9:高级配置":"高级配置","@42BB9:自动设置上游":"自动设置上游","@42BB9:拉取策略":"拉取策略","@42BB9:自动清理远程分支":"自动清理远程分支","@42BB9:换行符处理":"换行符处理","@42BB9:默认初始化分支":"默认初始化分支","@42BB9:取消":"取消","@42BB9:保存设置":"保存设置","@2AEBA:加载中...":"加载中...","@1D6A1:已取消":"已取消","@1D6A1:- 国际化测试":"- 国际化测试","@1D6A1:基础翻译测试":"基础翻译测试","@1D6A1:模块翻译":"模块翻译","@1D6A1:动态参数测试":"动态参数测试","@1D6A1:组件国际化":"组件国际化","@1D6A1:表单国际化":"表单国际化","@1D6A1:操作翻译":"操作翻译","@1D6A1:提交历史翻译":"提交历史翻译","@1D6A1:错误信息翻译":"错误信息翻译","@1D6A1:脚本中使用 t() 函数":"脚本中使用 t() 函数","@1D6A1:在 script 中使用: ":"在 script 中使用: ","@1D6A1:结果: ":"结果: ","@1D6A1:带参数: ":"带参数: ","@71545:操作成功!":"操作成功!","@60CAC:尚未设置默认提交信息":"尚未设置默认提交信息","@60CAC:模板":"模板","@60CAC:作用域":"作用域","@60CAC:输入新模板内容":"输入新模板内容","@60CAC:编辑模板内容":"编辑模板内容","@60CAC:暂无保存的模板":"暂无保存的模板","@60CAC:更新模板":"更新模板","@60CAC:添加模板":"添加模板","@60CAC:模板内容不能为空":"模板内容不能为空","@60CAC:模板保存失败: ":"模板保存失败: ","@60CAC:模板删除失败: ":"模板删除失败: ","@60CAC:设置默认提交信息失败: ":"设置默认提交信息失败: ","@60CAC:取消":"取消","@60CAC:设为默认提交信息":"设为默认提交信息","@60CAC:已保存":"已保存","@60CAC:使用":"使用","@60CAC:编辑":"编辑","@60CAC:删除":"删除","@60CAC:已保存模板":"已保存模板","@60CAC:当前默认提交信息":"当前默认提交信息","@60CAC:关于默认提交信息":"关于默认提交信息","@60CAC:默认提交信息将在未输入提交信息时自动使用。":"默认提交信息将在未输入提交信息时自动使用。","@60CAC:你可以通过点击左侧模板的":"你可以通过点击左侧模板的","@60CAC:按钮先选择喜欢的模板,然后点击上方":"按钮先选择喜欢的模板,然后点击上方","@60CAC:按钮保存。":"按钮保存。","@F2A3A:加载中...":"加载中...","@B8591:操作成功!":"操作成功!","@D50BB:使用缓存的配置信息":"使用缓存的配置信息","@D50BB:加载配置信息...":"加载配置信息...","@D50BB:配置信息加载完成":"配置信息加载完成","@D50BB:默认提交信息已保存":"默认提交信息已保存","@D50BB:模板已保存":"模板已保存","@D50BB:模板已删除":"模板已删除","@D50BB:模板已更新":"模板已更新","@D50BB:加载配置失败: ":"加载配置失败: ","@D50BB:保存失败: ":"保存失败: ","@D50BB:保存模板失败: ":"保存模板失败: ","@D50BB:删除模板失败: ":"删除模板失败: ","@D50BB:更新模板失败: ":"更新模板失败: ","@D50BB:加载锁定文件列表失败: ":"加载锁定文件列表失败: ","@D50BB:文件已锁定: ":"文件已锁定: ","@D50BB:锁定文件失败: ":"锁定文件失败: ","@D50BB:文件已解锁: ":"文件已解锁: ","@D50BB:解锁文件失败: ":"解锁文件失败: ","@C298B:开发环境:使用默认后端端口 3000":"开发环境:使用默认后端端口 3000","@C298B:使用缓存的分支状态":"使用缓存的分支状态","@C298B:获取分支状态...":"获取分支状态...","@C298B:无":"无","@C298B:不是":"不是","@C298B:是":"是","@C298B: (强制刷新)":" (强制刷新)","@C298B:获取所有分支...":"获取所有分支...","@C298B:分支名称不能为空":"分支名称不能为空","@C298B:已清除Git用户配置":"已清除Git用户配置","@C298B:已恢复Git用户配置":"已恢复Git用户配置","@C298B:当前目录不是Git仓库":"当前目录不是Git仓库","@C298B:拉取成功":"拉取成功","@C298B:存在冲突需要手动解决":"存在冲突需要手动解决","@C298B:获取所有远程分支信息成功":"获取所有远程分支信息成功","@C298B:Socket.IO客户端已创建,开始注册事件监听器...":"Socket.IO客户端已创建,开始注册事件监听器...","@C298B:正在更新 Git 文件状态...":"正在更新 Git 文件状态...","@C298B:已停止":"已停止","@C298B:Socket连接超时":"Socket连接超时","@C298B:重连后重新发送start_monitoring请求":"重连后重新发送start_monitoring请求","@C298B:Socket重连失败,已达到最大重试次数":"Socket重连失败,已达到最大重试次数","@C298B:Socket.IO事件监听器注册完成:connect, project_info, project_changed, git_status_update, monitoring_status":"Socket.IO事件监听器注册完成:connect, project_info, project_changed, git_status_update, monitoring_status","@C298B:Socket未连接,尝试手动连接...":"Socket未连接,尝试手动连接...","@C298B:无法连接到服务器,自动更新可能不会生效":"无法连接到服务器,自动更新可能不会生效","@C298B:尝试重新建立socket连接...":"尝试重新建立socket连接...","@C298B:发送start_monitoring命令...":"发送start_monitoring命令...","@C298B:自动更新已启用":"自动更新已启用","@C298B:发送stop_monitoring命令...":"发送stop_monitoring命令...","@C298B:自动更新已禁用":"自动更新已禁用","@C298B:当前目录不是Git仓库,跳过加载提交历史":"当前目录不是Git仓库,跳过加载提交历史","@C298B:开始加载提交历史...":"开始加载提交历史...","@C298B:刷新提交历史...":"刷新提交历史...","@C298B:提交历史刷新完成":"提交历史刷新完成","@C298B:当前目录不是Git仓库,跳过加载Git状态":"当前目录不是Git仓库,跳过加载Git状态","@C298B:开始获取Git状态(porcelain格式)...":"开始获取Git状态(porcelain格式)...","@C298B:没有需要暂存的文件(所有文件都被锁定)":"没有需要暂存的文件(所有文件都被锁定)","@C298B:文件已添加到暂存区":"文件已添加到暂存区","@C298B:所有文件已添加到暂存区":"所有文件已添加到暂存区","@C298B:文件已暂存":"文件已暂存","@C298B:已取消暂存文件":"已取消暂存文件","@C298B:提交成功":"提交成功","@C298B:请选择要合并的分支":"请选择要合并的分支","@C298B:不能合并当前分支到自身":"不能合并当前分支到自身","@C298B:合并分支时发生冲突,请手动解决":"合并分支时发生冲突,请手动解决","@C298B:开始暂存并提交操作...":"开始暂存并提交操作...","@C298B:暂存完成,等待Git操作完成...":"暂存完成,等待Git操作完成...","@C298B:开始提交更改...":"开始提交更改...","@C298B:暂存并提交操作完成":"暂存并提交操作完成","@C298B:开始暂存文件...":"开始暂存文件...","@C298B:提交完成,等待Git操作完成...":"提交完成,等待Git操作完成...","@C298B:开始推送到远程...":"开始推送到远程...","@C298B:一键推送操作完成,状态已统一刷新":"一键推送操作完成,状态已统一刷新","@C298B:检测到Git锁定文件冲突,已自动清理,请重试操作":"检测到Git锁定文件冲突,已自动清理,请重试操作","@C298B:已重置暂存区":"已重置暂存区","@C298B:获取远程仓库地址...":"获取远程仓库地址...","@C298B:没有可复制的远程仓库地址":"没有可复制的远程仓库地址","@C298B:已复制远程仓库地址":"已复制远程仓库地址","@C298B:应用stash时发生冲突,请手动解决":"应用stash时发生冲突,请手动解决","@C298B:开发环境:从环境变量读取后端端口 ":"开发环境:从环境变量读取后端端口 ","@C298B:生产环境:使用当前页面端口 ":"生产环境:使用当前页面端口 ","@C298B:分支状态更新:领先 ":"分支状态更新:领先 ","@C298B: 个提交,落后 ":" 个提交,落后 ","@C298B: 个提交,上游分支:":" 个提交,上游分支:","@C298B:当前目录":"当前目录","@C298B:Git仓库":"Git仓库","@C298B:当前分支更新为: ":"当前分支更新为: ","@C298B:获取到":"获取到","@C298B:个分支":"个分支","@C298B:已切换到分支: ":"已切换到分支: ","@C298B:切换分支失败: ":"切换分支失败: ","@C298B:已创建并切换到分支: ":"已创建并切换到分支: ","@C298B:创建分支失败: ":"创建分支失败: ","@C298B:清除配置失败: ":"清除配置失败: ","@C298B:恢复配置失败: ":"恢复配置失败: ","@C298B:需要合并更改: ":"需要合并更改: ","@C298B:拉取失败: ":"拉取失败: ","@C298B:获取远程分支信息失败: ":"获取远程分支信息失败: ","@C298B:当前项目: ":"当前项目: ","@C298B:房间ID: ":"房间ID: ","@C298B:项目已切换: ":"项目已切换: ","@C298B:已加入新项目房间: ":"已加入新项目房间: ","@C298B:忽略不同项目的状态更新: ":"忽略不同项目的状态更新: ","@C298B:Socket重连成功,尝试次数: ":"Socket重连成功,尝试次数: ","@C298B:Socket尝试重连,第 ":"Socket尝试重连,第 ","@C298B: 次尝试":" 次尝试","@C298B:切换自动更新失败: ":"切换自动更新失败: ","@C298B:提交历史加载完成,共 ":"提交历史加载完成,共 ","@C298B: 条记录":" 条记录","@C298B:获取提交历史失败: ":"获取提交历史失败: ","@C298B:获取Git状态失败: ":"获取Git状态失败: ","@C298B:获取Git状态(porcelain)失败: ":"获取Git状态(porcelain)失败: ","@C298B:添加文件失败: ":"添加文件失败: ","@C298B:已添加 ":"已添加 ","@C298B: 个文件到暂存区":" 个文件到暂存区","@C298B:,跳过 ":",跳过 ","@C298B: 个锁定文件":" 个锁定文件","@C298B:暂存文件失败: ":"暂存文件失败: ","@C298B:取消暂存失败: ":"取消暂存失败: ","@C298B:commitChanges 提交失败: ":"commitChanges 提交失败: ","@C298B:提交失败: ":"提交失败: ","@C298B:推送失败: ":"推送失败: ","@C298B:成功合并分支 ":"成功合并分支 ","@C298B: 到 ":" 到 ","@C298B:合并分支失败: ":"合并分支失败: ","@C298B:操作失败: ":"操作失败: ","@C298B:重置暂存区失败: ":"重置暂存区失败: ","@C298B:已重置分支 ":"已重置分支 ","@C298B: 到远程状态":" 到远程状态","@C298B:重置分支失败: ":"重置分支失败: ","@C298B:获取到远程仓库地址: ":"获取到远程仓库地址: ","@C298B:复制失败: ":"复制失败: ","@C298B:获取stash列表失败: ":"获取stash列表失败: ","@C298B:保存stash失败: ":"保存stash失败: ","@C298B:应用stash失败: ":"应用stash失败: ","@C298B:删除stash失败: ":"删除stash失败: ","@C298B:清空stash失败: ":"清空stash失败: ","@5C735:刚刚":"刚刚","@5C735:天前":"天前","@5C735:小时前":"小时前","@5C735:分钟前":"分钟前","@81F0F:查看Git命令历史":"查看Git命令历史","@81F0F:Git 命令历史":"Git 命令历史","@81F0F:只复制命令列表(不含输出)":"只复制命令列表(不含输出)","@81F0F:复制完整命令历史(含输出)":"复制完整命令历史(含输出)","@81F0F:清空命令历史":"清空命令历史","@81F0F:暂无命令历史":"暂无命令历史","@81F0F:复制命令":"复制命令","@81F0F:展开/收起":"展开/收起","@81F0F:复制输出":"复制输出","@81F0F:实时更新":"实时更新","@81F0F:未连接":"未连接","@81F0F:成功":"成功","@81F0F:失败":"失败","@81F0F:输出信息":"输出信息","@81F0F:错误输出":"错误输出","@81F0F:没有可复制的命令历史":"没有可复制的命令历史","@81F0F:命令历史已复制到剪贴板":"命令历史已复制到剪贴板","@81F0F:没有可复制的命令":"没有可复制的命令","@81F0F:命令列表已复制到剪贴板":"命令列表已复制到剪贴板","@81F0F:确定要清空所有命令历史记录吗?此操作不可恢复。":"确定要清空所有命令历史记录吗?此操作不可恢复。","@81F0F:确定":"确定","@81F0F:取消":"取消","@81F0F:命令历史已清空":"命令历史已清空","@81F0F:命令已复制到剪贴板":"命令已复制到剪贴板","@81F0F:输出已复制到剪贴板":"输出已复制到剪贴板","@81F0F:Socket实例不可用":"Socket实例不可用","@81F0F:已连接到实时命令历史":"已连接到实时命令历史","@81F0F:实时命令历史连接已断开":"实时命令历史连接已断开","@81F0F:尝试初始化Socket连接":"尝试初始化Socket连接","@81F0F:加载命令历史失败: ":"加载命令历史失败: ","@81F0F: (耗时: ":" (耗时: ","@81F0F:复制失败: ":"复制失败: ","@81F0F:清空命令历史失败: ":"清空命令历史失败: ","@81F0F:命令":"命令","@81F0F:全部":"全部","@81F0F:清空":"清空","@81F0F:加载命令历史...":"加载命令历史...","@81F0F:耗时: ":"耗时: ","@81F0F:标准输出":"标准输出","@81F0F:输出内容过长已被截断,请直接执行命令查看完整输出":"输出内容过长已被截断,请直接执行命令查看完整输出","@81F0F:内容过长已被截断,请直接执行命令查看完整输出":"内容过长已被截断,请直接执行命令查看完整输出","@81F0F:错误信息":"错误信息","@76872:Git用户信息未配置":"Git用户信息未配置","@76872:提交命令预览:":"提交命令预览:","@76872:提交类型":"提交类型","@76872:作用域(可选)":"作用域(可选)","@76872:正文(可选):详细描述本次提交的内容和原因":"正文(可选):详细描述本次提交的内容和原因","@76872:页脚(可选):如 Closes #123":"页脚(可选):如 Closes #123","@76872:Git 操作":"Git 操作","@76872:合并其他分支到当前分支":"合并其他分支到当前分支","@76872:将工作区更改储藏起来":"将工作区更改储藏起来","@76872:查看和管理所有储藏记录":"查看和管理所有储藏记录","@76872:编辑配置 JSON":"编辑配置 JSON","@76872:在此编辑当前项目配置的 JSON...":"在此编辑当前项目配置的 JSON...","@76872:配置文件格式提示":"配置文件格式提示","@76872:简短描述模板设置":"简短描述模板设置","@76872:输入新模板内容":"输入新模板内容","@76872:编辑模板内容":"编辑模板内容","@76872:暂无保存的模板":"暂无保存的模板","@76872:作用域模板设置":"作用域模板设置","@76872:输入新作用域模板":"输入新作用域模板","@76872:编辑作用域模板内容":"编辑作用域模板内容","@76872:暂无保存的作用域":"暂无保存的作用域","@76872:默认提交信息设置":"默认提交信息设置","@76872:储藏更改 (Git Stash)":"储藏更改 (Git Stash)","@76872:储藏":"储藏","@76872:取消":"取消","@76872:储藏说明":"储藏说明","@76872:为这次储藏添加描述信息(可选)":"为这次储藏添加描述信息(可选)","@76872:合并分支":"合并分支","@76872:分支类型":"分支类型","@76872:选择分支":"选择分支","@76872:选择要合并的分支":"选择要合并的分支","@76872:合并选项":"合并选项","@76872:创建合并提交,即使可以使用快进合并":"创建合并提交,即使可以使用快进合并","@76872:将多个提交压缩为一个提交":"将多个提交压缩为一个提交","@76872:执行合并但不自动创建提交":"执行合并但不自动创建提交","@76872:合并提交信息 (可选)":"合并提交信息 (可选)","@76872:输入自定义合并提交信息":"输入自定义合并提交信息","@76872:储藏列表 (Git Stash)":"储藏列表 (Git Stash)","@76872:暂无储藏记录":"暂无储藏记录","@76872:储藏详情":"储藏详情","@76872:该stash没有变更文件":"该stash没有变更文件","@76872:提交设置":"提交设置","@76872:提交模式":"提交模式","@76872:选择传统或标准化提交格式":"选择传统或标准化提交格式","@76872:标准化":"标准化","@76872:普通":"普通","@76872:跳过钩子检查":"跳过钩子检查","@76872:添加 --no-verify 参数":"添加 --no-verify 参数","@76872:回车自动提交":"回车自动提交","@76872:输入提交信息后按回车直接执行一键推送":"输入提交信息后按回车直接执行一键推送","@76872:Push完成自动关闭":"Push完成自动关闭","@76872:推送成功后自动关闭进度弹窗":"推送成功后自动关闭进度弹窗","@76872:自动填充默认提交信息":"自动填充默认提交信息","@76872:打开页面或提交完成后自动填充默认提交信息":"打开页面或提交完成后自动填充默认提交信息","@76872:收起":"收起","@76872:正文及页脚":"正文及页脚","@76872:拉取":"拉取","@76872:个远程提交":"个远程提交","@76872:撤销":"撤销","@76872:个已暂存文件":"个已暂存文件","@76872:系统配置文件不存在,将使用默认配置。":"系统配置文件不存在,将使用默认配置。","@76872:加载配置失败":"加载配置失败","@76872:保存失败":"保存失败","@76872:配置已保存":"配置已保存","@76872:打开失败":"打开失败","@76872:已用系统程序打开配置文件":"已用系统程序打开配置文件","@76872:确定要删除此储藏吗?此操作不可恢复。":"确定要删除此储藏吗?此操作不可恢复。","@76872:删除储藏":"删除储藏","@76872:确定":"确定","@76872:确定要清空所有储藏吗?此操作不可恢复。":"确定要清空所有储藏吗?此操作不可恢复。","@76872:清空所有储藏":"清空所有储藏","@76872:无效的stash ID":"无效的stash ID","@76872:未知错误":"未知错误","@76872:没有变更内容":"没有变更内容","@76872:打开文件失败":"打开文件失败","@76872:用VSCode打开文件失败":"用VSCode打开文件失败","@76872:简短描述(必填)":"简短描述(必填)","@76872:简短描述(必填,按回车一键推送)":"简短描述(必填,按回车一键推送)","@76872:操作成功!":"操作成功!","@76872:已完成操作":"已完成操作","@76872:重置到远程分支":"重置到远程分支","@76872:正在暂存文件...":"正在暂存文件...","@76872:推送成功,状态已更新":"推送成功,状态已更新","@76872:默认提交信息设置成功":"默认提交信息设置成功","@76872:正在提交更改...":"正在提交更改...","@76872:正在推送...":"正在推送...","@76872:请选择要合并的分支":"请选择要合并的分支","@76872:系统配置文件格式有误:":"系统配置文件格式有误:","@76872:JSON 解析失败: ":"JSON 解析失败: ","@76872:保存配置失败: ":"保存配置失败: ","@76872:打开配置文件失败: ":"打开配置文件失败: ","@76872:获取文件列表失败: ":"获取文件列表失败: ","@76872:获取stash详情失败: ":"获取stash详情失败: ","@76872:获取差异失败: ":"获取差异失败: ","@76872:打开文件失败: ":"打开文件失败: ","@76872:用VSCode打开文件失败: ":"用VSCode打开文件失败: ","@76872:输入提交信息 (默认: ":"输入提交信息 (默认: ","@76872:(按回车一键推送)":"(按回车一键推送)","@76872:暂存并提交失败: ":"暂存并提交失败: ",'@76872:确定要重置当前分支 "':'确定要重置当前分支 "','@76872:" 到远程状态吗?这将丢失所有未推送的提交和本地更改。':'" 到远程状态吗?这将丢失所有未推送的提交和本地更改。',"@76872:重置到远程分支失败: ":"重置到远程分支失败: ","@76872:设置默认提交信息失败: ":"设置默认提交信息失败: ","@76872:提交更改":"提交更改","@76872:您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:":"您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:","@76872:基础操作":"基础操作","@76872:获取所有远程分支":"获取所有远程分支","@76872:组合操作":"组合操作","@76872:暂存并提交":"暂存并提交","@76872:重置操作":"重置操作","@76872:重置暂存区":"重置暂存区","@76872:重置到远程":"重置到远程","@76872:分支操作":"分支操作","@76872:储藏操作":"储藏操作","@76872:储藏更改":"储藏更改","@76872:储藏列表":"储藏列表","@76872:编辑当前项目的配置文件":"编辑当前项目的配置文件","@76872:支持JSON格式":"支持JSON格式","@76872:打开系统配置文件":"打开系统配置文件","@76872:保存配置":"保存配置","@76872:继续编辑":"继续编辑","@76872:储藏工作区更改":"储藏工作区更改","@76872:将当前工作区的更改临时保存,稍后可以重新应用到任何分支":"将当前工作区的更改临时保存,稍后可以重新应用到任何分支","@76872:储藏选项":"储藏选项","@76872:包含未跟踪文件":"包含未跟踪文件","@76872:同时储藏新建但未添加到Git的文件 (--include-untracked)":"同时储藏新建但未添加到Git的文件 (--include-untracked)","@76872:排除锁定文件":"排除锁定文件","@76872:不储藏被锁定的文件,保持其当前状态":"不储藏被锁定的文件,保持其当前状态","@76872:将要储藏的文件":"将要储藏的文件","@76872:已暂存: ":"已暂存: ","@76872:个文件":"个文件","@76872:未暂存: ":"未暂存: ","@76872:选择要合并到当前分支 (":"选择要合并到当前分支 (","@76872:) 的分支:":") 的分支:","@76872:所有分支":"所有分支","@76872:本地分支":"本地分支","@76872:远程分支":"远程分支","@76872:禁用快进合并 (--no-ff)":"禁用快进合并 (--no-ff)","@76872:压缩提交 (--squash)":"压缩提交 (--squash)","@76872:不自动提交 (--no-commit)":"不自动提交 (--no-commit)","@76872:合并":"合并","@76872:个储藏":"个储藏","@76872:还没有任何储藏记录":"还没有任何储藏记录","@76872:使用 git stash 可以临时保存工作进度":"使用 git stash 可以临时保存工作进度","@76872:最新":"最新","@76872:查看":"查看","@76872:应用":"应用","@76872:应用并删除":"应用并删除","@76872:删除":"删除","@76872:描述:":"描述:","@76872:更新状态中...":"更新状态中...","@76872:新功能":"新功能","@76872:修复bug":"修复bug","@76872:文档修改":"文档修改","@76872:样式修改":"样式修改","@76872:代码重构":"代码重构","@76872:测试代码":"测试代码","@76872:构建/工具修改":"构建/工具修改","@13D1C:Git Pull (拉取远程更新)":"Git Pull (拉取远程更新)","@13D1C:Git Fetch All (获取所有远程分支)":"Git Fetch All (获取所有远程分支)","@13D1C:管理锁定文件":"管理锁定文件","@13D1C:刷新状态":"刷新状态","@13D1C:本地分支与远程分支的状态对比":"本地分支与远程分支的状态对比","@13D1C:已暂存的更改":"已暂存的更改","@13D1C:未暂存的更改":"未暂存的更改","@13D1C:未跟踪的文件":"未跟踪的文件","@13D1C:文件差异":"文件差异","@13D1C:选择文件查看差异":"选择文件查看差异","@13D1C:锁定文件管理":"锁定文件管理","@13D1C:这些文件在提交时会被自动跳过":"这些文件在提交时会被自动跳过","@13D1C:解锁文件":"解锁文件","@13D1C:解锁":"解锁","@13D1C:自动更新文件状态":"自动更新文件状态","@13D1C:正在拉取代码...":"正在拉取代码...","@13D1C:正在获取远程分支信息...":"正在获取远程分支信息...","@13D1C:加载中...":"加载中...","@13D1C:打开文件失败":"打开文件失败","@13D1C:用VSCode打开文件失败":"用VSCode打开文件失败","@13D1C:未知目录":"未知目录","@13D1C:Git 状态已刷新":"Git 状态已刷新","@13D1C:确认解锁":"确认解锁","@13D1C:取消":"取消","@13D1C:清空全部锁定":"清空全部锁定","@13D1C:全部解锁":"全部解锁","@13D1C:已清空所有文件锁定":"已清空所有文件锁定","@13D1C:没有变更":"没有变更","@13D1C:目录浏览功能未启用":"目录浏览功能未启用","@13D1C:获取目录内容失败":"获取目录内容失败","@13D1C:目录路径不能为空":"目录路径不能为空","@13D1C:已切换工作目录":"已切换工作目录","@13D1C:当前目录不是一个Git仓库":"当前目录不是一个Git仓库","@13D1C:切换目录失败":"切换目录失败","@13D1C:未知当前分支":"未知当前分支","@13D1C:已推送并设置上游分支":"已推送并设置上游分支","@13D1C:设置上游失败":"设置上游失败","@13D1C:撤回修改":"撤回修改","@13D1C:确定":"确定","@13D1C:已撤回文件修改":"已撤回文件修改","@13D1C:撤回文件修改失败,请重试":"撤回文件修改失败,请重试","@13D1C:未知错误":"未知错误","@13D1C:打开文件失败: ":"打开文件失败: ","@13D1C:用VSCode打开文件失败: ":"用VSCode打开文件失败: ","@13D1C:确认解锁所有已锁定文件?共 ":"确认解锁所有已锁定文件?共 ","@13D1C: 个。":" 个。","@13D1C:新文件: ":"新文件: ","@13D1C:获取目录内容失败: ":"获取目录内容失败: ","@13D1C:切换目录失败: ":"切换目录失败: ","@13D1C:设置上游失败: ":"设置上游失败: ",'@13D1C:确定要撤回文件 "':'确定要撤回文件 "','@13D1C:" 的所有修改吗?此操作无法撤销。':'" 的所有修改吗?此操作无法撤销。',"@13D1C:撤回失败: ":"撤回失败: ","@13D1C:撤回文件修改失败: ":"撤回文件修改失败: ","@13D1C:自动更新状态变更: ":"自动更新状态变更: ","@13D1C:状态":"状态","@13D1C:当前目录不是Git仓库":"当前目录不是Git仓库","@13D1C:当前分支未设置上游分支":"当前分支未设置上游分支","@13D1C:首次推送后即可建立与远程的跟踪关系,后续可直接 pull/push。":"首次推送后即可建立与远程的跟踪关系,后续可直接 pull/push。","@13D1C:设置上游并推送":"设置上游并推送","@13D1C:个提交":"个提交","@13D1C:没有检测到任何更改":"没有检测到任何更改","@13D1C:工作区是干净的":"工作区是干净的","@13D1C:文件锁定功能说明":"文件锁定功能说明","@13D1C:锁定的文件在执行 Git 提交时会被自动跳过,不会被添加到暂存区":"锁定的文件在执行 Git 提交时会被自动跳过,不会被添加到暂存区","@13D1C:当前没有锁定的文件":"当前没有锁定的文件","@13D1C:您可以在文件列表中点击锁定按钮来锁定文件":"您可以在文件列表中点击锁定按钮来锁定文件","@13D1C:个文件":"个文件","@13D1C:文件列表":"文件列表","@A1833:选择作者":"选择作者","@A1833:选择分支":"选择分支","@A1833:提交信息关键词":"提交信息关键词","@A1833:至":"至","@A1833:开始日期":"开始日期","@A1833:结束日期":"结束日期","@A1833:哈希":"哈希","@A1833:提交信息":"提交信息","@A1833:复制纯净提交信息(不含类型前缀)":"复制纯净提交信息(不含类型前缀)","@A1833:日期":"日期","@A1833:作者":"作者","@A1833:没有找到变更文件":"没有找到变更文件","@A1833:加载中...":"加载中...","@A1833:没有匹配的提交记录":"没有匹配的提交记录","@A1833:未知":"未知","@A1833:提交详情: ":"提交详情: ","@A1833:打开文件失败":"打开文件失败","@A1833:用VSCode打开文件失败":"用VSCode打开文件失败","@A1833:提交信息已复制到剪贴板":"提交信息已复制到剪贴板","@A1833:复制失败":"复制失败","@A1833:获取文件列表失败: ":"获取文件列表失败: ","@A1833:获取提交详情失败: ":"获取提交详情失败: ","@A1833:获取差异失败: ":"获取差异失败: ","@A1833:打开文件失败: ":"打开文件失败: ","@A1833:用VSCode打开文件失败: ":"用VSCode打开文件失败: ","@A1833:确定要撤销提交 ":"确定要撤销提交 ","@A1833: 吗?这将创建一个新的提交来撤销这次提交的更改。":" 吗?这将创建一个新的提交来撤销这次提交的更改。","@A1833:确定要将提交 ":"确定要将提交 ","@A1833: Cherry-Pick 到当前分支吗?":" Cherry-Pick 到当前分支吗?","@A1833:已复制提交哈希: ":"已复制提交哈希: ","@A1833:复制提交哈希失败: ":"复制提交哈希失败: ","@A1833:确定要将当前分支重置(hard)到提交 ":"确定要将当前分支重置(hard)到提交 ","@A1833:提交历史":"提交历史","@A1833:分支":"分支","@A1833:信息":"信息","@A1833:应用":"应用","@A1833:重置":"重置","@A1833:查看详情":"查看详情","@A1833:复制提交哈希":"复制提交哈希","@A1833:重置到该提交(hard)":"重置到该提交(hard)","@A1833:撤销提交 (Revert)":"撤销提交 (Revert)","@A1833:-Pick 到当前分支":"-Pick 到当前分支"},ma={"@F13B4:编辑项目配置":"Edit project configuration","@F13B4:国际化测试":"Internationalization testing","@F13B4:Git 操作":"Git operation","@F13B4:用户设置":"User Settings","@F13B4:创建新分支":"Create a new branch","@F13B4:请输入新分支名称":"Please enter the new branch name","@F13B4:选择基础分支":"Select the basic branch","@F13B4:当前分支":"Current branch","@F13B4:复制仓库地址":"Copy repository URL","@F13B4:切换到浅色主题":"Switch to light theme","@F13B4:切换到深色主题":"Switch to dark theme","@F13B4:未知目录":"Unknown directory","@F13B4:---------- 页面初始化开始 ----------":"----------Page initialization begins----------","@F13B4:当前目录不是Git仓库,部分功能将不可用":"The current directory is not a Git repository, some features will be unavailable","@F13B4:---------- 页面初始化完成 ----------":"----------Page initialization completed----------","@F13B4:默认提交信息: ":"Default commit message: ","@F13B4:布局比例已保存 - 左侧: ":"Layout ratio saved - Left: ","@F13B4:%, 上方: ":"%, Top: ","@F13B4:底部布局比例已保存 - 左侧: ":"Bottom layout ratio saved - Left: ","@F13B4:已恢复左侧比例: ":"Left aspect ratio restored:","@F13B4:已恢复上方比例: ":"The proportion above has been restored:","@F13B4:用户: ":"User:","@F13B4:未配置":"Not configured","@F13B4:关闭测试":"Close testing","@F13B4:加载中...":"Loading...","@F13B4:用户未配置":"User not configured","@F13B4:请先配置Git用户信息才能进行提交操作。":"Please configure Git user information before performing the commit operation.","@F13B4:您可以通过以下方式配置:":"You can configure it in the following ways:","@F13B4:点击右上角的设置按钮,配置用户名和邮箱":"Click the settings button in the upper right corner to configure the username and email","@F13B4:或者使用命令行配置:":"Or use the command line to configure:",'@F13B4:--global user.name "您的用户名"':'--Globaluser.name "Your username"','@F13B4:--global user.email "您的邮箱"':'--Globaluser.email "Your email"',"@F13B4:立即配置":"Configure now","@F13B4:仓库初始化":"Repository initialization","@F13B4:当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。":"The current directory is not a Git repository. Please initialize the Git repository or switch to the Git repository directory first.","@F13B4:可以使用以下命令初始化仓库:":"You can use the following command to initialize the repository:","@F13B4:新分支名称":"New branch name","@F13B4:基于分支":"Based on branches","@F13B4:取消":"Cancel","@F13B4:创建":"Create","@F13B4:远程仓库:":"Remote repository:","@76A11:没有已暂存的更改":"There are no staged changes","@76A11:请输入提交信息":"Please enter the commit information","@76A11:提交":"Commit","@76A11:个已暂存文件":"A staged file","@F4137:当前分支没有上游分支":"There is no upstream branch in the current branch","@F4137:没有需要推送的提交":"There are no commits that need to be pushed","@F4137:有未提交的暂存更改,请先提交":"There are pending temporary changes that have not been submitted. Please submit them first","@F4137:推送":"Push","@F4137:个本地提交":"Local commit","@2E184:一键推送所有":"One click push to all","@2E184:暂存 + 提交 + 推送":"Stage + Commit + Push","@29974:没有需要暂存的更改":"There are no changes that need to be staged","@29974:暂存":"Stage","@29974:个未暂存文件(逐个添加)":"Unstaged files (added one by one)","@29974:暂存所有更改(git add .)":"Stage all changes (git add .)","@29974:暂存更改":"Stage changes","@CF05E:当前路径":"Current path","@CF05E:退出全屏":"Exit fullscreen","@CF05E:全屏显示":"Full screen display","@CF05E:收起":"Fold up","@CF05E:展开":"Expand","@CF05E:收起输出":"Retract output","@CF05E:展开输出":"Expand output","@CF05E:无输出内容":"No output content","@CF05E:自定义指令执行":"Custom instruction execution","@CF05E:执行":"Execute","@803A9:确定":"Confirm","@803A9:取消":"Cancel","@67CE7:在资源管理器中打开":"Open in File Explorer","@67CE7:切换工作目录":"Switch working directory","@67CE7:请输入目录路径":"Please enter the directory path","@67CE7:当前目录不是Git仓库,部分功能将不可用":"The current directory is not a Git repository, some features will be unavailable","@67CE7:打开目录失败: ":"Failed to open directory:","@67CE7:切换目录失败: ":"Failed to switch directory:","@67CE7:浏览目录失败: ":"Browse directory failed:","@67CE7:处理目录选择时出错: ":"Error processing directory selection:","@67CE7:目录路径":"Directory path","@67CE7:浏览":"Browse","@67CE7:常用目录":"Common Directories","@67CE7:取消":"Cancel","@67CE7:切换":"Switch","@0883F:处理中...":"Processing...","@0883F:解锁文件":"Unlock files","@0883F:锁定文件":"Lock file","@0883F:取消暂存":"Cancel staging","@0883F:添加到暂存区":"Add to staging area","@0883F:撤回修改":"Discard changes","@0883F:删除文件":"Delete file","@E80AC:搜索文件名或路径...":"Search for file name or path ..","@E80AC:没有找到匹配的文件":"No matching files found","@E80AC:该文件已被锁定,提交时会被跳过":"This file has been locked and will be skipped during commit","@E80AC:复制文件路径":"Copy file path","@E80AC:用VSCode打开文件":"Open the file with VSCode","@E80AC:该文件没有差异内容":"This file has no differential content","@E80AC:请选择文件查看差异":"Please select a file to view differences","@E80AC:没有找到变更文件":"No change file found","@E80AC:请先选择一个文件":"Please select a file first","@E80AC:文件路径已复制到剪贴板":"The file path has been copied to the clipboard","@E80AC:复制失败":"Copy failed","@E80AC:在系统默认编辑器中打开文件":"Open the file in the default editor of the system","@E80AC:打开该提交时的文件版本":"Open the file version at the time of commit","@E80AC:打开该stash中的文件版本":"Open the file version in this stash","@E80AC:打开文件":"Open the file","@E80AC:变更文件":"Changed Files","@E80AC:文件差异":"File Diff","@E80AC:列表视图":"List View","@E80AC:树状视图":"Tree View","@E80AC:文件列表":"File List","@34292:Git命令预览:":"Git command preview:","@34292:复制命令":"Copy command","@34292:没有可复制的命令内容":"There is no command content that can be copied","@34292:命令已复制到剪贴板":"Command copied to clipboard","@34292:复制失败: ":"Copy failed:","@42BB9:Git 全局设置":"Git Global Settings","@42BB9:正在加载配置...":"Loading configuration ..","@42BB9:用户名":"Username","@42BB9:请输入 Git 用户名":"Please enter Git username","@42BB9:邮箱地址":"Email address","@42BB9:请输入 Git 邮箱地址":"Please enter your Git email address","@42BB9:首次 git push 时,自动为当前分支创建远程同名分支并建立跟踪关系(等同于 push -u)。":"When Git pushes for the first time, it automatically creates a remote branch with the same name for the current branch and establishes a tracking relationship (equivalent to push-u).","@42BB9:merge (默认)":"Merge (default)","@42BB9:rebase(保留合并)":"Rebase (retain merge)","@42BB9:在 git fetch 时自动 prune,移除已在远程删除但本地仍保留的远程分支引用。":"Automatically prune during git fetch to remove remote branch references that have been deleted remotely but are still retained locally.","@42BB9:新建仓库时(git init)默认创建的分支名,常见为 main 或 master。":"When creating a new repository (gitinit), the default branch name created is' main 'or' master '.","@42BB9:例如: main":"For example: main","@42BB9:已保存变更的 Git 配置":"Git configuration with saved changes","@42BB9:用户名和邮箱不能为空":"Username and email cannot be empty","@42BB9:没有需要保存的变更":"There are no changes that need to be saved","@42BB9:设置 ":"Settings","@42BB9: 失败":"Failure","@42BB9:全局配置":"Global Configuration","@42BB9:这些设置将影响全局 Git 配置,对所有 Git 仓库生效":"These settings will affect the global Git configuration and take effect for all Git repositories","@42BB9:高级配置":"Advanced Configuration","@42BB9:自动设置上游":"Automatically set upstream","@42BB9:拉取策略":"Pull strategy","@42BB9:自动清理远程分支":"Automatically clean up remote branches","@42BB9:换行符处理":"Line break processing","@42BB9:默认初始化分支":"Default initialization branch","@42BB9:取消":"Cancel","@42BB9:保存设置":"Save Settings","@2AEBA:加载中...":"Loading...","@1D6A1:已取消":"Canceled","@1D6A1:- 国际化测试":"-Internationalization testing","@1D6A1:基础翻译测试":"Basic Translation Test","@1D6A1:模块翻译":"Module translation","@1D6A1:动态参数测试":"Dynamic parameter testing","@1D6A1:组件国际化":"Internationalization of Components","@1D6A1:表单国际化":"Internationalization of Forms","@1D6A1:操作翻译":"Operation translation","@1D6A1:提交历史翻译":"Commit historical translation","@1D6A1:错误信息翻译":"Translation of incorrect information","@1D6A1:脚本中使用 t() 函数":"Using the t() function in the script","@1D6A1:在 script 中使用: ":"Use in script:","@1D6A1:结果: ":"Result:","@1D6A1:带参数: ":"With parameters:","@71545:操作成功!":"Operation successful!","@60CAC:尚未设置默认提交信息":"Default commit information has not been set yet","@60CAC:模板":"Template","@60CAC:作用域":"Scope","@60CAC:输入新模板内容":"Enter new template content","@60CAC:编辑模板内容":"Edit template content","@60CAC:暂无保存的模板":"There are currently no saved templates available","@60CAC:更新模板":"Update template","@60CAC:添加模板":"Add template","@60CAC:模板内容不能为空":"Template content cannot be empty","@60CAC:模板保存失败: ":"Template save failed:","@60CAC:模板删除失败: ":"Template deletion failed:","@60CAC:设置默认提交信息失败: ":"Failed to set default commit information:","@60CAC:取消":"Cancel","@60CAC:设为默认提交信息":"Set as default commit information","@60CAC:已保存":"Saved","@60CAC:使用":"Use","@60CAC:编辑":"Edit","@60CAC:删除":"Delete","@60CAC:已保存模板":"Template saved","@60CAC:当前默认提交信息":"Current default commit information","@60CAC:关于默认提交信息":"About default commit information","@60CAC:默认提交信息将在未输入提交信息时自动使用。":"The default commit information will be automatically used when no commit information is entered.","@60CAC:你可以通过点击左侧模板的":"You can click on the template on the left","@60CAC:按钮先选择喜欢的模板,然后点击上方":"Select your favorite template first, and then click on the button above","@60CAC:按钮保存。":"Button to save.","@F2A3A:加载中...":"Loading...","@B8591:操作成功!":"Operation successful!","@D50BB:使用缓存的配置信息":"Use cached configuration information","@D50BB:加载配置信息...":"Load configuration information ..","@D50BB:配置信息加载完成":"Configuration information loading completed","@D50BB:默认提交信息已保存":"Default commit information has been saved","@D50BB:模板已保存":"Template saved","@D50BB:模板已删除":"Template deleted","@D50BB:模板已更新":"Template updated","@D50BB:加载配置失败: ":"Loading configuration failed:","@D50BB:保存失败: ":"Save failed:","@D50BB:保存模板失败: ":"Failed to save template:","@D50BB:删除模板失败: ":"Template deletion failed:","@D50BB:更新模板失败: ":"Template update failed:","@D50BB:加载锁定文件列表失败: ":"Failed to load lock file list:","@D50BB:文件已锁定: ":"File locked:","@D50BB:锁定文件失败: ":"Failed to lock file:","@D50BB:文件已解锁: ":"File unlocked:","@D50BB:解锁文件失败: ":"Unlocking file failed:","@C298B:开发环境:使用默认后端端口 3000":"Development environment: Use default backend port 3000","@C298B:使用缓存的分支状态":"Using cached branch states","@C298B:获取分支状态...":"Get branch status ..","@C298B:无":"None","@C298B:不是":"Not","@C298B:是":"Yes","@C298B: (强制刷新)":"(Force refresh)","@C298B:获取所有分支...":"Get all branches ..","@C298B:分支名称不能为空":"Branch name cannot be empty","@C298B:已清除Git用户配置":"Git user configuration cleared","@C298B:已恢复Git用户配置":"Git user configuration has been restored","@C298B:当前目录不是Git仓库":"The current directory is not a Git repository","@C298B:拉取成功":"Pull successful","@C298B:存在冲突需要手动解决":"There is a conflict that needs to be manually resolved","@C298B:获取所有远程分支信息成功":"Successfully obtained all remote branch information","@C298B:Socket.IO客户端已创建,开始注册事件监听器...":"The Socket.IO client has been created and registration for event listeners has begun ..","@C298B:正在更新 Git 文件状态...":"Updating Git file status ..","@C298B:已停止":"Stopped","@C298B:Socket连接超时":"Socket connection timeout","@C298B:重连后重新发送start_monitoring请求":"Reconnect and resend start_manitoring request","@C298B:Socket重连失败,已达到最大重试次数":"Socket reconnection failed, maximum retry count reached","@C298B:Socket.IO事件监听器注册完成:connect, project_info, project_changed, git_status_update, monitoring_status":"Socket.IO event listener registration completed: connect, project_info, project_changed, git_datus_uUpdate, self-moniting_status","@C298B:Socket未连接,尝试手动连接...":"Socket not connected, attempt to manually connect ..","@C298B:无法连接到服务器,自动更新可能不会生效":"Unable to connect to the server, automatic updates may not take effect","@C298B:尝试重新建立socket连接...":"Attempt to re-establish the socket connection ..","@C298B:发送start_monitoring命令...":"Send the start_manitoring command ..","@C298B:自动更新已启用":"Automatic update enabled","@C298B:发送stop_monitoring命令...":"Send the stop_manitoring command ..","@C298B:自动更新已禁用":"Automatic updates disabled","@C298B:当前目录不是Git仓库,跳过加载提交历史":"The current directory is not a Git repository, skip loading commit history","@C298B:开始加载提交历史...":"Start loading commit history ..","@C298B:刷新提交历史...":"Refresh commit history ..","@C298B:提交历史刷新完成":"Submission history refresh completed","@C298B:当前目录不是Git仓库,跳过加载Git状态":"The current directory is not a Git repository, skip loading Git status","@C298B:开始获取Git状态(porcelain格式)...":"Start obtaining Git status (in porcelain format) ..","@C298B:没有需要暂存的文件(所有文件都被锁定)":"There are no files that need to be staged (all files are locked)","@C298B:文件已添加到暂存区":"The file has been added to the staging area","@C298B:所有文件已添加到暂存区":"All files have been added to the staging area","@C298B:文件已暂存":"The file has been staged","@C298B:已取消暂存文件":"The temporary file has been cancelled","@C298B:提交成功":"Submission successful","@C298B:请选择要合并的分支":"Please select the branch to merge","@C298B:不能合并当前分支到自身":"Cannot merge the current branch into itself","@C298B:合并分支时发生冲突,请手动解决":"Conflict occurred during branch merging, please manually resolve it","@C298B:开始暂存并提交操作...":"Starting stage and commit operation...","@C298B:暂存完成,等待Git操作完成...":"Staging completed, waiting for Git operation to complete...","@C298B:开始提交更改...":"Start submitting changes ..","@C298B:暂存并提交操作完成":"Stage and commit operation completed","@C298B:开始暂存文件...":"Starting to stage files...","@C298B:提交完成,等待Git操作完成...":"Submission completed, waiting for Git operation to complete ..","@C298B:开始推送到远程...":"Start pushing to remote ..","@C298B:一键推送操作完成,状态已统一刷新":"One click push operation completed, status has been uniformly refreshed","@C298B:检测到Git锁定文件冲突,已自动清理,请重试操作":"Detected Git lock file conflict, automatically cleared, please retry operation","@C298B:已重置暂存区":"Reset staging area","@C298B:获取远程仓库地址...":"Obtain the remote repository address ..","@C298B:没有可复制的远程仓库地址":"There are no replicable remote repository addresses available","@C298B:已复制远程仓库地址":"The remote repository address has been copied","@C298B:应用stash时发生冲突,请手动解决":"There was a conflict while applying 'stash', please manually resolve it","@C298B:开发环境:从环境变量读取后端端口 ":"Development environment: Read backend ports from environment variables","@C298B:生产环境:使用当前页面端口 ":"Production environment: Use the current page port","@C298B:分支状态更新:领先 ":"Branch status update: Leading","@C298B: 个提交,落后 ":"A commit, lagging behind","@C298B: 个提交,上游分支:":"Submission, upstream branch:","@C298B:当前目录":"Current directory","@C298B:Git仓库":"Git repository","@C298B:当前分支更新为: ":"The current branch update is:","@C298B:获取到":"Obtained","@C298B:个分支":"A branch","@C298B:已切换到分支: ":"Switch to branch:","@C298B:切换分支失败: ":"Switching branches failed:","@C298B:已创建并切换到分支: ":"Created and switched to branch:","@C298B:创建分支失败: ":"Branch creation failed:","@C298B:清除配置失败: ":"Clearing configuration failed:","@C298B:恢复配置失败: ":"Failed to restore configuration:","@C298B:需要合并更改: ":"Need to merge changes:","@C298B:拉取失败: ":"Pull failed:","@C298B:获取远程分支信息失败: ":"Failed to obtain remote branch information:","@C298B:当前项目: ":"Current project:","@C298B:房间ID: ":"Room ID:","@C298B:项目已切换: ":"Project switched:","@C298B:已加入新项目房间: ":"New project room added:","@C298B:忽略不同项目的状态更新: ":"Ignore status updates for different projects:","@C298B:Socket重连成功,尝试次数: ":"Socket reconnection successful, attempts:","@C298B:Socket尝试重连,第 ":"Socket attempts to reconnect, step","@C298B: 次尝试":"Try again","@C298B:切换自动更新失败: ":"Switching to automatic update failed:","@C298B:提交历史加载完成,共 ":"Submission history loading completed, total","@C298B: 条记录":"Record","@C298B:获取提交历史失败: ":"Failed to retrieve commit history:","@C298B:获取Git状态失败: ":"Failed to retrieve Git status:","@C298B:获取Git状态(porcelain)失败: ":"Failed to retrieve Git status (porcelain):","@C298B:添加文件失败: ":"Failed to add file:","@C298B:已添加 ":"Added","@C298B: 个文件到暂存区":"Transfer a file to the staging area","@C298B:,跳过 ":"Skip it","@C298B: 个锁定文件":"A locked file","@C298B:暂存文件失败: ":"Temporary file stash failed:","@C298B:取消暂存失败: ":"Cancel staging failed:","@C298B:commitChanges 提交失败: ":"CommitChanges failed to commit:","@C298B:提交失败: ":"Submission failed:","@C298B:推送失败: ":"Push failed:","@C298B:成功合并分支 ":"Successfully merged branches","@C298B: 到 ":"To","@C298B:合并分支失败: ":"Merge branch failed:","@C298B:操作失败: ":"Operation failed:","@C298B:重置暂存区失败: ":"Reset staging area failed:","@C298B:已重置分支 ":"Branch has been reset","@C298B: 到远程状态":"To remote status","@C298B:重置分支失败: ":"Reset branch failed:","@C298B:获取到远程仓库地址: ":"Obtained remote repository address:","@C298B:复制失败: ":"Copy failed:","@C298B:获取stash列表失败: ":"Failed to retrieve the stash list:","@C298B:保存stash失败: ":"Save stash failed:","@C298B:应用stash失败: ":"Application stash failed:","@C298B:删除stash失败: ":"Failed to delete stash:","@C298B:清空stash失败: ":"Clearing stash failed:","@5C735:刚刚":"Just now","@5C735:天前":"Days ago","@5C735:小时前":"Hours ago","@5C735:分钟前":"Minutes ago","@81F0F:查看Git命令历史":"View Git Command History","@81F0F:Git 命令历史":"Git Command History","@81F0F:只复制命令列表(不含输出)":"Copy only command list (excluding output)","@81F0F:复制完整命令历史(含输出)":"Copy the complete command history (including output)","@81F0F:清空命令历史":"Clear command history","@81F0F:暂无命令历史":"No command history available at the moment","@81F0F:复制命令":"Copy command","@81F0F:展开/收起":"Expand","@81F0F:复制输出":"Copy output","@81F0F:实时更新":"Real-time update","@81F0F:未连接":"Not connected","@81F0F:成功":"Success","@81F0F:失败":"Failure","@81F0F:输出信息":"Output information","@81F0F:错误输出":"Error output","@81F0F:没有可复制的命令历史":"There is no replicable command history","@81F0F:命令历史已复制到剪贴板":"Command history copied to clipboard","@81F0F:没有可复制的命令":"There are no replicable commands","@81F0F:命令列表已复制到剪贴板":"The command list has been copied to the clipboard","@81F0F:确定要清空所有命令历史记录吗?此操作不可恢复。":"Are you sure you want to clear all command history records? This operation is irreversible.","@81F0F:确定":"Confirm","@81F0F:取消":"Cancel","@81F0F:命令历史已清空":"Command history cleared","@81F0F:命令已复制到剪贴板":"Command copied to clipboard","@81F0F:输出已复制到剪贴板":"Output copied to clipboard","@81F0F:Socket实例不可用":"Socket instance unavailable","@81F0F:已连接到实时命令历史":"Connected to real-time command history","@81F0F:实时命令历史连接已断开":"Real time command history connection disconnected","@81F0F:尝试初始化Socket连接":"Attempt to initialize Socket connection","@81F0F:加载命令历史失败: ":"Failed to load command history:","@81F0F: (耗时: ":"(Time consumption:","@81F0F:复制失败: ":"Copy failed:","@81F0F:清空命令历史失败: ":"Failed to clear command history:","@81F0F:命令":"Command","@81F0F:全部":"All","@81F0F:清空":"Clear","@81F0F:加载命令历史...":"Load command history ..","@81F0F:耗时: ":"Time-consuming","@81F0F:标准输出":"Standard output","@81F0F:输出内容过长已被截断,请直接执行命令查看完整输出":"The output content is too long and has been truncated. Please execute the command directly to view the complete output","@81F0F:内容过长已被截断,请直接执行命令查看完整输出":"The content is too long and has been truncated. Please execute the command directly to view the complete output","@81F0F:错误信息":"Error message","@76872:Git用户信息未配置":"Git user information not configured","@76872:提交命令预览:":"Commit command preview:","@76872:提交类型":"Submission Type","@76872:作用域(可选)":"Scope (optional)","@76872:正文(可选):详细描述本次提交的内容和原因":"Text (optional): Provide a detailed description of the content and reasons for this commit","@76872:页脚(可选):如 Closes #123":"Footer (optional): such as Close # 123","@76872:Git 操作":"Git operation","@76872:合并其他分支到当前分支":"Merge other branches into the current branch","@76872:将工作区更改储藏起来":"Store changes to the workspace","@76872:查看和管理所有储藏记录":"View and manage all stash records","@76872:编辑配置 JSON":"Edit configuration JSON","@76872:在此编辑当前项目配置的 JSON...":"Edit the JSON of the current project configuration here","@76872:配置文件格式提示":"Format prompt for configuration file","@76872:简短描述模板设置":"Short description of template settings","@76872:输入新模板内容":"Enter new template content","@76872:编辑模板内容":"Edit template content","@76872:暂无保存的模板":"There are currently no saved templates available","@76872:作用域模板设置":"Scope Template Settings","@76872:输入新作用域模板":"Enter new scope template","@76872:编辑作用域模板内容":"Edit Scope Template Content","@76872:暂无保存的作用域":"There are currently no saved scopes available","@76872:默认提交信息设置":"Default commit information settings","@76872:储藏更改 (Git Stash)":"Store changes (Git Stash)","@76872:储藏":"Stash","@76872:取消":"Cancel","@76872:储藏说明":"Stash Instructions","@76872:为这次储藏添加描述信息(可选)":"Add descriptive information for this stash (optional)","@76872:合并分支":"Merge branch","@76872:分支类型":"Branch type","@76872:选择分支":"Select branch","@76872:选择要合并的分支":"Select the branches to merge","@76872:合并选项":"Merge Options","@76872:创建合并提交,即使可以使用快进合并":"Create merge commit, even if fast forward merge can be used","@76872:将多个提交压缩为一个提交":"Compress multiple commits into one commit","@76872:执行合并但不自动创建提交":"Perform merge but do not automatically create commit","@76872:合并提交信息 (可选)":"Merge commit information (optional)","@76872:输入自定义合并提交信息":"Enter custom merge commit information","@76872:储藏列表 (Git Stash)":"Stash List (Git Stash)","@76872:暂无储藏记录":"No stash records available at the moment","@76872:储藏详情":"Stash Details","@76872:该stash没有变更文件":"The stash has not changed the file","@76872:提交设置":"Commit Settings","@76872:提交模式":"Submission mode","@76872:选择传统或标准化提交格式":"Choose traditional or standardized commit format","@76872:标准化":"Standardization","@76872:普通":"Ordinary","@76872:跳过钩子检查":"Skip hook check","@76872:添加 --no-verify 参数":"Add -- no verify parameter","@76872:回车自动提交":"Enter and submit automatically","@76872:输入提交信息后按回车直接执行一键推送":"After entering the commit information, press Enter to directly execute the one click push","@76872:Push完成自动关闭":"Auto-close after push","@76872:推送成功后自动关闭进度弹窗":"Automatically close the progress dialog after successful push","@76872:自动填充默认提交信息":"Auto-fill default commit message","@76872:打开页面或提交完成后自动填充默认提交信息":"Automatically fill in default commit message when opening page or after committing","@76872:收起":"Fold up","@76872:正文及页脚":"Main text and footer","@76872:拉取":"Pull","@76872:个远程提交":"Remote commit","@76872:撤销":"Revoke","@76872:个已暂存文件":"A staged file","@76872:系统配置文件不存在,将使用默认配置。":"The system configuration file does not exist, the default configuration will be used.","@76872:加载配置失败":"Loading configuration failed","@76872:保存失败":"Save failed","@76872:配置已保存":"Configuration saved","@76872:打开失败":"Failed to open","@76872:已用系统程序打开配置文件":"The configuration file has been opened using the system program","@76872:确定要删除此储藏吗?此操作不可恢复。":"Are you sure you want to delete this stash? This operation is irreversible.","@76872:删除储藏":"Delete stash","@76872:确定":"Confirm","@76872:确定要清空所有储藏吗?此操作不可恢复。":"Are you sure you want to clear all stash? This operation is irreversible.","@76872:清空所有储藏":"Clear all stash","@76872:无效的stash ID":"Invalid stashID","@76872:未知错误":"Unknown error","@76872:没有变更内容":"No changes made","@76872:打开文件失败":"Fail to open file","@76872:用VSCode打开文件失败":"Failed to open file using VSCode","@76872:简短描述(必填)":"Short description (required)","@76872:简短描述(必填,按回车一键推送)":"Short description (required, press enter to push)","@76872:操作成功!":"Operation successful!","@76872:已完成操作":"Operation completed","@76872:重置到远程分支":"Reset to remote branch","@76872:正在暂存文件...":"Staging files...","@76872:推送成功,状态已更新":"Push successful, status updated","@76872:默认提交信息设置成功":"Default commit information setting successful","@76872:正在提交更改...":"Committing changes ..","@76872:正在推送...":"Pushing ..","@76872:请选择要合并的分支":"Please select the branch to merge","@76872:系统配置文件格式有误:":"The format of the system configuration file is incorrect:","@76872:JSON 解析失败: ":"JSON parsing failed:","@76872:保存配置失败: ":"Failed to save configuration:","@76872:打开配置文件失败: ":"Failed to open configuration file:","@76872:获取文件列表失败: ":"Failed to retrieve file list:","@76872:获取stash详情失败: ":"Failed to retrieve the details of stash:","@76872:获取差异失败: ":"Failed to obtain differences:","@76872:打开文件失败: ":"Failed to open file:","@76872:用VSCode打开文件失败: ":"Failed to open file using VSCode:","@76872:输入提交信息 (默认: ":"Enter commit information (default:","@76872:(按回车一键推送)":"(Press Enter to push)","@76872:暂存并提交失败: ":"Temporary stash and commit failed:",'@76872:确定要重置当前分支 "':"Confirm to reset the current branch“",'@76872:" 到远程状态吗?这将丢失所有未推送的提交和本地更改。':"Going to remote mode? This will result in the loss of all non pushed commits and local changes.","@76872:重置到远程分支失败: ":"Reset to remote branch failed:","@76872:设置默认提交信息失败: ":"Failed to set default commit information:","@76872:提交更改":"Commit changes","@76872:您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:":"You need to configure a Git username and email to submit code. Please use the following command to configure:","@76872:基础操作":"Basic Operations","@76872:获取所有远程分支":"Get all remote branches","@76872:组合操作":"Combination operation","@76872:暂存并提交":"Stage and Commit","@76872:重置操作":"Reset operation","@76872:重置暂存区":"Reset staging area","@76872:重置到远程":"Reset to remote","@76872:分支操作":"Branch operation","@76872:储藏操作":"Stash operation","@76872:储藏更改":"Stash changes","@76872:储藏列表":"Stash List","@76872:编辑当前项目的配置文件":"Edit the configuration file of the current project","@76872:支持JSON格式":"Supports JSON format","@76872:打开系统配置文件":"Open the system configuration file","@76872:保存配置":"Save Configuration","@76872:继续编辑":"Continue editing","@76872:储藏工作区更改":"Stash workspace change","@76872:将当前工作区的更改临时保存,稍后可以重新应用到任何分支":"Save the changes in the current workspace temporarily and reapply them to any branch later","@76872:储藏选项":"Stash options","@76872:包含未跟踪文件":"Include untracked files","@76872:同时储藏新建但未添加到Git的文件 (--include-untracked)":"Simultaneously store newly created files that have not been added to Git (-- include untacked)","@76872:排除锁定文件":"Exclude locked files","@76872:不储藏被锁定的文件,保持其当前状态":"Do not store locked files and maintain their current state","@76872:将要储藏的文件":"The files to be stored","@76872:已暂存: ":"Temporarily stored:","@76872:个文件":"A file","@76872:未暂存: ":"Not staged:","@76872:选择要合并到当前分支 (":"Select to merge into the current branch(","@76872:) 的分支:":")The branch:","@76872:所有分支":"All branches","@76872:本地分支":"Local branch","@76872:远程分支":"Remote branch","@76872:禁用快进合并 (--no-ff)":"Disable fast forward merge (-- no ff)","@76872:压缩提交 (--squash)":"Compressed commit (-- squash)","@76872:不自动提交 (--no-commit)":"Do not submit automatically (-- no commit)","@76872:合并":"Merge","@76872:个储藏":"A stash","@76872:还没有任何储藏记录":"There are no stash records yet","@76872:使用 git stash 可以临时保存工作进度":"Use git stash to temporarily save work progress","@76872:最新":"Latest","@76872:查看":"View","@76872:应用":"Application","@76872:应用并删除":"Apply and delete","@76872:删除":"Delete","@76872:描述:":"Description:","@76872:更新状态中...":"Updating status ..","@76872:新功能":"New feature","@76872:修复bug":"Bug fix","@76872:文档修改":"Documentation","@76872:样式修改":"Code style","@76872:代码重构":"Refactoring","@76872:测试代码":"Testing","@76872:构建/工具修改":"Build/Tools","@13D1C:Git Pull (拉取远程更新)":"GitPull (Pull Remote Updates)","@13D1C:Git Fetch All (获取所有远程分支)":"Gitfetch All (Get all remote branches)","@13D1C:管理锁定文件":"Manage Locked Files","@13D1C:刷新状态":"Refresh status","@13D1C:本地分支与远程分支的状态对比":"Comparison of Status between Local and Remote Branches","@13D1C:已暂存的更改":"Temporarily stored changes","@13D1C:未暂存的更改":"Untreated changes","@13D1C:未跟踪的文件":"Untracked files","@13D1C:文件差异":"File differences","@13D1C:选择文件查看差异":"Select file to view differences","@13D1C:锁定文件管理":"Lock file management","@13D1C:这些文件在提交时会被自动跳过":"These files will be automatically skipped when submitted","@13D1C:解锁文件":"Unlock files","@13D1C:解锁":"Unlock","@13D1C:自动更新文件状态":"Automatically update file status","@13D1C:正在拉取代码...":"Pulling code ..","@13D1C:正在获取远程分支信息...":"Getting remote branch information ..","@13D1C:加载中...":"Loading...","@13D1C:打开文件失败":"Fail to open file","@13D1C:用VSCode打开文件失败":"Failed to open file using VSCode","@13D1C:未知目录":"Unknown directory","@13D1C:Git 状态已刷新":"Git status refreshed","@13D1C:确认解锁":"Confirm unlocking","@13D1C:取消":"Cancel","@13D1C:清空全部锁定":"Clear all locks","@13D1C:全部解锁":"Fully unlocked","@13D1C:已清空所有文件锁定":"Cleared all file locks","@13D1C:没有变更":"No changes","@13D1C:目录浏览功能未启用":"The directory browsing function is not enabled","@13D1C:获取目录内容失败":"Failed to retrieve directory contents","@13D1C:目录路径不能为空":"The directory path cannot be empty","@13D1C:已切换工作目录":"Changed working directory","@13D1C:当前目录不是一个Git仓库":"The current directory is not a Git repository","@13D1C:切换目录失败":"Failed to switch directory","@13D1C:未知当前分支":"Unknown current branch","@13D1C:已推送并设置上游分支":"Promoted and set up upstream branch","@13D1C:设置上游失败":"Setting upstream failed","@13D1C:撤回修改":"Discard changes","@13D1C:确定":"Confirm","@13D1C:已撤回文件修改":"File modifications have been withdrawn","@13D1C:撤回文件修改失败,请重试":"Withdrawal of file modification failed, please try again","@13D1C:未知错误":"Unknown error","@13D1C:打开文件失败: ":"Failed to open file:","@13D1C:用VSCode打开文件失败: ":"Failed to open file using VSCode:","@13D1C:确认解锁所有已锁定文件?共 ":"Confirm unlocking all locked files? together","@13D1C: 个。":"One.","@13D1C:新文件: ":"New file:","@13D1C:获取目录内容失败: ":"Failed to retrieve directory contents:","@13D1C:切换目录失败: ":"Failed to switch directory:","@13D1C:设置上游失败: ":"Setting upstream failed:",'@13D1C:确定要撤回文件 "':"Confirm to withdraw the file“",'@13D1C:" 的所有修改吗?此操作无法撤销。':"All modifications made? This operation cannot be undone.","@13D1C:撤回失败: ":"Withdrawal failed:","@13D1C:撤回文件修改失败: ":"Withdrawal of file modification failed:","@13D1C:自动更新状态变更: ":"Automatic update status change:","@13D1C:状态":"Status","@13D1C:当前目录不是Git仓库":"The current directory is not a Git repository","@13D1C:当前分支未设置上游分支":"The current branch has not set an upstream branch","@13D1C:首次推送后即可建立与远程的跟踪关系,后续可直接 pull/push。":"After the first push, a tracking relationship with the remote can be established, and subsequent pulls/pushes can be made directly.","@13D1C:设置上游并推送":"Set up upstream and push","@13D1C:个提交":"A commit","@13D1C:没有检测到任何更改":"No changes detected","@13D1C:工作区是干净的":"The workspace is clean","@13D1C:文件锁定功能说明":"Explanation of File Lock Function","@13D1C:锁定的文件在执行 Git 提交时会被自动跳过,不会被添加到暂存区":"Locked files will be automatically skipped during Git commit execution and will not be added to the staging area","@13D1C:当前没有锁定的文件":"There are currently no locked files","@13D1C:您可以在文件列表中点击锁定按钮来锁定文件":"You can click the lock button in the file list to lock the file","@13D1C:个文件":"A file","@13D1C:文件列表":"File List","@A1833:选择作者":"Select author","@A1833:选择分支":"Select branch","@A1833:提交信息关键词":"Commit information keywords","@A1833:至":"To","@A1833:开始日期":"Start date","@A1833:结束日期":"End Date","@A1833:哈希":"Hash","@A1833:提交信息":"Commit message","@A1833:复制纯净提交信息(不含类型前缀)":"Copy pure commit information (excluding type prefix)","@A1833:日期":"Date","@A1833:作者":"Author","@A1833:没有找到变更文件":"No change file found","@A1833:加载中...":"Loading...","@A1833:没有匹配的提交记录":"There are no matching commit records","@A1833:未知":"Unknown","@A1833:提交详情: ":"Submission details:","@A1833:打开文件失败":"Fail to open file","@A1833:用VSCode打开文件失败":"Failed to open file using VSCode","@A1833:提交信息已复制到剪贴板":"The submitted information has been copied to the clipboard","@A1833:复制失败":"Copy failed","@A1833:获取文件列表失败: ":"Failed to retrieve file list:","@A1833:获取提交详情失败: ":"Failed to obtain commit details:","@A1833:获取差异失败: ":"Failed to obtain differences:","@A1833:打开文件失败: ":"Failed to open file:","@A1833:用VSCode打开文件失败: ":"Failed to open file using VSCode:","@A1833:确定要撤销提交 ":"Confirm to withdraw commit","@A1833: 吗?这将创建一个新的提交来撤销这次提交的更改。":"Is that okay? This will create a new commit to undo the changes made in this commit.","@A1833:确定要将提交 ":"Confirm to submit","@A1833: Cherry-Pick 到当前分支吗?":"Is Cherry Pick going to the current branch?","@A1833:已复制提交哈希: ":"Copy submitted hash:","@A1833:复制提交哈希失败: ":"Copy commit hash failed:","@A1833:确定要将当前分支重置(hard)到提交 ":"Confirm to hard reset the current branch to commit","@A1833:提交历史":"Commit History","@A1833:分支":"Branch","@A1833:信息":"Information","@A1833:应用":"Application","@A1833:重置":"Reset","@A1833:查看详情":"View details","@A1833:复制提交哈希":"Copy and submit hash","@A1833:重置到该提交(hard)":"Reset to this commit (hard)","@A1833:撤销提交 (Revert)":"Revert Submission","@A1833:-Pick 到当前分支":"-Pick to the current branch"},ao=["zh-CN","en-US"],Us={"zh-CN":"简体中文","en-US":"English"},ha=()=>{const E=localStorage.getItem("locale");return E&&ao.includes(E)?E:(navigator.language.startsWith("zh"),"zh-CN")},ts=To({legacy:!1,locale:ha(),fallbackLocale:"zh-CN",messages:{"zh-CN":pa,"en-US":ma},globalInjection:!0});function ga(E){var C;ts.global.locale.value=E,localStorage.setItem("locale",E),(C=document.querySelector("html"))==null||C.setAttribute("lang",E)}function va(){return ts.global.locale.value}const e=(E,C)=>ts.global.t(E,C),Ca=["width","height"],no=Fe({__name:"TreeIcon",props:{size:{default:"1em"}},setup(E){return(C,n)=>(c(),g("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",width:C.size,height:C.size,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},n[0]||(n[0]=[Eo('<line x1="3" y1="2" x2="3" y2="14"></line><line x1="3" y1="4" x2="6" y2="4"></line><rect x="2" y="3" width="8" height="2" rx="0.5" fill="currentColor" stroke="none"></rect><line x1="3" y1="8" x2="6" y2="8"></line><rect x="4" y="7" width="8" height="2" rx="0.5" fill="currentColor" stroke="none"></rect><line x1="3" y1="12" x2="6" y2="12"></line><rect x="6" y="11" width="8" height="2" rx="0.5" fill="currentColor" stroke="none"></rect>',7)]),8,Ca))}}),ya=["width","height"],lo=Fe({__name:"ListIcon",props:{size:{default:"1em"}},setup(E){return(C,n)=>(c(),g("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",width:C.size,height:C.size,fill:"currentColor",stroke:"none"},n[0]||(n[0]=[s("rect",{x:"2",y:"3",width:"12",height:"2",rx:"0.5"},null,-1),s("rect",{x:"2",y:"7",width:"12",height:"2",rx:"0.5"},null,-1),s("rect",{x:"2",y:"11",width:"12",height:"2",rx:"0.5"},null,-1)]),8,ya))}}),et=ks("config",()=>{const E=u(""),C=u([]),n=u([]),l=u([]),p=u([]),d=u(!1),m=u(!1),f=u(""),B=u(!0),D=u(!1);function L(S){f.value=S||""}const k=localStorage.getItem("zen-gitsync-auto-close-push-modal");k!==null&&(B.value=k==="true"),Ge(B,S=>{localStorage.setItem("zen-gitsync-auto-close-push-modal",S.toString())});const h=localStorage.getItem("zen-gitsync-auto-set-default-message");h!==null&&(D.value=h==="true"),Ge(D,S=>{localStorage.setItem("zen-gitsync-auto-set-default-message",S.toString())});const K=se(()=>({defaultCommitMessage:E.value,descriptionTemplates:C.value,scopeTemplates:n.value,messageTemplates:l.value,lockedFiles:p.value,currentDirectory:f.value}));async function x(S=!1){if(!S&&m.value&&!d.value)return console.log(e("@D50BB:使用缓存的配置信息")),K.value;d.value=!0;try{d.value=!0,console.log(e("@D50BB:加载配置信息..."));const w=await(await fetch("/api/config/getConfig")).json();return E.value=w.defaultCommitMessage||"",C.value=w.descriptionTemplates||[],n.value=w.scopeTemplates||[],l.value=w.messageTemplates||[],p.value=w.lockedFiles||[],w.currentDirectory&&(f.value=w.currentDirectory),m.value=!0,console.log(e("@D50BB:配置信息加载完成")),K.value}catch(y){return console.error("加载配置失败:",y),r.error(`${e("@D50BB:加载配置失败: ")}${y.message}`),null}finally{d.value=!1}}async function Y(S){try{const w=await(await fetch("/api/config/saveDefaultMessage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultCommitMessage:S})})).json();return w.success?(E.value=S,r.success(e("@D50BB:默认提交信息已保存")),!0):(r.error(`${e("@D50BB:保存失败: ")}${w.error}`),!1)}catch(y){return r.error(`${e("@D50BB:保存失败: ")}${y.message}`),!1}}async function T(S,y){try{const ee=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:S,type:y})})).json();return ee.success?(y==="description"?C.value.includes(S)||C.value.push(S):y==="scope"?n.value.includes(S)||n.value.push(S):y==="message"&&(l.value.includes(S)||l.value.push(S)),r.success(e("@D50BB:模板已保存")),!0):(r.error(`${e("@D50BB:保存模板失败: ")}${ee.error}`),!1)}catch(w){return r.error(`${e("@D50BB:保存模板失败: ")}${w.message}`),!1}}async function P(S,y){try{const ee=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:S,type:y})})).json();return ee.success?(y==="description"?C.value=C.value.filter(G=>G!==S):y==="scope"?n.value=n.value.filter(G=>G!==S):y==="message"&&(l.value=l.value.filter(G=>G!==S)),r.success(e("@D50BB:模板已删除")),!0):(r.error(`${e("@D50BB:删除模板失败: ")}${ee.error}`),!1)}catch(w){return r.error(`${e("@D50BB:删除模板失败: ")}${w.message}`),!1}}async function V(S,y,w){try{const G=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:S,newTemplate:y,type:w})})).json();if(G.success){if(w==="description"){const M=C.value.indexOf(S);M!==-1&&(C.value[M]=y)}else if(w==="scope"){const M=n.value.indexOf(S);M!==-1&&(n.value[M]=y)}else if(w==="message"){const M=l.value.indexOf(S);M!==-1&&(l.value[M]=y)}return r.success(e("@D50BB:模板已更新")),!0}else return r.error(`${e("@D50BB:更新模板失败: ")}${G.error}`),!1}catch(ee){return r.error(`${e("@D50BB:更新模板失败: ")}${ee.message}`),!1}}async function N(){try{const y=await(await fetch("/api/locked-files")).json();return y.success?(p.value=y.lockedFiles||[],y.lockedFiles):(r.error(`${e("@D50BB:加载锁定文件列表失败: ")}${y.error}`),[])}catch(S){return console.error("加载锁定文件列表失败:",S),r.error(`${e("@D50BB:加载锁定文件列表失败: ")}${S.message}`),[]}}async function oe(S){try{const w=await(await fetch("/api/lock-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:S})})).json();return w.success?(await N(),r.success(`${e("@D50BB:文件已锁定: ")}${S}`),!0):(r.error(`${e("@D50BB:锁定文件失败: ")}${w.error}`),!1)}catch(y){return console.error("锁定文件失败:",y),r.error(`${e("@D50BB:锁定文件失败: ")}${y.message}`),!1}}async function me(S){try{const w=await(await fetch("/api/unlock-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:S})})).json();return w.success?(await N(),r.success(`${e("@D50BB:文件已解锁: ")}${S}`),!0):(r.error(`${e("@D50BB:解锁文件失败: ")}${w.error}`),!1)}catch(y){return console.error("解锁文件失败:",y),r.error(`${e("@D50BB:解锁文件失败: ")}${y.message}`),!1}}async function Q(S){try{const w=await(await fetch("/api/check-file-lock",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:S})})).json();return w.success?w.isLocked:(console.error("检查文件锁定状态失败:",w.error),!1)}catch(y){return console.error("检查文件锁定状态失败:",y),!1}}return{defaultCommitMessage:E,descriptionTemplates:C,scopeTemplates:n,messageTemplates:l,lockedFiles:p,isLoading:d,isLoaded:m,currentDirectory:f,config:K,autoClosePushModal:B,autoSetDefaultMessage:D,loadConfig:x,setCurrentDirectory:L,saveTemplate:T,saveDefaultMessage:Y,deleteTemplate:P,updateTemplate:V,loadLockedFiles:N,lockFile:oe,unlockFile:me,isFileLocked:Q}}),ms=800;function _a(){const E=window.location.port||"80";if(E==="5173"||E==="4173"||E==="5544"){const n="3002";return console.log(`${e("@C298B:开发环境:从环境变量读取后端端口 ")}${n}`),parseInt(n,10)}const C=parseInt(E,10);return console.log(`${e("@C298B:生产环境:使用当前页面端口 ")}${C}`),C}const Ba=_a(),qe=ks("git",()=>{const E=et(),C=u(""),n=u([]),l=u(""),p=u(""),d=u(!1),m=u(!1),f=u(!1),B=u(0),D=u(""),L=u(!1),k=u(!1),h=u(!1),K=u(!1),x=u(!1),Y=u(0),T=u(0),P=u(!1),V=u(""),N=u(0),oe=u(0),me=u(!0),Q=u(null),S=u(""),y=u(""),w=u([]),ee=u({staged:[],unstaged:[],untracked:[]}),G=u([]),M=u(!1),re=u(!1),$=u(!1),O=u(!1),j=u(!1),U=u(1),ne=u(!0),we=u(0),Pe=u([]),Le=u(!1),_e=u(!1),te=u(!1),J=u(!1);function he(){C.value="",n.value=[],l.value="",p.value="",d.value=!1,m.value=!1,f.value=!1,B.value=0,Y.value=0,T.value=0,P.value=!1,V.value="",N.value=0,oe.value=0,k.value=!1,h.value=!1,K.value=!1,x.value=!1,D.value="",L.value=!1,w.value=[],ee.value={staged:[],unstaged:[],untracked:[]},G.value=[],M.value=!1,re.value=!1,$.value=!1,O.value=!1,j.value=!1,U.value=1,ne.value=!0,we.value=0}async function ce(F=!1,_=!1){if(!f.value)return;const Z=Date.now();if(!F&&!_&&Z-N.value<3e4){console.log(e("@C298B:使用缓存的分支状态"));return}try{console.log(e("@C298B:获取分支状态..."));let ie="/api/branch-status";const Ee=[];F&&Ee.push("force=true"),_&&Ee.push("countOnly=true"),Ee.length>0&&(ie+="?"+Ee.join("&"));const Ne=await(await fetch(ie)).json();Ne&&(Y.value=Ne.ahead||0,T.value=Ne.behind||0,P.value=Ne.hasUpstream||!1,V.value=Ne.upstreamBranch||"",N.value=Z,console.log(`${e("@C298B:分支状态更新:领先 ")}${Y.value}${e("@C298B: 个提交,落后 ")}${T.value}${e("@C298B: 个提交,上游分支:")}${P.value?V.value:e("@C298B:无")}`))}catch(ie){console.error("获取分支状态失败:",ie),Y.value=0,T.value=0,P.value=!1,V.value=""}}async function be(){const F=Date.now();if(F-B.value<1e3)return console.log("使用缓存的Git仓库状态:",f.value?"是":e("@C298B:不是")),f.value;try{const Z=await(await fetch("/api/current_directory")).json();return f.value=Z.isGitRepo===!0,B.value=F,console.log(`${e("@C298B:当前目录")}${f.value?e("@C298B:是"):e("@C298B:不是")}${e("@C298B:Git仓库")}`),f.value}catch(_){return console.error("检查Git仓库状态失败:",_),f.value=!1,B.value=F,!1}}async function Ve(F=!1){try{const ie=await(await fetch(F?"/api/branch?force=true":"/api/branch")).json();ie.branch&&(C.value=ie.branch,console.log(`${e("@C298B:当前分支更新为: ")}${ie.branch}${F?e("@C298B: (强制刷新)"):""}`))}catch(_){console.error("获取分支信息失败:",_)}}async function ke(){if(f.value)try{console.log(e("@C298B:获取所有分支..."));const _=await(await fetch("/api/branches")).json();_.branches&&Array.isArray(_.branches)&&(n.value=_.branches,oe.value=Date.now(),console.log(`${e("@C298B:获取到")}${_.branches.length}${e("@C298B:个分支")}`))}catch(F){console.error("获取所有分支信息失败:",F)}}async function A(F){console.log("切换到分支:",F);try{d.value=!0;const Z=await(await fetch("/api/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:F})})).json();return Z.success?(r({message:`${e("@C298B:已切换到分支: ")}${F}`,type:"success"}),await Ve(!0),await ce(!0),!0):(r({message:`${e("@C298B:切换分支失败: ")}${Z.error}`,type:"error"}),!1)}catch(_){return r({message:`${e("@C298B:切换分支失败: ")}${_.message}`,type:"error"}),!1}finally{d.value=!1}}async function z(){try{const _=await(await fetch("/api/user-info")).json();_.name&&_.email&&(l.value=_.name,p.value=_.email)}catch(F){console.error("获取用户信息失败:",F)}}async function fe(F,_){if(!F.trim())return r({message:e("@C298B:分支名称不能为空"),type:"warning"}),!1;try{m.value=!0;const ie=await(await fetch("/api/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newBranchName:F,baseBranch:_||C.value})})).json();return ie.success?(r({message:`${e("@C298B:已创建并切换到分支: ")}${F}`,type:"success"}),await Ve(!0),await ce(!0),await ke(),!0):(r({message:`${e("@C298B:创建分支失败: ")}${ie.error}`,type:"error"}),!1)}catch(Z){return r({message:`${e("@C298B:创建分支失败: ")}${Z.message}`,type:"error"}),!1}finally{m.value=!1}}async function le(){try{const _=await(await fetch("/api/clear-user-config",{method:"POST"})).json();return _.success?(l.value="",p.value="",r({message:e("@C298B:已清除Git用户配置"),type:"success"}),!0):(r({message:`${e("@C298B:清除配置失败: ")}${_.error}`,type:"error"}),!1)}catch(F){return r({message:`${e("@C298B:清除配置失败: ")}${F.message}`,type:"error"}),!1}}async function Ce(F,_){try{const ie=await(await fetch("/api/restore-user-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:F,email:_})})).json();return ie.success?(l.value=F,p.value=_,r({message:e("@C298B:已恢复Git用户配置"),type:"success"}),!0):(r({message:`${e("@C298B:恢复配置失败: ")}${ie.error}`,type:"error"}),!1)}catch(Z){return r({message:`${e("@C298B:恢复配置失败: ")}${Z.message}`,type:"error"}),!1}}async function Ae(){if(!f.value)return r({message:e("@C298B:当前目录不是Git仓库"),type:"warning"}),!1;try{h.value=!0;const _=await(await fetch("/api/pull",{method:"POST"})).json();return _.success?(r({message:e("@C298B:拉取成功"),type:"success"}),await ce(),!0):(_.needsMerge?r({message:`${e("@C298B:需要合并更改: ")}${_.pullOutput||e("@C298B:存在冲突需要手动解决")}`,type:"warning",duration:5e3}):r({message:`${e("@C298B:拉取失败: ")}${_.error}`,type:"error"}),!1)}catch(F){return r({message:`${e("@C298B:拉取失败: ")}${F.message}`,type:"error"}),!1}finally{h.value=!1}}async function Se(){if(!f.value)return r({message:e("@C298B:当前目录不是Git仓库"),type:"warning"}),!1;try{K.value=!0;const _=await(await fetch("/api/fetch-all",{method:"POST"})).json();return _.success?(r({message:e("@C298B:获取所有远程分支信息成功"),type:"success"}),await ce(),!0):(r({message:`${e("@C298B:获取远程分支信息失败: ")}${_.error}`,type:"error"}),!1)}catch(F){return r({message:`${e("@C298B:获取远程分支信息失败: ")}${F.message}`,type:"error"}),!1}finally{K.value=!1}}async function tt(){Q.value&&Q.value.disconnect();try{const F=`http://localhost:${Ba}`;if(console.log("尝试连接Socket.IO服务器:",F),Q.value=Lo(F,{reconnectionDelayMax:1e4,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3,timeout:2e4,autoConnect:!0,forceNew:!0,transports:["websocket","polling"]}),!Q.value){console.error("Socket.IO初始化失败: socket为null");return}console.log(e("@C298B:Socket.IO客户端已创建,开始注册事件监听器...")),Q.value.on("connect",()=>{var _;console.log("✅ Socket.IO连接成功,事件监听器已生效,Socket ID:",(_=Q.value)==null?void 0:_.id),me.value&&Q.value&&Q.value.emit("start_monitoring")}),Q.value.on("project_info",_=>{S.value=_.projectPath,y.value=_.projectRoomId,console.log(`${e("@C298B:当前项目: ")}${_.projectPath}`),console.log(`${e("@C298B:房间ID: ")}${_.projectRoomId}`)}),Q.value.on("project_changed",_=>{console.log(`${e("@C298B:项目已切换: ")}${_.oldProjectPath} -> ${_.newProjectPath}`),S.value=_.newProjectPath,y.value=_.newProjectRoomId,Q.value&&Q.value.emit("join_room",_.newProjectRoomId),console.log(`${e("@C298B:已加入新项目房间: ")}${_.newProjectRoomId}`)}),Q.value.on("disconnect",_=>{console.log("与Socket.IO服务器断开连接:",_)}),Q.value.on("git_status_update",_=>{if(me.value){if(console.log("✅ 成功监听到 git_status_update 事件:",new Date().toLocaleTimeString()),console.log("git_status_update data ==>",_),console.log("currentProjectPath.value ==>",S.value),console.log("data.projectPath ==>",_.projectPath),_.projectPath&&S.value&&_.projectPath!==S.value){console.log(`${e("@C298B:忽略不同项目的状态更新: ")}${_.projectPath}`);return}console.log(e("@C298B:正在更新 Git 文件状态...")),_.porcelain!==void 0&&st(_.porcelain)}}),Q.value.on("monitoring_status",_=>{console.log("文件监控状态:",_.active?"已启动":e("@C298B:已停止"))}),Q.value.on("connect_error",_=>{console.error("Socket连接错误:",_.message)}),Q.value.on("connect_timeout",()=>{console.error(e("@C298B:Socket连接超时"))}),Q.value.on("reconnect",_=>{var Z;console.log(`${e("@C298B:Socket重连成功,尝试次数: ")}${_}`),me.value&&(console.log(e("@C298B:重连后重新发送start_monitoring请求")),(Z=Q.value)==null||Z.emit("start_monitoring"))}),Q.value.on("reconnect_attempt",_=>{console.log(`${e("@C298B:Socket尝试重连,第 ")}${_}${e("@C298B: 次尝试")}`)}),Q.value.on("reconnect_error",_=>{console.error("Socket重连错误:",_.message)}),Q.value.on("reconnect_failed",()=>{console.error(e("@C298B:Socket重连失败,已达到最大重试次数"))}),console.log(e("@C298B:Socket.IO事件监听器注册完成:connect, project_info, project_changed, git_status_update, monitoring_status")),Q.value&&!Q.value.connected&&(console.log(e("@C298B:Socket未连接,尝试手动连接...")),Q.value.connect())}catch(F){console.error("Socket.IO连接初始化失败:",F)}}function ue(){if(console.log("toggleAutoUpdate调用,当前值:",me.value),!Q.value){console.error("无法切换自动更新状态: socket连接不存在"),r.error(e("@C298B:无法连接到服务器,自动更新可能不会生效")),console.log(e("@C298B:尝试重新建立socket连接...")),tt(),localStorage.setItem("zen-gitsync-auto-update",me.value.toString());return}try{me.value?(console.log(e("@C298B:发送start_monitoring命令...")),Q.value.emit("start_monitoring"),r.success(e("@C298B:自动更新已启用"))):(console.log(e("@C298B:发送stop_monitoring命令...")),Q.value.emit("stop_monitoring"),r.info(e("@C298B:自动更新已禁用"))),localStorage.setItem("zen-gitsync-auto-update",me.value.toString()),console.log("已保存自动更新设置到本地存储:",me.value)}catch(F){console.error("切换自动更新状态时出错:",F),r.error(`${e("@C298B:切换自动更新失败: ")}${F.message}`)}}function st(F){if(F===void 0||F===""){G.value=[];return}const _=F.split(`
|
|
2
|
+
`),Z=[];for(const ie of _){const Ee=ie.match(/^([ MADRCU\?]{2})\s+(.+)$/);if(Ee){let Oe="";const Ne=Ee[1],je=Ne.charAt(0),_t=Ne.charAt(1);je==="A"||je==="M"||je==="D"||je==="R"?Oe="added":je===" "&&_t==="M"?Oe="modified":je===" "&&_t==="D"?Oe="deleted":Ne==="??"?Oe="untracked":Oe="other",Z.push({path:Ee[2],type:Oe})}}G.value=Z}async function Qe(F=!0){if(!f.value){console.log(e("@C298B:当前目录不是Git仓库,跳过加载提交历史"));return}try{M.value=!0,console.log(e("@C298B:开始加载提交历史..."));const _=new Date().getTime(),ie=await(await fetch(`/api/log?page=1&_t=${_}`)).json();ie&&ie.data&&Array.isArray(ie.data)?(w.value=[...ie.data],console.log(`${e("@C298B:提交历史加载完成,共 ")}${w.value.length}${e("@C298B: 条记录")}`)):(console.warn("API返回的提交历史格式不正确:",ie),w.value=[])}catch(_){console.error("获取提交历史失败:",_),F&&r({message:`${e("@C298B:获取提交历史失败: ")}${_.message}`,type:"error"})}finally{M.value=!1}}async function $t(){console.log(e("@C298B:刷新提交历史...")),U.value=1,ne.value=!1,await Qe(!0),we.value=w.value.length,console.log(e("@C298B:提交历史刷新完成"))}async function Ie(){if(!f.value){console.log(e("@C298B:当前目录不是Git仓库,跳过加载Git状态"));return}try{re.value=!0,await ft()}catch(F){console.error("获取Git状态失败:",F),r({message:`${e("@C298B:获取Git状态失败: ")}${F.message}`,type:"error"})}finally{re.value=!1}}async function ft(){if(console.log(e("@C298B:开始获取Git状态(porcelain格式)...")),!f.value){console.log(e("@C298B:当前目录不是Git仓库,跳过加载Git状态"));return}try{const _=await(await fetch("/api/status_porcelain")).json();_.status!==void 0?st(_.status):G.value=[]}catch(F){console.error("获取Git状态(porcelain)失败:",F),r({message:`${e("@C298B:获取Git状态(porcelain)失败: ")}${F.message}`,type:"error"}),G.value=[]}}async function H(){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{$.value=!0;const F=G.value.filter(_=>{const Z=_.path.replace(/\\/g,"/");return!E.lockedFiles.some(Ee=>{const Oe=Ee.replace(/\\/g,"/");return Z===Oe})});if(F.length===0)return r({message:e("@C298B:没有需要暂存的文件(所有文件都被锁定)"),type:"warning"}),!1;if(F.length===G.value.length){const Z=await(await fetch("/api/add",{method:"POST"})).json();return Z.success?(r({message:e("@C298B:文件已添加到暂存区"),type:"success"}),!0):(r({message:`${e("@C298B:添加文件失败: ")}${Z.error}`,type:"error"}),!1)}else{const Z=await(await fetch("/api/add-filtered",{method:"POST"})).json();if(Z.success){const ie=G.value.length-F.length;let Ee=`${e("@C298B:已添加 ")}${F.length}${e("@C298B: 个文件到暂存区")}`;return ie>0&&(Ee+=`${e("@C298B:,跳过 ")}${ie}${e("@C298B: 个锁定文件")}`),r({message:Ee,type:"success"}),!0}else return r({message:`${e("@C298B:添加文件失败: ")}${Z.error}`,type:"error"}),!1}}catch(F){return r({message:`${e("@C298B:添加文件失败: ")}${F.message}`,type:"error"}),!1}finally{$.value=!1}}async function R(){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{$.value=!0;const _=await(await fetch("/api/add-all",{method:"POST"})).json();return _.success?(r({message:e("@C298B:所有文件已添加到暂存区"),type:"success"}),!0):(r({message:`${e("@C298B:添加文件失败: ")}${_.error}`,type:"error"}),!1)}catch(F){return r({message:`${e("@C298B:添加文件失败: ")}${F.message}`,type:"error"}),!1}finally{$.value=!1}}async function de(F){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{$.value=!0;const Z=await(await fetch("/api/add-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:F})})).json();return Z.success?(r({message:e("@C298B:文件已暂存"),type:"success"}),Ie(),!0):(r({message:`${e("@C298B:暂存文件失败: ")}${Z.error}`,type:"error"}),!1)}catch(_){return r({message:`${e("@C298B:暂存文件失败: ")}${_.message}`,type:"error"}),!1}finally{$.value=!1}}async function ye(F){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{j.value=!0;const Z=await(await fetch("/api/unstage-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:F})})).json();return Z.success?(r({message:e("@C298B:已取消暂存文件"),type:"success"}),Ie(),!0):(r({message:`${e("@C298B:取消暂存失败: ")}${Z.error}`,type:"error"}),!1)}catch(_){return r({message:`${e("@C298B:取消暂存失败: ")}${_.message}`,type:"error"}),!1}finally{j.value=!1}}function Me(F){return new Promise(_=>setTimeout(_,F))}async function Te(F,_=!1){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{O.value=!0;const ie=await(await fetch("/api/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:F,hasNewlines:F.includes(`
|
|
3
|
+
`),noVerify:_})})).json();return ie.success?(r({message:e("@C298B:提交成功"),type:"success"}),!0):(r({message:`${e("@C298B:commitChanges 提交失败: ")}${ie.error}`,type:"error"}),!1)}catch(Z){return r({message:`${e("@C298B:提交失败: ")}${Z.message}`,type:"error"}),!1}finally{O.value=!1}}async function ve(){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{k.value=!0;const _=await(await fetch("/api/push",{method:"POST"})).json();return _.success?(Y.value=0,T.value=0,await Promise.all([Ie(),Qe()]),console.log("推送成功,分支状态已设置为同步 (ahead=0, behind=0)"),!0):(r({message:`${e("@C298B:推送失败: ")}${_.error}`,type:"error"}),!1)}catch(F){return r({message:`${e("@C298B:推送失败: ")}${F.message}`,type:"error"}),!1}finally{k.value=!1}}async function He(F){return f.value?new Promise(_=>{try{k.value=!0,fetch("/api/push-with-progress",{method:"POST"}).then(Z=>{var Ne;const ie=(Ne=Z.body)==null?void 0:Ne.getReader(),Ee=new TextDecoder;if(!ie)throw new Error("无法读取响应流");(async()=>{try{for(;;){const{done:je,value:_t}=await ie.read();if(je)break;const zt=Ee.decode(_t,{stream:!0}).split(`
|
|
4
|
+
`);for(const Ot of zt)if(Ot.startsWith("data: "))try{const it=JSON.parse(Ot.slice(6));F&&F(it),it.type==="complete"&&(k.value=!1,it.success?(Y.value=0,T.value=0,Promise.all([Ie(),Qe()]),_(!0)):(r({message:`${e("@C298B:推送失败: ")}${it.error}`,type:"error"}),_(!1)))}catch(it){console.error("解析SSE数据失败:",it)}}}catch(je){console.error("读取流失败:",je),k.value=!1,r({message:`${e("@C298B:推送失败: ")}${je.message}`,type:"error"}),_(!1)}})()}).catch(Z=>{k.value=!1,r({message:`${e("@C298B:推送失败: ")}${Z.message}`,type:"error"}),_(!1)})}catch(Z){k.value=!1,r({message:`${e("@C298B:推送失败: ")}${Z.message}`,type:"error"}),_(!1)}}):(r.warning(e("@C298B:当前目录不是Git仓库")),!1)}async function nt(F,_={}){if(!f.value)return r({message:e("@C298B:当前目录不是Git仓库"),type:"warning"}),!1;if(!F)return r({message:e("@C298B:请选择要合并的分支"),type:"warning"}),!1;if(F===C.value)return r({message:e("@C298B:不能合并当前分支到自身"),type:"warning"}),!1;try{x.value=!0;const Z=await fetch("/api/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:F,..._})}),ie=await Z.json();return Z.status===409?(r({message:e("@C298B:合并分支时发生冲突,请手动解决"),type:"warning",duration:5e3}),!1):ie.success?(r({message:`${e("@C298B:成功合并分支 ")}${F}${e("@C298B: 到 ")}${C.value}`,type:"success"}),await Ie(),await ce(),!0):(r({message:`${e("@C298B:合并分支失败: ")}${ie.error}`,type:"error"}),!1)}catch(Z){return r({message:`${e("@C298B:合并分支失败: ")}${Z.message}`,type:"error"}),!1}finally{x.value=!1}}async function pt(F,_=!1){if(console.log(e("@C298B:开始暂存并提交操作...")),!await H())return!1;console.log(e("@C298B:暂存完成,等待Git操作完成...")),await Me(ms),console.log(e("@C298B:开始提交更改..."));const ie=await Te(F,_);return console.log(e("@C298B:暂存并提交操作完成")),ie}async function mt(F,_=!1){try{if(console.log(e("@C298B:开始暂存文件...")),!await H()||(console.log(e("@C298B:暂存完成,等待Git操作完成...")),await Me(ms),console.log(e("@C298B:开始提交更改...")),!await Te(F,_)))return!1;console.log(e("@C298B:提交完成,等待Git操作完成...")),await Me(ms),console.log(e("@C298B:开始推送到远程..."));const Ee=await ve();return console.log(e("@C298B:一键推送操作完成,状态已统一刷新")),Ee}catch(Z){console.error("一键推送操作失败:",Z);try{(await(await fetch("/api/remove-lock",{method:"POST"})).json()).success&&r({message:e("@C298B:检测到Git锁定文件冲突,已自动清理,请重试操作"),type:"warning"})}catch(ie){console.error("清理锁定文件失败:",ie)}r({message:`${e("@C298B:操作失败: ")}${Z.message}`,type:"error"});try{await Promise.all([Ie(),Qe(),ce()])}catch(ie){console.error("刷新状态失败:",ie)}return!1}}async function ss(){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{j.value=!0;const _=await(await fetch("/api/reset-head",{method:"POST"})).json();return _.success?(r({message:e("@C298B:已重置暂存区"),type:"success"}),Ie(),!0):(r({message:`${e("@C298B:重置暂存区失败: ")}${_.error}`,type:"error"}),!1)}catch(F){return r({message:`${e("@C298B:重置暂存区失败: ")}${F.message}`,type:"error"}),!1}finally{j.value=!1}}async function os(F){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{j.value=!0;const Z=await(await fetch("/api/reset-to-remote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:F})})).json();return Z.success?(r({message:`${e("@C298B:已重置分支 ")}${F}${e("@C298B: 到远程状态")}`,type:"success"}),Ie(),Qe(),!0):(r({message:`${e("@C298B:重置分支失败: ")}${Z.error}`,type:"error"}),!1)}catch(_){return r({message:`${e("@C298B:重置分支失败: ")}${_.message}`,type:"error"}),!1}finally{j.value=!1}}async function as(){if(f.value)try{L.value=!0,console.log(e("@C298B:获取远程仓库地址..."));const _=await(await fetch("/api/remote-url")).json();_.success?(D.value=_.url||"",console.log(`${e("@C298B:获取到远程仓库地址: ")}${D.value}`)):(console.warn("获取远程仓库地址失败:",_.error),D.value="")}catch(F){console.error("获取远程仓库地址失败:",F),D.value=""}finally{L.value=!1}}async function ns(){if(!D.value)return r({message:e("@C298B:没有可复制的远程仓库地址"),type:"warning"}),!1;try{return await navigator.clipboard.writeText(D.value),r({message:e("@C298B:已复制远程仓库地址"),type:"success"}),!0}catch(F){return console.error("复制远程仓库地址失败:",F),r({message:`${e("@C298B:复制失败: ")}${F.message}`,type:"error"}),!1}}at(()=>{const F=localStorage.getItem("zen-gitsync-auto-update");F!==null&&(me.value=F==="true"),tt()});function It(){Q.value&&(Q.value.disconnect(),Q.value=null)}Ws(()=>{It()});async function yt(){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),[];try{Le.value=!0;const _=await(await fetch("/api/stash-list")).json();return _.success?(Pe.value=_.stashes,_.stashes):(r.error(`${e("@C298B:获取stash列表失败: ")}${_.error}`),[])}catch(F){return console.error("获取stash列表失败:",F),r.error(`${e("@C298B:获取stash列表失败: ")}${F.message}`),[]}finally{Le.value=!1}}async function ls(F,_=!1,Z=!0){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{J.value=!0;const Ee=await(await fetch("/api/stash-save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:F,includeUntracked:_,excludeLocked:Z})})).json();return Ee.success?(r.success(Ee.message),await yt(),await Ie(),!0):(r.warning(Ee.message),!1)}catch(ie){return console.error("保存stash失败:",ie),r.error(`${e("@C298B:保存stash失败: ")}${ie.message}`),!1}finally{J.value=!1}}async function is(F,_=!1){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{_e.value=!0;const Z=await fetch("/api/stash-apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stashId:F,pop:_})}),ie=await Z.json();return Z.status===409?(r.warning(e("@C298B:应用stash时发生冲突,请手动解决")),!1):ie.success?(r.success(ie.message),await yt(),await Ie(),!0):(r.error(`${e("@C298B:应用stash失败: ")}${ie.error}`),!1)}catch(Z){return console.error("应用stash失败:",Z),r.error(`${e("@C298B:应用stash失败: ")}${Z.message}`),!1}finally{_e.value=!1}}async function rs(F){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{te.value=!0;const Z=await(await fetch("/api/stash-drop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stashId:F})})).json();return Z.success?(r.success(Z.message),await yt(),!0):(r.error(`${e("@C298B:删除stash失败: ")}${Z.error}`),!1)}catch(_){return console.error("删除stash失败:",_),r.error(`${e("@C298B:删除stash失败: ")}${_.message}`),!1}finally{te.value=!1}}async function lt(){if(!f.value)return r.warning(e("@C298B:当前目录不是Git仓库")),!1;try{te.value=!0;const _=await(await fetch("/api/stash-clear",{method:"POST"})).json();return _.success?(r.success(_.message),Pe.value=[],!0):(r.error(`${e("@C298B:清空stash失败: ")}${_.error}`),!1)}catch(F){return console.error("清空stash失败:",F),r.error(`${e("@C298B:清空stash失败: ")}${F.message}`),!1}finally{te.value=!1}}return{currentBranch:C,allBranches:n,userName:l,userEmail:p,isChangingBranch:d,isCreatingBranch:m,isGitRepo:f,lastCheckedTime:B,branchAhead:Y,branchBehind:T,hasUpstream:P,upstreamBranch:V,lastBranchStatusTime:N,lastBranchesTime:oe,remoteUrl:D,isLoadingRemoteUrl:L,stashes:Pe,isLoadingStashes:Le,isApplyingStash:_e,isDroppingStash:te,isSavingStash:J,log:w,status:ee,fileList:G,isLoadingLog:M,isLoadingStatus:re,isAddingFiles:$,isCommiting:O,isResetting:j,autoUpdateEnabled:me,currentPage:U,hasMoreData:ne,totalCommits:we,isPushing:k,isGitPulling:h,isGitFetching:K,isGitMerging:x,$reset:he,checkGitRepo:be,getCurrentBranch:Ve,getAllBranches:ke,changeBranch:A,getUserInfo:z,createBranch:fe,clearUserConfig:le,restoreUserConfig:Ce,getBranchStatus:ce,gitPull:Ae,gitFetchAll:Se,initSocketConnection:tt,toggleAutoUpdate:ue,parseStatusPorcelain:st,fetchLog:Qe,refreshLog:$t,fetchStatus:Ie,fetchStatusPorcelain:ft,addToStage:H,addAllToStage:R,addFileToStage:de,unstageFile:ye,commitChanges:Te,pushToRemote:ve,pushToRemoteWithProgress:He,addAndCommit:pt,addCommitAndPush:mt,resetHead:ss,resetToRemote:os,getRemoteUrl:as,copyRemoteUrl:ns,mergeBranch:nt,getStashList:yt,saveStash:ls,applyStash:is,dropStash:rs,clearAllStashes:lt,socket:Q,disconnectSocket:It}});function ba(E){return E.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ns(E){return E?E.split(`
|
|
5
|
+
`).map(n=>{const l=ba(n);return n.startsWith("diff --git")||n.startsWith("diff --cc")||n.startsWith("diff --combined")?`<div class="diff-header">${l}</div>`:n.startsWith("---")?`<div class="diff-old-file">${l}</div>`:n.startsWith("+++")?`<div class="diff-new-file">${l}</div>`:n.startsWith("@@")?`<div class="diff-hunk-header">${l}</div>`:n.startsWith("+")?`<div class="diff-added">${l}</div>`:n.startsWith("-")?`<div class="diff-removed">${l}</div>`:`<div class="diff-context">${l}</div>`}).join(""):""}function ka(E){return E?E.trim():"(无提交信息)"}function wa(E){if(!E)return"";const C=/^(feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert)(\([^)]+\))?\s*:\s*(.+)$/s,n=E.match(C);return n?n[3].trim():E.trim()}const Js="/assets/vscode-twqwGmNt.webp",$a={class:"file-action-buttons"},Fa={key:1,style:{"font-size":"16px","font-weight":"bold"}},Sa=Fe({__name:"FileActionButtons",props:{filePath:{},fileType:{},isLocked:{type:Boolean,default:!1},isLocking:{type:Boolean,default:!1},showLockButton:{type:Boolean,default:!0}},emits:["toggleLock","stage","unstage","revert"],setup(E,{emit:C}){const n=E,l=C,p=se(()=>{switch(n.fileType){case"added":return[{type:"unstage",tooltip:e("@0883F:取消暂存"),buttonType:"warning",icon:"-",handler:()=>l("unstage",n.filePath)}];case"modified":case"deleted":return[{type:"stage",tooltip:e("@0883F:添加到暂存区"),buttonType:"success",icon:"+",handler:()=>l("stage",n.filePath)},{type:"revert",tooltip:e("@0883F:撤回修改"),buttonType:"danger",icon:ws,handler:()=>l("revert",n.filePath)}];case"untracked":return[{type:"stage",tooltip:e("@0883F:添加到暂存区"),buttonType:"success",icon:"+",handler:()=>l("stage",n.filePath)},{type:"delete",tooltip:e("@0883F:删除文件"),buttonType:"danger",icon:Qt,handler:()=>l("revert",n.filePath)}];default:return[]}});function d(f){f.stopPropagation(),l("toggleLock",n.filePath)}function m(f,B){B.stopPropagation(),f()}return(f,B)=>{const D=xe,L=Je,k=$e;return c(),g("div",$a,[f.showLockButton?(c(),q(k,{key:0,content:f.isLocking?t(e)("@0883F:处理中..."):f.isLocked?t(e)("@0883F:解锁文件"):t(e)("@0883F:锁定文件"),placement:"top","show-after":200},{default:a(()=>[o(L,{type:f.isLocked?"danger":"info",size:"small",text:"",loading:f.isLocking,disabled:f.isLocking,onClick:d,class:"file-action-btn"},{default:a(()=>[f.isLocking?W("",!0):(c(),q(D,{key:0,size:"16"},{default:a(()=>[(c(),q(_s(f.isLocked?t(Wt):t(qs))))]),_:1}))]),_:1},8,["type","loading","disabled"])]),_:1},8,["content"])):W("",!0),f.isLocked?W("",!0):(c(!0),g(Be,{key:1},Re(p.value,h=>(c(),q(k,{key:h.type,content:h.tooltip,placement:"top","show-after":200},{default:a(()=>[o(L,{type:h.buttonType,size:"small",text:"",onClick:K=>m(h.handler,K),class:"file-action-btn"},{default:a(()=>[typeof h.icon!="string"?(c(),q(D,{key:0,size:"16"},{default:a(()=>[(c(),q(_s(h.icon)))]),_:2},1024)):(c(),g("span",Fa,i(h.icon),1))]),_:2},1032,["type","onClick"])]),_:2},1032,["content"]))),128))])}}}),De=(E,C)=>{const n=E.__vccOpts||E;for(const[l,p]of C)n[l]=p;return n},Ts=De(Sa,[["__scopeId","data-v-d2dc586f"]]);function Jt(E){const C=[],n=new Map;return[...E].sort((p,d)=>p.path.localeCompare(d.path)).forEach(p=>{const d=p.path.split("/").filter(B=>B);let m="",f=C;d.forEach((B,D)=>{const L=D===d.length-1;m=m?`${m}/${B}`:B;let k=n.get(m);k||(k={name:B,path:m,isDirectory:!L,expanded:!0},L?(k.file=p,k.type=p.type,k.locked=p.locked):k.children=[],n.set(m,k),f.push(k)),!L&&k.children&&(f=k.children)})}),C}function Aa(E){E.expanded=!E.expanded}function Ht(E,C){const n=new Map,l=d=>{d.forEach(m=>{m.isDirectory&&(n.set(m.path,m.expanded||!1),m.children&&l(m.children))})},p=d=>{d.forEach(m=>{if(m.isDirectory){const f=n.get(m.path);f!==void 0&&(m.expanded=f),m.children&&p(m.children)}})};l(C),p(E)}function Es(E){if(!E)return"";try{return Go(E)||""}catch(C){return console.warn("Failed to get file icon class:",C),""}}const Da={class:"tree-node-wrapper"},Ta={class:"node-name"},Ea={key:2,class:"file-type-tag"},La={key:4,class:"file-actions"},Ga={key:0,class:"tree-children"},Pa=Fe({__name:"TreeNodeItem",props:{node:{},level:{},selectedFile:{default:""},showActionButtons:{type:Boolean,default:!1},isFileLocked:{type:Function,default:()=>!1},isLocking:{type:Function,default:()=>!1}},emits:["file-select","toggle-lock","stage","unstage","revert","node-click"],setup(E,{emit:C}){const n=E,l=C;function p(B){return`${B*20+10}px`}function d(B){return B.isDirectory?"icon-file-directory":Es(B.name)}function m(B){return!B.isDirectory&&B.path===n.selectedFile}function f(){l("node-click",n.node)}return(B,D)=>{const L=Ks("TreeNodeItem",!0);return c(),g("div",Da,[s("div",{class:ge(["tree-node",{"is-directory":B.node.isDirectory,"is-file":!B.node.isDirectory,"is-selected":m(B.node),"is-locked":B.node.locked,[`file-type-${B.node.type}`]:B.node.type}]),style:ut({paddingLeft:p(B.level)}),onClick:f},[B.node.isDirectory?(c(),q(t(xe),{key:0,class:"folder-icon"},{default:a(()=>[o(t(Lt))]),_:1})):(c(),g("span",{key:1,class:ge(["node-icon","file-icon",d(B.node)])},null,2)),o(t($e),{content:B.node.path,placement:"top",disabled:B.node.name.length<=35,"show-after":200},{default:a(()=>[s("span",Ta,i(B.node.name),1)]),_:1},8,["content","disabled"]),B.node.isDirectory?W("",!0):(c(),g("span",Ea,i(B.node.type||"modified"),1)),B.node.locked?(c(),q(t($e),{key:3,content:t(e)("@E80AC:该文件已被锁定,提交时会被跳过"),placement:"top","show-after":200},{default:a(()=>[o(t(xe),{class:"lock-icon",color:"#E6A23C"},{default:a(()=>[o(t(Wt))]),_:1})]),_:1},8,["content"])):W("",!0),B.showActionButtons&&!B.node.isDirectory&&B.node.file?(c(),g("div",La,[o(Ts,{"file-path":B.node.path,"file-type":B.node.type||"modified","is-locked":B.isFileLocked(B.node.path),"is-locking":B.isLocking(B.node.path),onToggleLock:D[0]||(D[0]=k=>l("toggle-lock",k)),onStage:D[1]||(D[1]=k=>l("stage",k)),onUnstage:D[2]||(D[2]=k=>l("unstage",k)),onRevert:D[3]||(D[3]=k=>l("revert",k))},null,8,["file-path","file-type","is-locked","is-locking"])])):W("",!0)],6),B.node.isDirectory&&B.node.expanded&&B.node.children&&B.node.children.length>0?(c(),g("div",Ga,[(c(!0),g(Be,null,Re(B.node.children,k=>(c(),q(L,{key:k.path+"-"+(k.expanded?"open":"closed"),node:k,level:B.level+1,"selected-file":B.selectedFile,"show-action-buttons":B.showActionButtons,"is-file-locked":B.isFileLocked,"is-locking":B.isLocking,onFileSelect:D[4]||(D[4]=h=>l("file-select",h)),onToggleLock:D[5]||(D[5]=h=>l("toggle-lock",h)),onStage:D[6]||(D[6]=h=>l("stage",h)),onUnstage:D[7]||(D[7]=h=>l("unstage",h)),onRevert:D[8]||(D[8]=h=>l("revert",h)),onNodeClick:D[9]||(D[9]=h=>l("node-click",h))},null,8,["node","level","selected-file","show-action-buttons","is-file-locked","is-locking"]))),128))])):W("",!0)])}}}),Va=De(Pa,[["__scopeId","data-v-945171b0"]]),xa={class:"file-tree-view"},Ra=Fe({__name:"FileTreeView",props:{treeData:{},selectedFile:{default:""},showActionButtons:{type:Boolean,default:!1},isFileLocked:{type:Function,default:()=>!1},isLocking:{type:Function,default:()=>!1}},emits:["file-select","toggle-lock","stage","unstage","revert"],setup(E,{emit:C}){const n=C,l=u(0);function p(d){d.isDirectory?(Aa(d),l.value++):d.file&&n("file-select",d.path)}return(d,m)=>(c(),g("div",xa,[(c(!0),g(Be,null,Re(d.treeData,f=>(c(),q(Va,{key:f.path+"-"+(f.expanded?"open":"closed"),node:f,level:0,"selected-file":d.selectedFile,"show-action-buttons":d.showActionButtons,"is-file-locked":d.isFileLocked,"is-locking":d.isLocking,onFileSelect:m[0]||(m[0]=B=>n("file-select",B)),onToggleLock:m[1]||(m[1]=B=>n("toggle-lock",B)),onStage:m[2]||(m[2]=B=>n("stage",B)),onUnstage:m[3]||(m[3]=B=>n("unstage",B)),onRevert:m[4]||(m[4]=B=>n("revert",B)),onNodeClick:p},null,8,["node","selected-file","show-action-buttons","is-file-locked","is-locking"]))),128))]))}}),Yt=De(Ra,[["__scopeId","data-v-1112330c"]]),Ia={class:"files-panel"},Ma={class:"panel-header"},za={class:"header-left"},Oa={key:0,class:"file-count"},ja={class:"view-mode-toggle"},Ua={class:"search-box"},Na={class:"files-list"},Ja=["onClick"],Ha={class:"file-name"},Ya=["title"],Wa={class:"file-directory path-badge"},qa={key:1,class:"file-actions"},Ka={class:"diff-panel"},Qa={class:"panel-header"},Za={class:"header-right"},Xa={class:"selected-file"},en={class:"path-dir"},tn={class:"path-name"},sn={key:1,class:"action-buttons"},on=["src"],an={class:"diff-content"},nn=["innerHTML"],ln={key:1,class:"diff-panel full-width"},rn={class:"panel-header"},cn={class:"header-right"},un={class:"selected-file"},dn={class:"path-dir"},fn={class:"path-name"},pn={key:1,class:"action-buttons"},mn=["src"],hn={class:"diff-content"},gn=["innerHTML"],Hs="zen-gitsync-file-list-view-mode",hs="fileDiff.splitPercent",gs="zen-gitsync-filediff-ratio",vn=Fe({__name:"FileDiffViewer",props:{files:{},emptyText:{default:e("@E80AC:没有找到变更文件")},diffContent:{default:""},selectedFile:{default:""},height:{default:"100%"},showFileList:{type:Boolean,default:!0},context:{default:"git-status"},showOpenButton:{type:Boolean,default:!0},showActionButtons:{type:Boolean,default:!1},isFileLocked:{type:Function,default:()=>!1},isLocking:{type:Function,default:()=>!1}},emits:["file-select","open-file","open-with-vscode","toggle-lock","stage","unstage","revert"],setup(E,{emit:C}){const n=E,l=C,p=u(""),d=u(""),m=localStorage.getItem(Hs),f=u(m||"list"),B=localStorage.getItem(gs)??localStorage.getItem(hs),D=(()=>{const $=B?parseFloat(B):35;return isNaN($)?35:Math.min(85,Math.max(15,$))})(),L=u(D),k=se(()=>n.selectedFile||p.value),h=se(()=>n.files.map($=>{const O=$.name||$.path.split("/").pop()||$.path;return{...$,displayName:O,dirPath:(()=>{const j=($.path||"").split("/");return j.length>1?j.slice(0,-1).join("/"):""})(),iconClass:Es(O)}})),K=se(()=>{if(!d.value.trim())return h.value;const $=d.value.toLowerCase().trim();return h.value.filter(O=>O.displayName.toLowerCase().includes($)||O.path.toLowerCase().includes($))}),x=u([]);function Y(){const $=Jt(K.value);x.value.length>0&&Ht($,x.value),x.value=$}Ge(K,()=>{f.value==="tree"&&Y()},{deep:!0}),Ge(f,$=>{$==="tree"&&Y(),localStorage.setItem(Hs,$),window.dispatchEvent(new CustomEvent("file-list-view-mode-change",{detail:{mode:$}}))});const T=se(()=>n.diffContent&&n.diffContent.trim()!==""),P=se(()=>{if(!k.value)return"";const $=k.value.split("/");return $.slice(0,-1).join("/")+($.length>1?"/":"")}),V=se(()=>{if(!k.value)return"";const $=k.value.split("/");return $[$.length-1]||k.value});function N($){p.value=$,l("file-select",$)}function oe(){if(!k.value){r.warning(e("@E80AC:请先选择一个文件"));return}l("open-file",k.value,n.context)}function me(){if(!k.value){r.warning(e("@E80AC:请先选择一个文件"));return}navigator.clipboard.writeText(k.value).then(()=>{r.success(e("@E80AC:文件路径已复制到剪贴板"))}).catch(()=>{r.error(e("@E80AC:复制失败"))})}function Q(){if(!k.value){r.warning(e("@E80AC:请先选择一个文件"));return}l("open-with-vscode",k.value,n.context)}const S=se(()=>{switch(n.context){case"git-status":return e("@E80AC:在系统默认编辑器中打开文件");case"commit-detail":return e("@E80AC:打开该提交时的文件版本");case"stash-detail":return e("@E80AC:打开该stash中的文件版本");default:return e("@E80AC:打开文件")}});Ge(()=>n.selectedFile,$=>{$!==void 0&&(p.value=$)}),Ge(()=>n.files,$=>{if($.length>0&&!k.value){const O=$[0];N(O.path)}},{immediate:!0});const y=$=>Math.min(85,Math.max(15,$)),w=$=>{try{const O=String(y($));localStorage.setItem(gs,O),localStorage.setItem(hs,O)}catch{}};Ge(L,$=>{w($)}),at(()=>{try{const O=localStorage.getItem(gs)??localStorage.getItem(hs);if(O!=null){const j=parseFloat(O);isNaN(j)||(L.value=y(j))}}catch{}f.value==="tree"&&Y();const $=O=>{const U=O.detail.mode;f.value!==U&&(f.value=U)};return window.addEventListener("file-list-view-mode-change",$),()=>{window.removeEventListener("file-list-view-mode-change",$)}});const ee=u(null),G=()=>{var O,j;const $=((O=ee.value)==null?void 0:O.$el)??ee.value;if($&&$.clientWidth)return $.clientWidth;try{return((j=$==null?void 0:$.getBoundingClientRect)==null?void 0:j.call($).width)??0}catch{return 0}},M=()=>{var ne,we,Pe,Le;const $=((ne=ee.value)==null?void 0:ne.$el)??ee.value;if(!$)return;const O=(we=$.querySelectorAll)==null?void 0:we.call($,".el-splitter__panel"),j=G();if(!O||O.length<1||j<=0)return;const U=((Le=(Pe=O[0])==null?void 0:Pe.getBoundingClientRect)==null?void 0:Le.call(Pe).width)??0;if(U>0){const _e=y(U/j*100);_e!==L.value&&(L.value=_e,w(_e))}},re=se({get(){return`${y(L.value)}%`},set($){let O=NaN;if(typeof $=="number"){const j=$,U=G();U>0&&!isNaN(j)&&(O=j/U*100)}else if(typeof $=="string"){if($.endsWith("%"))O=parseFloat($);else if($.endsWith("px")){const j=parseFloat($),U=G();U>0&&!isNaN(j)&&(O=j/U*100)}}isNaN(O)||(L.value=y(O),w(L.value))}});return($,O)=>{const j=Po;return c(),g("div",{class:"file-diff-viewer",style:ut({height:$.height})},[$.showFileList?(c(),q(t(Ro),{key:0,ref_key:"splitterRef",ref:ee,layout:"horizontal",style:{height:"100%"},onResize:M,onResizeEnd:M},{default:a(()=>[o(j,{size:re.value,"onUpdate:size":O[11]||(O[11]=U=>re.value=U),min:"15%",max:"85%"},{default:a(()=>[s("div",Ia,[s("div",Ma,[s("div",za,[s("h4",null,i(t(e)("@E80AC:变更文件")),1),$.files.length>0?(c(),g("span",Oa,"("+i($.files.length)+")",1)):W("",!0)]),s("div",ja,[o(t($e),{content:t(e)("@E80AC:列表视图"),placement:"top","show-after":200},{default:a(()=>[s("button",{class:ge(["mode-btn",{active:f.value==="list"}]),onClick:O[0]||(O[0]=U=>f.value="list")},[o(lo,{style:{width:"1em",height:"1em"}})],2)]),_:1},8,["content"]),o(t($e),{content:t(e)("@E80AC:树状视图"),placement:"top","show-after":200},{default:a(()=>[s("button",{class:ge(["mode-btn",{active:f.value==="tree"}]),onClick:O[1]||(O[1]=U=>f.value="tree")},[o(no,{style:{width:"1em",height:"1em"}})],2)]),_:1},8,["content"])])]),s("div",Ua,[o(t(dt),{modelValue:d.value,"onUpdate:modelValue":O[2]||(O[2]=U=>d.value=U),placeholder:t(e)("@E80AC:搜索文件名或路径..."),"prefix-icon":t(Vo),clearable:"",size:"small"},null,8,["modelValue","placeholder","prefix-icon"])]),s("div",Na,[o(t(xo),{height:"100%"},{default:a(()=>[$.files.length===0?(c(),q(t(ht),{key:0,description:$.emptyText,"image-size":60},null,8,["description"])):K.value.length===0?(c(),q(t(ht),{key:1,description:t(e)("@E80AC:没有找到匹配的文件"),"image-size":60},null,8,["description"])):f.value==="list"?(c(!0),g(Be,{key:2},Re(K.value,U=>(c(),g("div",{key:U.path,class:ge(["file-item",{active:U.path===k.value,[`file-type-${U.type}`]:U.type,"is-locked":U.locked}]),onClick:ne=>N(U.path)},[s("span",{class:ge(["file-icon",U.iconClass])},null,2),o(t($e),{content:U.path,placement:"top",disabled:U.displayName.length<=35,"show-after":200},{default:a(()=>[s("span",Ha,i(U.displayName),1)]),_:2},1032,["content","disabled"]),U.dirPath?(c(),g("div",{key:0,class:"file-path-section",title:U.dirPath},[o(t($e),{content:U.dirPath,placement:"top",disabled:U.dirPath.length<=30,"show-after":200},{default:a(()=>[s("div",Wa,i(U.dirPath),1)]),_:2},1032,["content","disabled"])],8,Ya)):W("",!0),$.showActionButtons?(c(),g("div",qa,[o(Ts,{"file-path":U.path,"file-type":U.type||"modified","is-locked":$.isFileLocked(U.path),"is-locking":$.isLocking(U.path),onToggleLock:O[3]||(O[3]=ne=>l("toggle-lock",ne)),onStage:O[4]||(O[4]=ne=>l("stage",ne)),onUnstage:O[5]||(O[5]=ne=>l("unstage",ne)),onRevert:O[6]||(O[6]=ne=>l("revert",ne))},null,8,["file-path","file-type","is-locked","is-locking"])])):W("",!0)],10,Ja))),128)):(c(),q(Yt,{key:3,"tree-data":x.value,"selected-file":k.value,"show-action-buttons":$.showActionButtons,"is-file-locked":$.isFileLocked,"is-locking":$.isLocking,onFileSelect:N,onToggleLock:O[7]||(O[7]=U=>l("toggle-lock",U)),onStage:O[8]||(O[8]=U=>l("stage",U)),onUnstage:O[9]||(O[9]=U=>l("unstage",U)),onRevert:O[10]||(O[10]=U=>l("revert",U))},null,8,["tree-data","selected-file","show-action-buttons","is-file-locked","is-locking"]))]),_:1})])])]),_:1},8,["size"]),o(j,{min:"15%",max:"85%"},{default:a(()=>[s("div",Ka,[s("div",Qa,[s("h4",null,i(t(e)("@E80AC:文件差异")),1),s("div",Za,[k.value?(c(),q(t($e),{key:0,content:k.value,placement:"top",effect:"light","show-after":200},{default:a(()=>[s("span",Xa,[s("span",en,i(P.value),1),s("span",tn,i(V.value),1)])]),_:1},8,["content"])):W("",!0),$.showOpenButton&&k.value?(c(),g("div",sn,[o(t($e),{content:t(e)("@E80AC:复制文件路径"),placement:"top",effect:"light"},{default:a(()=>[s("button",{class:"modern-btn btn-icon-24",onClick:me},[o(t(xe),{class:"btn-icon"},{default:a(()=>[o(t(Bs))]),_:1})])]),_:1},8,["content"]),o(t($e),{content:S.value,placement:"top",effect:"light"},{default:a(()=>[s("button",{class:"modern-btn btn-icon-24",onClick:oe},[o(t(xe),{class:"btn-icon"},{default:a(()=>[o(t(qt))]),_:1})])]),_:1},8,["content"]),o(t($e),{content:t(e)("@E80AC:用VSCode打开文件"),placement:"top",effect:"light"},{default:a(()=>[s("button",{class:"modern-btn btn-icon-24",onClick:Q},[s("img",{src:t(Js),alt:"VSCode",class:"btn-icon vscode-icon"},null,8,on)])]),_:1},8,["content"])])):W("",!0)])]),s("div",an,[T.value?(c(),g("div",{key:1,class:"diff-text",innerHTML:t(Ns)($.diffContent)},null,8,nn)):(c(),q(t(ht),{key:0,description:k.value?t(e)("@E80AC:该文件没有差异内容"):t(e)("@E80AC:请选择文件查看差异"),"image-size":80},null,8,["description"]))])])]),_:1})]),_:1},512)):(c(),g("div",ln,[s("div",rn,[s("h4",null,i(t(e)("@E80AC:文件差异")),1),s("div",cn,[k.value?(c(),q(t($e),{key:0,content:k.value,placement:"top",effect:"light","show-after":200},{default:a(()=>[s("span",un,[s("span",dn,i(P.value),1),s("span",fn,i(V.value),1)])]),_:1},8,["content"])):W("",!0),$.showOpenButton&&k.value?(c(),g("div",pn,[o(t($e),{content:t(e)("@E80AC:复制文件路径"),placement:"top",effect:"light"},{default:a(()=>[s("button",{class:"modern-btn btn-icon-24",onClick:me},[o(t(xe),{class:"btn-icon"},{default:a(()=>[o(t(Bs))]),_:1})])]),_:1},8,["content"]),o(t($e),{content:S.value,placement:"top",effect:"light"},{default:a(()=>[s("button",{class:"modern-btn btn-icon-24 btn-primary",onClick:oe},[o(t(xe),{class:"btn-icon"},{default:a(()=>[o(t(qt))]),_:1})])]),_:1},8,["content"]),o(t($e),{content:t(e)("@E80AC:用VSCode打开文件"),placement:"top",effect:"light"},{default:a(()=>[s("button",{class:"modern-btn btn-icon-24 btn-success",onClick:Q},[s("img",{src:t(Js),alt:"VSCode",class:"btn-icon vscode-icon"},null,8,mn)])]),_:1},8,["content"])])):W("",!0)])]),s("div",hn,[T.value?(c(),g("div",{key:1,class:"diff-text",innerHTML:t(Ns)($.diffContent)},null,8,gn)):(c(),q(t(ht),{key:0,description:k.value?t(e)("@E80AC:该文件没有差异内容"):t(e)("@E80AC:请选择文件查看差异"),"image-size":80},null,8,["description"]))])]))],4)}}}),Ls=De(vn,[["__scopeId","data-v-ef535eca"]]),Cn={class:"common-dialog__footer"},yn=Fe({__name:"CommonDialog",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},type:{default:"default"},width:{},height:{},top:{default:"50px"},closeOnClickModal:{type:Boolean,default:!1},closeOnPressEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},customClass:{},appendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},heightMode:{default:"max"},heightOffset:{default:"100px"},showFooter:{type:Boolean,default:!1},confirmText:{default:e("@803A9:确定")},cancelText:{default:e("@803A9:取消")},showCancel:{type:Boolean,default:!0},confirmLoading:{type:Boolean,default:!1}},emits:["update:modelValue","confirm","cancel","close","opened","closed"],setup(E,{emit:C}){const n=E,l=C,p=se(()=>{if(n.width)return n.width;switch(n.size){case"small":return"30%";case"medium":return"50%";case"large":return"80%";case"extra-large":return"90%";default:return"50%"}}),d=se(()=>{const h=[];return n.customClass&&h.push(n.customClass),n.type==="flex"&&h.push("common-dialog--flex"),n.type==="full-height"&&h.push("common-dialog--full-height"),h.join(" ")}),m=se(()=>{const h=`calc(100% - ${n.heightOffset})`;return n.heightMode==="fixed"?{height:h}:{maxHeight:h}});function f(){l("update:modelValue",!1),l("close")}function B(){l("confirm")}function D(){l("cancel"),f()}function L(){l("opened")}function k(){l("closed")}return(h,K)=>{const x=Je;return c(),q(t($s),{"model-value":h.modelValue,title:h.title,width:p.value,top:h.top,style:ut(m.value),"close-on-click-modal":h.closeOnClickModal,"close-on-press-escape":h.closeOnPressEscape,"destroy-on-close":h.destroyOnClose,draggable:h.draggable,class:ge(d.value),"append-to-body":h.appendToBody,"lock-scroll":h.lockScroll,onClose:f,onOpened:L,onClosed:k},Io({default:a(()=>[gt(h.$slots,"default",{},void 0,!0)]),_:2},[h.showFooter||h.$slots.footer?{name:"footer",fn:a(()=>[gt(h.$slots,"footer",{},()=>[s("div",Cn,[h.showCancel?(c(),q(x,{key:0,onClick:D},{default:a(()=>[X(i(h.cancelText),1)]),_:1})):W("",!0),o(x,{type:"primary",loading:h.confirmLoading,onClick:B},{default:a(()=>[X(i(h.confirmText),1)]),_:1},8,["loading"])])],!0)]),key:"0"}:void 0]),1032,["model-value","title","width","top","style","close-on-click-modal","close-on-press-escape","destroy-on-close","draggable","class","append-to-body","lock-scroll"])}}}),Ye=De(yn,[["__scopeId","data-v-9d6311ce"]]),_n={key:0,class:"file-group"},Bn={class:"file-count"},bn={class:"file-list"},kn=["onClick"],wn={class:"file-info"},$n={class:"file-name-section"},Fn=["title"],Sn={class:"file-directory"},An={class:"file-actions"},Dn=Fe({__name:"FileGroup",props:{files:{},title:{},groupKey:{},collapsedGroups:{},isFileLocked:{type:Function},isLocking:{type:Function},getFileName:{type:Function},getFileDirectory:{type:Function}},emits:["toggleCollapse","fileClick","toggleFileLock","stageFile","unstageFile","revertFileChanges"],setup(E,{emit:C}){const n=E,l=C,p=se(()=>n.files.length>0),d=se(()=>n.collapsedGroups[n.groupKey]);function m(){l("toggleCollapse",n.groupKey)}function f(x){l("fileClick",x)}function B(x){l("toggleFileLock",x)}function D(x){l("stageFile",x)}function L(x){l("unstageFile",x)}function k(x){l("revertFileChanges",x)}function h(x){switch(x){case"added":return"A";case"modified":return"M";case"deleted":return"D";case"untracked":return"U";default:return""}}const K=x=>{const Y=n.getFileName(x);return Es(Y)};return(x,Y)=>{const T=xe,P=Ks("Lock"),V=$e;return p.value?(c(),g("div",_n,[s("div",{class:"file-group-header",onClick:m},[o(T,{class:ge(["collapse-icon",{collapsed:d.value}])},{default:a(()=>[o(t(ot))]),_:1},8,["class"]),s("span",null,i(x.title),1),s("span",Bn,"("+i(x.files.length)+")",1)]),Xe(s("div",bn,[(c(!0),g(Be,null,Re(x.files,N=>(c(),g("div",{key:N.path,class:ge(["file-item file-group-item",{"is-loading":n.isLocking(N.path),locked:n.isFileLocked(N.path)}]),onClick:oe=>f(N)},[s("div",wn,[s("span",{class:ge(["file-type-icon",K(N.path)])},null,2),s("div",$n,[o(V,{content:n.getFileName(N.path),placement:"top",disabled:n.getFileName(N.path).length<=25,"show-after":200},{default:a(()=>[s("div",{class:ge(["file-name",{"locked-file-name":n.isFileLocked(N.path),"deleted-file-name":N.type==="deleted"}])},[X(i(n.getFileName(N.path))+" ",1),n.isFileLocked(N.path)?(c(),q(T,{key:0,class:"lock-indicator"},{default:a(()=>[o(P)]),_:1})):W("",!0)],2)]),_:2},1032,["content","disabled"])]),s("div",{class:"file-path-section",title:n.getFileDirectory(N.path)},[o(V,{content:n.getFileDirectory(N.path),placement:"top",disabled:n.getFileDirectory(N.path).length<=30,"show-after":200},{default:a(()=>[s("span",Sn,i(n.getFileDirectory(N.path)),1)]),_:2},1032,["content","disabled"])],8,Fn),s("div",{class:ge(["file-status-indicator",[N.type,{locked:n.isFileLocked(N.path)}]])},i(h(N.type)),3)]),s("div",An,[o(Ts,{"file-path":N.path,"file-type":N.type,"is-locked":n.isFileLocked(N.path),"is-locking":n.isLocking(N.path),onToggleLock:B,onStage:D,onUnstage:L,onRevert:k},null,8,["file-path","file-type","is-locked","is-locking"])])],10,kn))),128))],512),[[xt,!d.value]])])):W("",!0)}}}),vs=De(Dn,[["__scopeId","data-v-0c4961fe"]]),io="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAklEQVR4AewaftIAAAJBSURBVO3BsW0TAAAF0ePjhgKyBl02MG1WYgMGYRKiVFTuGMAFFYUVKVKkCKYgli733ruf8JdEYiQiIxEZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIjERmJyEhERiIyEpGRiIxEZCQiIxEZichIREYicuBK3n/6xIfbW+LzdDrxcrlwDQeu5MPtLZ9//CA+v45HHu/vuYaRiIxEZCQiIxEZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIjERmJyEhERiIyEpGRiIxEZCQiIxE5kFdx/vqV1/bxyxdu7u54Sw7kVfz+9o1ruLm74y0ZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIjERmJyEhERiIyEpGRiIxEZCQiIxEZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIjERmJyEhERiIyEpGRiIxEZCQiIxEZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIjERmJyEhERiIyEpGRiIxEZCQiIxEZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIHruTpdOLX8Uj+nz/fv/P48MBrezqduJYDV/JyufB4f0/+n+fzmefzmbdkJCIjERmJyEhERiIyEpGRiIxEZCQiIxEZichIREYiMhKRkYiMRGQkIiMRGYnISERGIjISkZGIjERkJCIjERmJyEhERiLyD8sXKs9gnNZmAAAAAElFTkSuQmCC",Tn={id:"directory-selector",class:"directory-selector"},En=["title"],Ln={class:"directory-actions flex"},Gn={class:"directory-content"},Pn={class:"form-label"},Vn={class:"directory-input-group"},xn={class:"form-label"},Rn={class:"recent-directories"},In=["onClick"],Mn=["title"],zn={class:"directory-footer"},On={class:"footer-actions"},jn=["disabled"],Un=Fe({__name:"DirectorySelector",emits:["toggleNpmPanel"],setup(E,{emit:C}){const n=et(),l=qe(),p=se(()=>n.currentDirectory),d=u(!1),m=u(""),f=u(!1),B=u([]),D=u(!1),L=u(!1),k=C;function h(){m.value=p.value,d.value=!0,P()}async function K(){try{if(!p.value){r.warning("当前目录路径为空");return}const y=await(await fetch("/api/open_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:p.value})})).json();y.success?r.success("已在文件管理器中打开目录"):y.error&&r.error(y.error)}catch(S){r.error(`${e("@67CE7:打开目录失败: ")}${S.message}`)}}async function x(){try{if(!p.value){r.warning("当前目录路径为空");return}const y=await(await fetch("/api/open_terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:p.value})})).json();y.success?r.success("已在终端中打开目录"):y.error&&r.error(y.error)}catch(S){r.error(`${e("@67CE7:打开终端失败: ")}${S.message}`)}}async function Y(){try{L.value=!0;const y=await(await fetch("/api/scan-npm-scripts")).json();y.success&&(D.value=y.totalScripts>0)}catch(S){console.error("检查npm脚本失败:",S),D.value=!1}finally{L.value=!1}}function T(){k("toggleNpmPanel")}async function P(){try{const y=await(await fetch("/api/recent_directories")).json();y.success&&Array.isArray(y.directories)&&(B.value=y.directories)}catch(S){console.error("获取最近目录失败:",S)}}Ge(p,()=>{Y()}),at(()=>{Y()});async function V(S){try{await fetch("/api/save_recent_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:S})})}catch(y){console.error("保存最近目录失败:",y)}}async function N(){if(!m.value){r.warning("目录路径不能为空");return}try{f.value=!0;const y=await(await fetch("/api/change_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:m.value})})).json();y.success?(r.success("已切换工作目录"),d.value=!1,await V(y.directory),await P(),n.setCurrentDirectory(y.directory),l.isGitRepo=y.isGitRepo,await n.loadConfig(!0),y.isGitRepo?(await Promise.all([l.getCurrentBranch(),l.getAllBranches(),l.getUserInfo(),l.getRemoteUrl()]),l.refreshLog()):(r.warning(e("@67CE7:当前目录不是Git仓库,部分功能将不可用")),l.$reset())):r.error(y.error||"切换目录失败")}catch(S){r.error(`${e("@67CE7:切换目录失败: ")}${S.message}`)}finally{f.value=!1}}async function oe(){try{const y=await(await fetch("/api/browse_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPath:m.value||p.value})})).json();y.success?me(y):y.error&&r.error(y.error)}catch(S){r.error(`${e("@67CE7:浏览目录失败: ")}${S.message}`)}}function me(S){!S||!S.items||We.alert(Ue("div",{class:"directory-browser"},[Ue("div",{class:"current-path"},[Ue("span",{class:"path-label"},"当前路径: "),Ue("span",{class:"path-value"},S.path)]),Ue("div",{class:"directory-list"},[S.parentPath?Ue("div",{class:"directory-item parent-dir",onClick:()=>Q(S.parentPath)},[Ue("span",{class:"dir-icon"},Ue("svg",{class:"folder-icon",viewBox:"0 0 24 24",width:"20",height:"20",style:{fill:"#E6A23C"}},[Ue("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"})])),Ue("span",{class:"dir-name"},"返回上级目录")]):null,...S.items.map(y=>Ue("div",{class:"directory-item",onClick:()=>Q(y.path)},[Ue("span",{class:"dir-icon"},Ue("svg",{class:"folder-icon",viewBox:"0 0 24 24",width:"20",height:"20",style:{fill:"#409EFF"}},[Ue("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"})])),Ue("span",{class:"dir-name"},y.name)]))])]),"浏览并选择目录",{confirmButtonText:"使用当前目录",customClass:"directory-browser-dialog",callback:y=>{y==="confirm"&&(m.value=S.path)}})}async function Q(S){try{We.close(),setTimeout(async()=>{try{const w=await(await fetch("/api/browse_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPath:S})})).json();w.success?me(w):w.error&&r.error(w.error)}catch(y){r.error(`${e("@67CE7:浏览目录失败: ")}${y.message}`)}},100)}catch(y){r.error(`${e("@67CE7:处理目录选择时出错: ")}${y.message}`)}}return(S,y)=>{const w=xe,ee=$e,G=dt,M=Xt,re=Zt;return c(),g(Be,null,[s("div",Tn,[s("div",{class:"directory-display cursor-pointer",title:p.value,onClick:h},i(p.value),9,En),s("div",Ln,[o(ee,{content:t(e)("@67CE7:在资源管理器中打开"),placement:"top",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-28",onClick:K},[o(w,{class:"btn-icon"},{default:a(()=>[o(t(qt))]),_:1})])]),_:1},8,["content"]),o(ee,{content:"在终端中打开",placement:"top",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-28",onClick:x},[o(w,{class:"btn-icon"},{default:a(()=>[o(t(Mo))]),_:1})])]),_:1}),D.value?(c(),q(ee,{key:0,content:"NPM脚本",placement:"top",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-28 npm-btn",onClick:T},y[4]||(y[4]=[s("img",{src:io,alt:"npm",class:"btn-icon",style:{width:"16px",height:"16px"}},null,-1)]))]),_:1})):W("",!0)])]),o(Ye,{modelValue:d.value,"onUpdate:modelValue":y[3]||(y[3]=$=>d.value=$),title:t(e)("@67CE7:切换工作目录"),size:"medium","destroy-on-close":!0,"append-to-body":!0,"custom-class":"directory-dialog"},{footer:a(()=>[s("div",zn,[s("div",On,[s("button",{type:"button",class:"footer-btn cancel-btn",onClick:y[1]||(y[1]=$=>d.value=!1)},i(t(e)("@67CE7:取消")),1),s("button",{type:"button",class:"footer-btn primary-btn",onClick:y[2]||(y[2]=$=>N()),disabled:f.value},[f.value?(c(),q(w,{key:1,class:"is-loading"},{default:a(()=>y[5]||(y[5]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("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 32z"})],-1)])),_:1})):(c(),q(w,{key:0},{default:a(()=>[o(t(Lt))]),_:1})),s("span",null,i(t(e)("@67CE7:切换")),1)],8,jn)])])]),default:a(()=>[s("div",Gn,[o(re,{"label-position":"top"},{default:a(()=>[o(M,null,{label:a(()=>[s("div",Pn,[o(w,{class:"label-icon"},{default:a(()=>[o(t(Lt))]),_:1}),s("span",null,i(t(e)("@67CE7:目录路径")),1)])]),default:a(()=>[s("div",Vn,[o(G,{modelValue:m.value,"onUpdate:modelValue":y[0]||(y[0]=$=>m.value=$),placeholder:t(e)("@67CE7:请输入目录路径"),class:"modern-input",size:"large"},null,8,["modelValue","placeholder"]),s("button",{type:"button",class:"browse-btn",onClick:oe},[o(w,null,{default:a(()=>[o(t(Lt))]),_:1}),s("span",null,i(t(e)("@67CE7:浏览")),1)])])]),_:1}),B.value.length>0?(c(),q(M,{key:0},{label:a(()=>[s("div",xn,[o(w,{class:"label-icon"},{default:a(()=>[o(t(Qs))]),_:1}),s("span",null,i(t(e)("@67CE7:常用目录")),1)])]),default:a(()=>[s("div",Rn,[(c(!0),g(Be,null,Re(B.value,($,O)=>(c(),g("div",{key:O,class:"recent-dir-item",onClick:j=>m.value=$},[o(w,{class:"dir-icon"},{default:a(()=>[o(t(Lt))]),_:1}),s("span",{class:"dir-path",title:$},i($),9,Mn)],8,In))),128))])]),_:1})):W("",!0)]),_:1})])]),_:1},8,["modelValue","title"])],64)}}}),Nn=De(Un,[["__scopeId","data-v-836aa9a1"]]),Jn={key:0,class:"npm-scripts-panel"},Hn={class:"panel-header"},Yn={class:"header-left"},Wn={class:"panel-title"},qn={key:0,class:"package-count"},Kn={class:"header-right"},Qn=["disabled"],Zn={key:0,class:"loading-container"},Xn={class:"loading-text"},el={key:1,class:"empty-container"},tl={class:"empty-text"},sl=["onClick"],ol={class:"package-info"},al={class:"package-name"},nl={class:"package-path"},ll={key:0,class:"scripts-list"},il=["onClick"],rl={class:"script-left"},cl={class:"script-name"},ul={class:"script-command"},dl=Fe({__name:"NpmScriptsPanel",props:{visible:{type:Boolean}},emits:["close"],setup(E,{emit:C}){const n=E,l=C,p=u([]),d=u(!1),m=u(new Set),f=u(300),B=u(!1),D=u(0),L=u(0);function k(P){B.value=!0,D.value=P.clientY,L.value=f.value,document.addEventListener("mousemove",h),document.addEventListener("mouseup",K),P.preventDefault()}function h(P){if(!B.value)return;const V=D.value-P.clientY,N=Math.max(200,Math.min(600,L.value+V));f.value=N}function K(){B.value=!1,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",K)}async function x(){try{d.value=!0;const V=await(await fetch("/api/scan-npm-scripts")).json();V.success?(p.value=V.packages,p.value.forEach(N=>{m.value.add(N.path)})):r.error(e("@NPM01:加载npm脚本失败"))}catch(P){console.error("加载npm脚本失败:",P),r.error(`${e("@NPM01:加载npm脚本失败")}: ${P.message}`)}finally{d.value=!1}}function Y(P){m.value.has(P)?m.value.delete(P):m.value.add(P)}async function T(P,V){try{const oe=await(await fetch("/api/run-npm-script",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packagePath:P,scriptName:V})})).json();oe.success?r.success(`${e("@NPM01:已在新终端中执行")}: ${V}`):r.error(oe.error||e("@NPM01:执行脚本失败"))}catch(N){console.error("执行npm脚本失败:",N),r.error(`${e("@NPM01:执行脚本失败")}: ${N.message}`)}}return Ge(()=>n.visible,P=>{P&&x()},{immediate:!0}),(P,V)=>{const N=xe;return P.visible?(c(),g("div",Jn,[s("div",{class:"resize-handle",onMousedown:k},null,32),s("div",Hn,[s("div",Yn,[V[1]||(V[1]=s("img",{src:io,alt:"npm",class:"npm-icon"},null,-1)),s("span",Wn,i(t(e)("@NPM01:NPM 脚本")),1),d.value?W("",!0):(c(),g("span",qn,i(p.value.length)+" "+i(t(e)("@NPM01:个包")),1))]),s("div",Kn,[s("button",{class:"refresh-btn",onClick:x,disabled:d.value},[o(N,{class:ge({"is-rotating":d.value})},{default:a(()=>V[2]||(V[2]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"})],-1)])),_:1},8,["class"])],8,Qn),s("button",{class:"close-btn",onClick:V[0]||(V[0]=oe=>l("close"))},[o(N,null,{default:a(()=>V[3]||(V[3]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})],-1)])),_:1})])])]),d.value?(c(),g("div",Zn,[o(N,{class:"is-loading loading-icon"},{default:a(()=>V[4]||(V[4]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("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 32z"})],-1)])),_:1}),s("p",Xn,i(t(e)("@NPM01:正在扫描项目中的 npm 脚本...")),1)])):p.value.length===0?(c(),g("div",el,[V[5]||(V[5]=s("svg",{class:"empty-icon",viewBox:"0 0 1024 1024",width:"64",height:"64"},[s("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z"})],-1)),s("p",tl,i(t(e)("@NPM01:当前项目中未找到包含 scripts 的 package.json")),1)])):(c(),g("div",{key:2,class:"packages-container",style:ut({maxHeight:f.value+"px"})},[(c(!0),g(Be,null,Re(p.value,oe=>(c(),g("div",{key:oe.path,class:"package-item"},[s("div",{class:"package-header",onClick:me=>Y(oe.path)},[o(N,{class:ge(["expand-icon",{expanded:m.value.has(oe.path)}])},{default:a(()=>V[6]||(V[6]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})],-1)])),_:2},1032,["class"]),o(N,{class:"folder-icon"},{default:a(()=>[o(t(qt))]),_:1}),s("div",ol,[s("span",al,i(oe.name),1),s("span",nl,i(oe.relativePath),1)])],8,sl),m.value.has(oe.path)?(c(),g("div",ll,[(c(!0),g(Be,null,Re(oe.scripts,(me,Q)=>(c(),g("div",{key:Q,class:"script-item",onClick:S=>T(oe.path,Q)},[s("div",rl,[o(N,{class:"play-icon"},{default:a(()=>V[7]||(V[7]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("path",{fill:"currentColor",d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}),s("path",{fill:"currentColor",d:"M719.4 499.1l-296.1-215A15.9 15.9 0 0 0 398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 0 0 0-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"})],-1)])),_:1}),s("span",cl,i(Q),1)]),s("span",ul,i(me),1)],8,il))),128))])):W("",!0)]))),128))],4))])):W("",!0)}}}),fl=De(dl,[["__scopeId","data-v-fbfe7231"]]),pl={class:"card git-status-card flex flex-col"},ml={class:"status-header"},hl={class:"title-row"},gl={class:"header-actions"},vl=["element-loading-text"],Cl={key:0,class:"status-box"},yl={class:"empty-status"},_l={key:1,class:"status-box-wrap"},Bl={key:0,class:"upstream-tip"},bl={class:"tip-header"},kl={class:"tip-title"},wl={class:"tip-body"},$l={class:"tip-text"},Fl={class:"tip-actions"},Sl={key:1,class:"branch-status-info"},Al={class:"branch-sync-status"},Dl={class:"sync-status-content"},Tl={class:"status-badges"},El={class:"badge-content"},Ll={class:"badge-content"},Gl={key:2,class:"file-list-wrapper"},Pl={class:"file-list-header"},Vl={class:"header-left"},xl={key:0,class:"file-count"},Rl={class:"view-mode-toggle"},Il={class:"file-list-container"},Ml={key:0,class:"tree-group"},zl={class:"file-count"},Ol={key:1,class:"tree-group"},jl={class:"file-count"},Ul={key:2,class:"tree-group"},Nl={class:"file-count"},Jl={key:3,class:"empty-status"},Hl={class:"empty-icon"},Yl={class:"empty-text"},Wl={class:"empty-subtext"},ql={class:"lock-feature-description"},Kl={class:"description-header"},Ql={class:"description-title"},Zl={class:"description-content"},Xl={key:0,class:"empty-locked-files"},ei={class:"empty-icon"},ti={class:"empty-tip"},si={key:1,class:"locked-files-list"},oi={class:"locked-files-header"},ai={class:"locked-file-items"},ni={class:"file-info"},li={class:"file-path-container"},ii={class:"file-name"},ri={class:"file-directory"},ci={class:"file-actions"},Ys="zen-gitsync-file-list-view-mode",ui=Fe({__name:"GitStatus",props:{initialDirectory:{type:String,default:""}},setup(E,{expose:C}){const n=E,l=qe(),p=et(),d=se(()=>l.isLoadingStatus),m=u(""),f=u(""),B=u(!1),D=u(!1),L=u(-1),k=u({});function h(A){return!!k.value[A]}const K=u(!1);function x(){K.value=!K.value}const Y=se(()=>l.fileList.map(A=>({path:A.path,name:A.path.split("/").pop()||A.path,type:A.type,locked:te(A.path)})));async function T(A){await G(A)}async function P(A,z){try{const le=await(await fetch("/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:A,context:z})})).json();le.success?r.success(le.message):r.error(le.error||e("@13D1C:打开文件失败"))}catch(fe){r.error(`${e("@13D1C:打开文件失败: ")}${fe.message}`)}}async function V(A,z){try{const le=await(await fetch("/api/open-with-vscode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:A,context:z})})).json();le.success?r.success(le.message):r.error(le.error||e("@13D1C:用VSCode打开文件失败"))}catch(fe){r.error(`${e("@13D1C:用VSCode打开文件失败: ")}${fe.message}`)}}const N=u(!1),oe=u({staged:!1,unstaged:!1,untracked:!1}),me=localStorage.getItem(Ys),Q=u(me||"list"),S=u(n.initialDirectory||"");async function y(){try{if(!S.value){const z=await(await fetch("/api/current_directory")).json();S.value=z.directory||e("@13D1C:未知目录")}if(!l.isGitRepo)return;await l.fetchStatus(),await l.getBranchStatus(),r({message:e("@13D1C:Git 状态已刷新"),type:"success"})}catch(A){r({message:"刷新失败: "+A.message,type:"error"})}}async function w(A){try{await We.confirm(`确认解锁该文件?
|
|
6
|
+
${A}`,e("@13D1C:确认解锁"),{type:"warning",confirmButtonText:e("@13D1C:解锁"),cancelButtonText:e("@13D1C:取消")}),await p.unlockFile(A)}catch{}}async function ee(){if(p.lockedFiles.length)try{await We.confirm(`${e("@13D1C:确认解锁所有已锁定文件?共 ")}${p.lockedFiles.length}${e("@13D1C: 个。")}`,e("@13D1C:清空全部锁定"),{type:"warning",confirmButtonText:e("@13D1C:全部解锁"),cancelButtonText:e("@13D1C:取消")});const A=[...p.lockedFiles];await Promise.all(A.map(z=>p.unlockFile(z))),await p.loadLockedFiles(),r.success(e("@13D1C:已清空所有文件锁定"))}catch{}}async function G(A){try{D.value=!0,m.value=A,L.value=l.fileList.findIndex(fe=>fe.path===A);const z=l.fileList[L.value];if(z&&z.type==="untracked")try{const le=await(await fetch(`/api/file-content?file=${encodeURIComponent(A)}`)).json();le.success&&le.content?f.value=`diff --git a/${A} b/${A}
|
|
7
|
+
${e("@13D1C:新文件: ")}${A}
|
|
8
|
+
--- /dev/null
|
|
9
|
+
+++ b/${A}
|
|
10
|
+
@@ -0,0 +1,${le.content.split(`
|
|
11
|
+
`).length} @@
|
|
12
|
+
`+le.content.split(`
|
|
13
|
+
`).map(Ce=>`+${Ce}`).join(`
|
|
14
|
+
`):f.value=`这是一个新文件,尚未被Git跟踪。
|
|
15
|
+
添加到暂存区后可以提交该文件。`}catch(fe){console.error("获取未跟踪文件内容失败:",fe),f.value=`这是一个新文件,尚未被Git跟踪。
|
|
16
|
+
添加到暂存区后可以提交该文件。`}else if(z&&z.type==="added"){const le=await(await fetch(`/api/diff-cached?file=${encodeURIComponent(A)}`)).json();f.value=le.diff||e("@13D1C:没有变更")}else{const le=await(await fetch(`/api/diff?file=${encodeURIComponent(A)}`)).json();f.value=le.diff||e("@13D1C:没有变更")}}catch(z){r({message:"获取文件差异失败: "+z.message,type:"error"}),f.value="获取差异失败: "+z.message}finally{D.value=!1}}function M(A){if(B.value=!0,l.fileList.length>0){const z=l.fileList.find(fe=>fe.path===A.path)||l.fileList[0];G(z.path)}}async function re(A){await l.addFileToStage(A)}async function $(A){await l.unstageFile(A)}async function O(){try{if(!l.isGitRepo)return;await l.fetchStatus(),await l.getBranchStatus(!0),r.success(e("@13D1C:Git 状态已刷新"))}catch(A){r.error("刷新失败: "+A.message)}}async function j(){try{await l.gitPull(),await y()}catch(A){console.error("拉取操作发生错误:",A)}}async function U(){try{await l.gitFetchAll(),await y()}catch(A){console.error("获取远程分支信息操作发生错误:",A)}}const ne=u(!1);async function we(){if(!l.currentBranch){r.warning(e("@13D1C:未知当前分支"));return}try{ne.value=!0;const A=`git push -u origin ${l.currentBranch}`,fe=await(await fetch("/api/exec",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:A})})).json();fe.success?(r.success(e("@13D1C:已推送并设置上游分支")),await l.getAllBranches(),await l.getCurrentBranch(!0),await l.getBranchStatus(!0)):r.error(fe.error||e("@13D1C:设置上游失败"))}catch(A){r.error(`${e("@13D1C:设置上游失败: ")}${A.message}`)}finally{ne.value=!1}}async function Pe(A){try{await We.confirm(`${e('@13D1C:确定要撤回文件 "')}${A}${e('@13D1C:" 的所有修改吗?此操作无法撤销。')}`,e("@13D1C:撤回修改"),{confirmButtonText:e("@13D1C:确定"),cancelButtonText:e("@13D1C:取消"),type:"warning"});const fe=await(await fetch("/api/revert_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:A})})).json();fe.success?(r.success(e("@13D1C:已撤回文件修改")),await y()):r.error(fe.error?`${e("@13D1C:撤回失败: ")}${fe.error}`:e("@13D1C:撤回文件修改失败,请重试"))}catch(z){if(z==="cancel"||z.message==="cancel")return;const fe=z.message||e("@13D1C:未知错误");fe!=="undefined"?r.error(`${e("@13D1C:撤回文件修改失败: ")}${fe}`):r.error(e("@13D1C:撤回文件修改失败,请重试"))}}function Le(A){const z=A.split("/");return z[z.length-1]}function _e(A){const z=A.split("/");return z.length<=1?"":z.slice(0,-1).join("/")}function te(A){const z=A.replace(/\\/g,"/");return p.lockedFiles.some(le=>{const Ce=le.replace(/\\/g,"/");return z===Ce})}async function J(A){if(!k.value[A]){k.value[A]=!0;try{te(A)?await p.unlockFile(A):await p.lockFile(A)}finally{delete k.value[A]}}}function he(A){oe.value[A]=!oe.value[A]}const ce=u([]),be=u([]),Ve=u([]);function ke(){const A=l.fileList.filter(Se=>Se.type==="added").map(Se=>({path:Se.path,type:Se.type,locked:te(Se.path)})),z=Jt(A);ce.value.length>0&&Ht(z,ce.value),ce.value=z;const fe=l.fileList.filter(Se=>Se.type==="modified"||Se.type==="deleted").map(Se=>({path:Se.path,type:Se.type,locked:te(Se.path)})),le=Jt(fe);be.value.length>0&&Ht(le,be.value),be.value=le;const Ce=l.fileList.filter(Se=>Se.type==="untracked").map(Se=>({path:Se.path,type:Se.type,locked:te(Se.path)})),Ae=Jt(Ce);Ve.value.length>0&&Ht(Ae,Ve.value),Ve.value=Ae}return Ge(()=>l.fileList,()=>{Q.value==="tree"&&ke()},{deep:!0}),Ge(Q,A=>{A==="tree"&&ke(),localStorage.setItem(Ys,A),window.dispatchEvent(new CustomEvent("file-list-view-mode-change",{detail:{mode:A}}))}),at(()=>{y(),p.loadConfig(),p.loadLockedFiles(),Q.value==="tree"&&ke();const A=z=>{const le=z.detail.mode;Q.value!==le&&(Q.value=le)};return window.addEventListener("file-list-view-mode-change",A),()=>{window.removeEventListener("file-list-view-mode-change",A)}}),Ge(()=>l.autoUpdateEnabled,(A,z)=>{console.log(`${e("@13D1C:自动更新状态变更: ")}${z} -> ${A}`),l.toggleAutoUpdate()},{immediate:!1}),C({refreshStatus:O}),(A,z)=>{const fe=Fs,le=$e,Ce=Je,Ae=xe,Se=Rt,tt=es;return c(),g(Be,null,[s("div",pl,[s("div",ml,[o(Nn,{onToggleNpmPanel:x}),s("div",hl,[s("h2",null,"Git "+i(t(e)("@13D1C:状态")),1),s("div",gl,[o(le,{content:t(l).autoUpdateEnabled?t(e)("@13D1C:自动更新文件状态"):t(e)("@13D1C:自动更新文件状态"),placement:"top","show-after":200},{default:a(()=>[o(fe,{modelValue:t(l).autoUpdateEnabled,"onUpdate:modelValue":z[0]||(z[0]=ue=>t(l).autoUpdateEnabled=ue),style:{"--el-switch-on-color":"#67C23A","--el-switch-off-color":"#909399","margin-right":"4px"},"inline-prompt":"","active-icon":t(ct),"inactive-icon":t(Qt),class:"auto-update-switch"},null,8,["modelValue","active-icon","inactive-icon"])]),_:1},8,["content"]),o(le,{content:t(e)("@13D1C:Git Pull (拉取远程更新)"),placement:"top","show-after":200},{default:a(()=>[o(Ce,{type:"primary",icon:t(bs),circle:"",size:"small",onClick:j,loading:t(l).isGitPulling,disabled:!t(l).hasUpstream},null,8,["icon","loading","disabled"])]),_:1},8,["content"]),o(le,{content:t(e)("@13D1C:Git Fetch All (获取所有远程分支)"),placement:"top","show-after":200},{default:a(()=>[Xe(o(Ce,{type:"primary",icon:t(bt),circle:"",size:"small",onClick:U,loading:t(l).isGitFetching},null,8,["icon","loading"]),[[xt,!1]])]),_:1},8,["content"]),t(p).lockedFiles.length>0?(c(),q(le,{key:0,content:t(e)("@13D1C:管理锁定文件"),placement:"top","show-after":200},{default:a(()=>[o(Ce,{type:"warning",circle:"",size:"small",onClick:z[1]||(z[1]=ue=>N.value=!0)},{default:a(()=>[o(Ae,null,{default:a(()=>[o(t(Wt))]),_:1})]),_:1})]),_:1},8,["content"])):W("",!0),o(le,{content:t(e)("@13D1C:刷新状态"),placement:"top","show-after":200},{default:a(()=>[o(Ce,{type:"primary",icon:t(zo),circle:"",size:"small",onClick:O,loading:d.value},null,8,["icon","loading"])]),_:1},8,["content"])])])]),Xe((c(),g("div",{class:"card-content","element-loading-text":t(l).isGitPulling?t(e)("@13D1C:正在拉取代码..."):t(e)("@13D1C:正在获取远程分支信息...")},[t(l).isGitRepo?(c(),g("div",_l,[t(l).hasUpstream?W("",!0):(c(),g("div",Bl,[s("div",bl,[o(Ae,{class:"tip-icon"},{default:a(()=>[o(t(vt))]),_:1}),s("span",kl,i(t(e)("@13D1C:当前分支未设置上游分支")),1)]),s("div",wl,[s("div",$l,i(t(e)("@13D1C:首次推送后即可建立与远程的跟踪关系,后续可直接 pull/push。")),1),s("div",Fl,[o(Ce,{size:"small",type:"primary",plain:"",loading:ne.value,disabled:ne.value,onClick:we},{default:a(()=>[X(i(t(e)("@13D1C:设置上游并推送")),1)]),_:1},8,["loading","disabled"])])])])),t(l).hasUpstream&&(t(l).branchAhead>0||t(l).branchBehind>0)?(c(),g("div",Sl,[s("div",Al,[s("div",Dl,[o(le,{content:t(e)("@13D1C:本地分支与远程分支的状态对比"),placement:"top","show-after":200},{default:a(()=>[s("div",Tl,[t(l).branchAhead>0?(c(),q(Se,{key:0,size:"small",type:"warning",class:"status-badge"},{default:a(()=>[s("span",El,[o(Ae,null,{default:a(()=>[o(t(Zs))]),_:1}),X(" 你的分支领先 'origin/"+i(t(l).currentBranch)+"' "+i(t(l).branchAhead)+" "+i(t(e)("@13D1C:个提交")),1)])]),_:1})):W("",!0),t(l).branchBehind>0?(c(),q(Se,{key:1,size:"small",type:"info",class:"status-badge"},{default:a(()=>[s("span",Ll,[o(Ae,null,{default:a(()=>[o(t(ot))]),_:1}),X(" 你的分支落后 'origin/"+i(t(l).currentBranch)+"' "+i(t(l).branchBehind)+" "+i(t(e)("@13D1C:个提交")),1)])]),_:1})):W("",!0)])]),_:1},8,["content"])])])])):W("",!0),t(l).fileList.length?(c(),g("div",Gl,[s("div",Pl,[s("div",Vl,[s("h4",null,i(t(e)("@13D1C:文件列表")),1),t(l).fileList.length>0?(c(),g("span",xl,"("+i(t(l).fileList.length)+")",1)):W("",!0)]),s("div",Rl,[o(le,{content:t(e)("@E80AC:列表视图"),placement:"top","show-after":200},{default:a(()=>[s("button",{class:ge(["mode-btn",{active:Q.value==="list"}]),onClick:z[2]||(z[2]=ue=>Q.value="list")},[o(lo,{style:{width:"1em",height:"1em"}})],2)]),_:1},8,["content"]),o(le,{content:t(e)("@E80AC:树状视图"),placement:"top","show-after":200},{default:a(()=>[s("button",{class:ge(["mode-btn",{active:Q.value==="tree"}]),onClick:z[3]||(z[3]=ue=>Q.value="tree")},[o(no,{style:{width:"1em",height:"1em"}})],2)]),_:1},8,["content"])])]),s("div",Il,[Q.value==="list"?(c(),g(Be,{key:0},[o(vs,{files:t(l).fileList.filter(ue=>ue.type==="added"),title:t(e)("@13D1C:已暂存的更改"),"group-key":"staged","collapsed-groups":oe.value,"is-file-locked":te,"is-locking":h,"get-file-name":Le,"get-file-directory":_e,onToggleCollapse:he,onFileClick:M,onToggleFileLock:J,onUnstageFile:$},null,8,["files","title","collapsed-groups"]),o(vs,{files:t(l).fileList.filter(ue=>ue.type==="modified"||ue.type==="deleted"),title:t(e)("@13D1C:未暂存的更改"),"group-key":"unstaged","collapsed-groups":oe.value,"is-file-locked":te,"is-locking":h,"get-file-name":Le,"get-file-directory":_e,onToggleCollapse:he,onFileClick:M,onToggleFileLock:J,onStageFile:re,onRevertFileChanges:Pe},null,8,["files","title","collapsed-groups"]),o(vs,{files:t(l).fileList.filter(ue=>ue.type==="untracked"),title:t(e)("@13D1C:未跟踪的文件"),"group-key":"untracked","collapsed-groups":oe.value,"is-file-locked":te,"is-locking":h,"get-file-name":Le,"get-file-directory":_e,onToggleCollapse:he,onFileClick:M,onToggleFileLock:J,onStageFile:re,onRevertFileChanges:Pe},null,8,["files","title","collapsed-groups"])],64)):(c(),g(Be,{key:1},[t(l).fileList.filter(ue=>ue.type==="added").length?(c(),g("div",Ml,[s("div",{class:"tree-group-header",onClick:z[4]||(z[4]=ue=>he("staged"))},[o(Ae,{class:ge(["collapse-icon",{collapsed:oe.value.staged}])},{default:a(()=>[o(t(ot))]),_:1},8,["class"]),s("h5",null,i(t(e)("@13D1C:已暂存的更改")),1),s("span",zl,i(t(l).fileList.filter(ue=>ue.type==="added").length),1)]),oe.value.staged?W("",!0):(c(),q(Yt,{key:0,"tree-data":ce.value,"selected-file":"","show-action-buttons":!0,"is-file-locked":te,"is-locking":h,onFileSelect:z[5]||(z[5]=ue=>M({path:ue})),onToggleLock:J,onUnstage:$},null,8,["tree-data"]))])):W("",!0),t(l).fileList.filter(ue=>ue.type==="modified"||ue.type==="deleted").length?(c(),g("div",Ol,[s("div",{class:"tree-group-header",onClick:z[6]||(z[6]=ue=>he("unstaged"))},[o(Ae,{class:ge(["collapse-icon",{collapsed:oe.value.unstaged}])},{default:a(()=>[o(t(ot))]),_:1},8,["class"]),s("h5",null,i(t(e)("@13D1C:未暂存的更改")),1),s("span",jl,i(t(l).fileList.filter(ue=>ue.type==="modified"||ue.type==="deleted").length),1)]),oe.value.unstaged?W("",!0):(c(),q(Yt,{key:0,"tree-data":be.value,"selected-file":"","show-action-buttons":!0,"is-file-locked":te,"is-locking":h,onFileSelect:z[7]||(z[7]=ue=>M({path:ue})),onToggleLock:J,onStage:re,onRevert:Pe},null,8,["tree-data"]))])):W("",!0),t(l).fileList.filter(ue=>ue.type==="untracked").length?(c(),g("div",Ul,[s("div",{class:"tree-group-header",onClick:z[8]||(z[8]=ue=>he("untracked"))},[o(Ae,{class:ge(["collapse-icon",{collapsed:oe.value.untracked}])},{default:a(()=>[o(t(ot))]),_:1},8,["class"]),s("h5",null,i(t(e)("@13D1C:未跟踪的文件")),1),s("span",Nl,i(t(l).fileList.filter(ue=>ue.type==="untracked").length),1)]),oe.value.untracked?W("",!0):(c(),q(Yt,{key:0,"tree-data":Ve.value,"selected-file":"","show-action-buttons":!0,"is-file-locked":te,"is-locking":h,onFileSelect:z[9]||(z[9]=ue=>M({path:ue})),onToggleLock:J,onStage:re,onRevert:Pe},null,8,["tree-data"]))])):W("",!0)],64))])])):t(l).isGitRepo?(c(),g("div",Jl,[s("div",Hl,[o(Ae,null,{default:a(()=>[o(t(Ss))]),_:1})]),s("div",Yl,i(t(e)("@13D1C:没有检测到任何更改")),1),s("div",Wl,i(t(e)("@13D1C:工作区是干净的")),1)])):W("",!0)])):(c(),g("div",Cl,[s("div",yl,[s("p",null,i(t(e)("@13D1C:当前目录不是Git仓库")),1)])]))],8,vl)),[[tt,t(l).isGitPulling||t(l).isGitFetching]]),o(fl,{visible:K.value,onClose:z[10]||(z[10]=ue=>K.value=!1)},null,8,["visible"])]),o(Ye,{modelValue:B.value,"onUpdate:modelValue":z[11]||(z[11]=ue=>B.value=ue),title:t(e)("@13D1C:文件差异"),"custom-class":"file-diff-dialog",size:"extra-large",type:"flex","destroy-on-close":"",heightMode:"fixed"},{default:a(()=>[o(Ls,{files:Y.value,diffContent:f.value,selectedFile:m.value,showActionButtons:!0,isFileLocked:te,isLocking:h,context:"git-status",emptyText:t(e)("@13D1C:选择文件查看差异"),onFileSelect:T,onOpenFile:P,onOpenWithVscode:V,onToggleLock:J,onStage:re,onUnstage:$,onRevert:Pe},null,8,["files","diffContent","selectedFile","emptyText"])]),_:1},8,["modelValue","title"]),o(Ye,{modelValue:N.value,"onUpdate:modelValue":z[12]||(z[12]=ue=>N.value=ue),title:t(e)("@13D1C:锁定文件管理"),size:"large","destroy-on-close":""},{default:a(()=>[s("div",ql,[s("div",Kl,[o(Ae,{class:"description-icon"},{default:a(()=>[o(t(vt))]),_:1}),s("span",Ql,i(t(e)("@13D1C:文件锁定功能说明")),1)]),s("div",Zl,[s("ul",null,[s("li",null,i(t(e)("@13D1C:锁定的文件在执行 Git 提交时会被自动跳过,不会被添加到暂存区")),1)])])]),t(p).lockedFiles.length===0?(c(),g("div",Xl,[s("div",ei,[o(Ae,null,{default:a(()=>[o(t(Wt))]),_:1})]),s("p",null,i(t(e)("@13D1C:当前没有锁定的文件")),1),s("p",ti,i(t(e)("@13D1C:您可以在文件列表中点击锁定按钮来锁定文件")),1)])):(c(),g("div",si,[s("div",oi,[s("span",null,"🔒 已锁定 "+i(t(p).lockedFiles.length)+" "+i(t(e)("@13D1C:个文件")),1),o(le,{content:t(e)("@13D1C:这些文件在提交时会被自动跳过"),placement:"top"},{default:a(()=>[o(Ae,{class:"info-icon"},{default:a(()=>[o(t(vt))]),_:1})]),_:1},8,["content"]),z[13]||(z[13]=s("div",{style:{flex:"1"}},null,-1)),o(Ce,{type:"danger",size:"small",plain:"",disabled:!t(p).lockedFiles.length,onClick:ee},{default:a(()=>[X(i(t(e)("@13D1C:清空全部锁定")),1)]),_:1},8,["disabled"])]),s("div",ai,[(c(!0),g(Be,null,Re(t(p).lockedFiles,ue=>(c(),g("div",{key:ue,class:"locked-file-item"},[s("div",ni,[z[14]||(z[14]=s("div",{class:"file-status-indicator locked"},null,-1)),s("div",li,[s("span",ii,i(Le(ue)),1),s("span",ri,i(_e(ue)),1)])]),s("div",ci,[o(le,{content:t(e)("@13D1C:解锁文件"),placement:"top"},{default:a(()=>[o(Ce,{type:"danger",size:"small",circle:"",class:"file-action-btn",icon:t(qs),"aria-label":t(e)("@13D1C:解锁"),onClick:st=>w(ue)},null,8,["icon","aria-label","onClick"])]),_:2},1032,["content"])])]))),128))])]))]),_:1},8,["modelValue","title"])],64)}}}),di=De(ui,[["__scopeId","data-v-99d0d866"]]),fi={class:"loading-container"},pi={class:"loading-text"},mi={key:0,class:"loading-progress"},hi=Fe({__name:"GlobalLoading",props:{visible:{type:Boolean,default:!1},text:{default:e("@2AEBA:加载中...")},showProgress:{type:Boolean,default:!1},progress:{default:0},mock:{type:Boolean,default:!1}},setup(E){return(C,n)=>(c(),q(Xs,{to:"body"},[o(Gt,{name:"loading-fade"},{default:a(()=>[C.visible||C.mock?(c(),g("div",{key:0,class:"global-loading-overlay",onClick:n[0]||(n[0]=wt(()=>{},["stop"]))},[s("div",fi,[n[1]||(n[1]=s("div",{class:"loading-spinner"},[s("div",{class:"spinner-ring"}),s("div",{class:"spinner-ring"}),s("div",{class:"spinner-ring"})],-1)),s("div",pi,i(C.text),1),C.showProgress||C.mock?(c(),g("div",mi,[s("div",{class:ge(["progress-bar",{"is-mock":C.mock&&!C.showProgress}]),style:ut(C.showProgress?{width:C.progress+"%"}:void 0)},null,6)])):W("",!0)])])):W("",!0)]),_:1})]))}}),gi=De(hi,[["__scopeId","data-v-b44fd3a8"]]),vi={class:"success-container"},Ci={class:"success-text"},yi={key:0,class:"success-description"},_i=Fe({__name:"SuccessModal",props:{visible:{type:Boolean,default:!1},text:{default:e("@71545:操作成功!")},description:{default:""}},setup(E){return(C,n)=>(c(),q(Xs,{to:"body"},[o(Gt,{name:"success-fade"},{default:a(()=>[C.visible?(c(),g("div",{key:0,class:"success-overlay",onClick:n[0]||(n[0]=wt(()=>{},["stop"]))},[s("div",vi,[n[1]||(n[1]=s("div",{class:"success-icon"},[s("svg",{viewBox:"0 0 52 52",class:"success-svg"},[s("circle",{class:"success-circle",cx:"26",cy:"26",r:"25",fill:"none"}),s("path",{class:"success-check",fill:"none",d:"m14.1 27.2l7.1 7.2 16.7-16.8"})])],-1)),s("div",Ci,i(C.text),1),C.description?(c(),g("div",yi,i(C.description),1)):W("",!0)])])):W("",!0)]),_:1})]))}}),Bi=De(_i,[["__scopeId","data-v-53fd0fc6"]]),Ze=As({visible:!1,text:e("@F2A3A:加载中..."),showProgress:!1,progress:0});function bi(){return{loadingState:Ze,show:d=>{Ze.visible=!0,Ze.text=(d==null?void 0:d.text)||e("@F2A3A:加载中..."),Ze.showProgress=(d==null?void 0:d.showProgress)||!1,Ze.progress=(d==null?void 0:d.progress)||0},hide:()=>{Ze.visible=!1},updateProgress:d=>{Ze.progress=Math.max(0,Math.min(100,d))},updateText:d=>{Ze.text=d},setText:d=>{Ze.visible&&(Ze.text=d)}}}const Tt=As({visible:!1,text:e("@B8591:操作成功!"),description:""});function ki(){const E=n=>{Tt.visible=!0,Tt.text=(n==null?void 0:n.text)||e("@B8591:操作成功!"),Tt.description=(n==null?void 0:n.description)||"";const l=(n==null?void 0:n.duration)||2e3;setTimeout(()=>{C()},l)},C=()=>{Tt.visible=!1};return{successState:Tt,show:E,hide:C}}const wi={class:"template-form"},$i={class:"template-form-buttons"},Fi={key:0,class:"template-list"},Si={key:1,class:"template-list-scroll"},Ai={class:"template-content"},Di={class:"template-actions"},Ti={key:1,class:"templates-container"},Ei={class:"message-templates-list"},Li={class:"templates-scroll-area"},Gi={class:"template-content"},Pi={class:"template-actions"},Vi={key:0,class:"current-default-message"},xi={class:"default-message-content"},Ri={key:2,class:"message-help-text"},Ii=Fe({__name:"TemplateManager",props:{visible:{type:Boolean},type:{},title:{},placeholder:{default:e("@60CAC:输入新模板内容")},editPlaceholder:{default:e("@60CAC:编辑模板内容")},emptyDescription:{default:e("@60CAC:暂无保存的模板")},showDefaultSection:{type:Boolean,default:!1},showHelpText:{type:Boolean,default:!1}},emits:["update:visible","use-template","set-default"],setup(E,{expose:C,emit:n}){const l=E,p=n,d=et(),m=u(""),f=u(!1),B=u(""),D=u(-1),L=u(!1),k=u(!1),h=se(()=>{switch(l.type){case"description":return d.descriptionTemplates||[];case"scope":return d.scopeTemplates||[];case"message":return d.messageTemplates||[];default:return[]}}),K=se(()=>l.type==="message"?d.defaultCommitMessage:""),x=se(()=>f.value?l.editPlaceholder:l.placeholder),Y=se(()=>f.value?e("@60CAC:更新模板"):e("@60CAC:添加模板")),T=se({get:()=>l.visible,set:y=>p("update:visible",y)});Ge(T,y=>{y||P()});function P(){m.value="",f.value=!1,B.value="",D.value=-1}async function V(){if(!m.value.trim()){r.warning(e("@60CAC:模板内容不能为空"));return}try{L.value=!0,f.value?await d.updateTemplate(B.value,m.value,l.type)&&P():await d.saveTemplate(m.value,l.type)&&(m.value="")}catch(y){r.error(`${e("@60CAC:模板保存失败: ")}${y.message}`)}finally{L.value=!1}}function N(y){p("use-template",y),l.type!=="message"&&(T.value=!1)}function oe(y,w){f.value=!0,B.value=y,m.value=y,D.value=w}function me(){P()}async function Q(y){try{const w=await d.deleteTemplate(y,l.type)}catch(w){r.error(`${e("@60CAC:模板删除失败: ")}${w.message}`)}}async function S(){if(!(l.type!=="message"||!m.value.trim()))try{k.value=!0,await d.saveDefaultMessage(m.value)&&p("set-default",m.value)}catch(y){r.error(`${e("@60CAC:设置默认提交信息失败: ")}${y.message}`)}finally{k.value=!1}}return C({resetForm:P}),(y,w)=>{const ee=dt,G=Je,M=ht,re=Oo,$=eo,O=Rt;return c(),q(Ye,{modelValue:T.value,"onUpdate:modelValue":w[1]||(w[1]=j=>T.value=j),title:y.title,"close-on-click-modal":!1,"custom-class":y.type==="message"?"message-template-dialog":"template-dialog"},{default:a(()=>[s("div",{class:ge(["template-container",{"message-template-container":y.type==="message"}])},[s("div",wi,[o(ee,{modelValue:m.value,"onUpdate:modelValue":w[0]||(w[0]=j=>m.value=j),placeholder:x.value,class:"template-input",clearable:"",onKeyup:Ds(V,["enter"])},null,8,["modelValue","placeholder"]),s("div",$i,[f.value?(c(),q(G,{key:0,onClick:me},{default:a(()=>[X(i(t(e)("@60CAC:取消")),1)]),_:1})):W("",!0),o(G,{type:"primary",onClick:V,disabled:!m.value.trim()||L.value,loading:L.value},{default:a(()=>[X(i(Y.value),1)]),_:1},8,["disabled","loading"]),y.type==="message"?(c(),q(G,{key:1,type:"success",onClick:S,disabled:!m.value.trim()||k.value,loading:k.value,plain:""},{default:a(()=>[X(i(t(e)("@60CAC:设为默认提交信息")),1)]),_:1},8,["disabled","loading"])):W("",!0)])]),y.type!=="message"?(c(),g("div",Fi,[s("h3",null,i(t(e)("@60CAC:已保存"))+i(y.type==="description"?t(e)("@60CAC:模板"):t(e)("@60CAC:作用域")),1),h.value.length===0?(c(),q(M,{key:0,description:y.emptyDescription},null,8,["description"])):(c(),g("div",Si,[(c(!0),g(Be,null,Re(h.value,(j,U)=>(c(),q($,{key:U,class:"template-item"},{default:a(()=>[o(re,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:a(()=>[s("div",Ai,i(j),1),s("div",Di,[o(G,{type:"primary",size:"small",onClick:ne=>N(j)},{default:a(()=>[X(i(t(e)("@60CAC:使用")),1)]),_:2},1032,["onClick"]),o(G,{type:"warning",size:"small",icon:t(rt),onClick:ne=>oe(j,U)},{default:a(()=>[X(i(t(e)("@60CAC:编辑")),1)]),_:2},1032,["icon","onClick"]),o(G,{type:"danger",size:"small",onClick:ne=>Q(j)},{default:a(()=>[X(i(t(e)("@60CAC:删除")),1)]),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))]))])):(c(),g("div",Ti,[s("div",Ei,[s("h3",null,i(t(e)("@60CAC:已保存模板")),1),s("div",Li,[h.value.length===0?(c(),q(M,{key:0,description:y.emptyDescription},null,8,["description"])):W("",!0),(c(!0),g(Be,null,Re(h.value,(j,U)=>(c(),q($,{key:U,class:"template-item"},{default:a(()=>[o(re,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:a(()=>[s("div",Gi,i(j),1),s("div",Pi,[o(G,{type:"primary",size:"small",onClick:ne=>N(j)},{default:a(()=>[X(i(t(e)("@60CAC:使用")),1)]),_:2},1032,["onClick"]),o(G,{type:"warning",size:"small",icon:t(rt),onClick:ne=>oe(j,U)},{default:a(()=>[X(i(t(e)("@60CAC:编辑")),1)]),_:2},1032,["icon","onClick"]),o(G,{type:"danger",size:"small",onClick:ne=>Q(j)},{default:a(()=>[X(i(t(e)("@60CAC:删除")),1)]),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])]),y.showDefaultSection?(c(),g("div",Vi,[s("h3",null,i(t(e)("@60CAC:当前默认提交信息")),1),K.value?(c(),q($,{key:0,class:"default-message-card"},{default:a(()=>[s("div",xi,i(K.value),1)]),_:1})):(c(),q(M,{key:1,description:t(e)("@60CAC:尚未设置默认提交信息"),"image-size":100},null,8,["description"])),y.showHelpText?(c(),g("div",Ri,[s("h4",null,i(t(e)("@60CAC:关于默认提交信息")),1),s("p",null,i(t(e)("@60CAC:默认提交信息将在未输入提交信息时自动使用。")),1),s("p",null,[X(i(t(e)("@60CAC:你可以通过点击左侧模板的")),1),o(O,{size:"small",type:"primary"},{default:a(()=>[X(i(t(e)("@60CAC:使用")),1)]),_:1}),X(i(t(e)("@60CAC:按钮先选择喜欢的模板,然后点击上方")),1),o(O,{size:"small",type:"success"},{default:a(()=>[X(i(t(e)("@60CAC:设为默认提交信息")),1)]),_:1}),X(i(t(e)("@60CAC:按钮保存。")),1)])])):W("",!0)])):W("",!0)]))],2)]),_:1},8,["modelValue","title","custom-class"])}}}),Cs=De(Ii,[["__scopeId","data-v-106573de"]]),Mi={class:"git-command-preview"},zi={class:"preview-container"},Oi={class:"preview-title"},ji={class:"preview-content code-command"},Ui=Fe({__name:"GitCommandPreview",props:{command:{},title:{default:e("@34292:Git命令预览:")},copyButtonText:{default:e("@34292:复制命令")},placeholder:{default:"<命令内容>"}},setup(E){const C=E,n=se(()=>C.command||C.placeholder);async function l(){if(!C.command){r.warning(e("@34292:没有可复制的命令内容"));return}try{await navigator.clipboard.writeText(C.command),r.success(e("@34292:命令已复制到剪贴板"))}catch(p){r.error(`${e("@34292:复制失败: ")}${p.message}`)}}return(p,d)=>{const m=xe,f=$e;return c(),g("div",Mi,[s("div",zi,[s("div",Oi,i(p.title),1),s("div",ji,i(n.value),1),o(f,{content:p.copyButtonText,placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn copy-command-btn",onClick:l},[o(m,{class:"btn-icon"},{default:a(()=>[o(t(kt))]),_:1})])]),_:1},8,["content"])])])}}}),Ni=De(Ui,[["__scopeId","data-v-917ed3fe"]]),Ji={class:"push-progress-container"},Hi={class:"stage-header"},Yi={class:"stage-icon"},Wi={class:"stage-info"},qi={class:"stage-label"},Ki={key:0,class:"stage-percent"},Qi={key:0,class:"stage-progress"},Zi={key:0,class:"error-section"},Xi={class:"error-content"},er={key:1,class:"messages-section"},tr=Fe({__name:"PushProgressModal",props:{modelValue:{type:Boolean}},emits:["update:modelValue","complete"],setup(E,{expose:C,emit:n}){const l=E,p=n,d=et(),m=u("progress"),f=u([]),B=u(""),D=As([{name:"counting",label:"计数对象",status:"wait",percent:0},{name:"compressing",label:"压缩对象",status:"wait",percent:0},{name:"writing",label:"写入对象",status:"wait",percent:0},{name:"resolving",label:"解析增量",status:"wait",percent:0}]),L=u(0),k=u(null),h=se({get:()=>l.modelValue,set:T=>p("update:modelValue",T)}),K=se(()=>{switch(m.value){case"progress":return"正在推送...";case"success":return"推送成功";case"error":return"推送失败";default:return""}});function x(T){switch(T.type){case"progress":T.message&&(f.value.push(T.message),setTimeout(()=>{k.value&&(k.value.scrollTop=k.value.scrollHeight)},0));break;case"stage-progress":if(T.stage&&typeof T.percent=="number"){const P=D.findIndex(V=>V.name===T.stage);P!==-1&&(D[P].percent=T.percent,D[P].status=T.percent===100?"finish":"process",L.value=P,T.percent===100&&P<D.length-1&&(D[P+1].status="wait"))}break;case"complete":T.success?(m.value="success",D.forEach(P=>{(P.status==="process"||P.status==="wait")&&(P.status="finish",P.percent=100)}),L.value=-1,d.autoClosePushModal?setTimeout(()=>{h.value=!1,p("complete",!0)},2e3):p("complete",!0)):(m.value="error",B.value=T.error||"未知错误",L.value<D.length&&(D[L.value].status="error"),L.value=-1,p("complete",!1));break}}function Y(){m.value="progress",f.value=[],B.value="",L.value=0,D.forEach(T=>{T.status="wait",T.percent=0})}return C({handleProgress:x,reset:Y}),(T,P)=>(c(),q(t($s),{modelValue:h.value,"onUpdate:modelValue":P[0]||(P[0]=V=>h.value=V),title:K.value,width:"650px","close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":m.value!=="progress","append-to-body":!0,"lock-scroll":!1,"destroy-on-close":"",class:ge(["push-progress-dialog",`status-${m.value}`])},{default:a(()=>[s("div",Ji,[s("div",{class:ge(["stages-section",{"is-loading":m.value==="progress","is-success":m.value==="success"}])},[(c(!0),g(Be,null,Re(D,(V,N)=>(c(),g("div",{key:V.name,class:ge(["stage-item",{active:L.value===N,finished:V.status==="finish",error:V.status==="error"}])},[s("div",Hi,[s("div",Yi,[V.status==="finish"?(c(),q(t(xe),{key:0,class:"icon-finish"},{default:a(()=>[o(t(jo))]),_:1})):V.status==="error"?(c(),q(t(xe),{key:1,class:"icon-error"},{default:a(()=>[o(t(Qt))]),_:1})):V.status==="process"?(c(),q(t(xe),{key:2,class:"icon-process rotating"},{default:a(()=>[o(t(Ct))]),_:1})):(c(),q(t(xe),{key:3,class:"icon-wait"},{default:a(()=>[o(t(Ct))]),_:1}))]),s("div",Wi,[s("div",qi,i(V.label),1),V.status==="process"||V.status==="finish"?(c(),g("div",Ki,i(V.percent)+"% ",1)):W("",!0)])]),V.status==="process"||V.status==="finish"?(c(),g("div",Qi,[o(t(Uo),{percentage:V.percent,"stroke-width":6,"show-text":!1,color:V.status==="finish"?"#67c23a":"#409eff"},null,8,["percentage","color"])])):W("",!0)],2))),128))],2),m.value==="error"&&B.value?(c(),g("div",Zi,[P[1]||(P[1]=s("div",{class:"error-title"},"错误详情:",-1)),s("div",Xi,i(B.value),1)])):W("",!0),f.value.length>0?(c(),g("div",er,[P[2]||(P[2]=s("div",{class:"messages-title"},"详细信息:",-1)),s("div",{ref_key:"messagesContainerRef",ref:k,class:"progress-messages"},[(c(!0),g(Be,null,Re(f.value,(V,N)=>(c(),g("div",{key:N,class:"message-item"},i(V),1))),128))],512)])):W("",!0)])]),_:1},8,["modelValue","title","show-close","class"]))}}),ro=De(tr,[["__scopeId","data-v-ff5cea0b"]]),sr={class:"one-push-content"},or={class:"one-push-text"},ar={class:"one-push-title"},nr={key:0,class:"one-push-desc"},lr=Fe({__name:"QuickPushButton",props:{from:{default:"form"},hasUserCommitMessage:{type:Boolean,default:!1},finalCommitMessage:{default:""},skipHooks:{type:Boolean,default:!1}},emits:["beforePush","afterPush","clearFields"],setup(E,{emit:C}){const n=qe(),l=et(),p=u(!1),d=u(null),m=E,f=C;function B(Y){const T=Y.replace(/\\/g,"/");return l.lockedFiles.some(P=>{const V=P.replace(/\\/g,"/");return T===V})}const D=se(()=>n.fileList.some(Y=>!B(Y.path))),L=se(()=>!D.value||!m.hasUserCommitMessage||!n.hasUpstream),k=se(()=>n.isAddingFiles||n.isCommiting||n.isPushing),h=se(()=>D.value?m.hasUserCommitMessage?n.hasUpstream?"一键完成:暂存所有更改 → 提交 → 推送到远程仓库":"当前分支没有上游分支":"请输入提交信息":"没有需要提交的更改");async function K(){f("beforePush");try{if(!await n.addAndCommit(m.finalCommitMessage,m.skipHooks)){f("afterPush",!1);return}p.value=!0,d.value&&d.value.reset();const T=await n.pushToRemoteWithProgress(P=>{d.value&&d.value.handleProgress(P)});T&&f("clearFields"),f("afterPush",T)}catch(Y){console.error("一键推送失败:",Y),f("afterPush",!1)}}function x(Y){}return(Y,T)=>{const P=xe,V=Je;return c(),g("div",null,[o(t($e),{content:h.value,placement:"top","show-after":200},{default:a(()=>[o(V,{type:"success",onClick:K,loading:k.value,disabled:L.value,class:ge([Y.from,"one-push-button"])},{default:a(()=>[s("div",sr,[o(P,{class:"one-push-icon"},{default:a(()=>[o(t(No))]),_:1}),s("div",or,[s("span",ar,i(Y.$t("@2E184:一键推送所有")),1),Y.from==="form"?(c(),g("span",nr,i(Y.$t("@2E184:暂存 + 提交 + 推送")),1)):W("",!0)])])]),_:1},8,["loading","disabled","class"])]),_:1},8,["content"]),o(ro,{ref_key:"progressModalRef",ref:d,modelValue:p.value,"onUpdate:modelValue":T[0]||(T[0]=N=>p.value=N),onComplete:x},null,8,["modelValue"])])}}}),co=De(lr,[["__scopeId","data-v-1ba9137f"]]),ir={key:0},rr=Fe({__name:"StageButton",props:{from:{default:"form"}},emits:["click"],setup(E,{emit:C}){const n=C,l=qe(),p=et();function d(h){const K=h.replace(/\\/g,"/");return p.lockedFiles.some(x=>{const Y=x.replace(/\\/g,"/");return K===Y})}function m(){return p.lockedFiles.length===0?!1:l.fileList.some(h=>["modified","deleted","untracked"].includes(h.type)?d(h.path):!1)}const f=se(()=>l.fileList.filter(h=>["modified","deleted","untracked"].includes(h.type)&&!d(h.path)).length),B=se(()=>l.fileList.some(h=>["modified","deleted","untracked"].includes(h.type)&&!d(h.path))),D=se(()=>!B.value),L=se(()=>B.value?m()?`${e("@29974:暂存")}${f.value}${e("@29974:个未暂存文件(逐个添加)")}`:`${e("@29974:暂存所有更改(git add .)")}`:e("@29974:没有需要暂存的更改"));async function k(){n("click");try{let h;m()?h=await l.addToStage():h=await l.addAllToStage(),h&&l.fetchStatus()}catch(h){console.error("添加文件失败:",h)}}return(h,K)=>{const x=Je,Y=$e;return c(),q(Y,{content:L.value,placement:"top"},{default:a(()=>[o(x,{type:"primary",onClick:k,loading:t(l).isAddingFiles,disabled:D.value,class:ge(["stage-button",`from-${h.from}`])},{default:a(()=>[X(i(t(e)("@29974:暂存更改"))+" ",1),f.value>0?(c(),g("span",ir,"("+i(f.value)+")",1)):W("",!0)]),_:1},8,["loading","disabled","class"])]),_:1},8,["content"])}}}),uo=De(rr,[["__scopeId","data-v-c1c77d2d"]]),cr={key:0},ur=Fe({__name:"CommitButton",props:{from:{default:"form"},hasUserCommitMessage:{type:Boolean,default:!1},finalCommitMessage:{default:""},skipHooks:{type:Boolean,default:!1}},emits:["click","beforeCommit","afterCommit"],setup(E,{emit:C}){const n=E,l=C,p=qe(),d=et();function m(h){const K=h.replace(/\\/g,"/");return d.lockedFiles.some(x=>{const Y=x.replace(/\\/g,"/");return K===Y})}const f=se(()=>p.fileList.filter(h=>h.type==="added"&&!m(h.path)).length),B=se(()=>f.value>0),D=se(()=>!B.value||!n.hasUserCommitMessage),L=se(()=>B.value?n.hasUserCommitMessage?`${e("@76A11:提交")}${f.value}${e("@76A11:个已暂存文件")}`:e("@76A11:请输入提交信息"):e("@76A11:没有已暂存的更改"));async function k(){if(n.finalCommitMessage.trim()){l("beforeCommit"),l("click");try{const h=await p.commitChanges(n.finalCommitMessage,n.skipHooks);h&&(p.fetchStatus(),p.fetchLog(),p.getBranchStatus(!0)),l("afterCommit",h)}catch(h){console.error("提交失败:",h),l("afterCommit",!1)}}}return(h,K)=>{const x=Je,Y=$e;return c(),q(Y,{content:L.value,placement:"top"},{default:a(()=>[o(x,{type:"primary",onClick:k,icon:t(ct),loading:t(p).isLoadingStatus,disabled:D.value,class:ge(["commit-button",`from-${h.from}`])},{default:a(()=>[X(i(t(e)("@76A11:提交"))+" ",1),f.value>0?(c(),g("span",cr,"("+i(f.value)+")",1)):W("",!0)]),_:1},8,["icon","loading","disabled","class"])]),_:1},8,["content"])}}}),fo=De(ur,[["__scopeId","data-v-754aa236"]]),dr={key:0},fr=Fe({__name:"PushButton",props:{from:{default:"form"}},emits:["click","beforePush","afterPush"],setup(E,{emit:C}){const n=C,l=qe(),p=u(!1),d=u(null),m=se(()=>l.branchAhead>0),f=se(()=>l.fileList.some(x=>x.type==="added")),B=se(()=>l.hasUpstream&&m.value&&!f.value),D=se(()=>!B.value),L=se(()=>l.hasUpstream?m.value?f.value?e("@F4137:有未提交的暂存更改,请先提交"):`${e("@F4137:推送")}${l.branchAhead}${e("@F4137:个本地提交")}`:e("@F4137:没有需要推送的提交"):e("@F4137:当前分支没有上游分支")),k=se(()=>B.value?{backgroundColor:"#67c23a",borderColor:"#67c23a"}:{});async function h(){n("beforePush"),n("click");try{p.value=!0,d.value&&d.value.reset();const x=await l.pushToRemoteWithProgress(Y=>{d.value&&d.value.handleProgress(Y)});x&&await new Promise(Y=>setTimeout(Y,200)),n("afterPush",x)}catch(x){console.error("推送失败:",x),n("afterPush",!1)}}function K(x){}return(x,Y)=>{const T=Je,P=$e;return c(),g("div",null,[o(P,{content:L.value,placement:"top"},{default:a(()=>[o(T,{type:"primary",icon:t(Jo),onClick:h,loading:t(l).isPushing,disabled:D.value,style:ut(k.value),class:ge(["push-button",`from-${x.from}`])},{default:a(()=>[X(i(t(e)("@F4137:推送"))+" ",1),m.value?(c(),g("span",dr,"("+i(t(l).branchAhead)+")",1)):W("",!0)]),_:1},8,["icon","loading","disabled","style","class"])]),_:1},8,["content"]),o(ro,{ref_key:"progressModalRef",ref:d,modelValue:p.value,"onUpdate:modelValue":Y[0]||(Y[0]=V=>p.value=V),onComplete:K},null,8,["modelValue"])])}}}),po=De(fr,[["__scopeId","data-v-a5bb0055"]]),pr={class:"form-bottom-actions"},mr={class:"actions-flex-container"},hr={class:"left-actions"},gr={class:"button-grid"},vr={class:"right-actions"},Cr=Fe({__name:"GitActionButtons",props:{hasUserCommitMessage:{type:Boolean,default:!1},finalCommitMessage:{default:""},skipHooks:{type:Boolean,default:!1},from:{default:"form"}},emits:["afterCommit","afterPush","beforePush","clearFields"],setup(E,{emit:C}){const n=C;function l(f){n("afterCommit",f)}function p(f){n("afterPush",f)}function d(){n("beforePush")}function m(){n("clearFields")}return(f,B)=>(c(),g("div",pr,[s("div",mr,[s("div",hr,[s("div",gr,[o(uo,{onClick:()=>{},from:f.from},null,8,["from"]),o(fo,{"has-user-commit-message":f.hasUserCommitMessage,"final-commit-message":f.finalCommitMessage,"skip-hooks":f.skipHooks,onBeforeCommit:()=>{},onAfterCommit:l,onClick:()=>{},from:f.from},null,8,["has-user-commit-message","final-commit-message","skip-hooks","from"]),o(po,{onBeforePush:()=>{},onAfterPush:p,onClick:()=>{},from:f.from},null,8,["from"])])]),s("div",vr,[o(co,{from:f.from,"has-user-commit-message":f.hasUserCommitMessage,"final-commit-message":f.finalCommitMessage,"skip-hooks":f.skipHooks,onBeforePush:d,onAfterPush:p,onClearFields:m},null,8,["from","has-user-commit-message","final-commit-message","skip-hooks"])])])]))}}),yr=De(Cr,[["__scopeId","data-v-5b78899b"]]),_r={class:"option-header"},Br={class:"option-info"},br={class:"option-title"},kr=Fe({__name:"OptionSwitchCard",props:{modelValue:{type:Boolean},title:{},tooltip:{},activeText:{},inactiveText:{},activeColor:{},iconClass:{},compact:{type:Boolean}},emits:["update:modelValue"],setup(E,{emit:C}){const n=E,l=C;function p(d){l("update:modelValue",d)}return(d,m)=>{const f=Fs,B=$e;return c(),g("div",{class:ge(["option-card",{compact:n.compact}])},[o(B,{content:d.tooltip,placement:"top","show-after":200},{default:a(()=>[s("div",_r,[s("div",{class:ge(["option-icon",d.iconClass])},[gt(d.$slots,"icon",{},void 0,!0)],2),s("div",Br,[s("h4",br,i(d.title),1)]),o(f,{class:"option-switch","model-value":d.modelValue,"onUpdate:modelValue":p,"active-text":d.activeText,"inactive-text":d.inactiveText,"active-color":d.activeColor,size:"small"},null,8,["model-value","active-text","inactive-text","active-color"])])]),_:3},8,["content"])],2)}}}),Et=De(kr,[["__scopeId","data-v-98a6acaa"]]),wr={class:"console-header"},$r={class:"header-left"},Fr={class:"console-title"},Sr={class:"header-actions"},Ar={class:"console-content"},Dr={class:"console-input-row"},Tr=["title"],Er={key:0,class:"console-output"},Lr={class:"cmd-header"},Gr={class:"cmd-line"},Pr={class:"cmd-text"},Vr={class:"ts"},xr={key:0,class:"output-content"},Rr={key:0,class:"stdout"},Ir={key:1,class:"stderr"},Mr=Fe({__name:"CommandConsole",setup(E){const C=u(""),n=u(""),l=u(!1),p=u([]);let d=0;const m=u(!1),f=u(!1);async function B(){const L=n.value.trim();if(!L||l.value)return;l.value=!0;const k={id:++d,command:L,success:!1,ts:new Date().toLocaleString(),expanded:!0,stdout:"",stderr:""};p.value.unshift(k);try{const K=await(await fetch("/api/exec",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:L})})).json();k.success=!!(K!=null&&K.success),k.stdout=(K==null?void 0:K.stdout)||"",k.stderr=(K==null?void 0:K.error)||(K==null?void 0:K.stderr)||""}catch(h){k.success=!1,k.stderr=(h==null?void 0:h.message)||String(h)}finally{l.value=!1,n.value=""}}function D(L){const k=p.value.findIndex(h=>h.id===L.id);k!==-1&&(p.value[k].expanded=!p.value[k].expanded)}return at(async()=>{try{const k=await(await fetch("/api/current_directory")).json();C.value=(k==null?void 0:k.directory)||""}catch{}}),(L,k)=>{const h=xe,K=Je,x=$e,Y=dt;return c(),g("div",{class:ge(["command-console",{fullscreen:f.value}])},[s("div",wr,[s("div",$r,[o(h,{class:"title-icon"},{default:a(()=>[o(t(Ss))]),_:1}),s("span",Fr,i(L.$t("@CF05E:自定义指令执行")),1)]),s("div",Sr,[o(x,{content:f.value?L.$t("@CF05E:退出全屏"):L.$t("@CF05E:全屏显示"),placement:"bottom"},{default:a(()=>[o(K,{text:"",onClick:k[0]||(k[0]=T=>f.value=!f.value),class:"toggle-console-btn"},{default:a(()=>[o(h,null,{default:a(()=>[o(t(to))]),_:1})]),_:1})]),_:1},8,["content"]),o(x,{content:m.value?L.$t("@CF05E:收起"):L.$t("@CF05E:展开"),placement:"bottom"},{default:a(()=>[o(K,{text:"",onClick:k[1]||(k[1]=T=>m.value=!m.value),class:"toggle-console-btn"},{default:a(()=>[o(h,{class:ge({"rotate-icon":!m.value})},{default:a(()=>[o(t(ot))]),_:1},8,["class"])]),_:1})]),_:1},8,["content"])])]),o(Gt,{name:"console-content-slide"},{default:a(()=>[Xe(s("div",Ar,[s("div",Dr,[s("span",{class:"prompt",title:L.$t("@CF05E:当前路径")},i(C.value)+" >",9,Tr),o(Y,{modelValue:n.value,"onUpdate:modelValue":k[2]||(k[2]=T=>n.value=T),class:"console-input",placeholder:"输入命令,例如: git status",onKeydown:Ds(wt(B,["prevent"]),["enter"]),disabled:l.value,clearable:""},null,8,["modelValue","onKeydown","disabled"]),o(K,{type:"primary",loading:l.value,onClick:B},{default:a(()=>[X(i(L.$t("@CF05E:执行")),1)]),_:1},8,["loading"])]),p.value.length?(c(),g("div",Er,[(c(!0),g(Be,null,Re(p.value,T=>(c(),g("div",{key:T.id,class:"console-record"},[s("div",Lr,[s("div",Gr,[k[3]||(k[3]=s("span",{class:"cmd-prefix"},">",-1)),s("span",Pr,i(T.command),1),s("span",Vr,i(T.ts),1)]),o(x,{content:T.stdout||T.stderr?T.expanded?L.$t("@CF05E:收起输出"):L.$t("@CF05E:展开输出"):L.$t("@CF05E:无输出内容"),placement:"left"},{default:a(()=>[o(K,{text:"",size:"small",onClick:P=>D(T),disabled:!T.stdout&&!T.stderr,class:"toggle-output-btn"},{default:a(()=>[o(h,{class:ge({"rotate-icon":!T.expanded})},{default:a(()=>[o(t(ot))]),_:2},1032,["class"])]),_:2},1032,["onClick","disabled"])]),_:2},1032,["content"])]),o(Gt,{name:"output-slide"},{default:a(()=>[T.expanded&&(T.stdout||T.stderr)?(c(),g("div",xr,[T.stdout?(c(),g("pre",Rr,i(T.stdout),1)):W("",!0),T.stderr?(c(),g("pre",Ir,i(T.stderr),1)):W("",!0)])):W("",!0)]),_:2},1024)]))),128))])):W("",!0)],512),[[xt,m.value]])]),_:1})],2)}}}),zr=De(Mr,[["__scopeId","data-v-7d31ab4a"]]),Or={class:"card-header app-card-header"},jr={class:"header-left"},Ur={key:0,class:"header-actions"},Nr={class:"card-content app-card-content"},Jr={class:"layout-container"},Hr={key:0,class:"git-config-warning"},Yr={key:1,class:"commit-section"},Wr={key:0,class:"commit-form"},qr={class:"description-container"},Kr={key:1,class:"standard-commit-form"},Qr={class:"standard-commit-header"},Zr={class:"type-scope-container"},Xr={class:"scope-wrapper"},ec={class:"description-container description-inline"},tc={class:"advanced-fields"},sc={class:"actions-section"},oc={class:"action-groups"},ac={class:"operations-wrapper"},nc={class:"action-group"},lc={class:"group-title"},ic={class:"group-buttons"},rc={key:0},cc={class:"action-group"},uc={class:"group-title"},dc={class:"group-buttons"},fc={class:"action-group reset-group"},pc={class:"group-title"},mc={class:"group-buttons"},hc={key:0},gc={class:"action-group branch-group"},vc={class:"group-title"},Cc={class:"group-buttons"},yc={class:"action-group"},_c={class:"group-title"},Bc={class:"group-buttons"},bc={class:"editor-header"},kc={class:"editor-info"},wc={class:"info-text"},$c={class:"editor-tips"},Fc={class:"json-editor-wrapper"},Sc={class:"editor-footer"},Ac={class:"footer-left"},Dc={class:"footer-right"},Tc={class:"config-warning-content"},Ec={class:"warning-message"},Lc={class:"dialog-footer"},Gc={class:"stash-dialog-content"},Pc={class:"stash-info-card"},Vc={class:"info-icon"},xc={class:"info-content"},Rc={class:"stash-options"},Ic={class:"options-title"},Mc={class:"option-item"},zc={class:"option-label"},Oc={class:"option-desc"},jc={class:"option-item"},Uc={class:"option-label"},Nc={key:0,class:"stash-preview"},Jc={class:"preview-title"},Hc={class:"file-count-info"},Yc={class:"merge-dialog-content"},Wc={class:"merge-intro"},qc={class:"merge-options"},Kc={class:"dialog-footer"},Qc={class:"stash-list-content"},Zc={key:0,class:"stash-header"},Xc={class:"stash-stats"},eu={class:"stat-item"},tu={class:"stat-number"},su={class:"stat-label"},ou={key:0,class:"stash-actions-header"},au={class:"stash-list-container"},nu={key:0,class:"empty-state"},lu={class:"empty-text"},iu={class:"empty-hint"},ru={key:1,class:"stash-cards"},cu={class:"stash-card-content"},uu={class:"stash-info"},du={class:"stash-main-info"},fu={class:"stash-id-badge"},pu={class:"stash-id-text"},mu={class:"stash-description"},hu={class:"description-text"},gu={class:"stash-card-actions"},vu={class:"stash-content"},Cu={key:0,class:"stash-info-row"},yu={class:"stash-id"},_u={class:"stash-id-value"},Bu={class:"stash-description"},bu={class:"info-label"},ku={class:"stash-description-value"},wu={class:"stash-main-content"},$u={key:0,class:"status-updating-indicator"},Fu={class:"commit-settings-content"},Su=Fe({__name:"CommitForm",setup(E,{expose:C}){const n=qe(),l=et(),p=u(""),{loadingState:d,show:m,hide:f,setText:B}=bi(),{successState:D,show:L}=ki(),k=u(!1),h=u("输入提交信息..."),K=u(""),x=u(!1),Y=u("feat"),T=u(""),P=u(""),V=u(""),N=u(""),oe=u(!1),me=u(""),Q=u(!1),S=u(!1),y=u(""),w=u([]),ee=u(!1),G=u(!1),M=u(""),re=u({noFf:!1,squash:!1,noCommit:!1,message:""}),$=u([]),O=u(!1),j=u(!1),U=u(!1),ne=u(!1),we=u(!1),Pe=se(()=>[{value:"feat",label:`feat: ${e("@76872:新功能")}`},{value:"fix",label:`fix: ${e("@76872:修复bug")}`},{value:"docs",label:`docs: ${e("@76872:文档修改")}`},{value:"style",label:`style: ${e("@76872:样式修改")}`},{value:"refactor",label:`refactor: ${e("@76872:代码重构")}`},{value:"test",label:`test: ${e("@76872:测试代码")}`},{value:"chore",label:`chore: ${e("@76872:构建/工具修改")}`}]),Le=u(!1),_e=u(!1),te=u(""),J=u(!0),he=u(!0),ce=u(!1),be=u(null),Ve=u([]),ke=u(""),A=u(!1),z=u("");function fe(){te.value="",J.value=!1,he.value=!je.value,Le.value=!0}async function le(){try{const b=await(await fetch("/api/config/check-file-format")).json();let ae="";b.success&&(b.exists?b.isValidJson||(ae=`${e("@76872:系统配置文件格式有误:")}${b.error}
|
|
17
|
+
编辑后保存可能会覆盖原文件内容。`):ae=e("@76872:系统配置文件不存在,将使用默认配置。"));const pe=l.config;if(me.value=JSON.stringify(pe,null,2),ae){y.value=ae,S.value=!0;return}oe.value=!0}catch{r.error(e("@76872:加载配置失败"))}}async function Ce(){try{Q.value=!0;let v;try{v=JSON.parse(me.value)}catch(pe){r.error(`${e("@76872:JSON 解析失败: ")}${pe.message||pe}`);return}const ae=await(await fetch("/api/config/saveAll",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:v})})).json();if(!ae.success)throw new Error(ae.error||e("@76872:保存失败"));await l.loadConfig(!0);try{await l.loadLockedFiles()}catch{}try{Array.isArray(l.descriptionTemplates)&&(w.value=[...l.descriptionTemplates])}catch{}try{Array.isArray(l.scopeTemplates)&&($.value=[...l.scopeTemplates])}catch{}try{Array.isArray(l.messageTemplates)&&(ye.value=[...l.messageTemplates])}catch{}r.success(e("@76872:配置已保存")),oe.value=!1}catch(v){r.error(`${e("@76872:保存配置失败: ")}${v.message||v}`)}finally{Q.value=!1}}async function Ae(){try{const v=await fetch("/api/config/open-file",{method:"POST"}),b=await v.json();if(!v.ok||!(b!=null&&b.success))throw new Error((b==null?void 0:b.error)||e("@76872:打开失败"));r.success(e("@76872:已用系统程序打开配置文件"))}catch(v){r.error(`${e("@76872:打开配置文件失败: ")}${(v==null?void 0:v.message)||v}`)}}function Se(v){S.value=!1,v==="continue"?oe.value=!0:v==="open"&&Ae()}function tt(){n.getStashList(),_e.value=!0}async function ue(){try{await n.saveStash(te.value,J.value,he.value),Le.value=!1}catch(v){console.error("储藏失败:",v)}}async function st(v,b=!1){try{await n.applyStash(v,b),b&&await n.getStashList()}catch(ae){console.error("应用储藏失败:",ae)}}async function Qe(v){We.confirm(e("@76872:确定要删除此储藏吗?此操作不可恢复。"),e("@76872:删除储藏"),{confirmButtonText:e("@76872:确定"),cancelButtonText:e("@76872:取消"),type:"warning"}).then(async()=>{await n.dropStash(v),await n.getStashList()}).catch(()=>{})}async function $t(){We.confirm(e("@76872:确定要清空所有储藏吗?此操作不可恢复。"),e("@76872:清空所有储藏"),{confirmButtonText:e("@76872:确定"),cancelButtonText:e("@76872:取消"),type:"warning"}).then(async()=>{await n.clearAllStashes(),await n.getStashList()}).catch(()=>{})}async function Ie(v){if(v){be.value=v,ce.value=!0,A.value=!0,Ve.value=[],ke.value="",z.value="";try{if(!v.id||v.id.length<7){ke.value=e("@76872:无效的stash ID"),A.value=!1;return}const ae=await(await fetch(`/api/stash-files?stashId=${encodeURIComponent(v.id)}`)).json();ae.success&&Array.isArray(ae.files)?(Ve.value=ae.files,Ve.value.length>0?await ft(v.id,Ve.value[0]):ke.value=e("@76872:该stash没有变更文件")):ke.value=`${e("@76872:获取文件列表失败: ")}${ae.error||e("@76872:未知错误")}`}catch(b){ke.value=`${e("@76872:获取stash详情失败: ")}${b.message}`}finally{A.value=!1}}}async function ft(v,b){A.value=!0,z.value=b;try{const pe=await(await fetch(`/api/stash-file-diff?stashId=${encodeURIComponent(v)}&file=${encodeURIComponent(b)}`)).json();pe.success?ke.value=pe.diff||e("@76872:没有变更内容"):ke.value=`${e("@76872:获取差异失败: ")}${pe.error||e("@76872:未知错误")}`}catch(ae){ke.value=`${e("@76872:获取差异失败: ")}${ae.message}`}finally{A.value=!1}}function H(v){be.value&&ft(be.value.id,v)}async function R(v,b){try{const pe=await(await fetch("/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:v,context:b})})).json();pe.success?r.success(pe.message):r.error(pe.error||e("@76872:打开文件失败"))}catch(ae){r.error(`${e("@76872:打开文件失败: ")}${ae.message}`)}}async function de(v,b){try{const pe=await(await fetch("/api/open-with-vscode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:v,context:b})})).json();pe.success?r.success(pe.message):r.error(pe.error||e("@76872:用VSCode打开文件失败"))}catch(ae){r.error(`${e("@76872:用VSCode打开文件失败: ")}${ae.message}`)}}const ye=u([]);Ge(x,v=>{localStorage.setItem("zen-gitsync-standard-commit",v.toString())}),Ge(U,v=>{localStorage.setItem("zen-gitsync-skip-hooks",v.toString())}),Ge(ne,v=>{localStorage.setItem("zen-gitsync-auto-quick-push",v.toString())});const Me=se(()=>{if(!x.value)return p.value||K.value;let v=`${Y.value||""}`;return T.value&&(v+=`(${T.value})`),v+=`: ${P.value}`,V.value&&(v+=`
|
|
18
|
+
|
|
19
|
+
${V.value}`),N.value&&(v+=`
|
|
20
|
+
|
|
21
|
+
${N.value}`),v}),Te=se(()=>x.value?Y.value.trim()!==""&&P.value.trim()!=="":p.value.trim()!==""),ve=se(()=>{const v=`${e("@76872:输入提交信息 (默认: ")}${K.value})`;return ne.value?`${v}${e("@76872:(按回车一键推送)")}`:v}),He=se(()=>{const v=e("@76872:简短描述(必填)");return ne.value?e("@76872:简短描述(必填,按回车一键推送)"):v}),nt=se(()=>Ve.value.map(v=>({path:v,name:v.split("/").pop()||v}))),pt=se(()=>{let v=`git commit -m "${Me.value}"`;return U.value&&(v+=" --no-verify"),v});function mt(){const v=l.config;v&&(h.value=`${e("@76872:输入提交信息 (默认: ")}${v.defaultCommitMessage})`,K.value=v.defaultCommitMessage||"",v.descriptionTemplates&&Array.isArray(v.descriptionTemplates)&&(w.value=v.descriptionTemplates),v.scopeTemplates&&Array.isArray(v.scopeTemplates)&&($.value=v.scopeTemplates),v.messageTemplates&&Array.isArray(v.messageTemplates)&&(ye.value=v.messageTemplates))}function ss(v){P.value=v,ee.value=!1}function os(v){T.value=v,O.value=!1}function as(){ee.value=!0}function ns(){O.value=!0}function It(){L({text:e("@76872:操作成功!"),description:e("@76872:已完成操作"),duration:2e3})}async function yt(){try{await n.gitPull(),await n.fetchStatus(),await n.fetchLog(!1)}catch(v){console.error("拉取操作发生错误:",v)}}async function ls(){try{await n.gitFetchAll(),await n.fetchStatus(),await n.fetchLog(!1)}catch(v){console.error("获取远程分支信息操作发生错误:",v)}}async function is(){if(!Me.value.trim()){r({message:"提交信息不能为空",type:"warning"});return}try{await n.addAndCommit(Me.value,U.value),lt(),n.fetchStatus(),n.fetchLog()}catch(v){r({message:`${e("@76872:暂存并提交失败: ")}${v.message}`,type:"error"})}}async function rs(){try{await We.confirm(`${e('@76872:确定要重置当前分支 "')}${n.currentBranch}${e('@76872:" 到远程状态吗?这将丢失所有未推送的提交和本地更改。')}`,e("@76872:重置到远程分支"),{confirmButtonText:e("@76872:确定"),cancelButtonText:e("@76872:取消"),type:"warning"}),await n.resetToRemote(n.currentBranch)&&(n.fetchStatus(),n.fetchLog())}catch(v){v!=="cancel"&&r({message:`${e("@76872:重置到远程分支失败: ")}${v.message}`,type:"error"})}}function lt(){p.value="",P.value="",V.value="",N.value="",l.autoSetDefaultMessage&&l.defaultCommitMessage&&(p.value=l.defaultCommitMessage)}function F(){m({text:e("@76872:正在暂存文件..."),showProgress:!1})}function _(v){if(f(),v){k.value=!0;try{setTimeout(async()=>{try{console.log(e("@76872:推送成功,状态已更新"))}catch(b){console.error("一键推送后处理失败:",b)}finally{k.value=!1}},1e3)}catch(b){console.error("一键推送后处理失败:",b),k.value=!1}}}function Z(v){const b=v.replace(/\\/g,"/");return l.lockedFiles.some(ae=>{const pe=ae.replace(/\\/g,"/");return b===pe})}const ie=se(()=>n.fileList.some(v=>["modified","deleted","untracked"].includes(v.type)&&!Z(v.path))),Ee=se(()=>n.fileList.filter(v=>v.type==="added"&&!Z(v.path)).length),Oe=se(()=>Ee.value>0),Ne=se(()=>n.fileList.length>0),je=se(()=>n.fileList.length>0&&n.fileList.every(v=>Z(v.path))),_t=se(()=>n.branchAhead>0),Mt=se(()=>n.branchBehind>0),zt=se(()=>Oe.value),Ot=se(()=>{const v=n.fileList.length>0;return n.hasUpstream&&(_t.value||Mt.value||v)});function it(v){p.value=v,j.value=!1}async function Ps(v){if(!(!ne.value||!Te.value||!n.fileList.some(ae=>!Z(ae.path))||!Te.value||!n.hasUpstream)&&v.key==="Enter"&&!v.shiftKey){v.preventDefault();try{F();const ae=await n.addCommitAndPush(Me.value,U.value);ae&<(),_(ae)}catch(ae){console.error("回车自动一键提交失败:",ae),_(!1)}}}async function ho(v){try{await l.saveDefaultMessage(v)&&r.success(e("@76872:默认提交信息设置成功"))}catch(b){r.error(`${e("@76872:设置默认提交信息失败: ")}${b.message}`)}}Ge(()=>n.isAddingFiles,v=>{v&&d.visible&&B(e("@76872:正在暂存文件..."))}),Ge(()=>n.isCommiting,v=>{v&&d.visible&&B(e("@76872:正在提交更改..."))}),Ge(()=>n.isPushing,v=>{v&&d.visible&&f()}),at(async()=>{const v=localStorage.getItem("zen-gitsync-standard-commit");v!==null&&(x.value=v==="true");const b=localStorage.getItem("zen-gitsync-skip-hooks");b!==null&&(U.value=b==="true");const ae=localStorage.getItem("zen-gitsync-auto-quick-push");ae!==null&&(ne.value=ae==="true"),Ge(()=>l.config,mt,{immediate:!0}),l.config||await l.loadConfig(),l.autoSetDefaultMessage&&l.defaultCommitMessage&&!p.value&&(p.value=l.defaultCommitMessage)});function go(){M.value="",re.value={noFf:!1,squash:!1,noCommit:!1,message:""},Bt.value="all",G.value=!0,n.allBranches.length===0&&n.getAllBranches()}const Bt=u("all"),vo=se(()=>{const v=n.allBranches.filter(b=>b!==n.currentBranch);if(console.log("筛选分支列表:",{allBranches:n.allBranches,currentBranch:n.currentBranch,branchTypeFilter:Bt.value,filteredBranches:v}),Bt.value==="local"){const b=v.filter(ae=>!ae.includes("origin/"));return console.log("本地分支:",b),b}else if(Bt.value==="remote"){const b=v.filter(ae=>ae.includes("origin/"));return console.log("远程分支:",b),b}else return console.log("所有分支:",v),v});async function Co(){if(!M.value){r({message:e("@76872:请选择要合并的分支"),type:"warning"});return}try{await n.mergeBranch(M.value,re.value)&&(G.value=!1,await n.fetchStatus(),await n.fetchLog(!1))}catch(v){console.error("合并分支操作发生错误:",v)}}const jt=u(!1),cs=u(!1);function yo(){jt.value=!jt.value}C({openConfigEditor:le,toggleGitOperationsDrawer:yo});function _o(v,b){const pe=[...v?w.value.filter(ze=>ze.toLowerCase().includes(v.toLowerCase())).map(ze=>({value:ze})):w.value.map(ze=>({value:ze})),{value:"⚙️ 管理模板...",isSettings:!0}];b(pe)}function Bo(v,b){const pe=[...v?$.value.filter(ze=>ze.toLowerCase().includes(v.toLowerCase())).map(ze=>({value:ze})):$.value.map(ze=>({value:ze})),{value:"⚙️ 管理模板...",isSettings:!0}];b(pe)}function bo(v){v.isSettings?(as(),P.value=""):P.value=v.value}function ko(v){v.isSettings?(ns(),T.value=""):T.value=v.value}function wo(v,b){const pe=[...v?ye.value.filter(ze=>ze.toLowerCase().includes(v.toLowerCase())).map(ze=>({value:ze})):ye.value.map(ze=>({value:ze})),{value:"⚙️ 管理模板...",isSettings:!0}];b(pe)}function $o(v){v.isSettings?(j.value=!0,p.value=""):p.value=v.value}return(v,b)=>{const ae=xe,pe=Je,ze=so,us=Ho,Vs=Pt,xs=Vt,Ft=dt,Ke=$e,Fo=Wo,Ut=Rt,Rs=$s,St=Xt,At=Ko,Is=Zt,ds=Zo,So=Qo,Ao=ht,Do=es;return c(),g(Be,null,[s("div",{class:ge(["card app-card",{"is-pushing":t(n).isPushing}])},[s("div",Or,[s("div",jr,[o(Et,{modelValue:x.value,"onUpdate:modelValue":b[0]||(b[0]=I=>x.value=I),title:t(e)("@76872:提交模式"),tooltip:t(e)("@76872:选择传统或标准化提交格式"),"active-text":t(e)("@76872:标准化"),"inactive-text":t(e)("@76872:普通"),"active-color":"#409eff"},{icon:a(()=>[o(ae,null,{default:a(()=>[o(t(rt))]),_:1})]),_:1},8,["modelValue","title","tooltip","active-text","inactive-text"]),t(n).userName!==""&&t(n).userEmail!==""?(c(),q(pe,{key:0,icon:t(Kt),onClick:b[1]||(b[1]=I=>cs.value=!0),class:"modern-btn btn-icon-24"},null,8,["icon"])):W("",!0)]),t(n).userName!==""&&t(n).userEmail!==""?(c(),g("div",Ur,[o(yr,{"has-user-commit-message":Te.value,"final-commit-message":Me.value,"skip-hooks":U.value,from:"form",onAfterCommit:b[2]||(b[2]=I=>{I&<()}),onAfterPush:_,onBeforePush:F,onClearFields:lt},null,8,["has-user-commit-message","final-commit-message","skip-hooks"])])):W("",!0)]),s("div",Nr,[s("div",Jr,[t(n).userName===""||t(n).userEmail===""?(c(),g("div",Hr,[o(ze,{title:t(e)("@76872:Git用户信息未配置"),type:"warning",closable:!1,"show-icon":""},{default:a(()=>[s("p",null,i(t(e)("@76872:您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:")),1),b[42]||(b[42]=s("pre",{class:"config-command"},`git config --global user.name "Your Name"
|
|
22
|
+
git config --global user.email "your.email@example.com"`,-1))]),_:1},8,["title"])])):(c(),g("div",Yr,[o(Ni,{command:pt.value,title:t(e)("@76872:提交命令预览:"),placeholder:'git commit -m "<提交信息>"'},null,8,["command","title"]),x.value?(c(),g("div",Kr,[s("div",Qr,[s("div",Zr,[o(xs,{modelValue:Y.value,"onUpdate:modelValue":b[4]||(b[4]=I=>Y.value=I),placeholder:t(e)("@76872:提交类型"),class:"type-select",clearable:""},{default:a(()=>[(c(!0),g(Be,null,Re(Pe.value,I=>(c(),q(Vs,{key:I.value,label:I.label,value:I.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"]),s("div",Xr,[o(us,{modelValue:T.value,"onUpdate:modelValue":b[5]||(b[5]=I=>T.value=I),"fetch-suggestions":Bo,placeholder:t(e)("@76872:作用域(可选)"),class:"scope-input",clearable:"",onSelect:ko},null,8,["modelValue","placeholder"])]),s("div",ec,[o(us,{modelValue:P.value,"onUpdate:modelValue":b[6]||(b[6]=I=>P.value=I),"fetch-suggestions":_o,placeholder:He.value,class:"description-input",clearable:"",onSelect:bo,onKeydown:Ps},null,8,["modelValue","placeholder"])])])]),s("div",{class:"advanced-options-toggle",onClick:b[7]||(b[7]=I=>we.value=!we.value)},[s("span",null,i(we.value?t(e)("@76872:收起"):t(e)("@76872:正文及页脚")),1),o(ae,{class:ge(["toggle-icon",{"is-active":we.value}])},{default:a(()=>[o(t(ot))]),_:1},8,["class"])]),Xe(s("div",tc,[o(Ft,{modelValue:V.value,"onUpdate:modelValue":b[8]||(b[8]=I=>V.value=I),type:"textarea",rows:4,placeholder:t(e)("@76872:正文(可选):详细描述本次提交的内容和原因"),class:"body-input",clearable:""},null,8,["modelValue","placeholder"]),o(Ft,{modelValue:N.value,"onUpdate:modelValue":b[9]||(b[9]=I=>N.value=I),placeholder:t(e)("@76872:页脚(可选):如 Closes #123"),class:"footer-input",clearable:""},null,8,["modelValue","placeholder"])],512),[[xt,we.value]])])):(c(),g("div",Wr,[s("div",qr,[o(us,{modelValue:p.value,"onUpdate:modelValue":b[3]||(b[3]=I=>p.value=I),"fetch-suggestions":wo,placeholder:ve.value,type:"textarea",rows:3,resize:"none",class:"commit-message-input",onSelect:$o,onKeydown:Ps},null,8,["modelValue","placeholder"])])])),o(zr)]))])])],2),o(Fo,{modelValue:jt.value,"onUpdate:modelValue":b[12]||(b[12]=I=>jt.value=I),title:t(e)("@76872:Git 操作"),direction:"rtl",size:"362px","with-header":!0,"show-close":!0,"destroy-on-close":!1,class:"git-operations-drawer"},{default:a(()=>[s("div",sc,[s("div",oc,[s("div",ac,[s("div",nc,[s("div",lc,i(t(e)("@76872:基础操作")),1),s("div",ic,[o(uo,{onClick:()=>{},from:"drawer"}),o(fo,{"has-user-commit-message":Te.value,"final-commit-message":Me.value,"skip-hooks":U.value,onBeforeCommit:()=>{},onAfterCommit:b[10]||(b[10]=I=>{I&<()}),onClick:()=>{},from:"drawer"},null,8,["has-user-commit-message","final-commit-message","skip-hooks"]),o(po,{onBeforePush:()=>{},onAfterPush:b[11]||(b[11]=I=>{I&&It()}),onClick:()=>{},from:"drawer"}),o(Ke,{content:Mt.value?`${t(e)("@76872:拉取")}${t(n).branchBehind}${t(e)("@76872:个远程提交")}`:"git pull",placement:"top"},{default:a(()=>[o(pe,{type:"primary",icon:t(bs),onClick:yt,loading:t(n).isGitPulling,disabled:!t(n).hasUpstream,class:"action-button",style:ut(t(n).hasUpstream?{color:"white",backgroundColor:"#1e90ff",borderColor:"#1e90ff"}:{})},{default:a(()=>[X(i(t(e)("@76872:拉取"))+" ",1),Mt.value?(c(),g("span",rc,"("+i(t(n).branchBehind)+")",1)):W("",!0)]),_:1},8,["icon","loading","disabled","style"])]),_:1},8,["content"]),o(Ke,{content:"git fetch --all",placement:"top"},{default:a(()=>[o(pe,{type:"info",icon:t(bt),onClick:ls,loading:t(n).isGitFetching,class:"action-button",style:{color:"white","background-color":"#1e90ff","border-color":"#1e90ff"}},{default:a(()=>[X(i(t(e)("@76872:获取所有远程分支")),1)]),_:1},8,["icon","loading"])]),_:1})])]),s("div",cc,[s("div",uc,i(t(e)("@76872:组合操作")),1),s("div",dc,[o(Ke,{content:"git add + git commit",placement:"top"},{default:a(()=>[o(pe,{type:"primary",icon:t(rt),onClick:is,loading:t(n).isAddingFiles||t(n).isCommiting,disabled:!ie.value||!Te.value,class:"action-button"},{default:a(()=>[X(i(t(e)("@76872:暂存并提交")),1)]),_:1},8,["icon","loading","disabled"])]),_:1}),o(co,{from:"drawer","has-user-commit-message":Te.value,"final-commit-message":Me.value,"skip-hooks":U.value,onBeforePush:F,onAfterPush:_,onClearFields:lt},null,8,["has-user-commit-message","final-commit-message","skip-hooks"])])])]),s("div",fc,[s("div",pc,i(t(e)("@76872:重置操作")),1),s("div",mc,[o(Ke,{content:zt.value?`${t(e)("@76872:撤销")}${Ee.value}${t(e)("@76872:个已暂存文件")}`:"git reset HEAD",placement:"top"},{default:a(()=>[o(pe,{type:"warning",icon:t(ws),onClick:t(n).resetHead,loading:t(n).isResetting,disabled:!zt.value,class:"action-button reset-button"},{default:a(()=>[X(i(t(e)("@76872:重置暂存区"))+" ",1),Ee.value>0?(c(),g("span",hc,"("+i(Ee.value)+")",1)):W("",!0)]),_:1},8,["icon","onClick","loading","disabled"])]),_:1},8,["content"]),o(Ke,{content:"git reset --hard origin/branch",placement:"top"},{default:a(()=>[o(pe,{type:"danger",icon:t(Nt),onClick:rs,loading:t(n).isResetting,disabled:!Ot.value,class:"action-button danger-button"},{default:a(()=>[X(i(t(e)("@76872:重置到远程")),1)]),_:1},8,["icon","loading","disabled"])]),_:1})])]),s("div",gc,[s("div",vc,i(t(e)("@76872:分支操作")),1),s("div",Cc,[o(Ke,{content:t(e)("@76872:合并其他分支到当前分支"),placement:"top"},{default:a(()=>[o(pe,{type:"primary",icon:t(Yo),onClick:go,loading:t(n).isGitMerging,class:"action-button merge-button"},{default:a(()=>[X(i(t(e)("@76872:合并分支")),1)]),_:1},8,["icon","loading"])]),_:1},8,["content"])])]),s("div",yc,[s("div",_c,i(t(e)("@76872:储藏操作")),1),s("div",Bc,[o(Ke,{content:t(e)("@76872:将工作区更改储藏起来"),placement:"top"},{default:a(()=>[o(pe,{type:"warning",onClick:fe,loading:t(n).isSavingStash,disabled:!Ne.value,class:"action-button"},{default:a(()=>[X(i(t(e)("@76872:储藏更改")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),o(Ke,{content:t(e)("@76872:查看和管理所有储藏记录"),placement:"top"},{default:a(()=>[o(pe,{type:"info",onClick:tt,class:"action-button"},{default:a(()=>[X(i(t(e)("@76872:储藏列表")),1)]),_:1})]),_:1},8,["content"])])])])])]),_:1},8,["modelValue","title"]),o(Ye,{modelValue:oe.value,"onUpdate:modelValue":b[15]||(b[15]=I=>oe.value=I),title:t(e)("@76872:编辑配置 JSON"),size:"large","height-mode":"fixed","custom-class":"config-editor-dialog","show-footer":!1},{default:a(()=>[s("div",bc,[s("div",kc,[o(ae,{class:"info-icon"},{default:a(()=>[o(t(rt))]),_:1}),s("span",wc,i(t(e)("@76872:编辑当前项目的配置文件")),1)]),s("div",$c,[o(Ut,{size:"small",type:"info"},{default:a(()=>[X(i(t(e)("@76872:支持JSON格式")),1)]),_:1})])]),s("div",Fc,[o(Ft,{modelValue:me.value,"onUpdate:modelValue":b[13]||(b[13]=I=>me.value=I),type:"textarea",spellcheck:"false",autocomplete:"off",placeholder:t(e)("@76872:在此编辑当前项目配置的 JSON..."),class:"json-editor"},null,8,["modelValue","placeholder"])]),s("div",Sc,[s("div",Ac,[o(pe,{icon:t(bt),onClick:Ae,class:"system-config-btn"},{default:a(()=>[X(i(t(e)("@76872:打开系统配置文件")),1)]),_:1},8,["icon"])]),s("div",Dc,[o(pe,{onClick:b[14]||(b[14]=I=>oe.value=!1)},{default:a(()=>[X(i(t(e)("@76872:取消")),1)]),_:1}),o(pe,{type:"primary",loading:Q.value,icon:t(ct),onClick:Ce,class:"save-btn"},{default:a(()=>[X(i(t(e)("@76872:保存配置")),1)]),_:1},8,["loading","icon"])])])]),_:1},8,["modelValue","title"]),o(Rs,{modelValue:S.value,"onUpdate:modelValue":b[19]||(b[19]=I=>S.value=I),title:t(e)("@76872:配置文件格式提示"),width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1},{footer:a(()=>[s("span",Lc,[o(pe,{onClick:b[16]||(b[16]=I=>Se("cancel"))},{default:a(()=>[X(i(t(e)("@76872:取消")),1)]),_:1}),o(pe,{type:"info",onClick:b[17]||(b[17]=I=>Se("open"))},{default:a(()=>[X(i(t(e)("@76872:打开系统配置文件")),1)]),_:1}),o(pe,{type:"primary",onClick:b[18]||(b[18]=I=>Se("continue"))},{default:a(()=>[X(i(t(e)("@76872:继续编辑")),1)]),_:1})])]),default:a(()=>[s("div",Tc,[o(ae,{class:"warning-icon",color:"#f56c6c",size:"24"},{default:a(()=>[o(t(zs))]),_:1}),s("p",Ec,i(y.value),1)])]),_:1},8,["modelValue","title"]),o(Cs,{visible:ee.value,"onUpdate:visible":b[20]||(b[20]=I=>ee.value=I),type:"description",title:t(e)("@76872:简短描述模板设置"),placeholder:t(e)("@76872:输入新模板内容"),"edit-placeholder":t(e)("@76872:编辑模板内容"),"empty-description":t(e)("@76872:暂无保存的模板"),onUseTemplate:ss},null,8,["visible","title","placeholder","edit-placeholder","empty-description"]),o(Cs,{visible:O.value,"onUpdate:visible":b[21]||(b[21]=I=>O.value=I),type:"scope",title:t(e)("@76872:作用域模板设置"),placeholder:t(e)("@76872:输入新作用域模板"),"edit-placeholder":t(e)("@76872:编辑作用域模板内容"),"empty-description":t(e)("@76872:暂无保存的作用域"),onUseTemplate:os},null,8,["visible","title","placeholder","edit-placeholder","empty-description"]),o(Cs,{visible:j.value,"onUpdate:visible":b[22]||(b[22]=I=>j.value=I),type:"message",title:t(e)("@76872:默认提交信息设置"),placeholder:t(e)("@76872:输入新模板内容"),"edit-placeholder":t(e)("@76872:编辑模板内容"),"empty-description":t(e)("@76872:暂无保存的模板"),"show-default-section":!0,"show-help-text":!0,onUseTemplate:it,onSetDefault:ho},null,8,["visible","title","placeholder","edit-placeholder","empty-description"]),o(Ye,{modelValue:Le.value,"onUpdate:modelValue":b[26]||(b[26]=I=>Le.value=I),title:t(e)("@76872:储藏更改 (Git Stash)"),size:"medium","close-on-click-modal":!1,"show-footer":"","confirm-text":t(e)("@76872:储藏"),"cancel-text":t(e)("@76872:取消"),"confirm-loading":t(n).isSavingStash,"custom-class":"stash-dialog",onConfirm:ue},{default:a(()=>[s("div",Gc,[s("div",Pc,[s("div",Vc,[o(ae,null,{default:a(()=>[o(t(qo))]),_:1})]),s("div",xc,[s("h4",null,i(t(e)("@76872:储藏工作区更改")),1),s("p",null,i(t(e)("@76872:将当前工作区的更改临时保存,稍后可以重新应用到任何分支")),1)])]),o(Is,{"label-position":"top",class:"stash-form"},{default:a(()=>[o(St,{label:t(e)("@76872:储藏说明")},{default:a(()=>[o(Ft,{modelValue:te.value,"onUpdate:modelValue":b[23]||(b[23]=I=>te.value=I),placeholder:t(e)("@76872:为这次储藏添加描述信息(可选)"),clearable:"",rows:2,type:"textarea",resize:"none",maxlength:"200","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s("div",Rc,[s("h5",Ic,[o(ae,null,{default:a(()=>[o(t(Kt))]),_:1}),X(" "+i(t(e)("@76872:储藏选项")),1)]),s("div",Mc,[o(At,{modelValue:J.value,"onUpdate:modelValue":b[24]||(b[24]=I=>J.value=I),size:"large"},{default:a(()=>[s("span",zc,i(t(e)("@76872:包含未跟踪文件")),1)]),_:1},8,["modelValue"]),s("p",Oc,i(t(e)("@76872:同时储藏新建但未添加到Git的文件 (--include-untracked)")),1)]),s("div",jc,[o(At,{modelValue:he.value,"onUpdate:modelValue":b[25]||(b[25]=I=>he.value=I),disabled:je.value,size:"large"},{default:a(()=>[s("span",Uc,i(t(e)("@76872:排除锁定文件")),1)]),_:1},8,["modelValue","disabled"]),s("p",{class:ge(["option-desc",{disabled:je.value}])},i(t(e)("@76872:不储藏被锁定的文件,保持其当前状态")),3)])]),t(n).status.staged.length>0||t(n).status.unstaged.length>0?(c(),g("div",Nc,[s("h5",Jc,[o(ae,null,{default:a(()=>[o(t(Ss))]),_:1}),X(" "+i(t(e)("@76872:将要储藏的文件")),1)]),s("div",Hc,[t(n).status.staged.length>0?(c(),q(Ut,{key:0,type:"success"},{default:a(()=>[X(i(t(e)("@76872:已暂存: "))+i(t(n).status.staged.length)+" "+i(t(e)("@76872:个文件")),1)]),_:1})):W("",!0),t(n).status.unstaged.length>0?(c(),q(Ut,{key:1,type:"warning"},{default:a(()=>[X(i(t(e)("@76872:未暂存: "))+i(t(n).status.unstaged.length)+" "+i(t(e)("@76872:个文件")),1)]),_:1})):W("",!0)])])):W("",!0)]),_:1})])]),_:1},8,["modelValue","title","confirm-text","cancel-text","confirm-loading"]),o(Rs,{title:t(e)("@76872:合并分支"),modelValue:G.value,"onUpdate:modelValue":b[34]||(b[34]=I=>G.value=I),width:"500px","close-on-click-modal":!1,class:"merge-dialog"},{footer:a(()=>[s("div",Kc,[o(pe,{onClick:b[33]||(b[33]=I=>G.value=!1)},{default:a(()=>[X(i(t(e)("@76872:取消")),1)]),_:1}),o(pe,{type:"primary",onClick:Co,loading:t(n).isGitMerging,disabled:!M.value,class:"merge-confirm-btn"},{default:a(()=>[X(i(t(e)("@76872:合并")),1)]),_:1},8,["loading","disabled"])])]),default:a(()=>[s("div",Yc,[s("p",Wc,i(t(e)("@76872:选择要合并到当前分支 ("))+i(t(n).currentBranch)+i(t(e)("@76872:) 的分支:")),1),o(Is,{"label-position":"top"},{default:a(()=>[o(St,{label:t(e)("@76872:分支类型")},{default:a(()=>[o(So,{modelValue:Bt.value,"onUpdate:modelValue":b[27]||(b[27]=I=>Bt.value=I),size:"small"},{default:a(()=>[o(ds,{label:"all"},{default:a(()=>[X(i(t(e)("@76872:所有分支")),1)]),_:1}),o(ds,{label:"local"},{default:a(()=>[X(i(t(e)("@76872:本地分支")),1)]),_:1}),o(ds,{label:"remote"},{default:a(()=>[X(i(t(e)("@76872:远程分支")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),o(St,{label:t(e)("@76872:选择分支")},{default:a(()=>[o(xs,{modelValue:M.value,"onUpdate:modelValue":b[28]||(b[28]=I=>M.value=I),placeholder:t(e)("@76872:选择要合并的分支"),style:{width:"100%"},filterable:""},{default:a(()=>[(c(!0),g(Be,null,Re(vo.value,I=>(c(),q(Vs,{key:I,label:I,value:I},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(St,{label:t(e)("@76872:合并选项")},{default:a(()=>[s("div",qc,[o(At,{modelValue:re.value.noFf,"onUpdate:modelValue":b[29]||(b[29]=I=>re.value.noFf=I)},{default:a(()=>[o(Ke,{content:t(e)("@76872:创建合并提交,即使可以使用快进合并"),placement:"top"},{default:a(()=>[s("span",null,i(t(e)("@76872:禁用快进合并 (--no-ff)")),1)]),_:1},8,["content"])]),_:1},8,["modelValue"]),o(At,{modelValue:re.value.squash,"onUpdate:modelValue":b[30]||(b[30]=I=>re.value.squash=I)},{default:a(()=>[o(Ke,{content:t(e)("@76872:将多个提交压缩为一个提交"),placement:"top"},{default:a(()=>[s("span",null,i(t(e)("@76872:压缩提交 (--squash)")),1)]),_:1},8,["content"])]),_:1},8,["modelValue"]),o(At,{modelValue:re.value.noCommit,"onUpdate:modelValue":b[31]||(b[31]=I=>re.value.noCommit=I)},{default:a(()=>[o(Ke,{content:t(e)("@76872:执行合并但不自动创建提交"),placement:"top"},{default:a(()=>[s("span",null,i(t(e)("@76872:不自动提交 (--no-commit)")),1)]),_:1},8,["content"])]),_:1},8,["modelValue"])])]),_:1},8,["label"]),re.value.noFf&&!re.value.noCommit?(c(),q(St,{key:0,label:t(e)("@76872:合并提交信息 (可选)")},{default:a(()=>[o(Ft,{modelValue:re.value.message,"onUpdate:modelValue":b[32]||(b[32]=I=>re.value.message=I),type:"textarea",rows:3,placeholder:t(e)("@76872:输入自定义合并提交信息")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):W("",!0)]),_:1})])]),_:1},8,["title","modelValue"]),o(Ye,{modelValue:_e.value,"onUpdate:modelValue":b[35]||(b[35]=I=>_e.value=I),title:t(e)("@76872:储藏列表 (Git Stash)"),size:"large","show-footer":!1,"custom-class":"stash-list-dialog"},{default:a(()=>[s("div",Qc,[t(n).isLoadingStashes?W("",!0):(c(),g("div",Zc,[s("div",Xc,[s("div",eu,[o(ae,{class:"stat-icon"},{default:a(()=>[o(t(bt))]),_:1}),s("span",tu,i(t(n).stashes.length),1),s("span",su,i(t(e)("@76872:个储藏")),1)])]),t(n).stashes.length>0?(c(),g("div",ou,[o(pe,{type:"danger",size:"small",icon:t(Nt),onClick:$t,loading:t(n).isDroppingStash,class:"clear-all-btn"},{default:a(()=>[X(i(t(e)("@76872:清空所有储藏")),1)]),_:1},8,["icon","loading"])])):W("",!0)])),Xe((c(),g("div",au,[t(n).stashes.length===0&&!t(n).isLoadingStashes?(c(),g("div",nu,[o(Ao,{description:t(e)("@76872:暂无储藏记录"),"image-size":120},{image:a(()=>[o(ae,{class:"empty-icon"},{default:a(()=>[o(t(bt))]),_:1})]),description:a(()=>[s("p",lu,i(t(e)("@76872:还没有任何储藏记录")),1),s("p",iu,i(t(e)("@76872:使用 git stash 可以临时保存工作进度")),1)]),_:1},8,["description"])])):(c(),g("div",ru,[(c(!0),g(Be,null,Re(t(n).stashes,(I,Ms)=>(c(),g("div",{key:I.id,class:ge(["stash-card",{"stash-card-latest":Ms===0}])},[s("div",cu,[s("div",uu,[s("div",du,[s("div",fu,[o(ae,{class:"badge-icon"},{default:a(()=>[o(t(bt))]),_:1}),s("span",pu,i(I.id),1),Ms===0?(c(),q(Ut,{key:0,size:"small",type:"success",class:"latest-tag"},{default:a(()=>[X(i(t(e)("@76872:最新")),1)]),_:1})):W("",!0)]),s("div",mu,[s("span",hu,i(I.description),1)])])]),s("div",gu,[o(pe,{size:"small",type:"info",icon:t(rt),onClick:fs=>Ie(I),loading:A.value,class:"action-btn view-btn"},{default:a(()=>[X(i(t(e)("@76872:查看")),1)]),_:2},1032,["icon","onClick","loading"]),o(pe,{size:"small",type:"success",icon:t(bs),onClick:fs=>st(I.id,!1),loading:t(n).isApplyingStash,class:"action-btn apply-btn"},{default:a(()=>[X(i(t(e)("@76872:应用")),1)]),_:2},1032,["icon","onClick","loading"]),o(pe,{size:"small",type:"primary",icon:t(ct),onClick:fs=>st(I.id,!0),loading:t(n).isApplyingStash,class:"action-btn apply-pop-btn"},{default:a(()=>[X(i(t(e)("@76872:应用并删除")),1)]),_:2},1032,["icon","onClick","loading"]),o(pe,{size:"small",type:"danger",icon:t(Nt),onClick:fs=>Qe(I.id),loading:t(n).isDroppingStash,class:"action-btn delete-btn"},{default:a(()=>[X(i(t(e)("@76872:删除")),1)]),_:2},1032,["icon","onClick","loading"])])])],2))),128))]))])),[[Do,t(n).isLoadingStashes]])])]),_:1},8,["modelValue","title"]),o(Ye,{modelValue:ce.value,"onUpdate:modelValue":b[36]||(b[36]=I=>ce.value=I),title:t(e)("@76872:储藏详情"),"custom-class":"stash-detail-dialog",size:"extra-large",type:"flex",heightMode:"fixed","close-on-click-modal":!1},{default:a(()=>[s("div",vu,[be.value?(c(),g("div",Cu,[s("div",yu,[b[43]||(b[43]=s("span",{class:"info-label"},"Stash ID:",-1)),s("code",_u,i(be.value.id),1)]),s("div",Bu,[s("span",bu,i(t(e)("@76872:描述:")),1),s("span",ku,i(be.value.description),1)])])):W("",!0),s("div",wu,[o(Ls,{files:nt.value,diffContent:ke.value,selectedFile:z.value,context:"stash-detail",emptyText:t(e)("@76872:该stash没有变更文件"),onFileSelect:H,onOpenFile:R,onOpenWithVscode:de},null,8,["files","diffContent","selectedFile","emptyText"])])])]),_:1},8,["modelValue","title"]),o(Gt,{name:"el-fade-in-linear"},{default:a(()=>[k.value?(c(),g("div",$u,[o(ae,{class:"is-loading"},{default:a(()=>[o(t(Ct))]),_:1}),s("span",null,i(t(e)("@76872:更新状态中...")),1)])):W("",!0)]),_:1}),o(gi,{visible:t(d).visible,text:t(d).text,"show-progress":t(d).showProgress,progress:t(d).progress},null,8,["visible","text","show-progress","progress"]),o(Bi,{visible:t(D).visible,text:t(D).text,description:t(D).description},null,8,["visible","text","description"]),o(Ye,{modelValue:cs.value,"onUpdate:modelValue":b[41]||(b[41]=I=>cs.value=I),title:t(e)("@76872:提交设置"),size:"medium","show-footer":!1,"custom-class":"commit-settings-dialog"},{default:a(()=>[s("div",Fu,[o(Et,{modelValue:U.value,"onUpdate:modelValue":b[37]||(b[37]=I=>U.value=I),title:t(e)("@76872:跳过钩子检查"),tooltip:t(e)("@76872:添加 --no-verify 参数"),"active-color":"#f56c6c","icon-class":"warning"},{icon:a(()=>[o(ae,null,{default:a(()=>[o(t(zs))]),_:1})]),_:1},8,["modelValue","title","tooltip"]),o(Et,{modelValue:ne.value,"onUpdate:modelValue":b[38]||(b[38]=I=>ne.value=I),title:t(e)("@76872:回车自动提交"),tooltip:t(e)("@76872:输入提交信息后按回车直接执行一键推送"),"active-color":"#67c23a","icon-class":"success"},{icon:a(()=>[o(ae,null,{default:a(()=>[o(t(ct))]),_:1})]),_:1},8,["modelValue","title","tooltip"]),o(Et,{modelValue:t(l).autoClosePushModal,"onUpdate:modelValue":b[39]||(b[39]=I=>t(l).autoClosePushModal=I),title:t(e)("@76872:Push完成自动关闭"),tooltip:t(e)("@76872:推送成功后自动关闭进度弹窗"),"active-color":"#409eff","icon-class":"info"},{icon:a(()=>[o(ae,null,{default:a(()=>[o(t(ct))]),_:1})]),_:1},8,["modelValue","title","tooltip"]),o(Et,{modelValue:t(l).autoSetDefaultMessage,"onUpdate:modelValue":b[40]||(b[40]=I=>t(l).autoSetDefaultMessage=I),title:t(e)("@76872:自动填充默认提交信息"),tooltip:t(e)("@76872:打开页面或提交完成后自动填充默认提交信息"),"active-color":"#67c23a","icon-class":"success"},{icon:a(()=>[o(ae,null,{default:a(()=>[o(t(rt))]),_:1})]),_:1},8,["modelValue","title","tooltip"])])]),_:1},8,["modelValue","title"])],64)}}}),Au=De(Su,[["__scopeId","data-v-b73cdd4f"]]),Du={class:"log-header"},Tu={class:"header-left"},Eu={class:"log-actions"},Lu={key:0,class:"filter-panel-header"},Gu={class:"filter-form"},Pu={class:"filter-item"},Vu={class:"compact-label"},xu={class:"filter-item"},Ru={class:"compact-label"},Iu={class:"filter-item"},Mu={class:"compact-label"},zu={class:"filter-item"},Ou={class:"compact-label"},ju={class:"filter-actions"},Uu={key:0},Nu={key:1,class:"content-area-content"},Ju={class:"table-view-container"},Hu={class:"commit-message-cell"},Yu={class:"message-content"},Wu={key:0,class:"branch-container"},qu={class:"message-text"},Ku={class:"author-name"},Qu={class:"commit-detail-container"},Zu={key:0,class:"commit-info"},Xu={class:"commit-info-row"},ed={class:"info-item date-item"},td={class:"info-label"},sd={class:"info-value"},od={class:"info-item message-item"},ad={class:"info-label"},nd=["innerHTML"],ld=Fe({__name:"LogList",setup(E,{expose:C}){const n=qe();let l=[];const p=u(l),d=u(""),m=u(!1),f=se(()=>n.isLoadingLog||m.value),B=u(!1),D=u(!1),L=u(null),k=u(!1),h=u(null),K=u([]),x=u(""),Y=u(!1),T=u(""),P=u(!1),V=u([]),N=u(""),oe=u(null),me=u([]),Q=u([]),S=u([]),y=u(!1),w=u(0),ee=u(0),G=u(null),M=u(null),re=se(()=>p.value),$=se(()=>K.value.map(H=>({path:H,name:H.split("/").pop()||H})));async function O(H=!1,R=1){const de=qe();if(!de.isGitRepo){d.value="当前目录不是Git仓库";return}try{R>1?D.value=!0:m.value=!0;const ye=new URLSearchParams;ye.append("page",R.toString()),ye.append("all",H.toString()),ye.append("with_parents","true"),V.value.length>0&&ye.append("author",V.value.join(",")),Q.value.length>0&&ye.append("branch",Q.value.join(",")),N.value&&ye.append("message",N.value),oe.value&&Array.isArray(oe.value)&&oe.value.length===2&&(ye.append("dateFrom",oe.value[0]),ye.append("dateTo",oe.value[1])),ye.append("_t",Date.now().toString());const Te=await(await fetch(`/api/log?${ye.toString()}`)).json();if(!Te||!Te.data||!Array.isArray(Te.data)){d.value="加载提交历史失败: 服务器返回数据格式不正确";return}const ve=R>1;ve?Te.data.forEach(He=>l.push(He)):(l.length=0,Te.data.forEach(He=>l.push(He))),p.value=[...l],de.currentPage=R,de.totalCommits=Te.total||l.length,de.hasMoreData=Te.hasMore===!0,!ve&&!H&&Dt(()=>{Le(),setTimeout($t,200)}),d.value=""}catch(ye){d.value="加载提交历史失败: "+(ye instanceof Error?ye.message:String(ye)),R>1&&(de.hasMoreData=!1)}finally{R>1?D.value=!1:m.value=!1}}function j(H){return H.includes("HEAD -> ")?H.replace("HEAD -> ",""):H.includes("origin/")?H:H.trim()}function U(H){return H.includes("HEAD")?"success":H.includes("origin/")?"warning":"info"}const ne=u(null),we=u(null);function Pe(H){if(!n.hasMoreData||D.value||f.value)return;const R=H.target,{scrollTop:de,scrollHeight:ye,clientHeight:Me}=R;ye-de-Me<=20&&z()}function Le(){if(!ne.value)return;const H=ne.value.$el.querySelector(".el-table__body-wrapper");H&&(we.value=H,we.value&&(we.value.removeEventListener("scroll",Pe,!0),we.value.addEventListener("scroll",Pe,!0)))}function _e(){we.value&&(we.value.removeEventListener("scroll",Pe,!0),we.value=null)}function te(H){H.key==="Escape"&&Ie.value&&(Ie.value=!1)}at(()=>{n.isGitRepo?(n.log.length>0?(l.length=0,n.log.forEach(H=>l.push(H)),n.totalCommits=n.log.length):O(),Ce()):d.value="当前目录不是Git仓库",Dt(()=>{setTimeout(()=>{Le()},500)}),Ge(()=>ne.value,H=>{H&&!B.value&&Dt(()=>{Le()})}),window.addEventListener("keydown",te)}),Ge(()=>n.allBranches,H=>{H&&H.length>0?S.value=[...H].sort():S.value=[]},{immediate:!0}),Xo(()=>{_e(),L.value!==null&&(window.clearInterval(L.value),L.value=null),window.removeEventListener("keydown",te)});async function J(){n.currentPage=1,n.hasMoreData=!0,await O(B.value,1),Dt(()=>{if(ne.value){const H=ne.value.$el.querySelector(".el-scrollbar__wrap");H&&(H.scrollTop=0)}})}Ge(()=>n.log,H=>{try{l.length=0,Array.isArray(H)&&H.forEach(R=>R&&l.push(R)),n.totalCommits=l.length,n.currentPage=1,n.hasMoreData=!1,p.value=[...l]}catch{}},{immediate:!0}),C({refreshLog:J});async function he(H){if(H){h.value=H,k.value=!0,Y.value=!0,K.value=[],x.value="",T.value="";try{if(!H.hash||H.hash.length<7){x.value="无效的提交哈希值",Y.value=!1;return}const de=await(await fetch(`/api/commit-files?hash=${H.hash}`)).json();de.success&&Array.isArray(de.files)?(K.value=de.files,K.value.length>0?await ce(H.hash,K.value[0]):x.value="该提交没有变更文件"):x.value=`${e("@A1833:获取文件列表失败: ")}${de.error||"未知错误"}`}catch(R){x.value=`${e("@A1833:获取提交详情失败: ")}${R.message}`}finally{Y.value=!1}}}async function ce(H,R){Y.value=!0,T.value=R;try{const ye=await(await fetch(`/api/commit-file-diff?hash=${H}&file=${encodeURIComponent(R)}`)).json();ye.success?x.value=ye.diff||"没有变更内容":x.value=`${e("@A1833:获取差异失败: ")}${ye.error||"未知错误"}`}catch(de){x.value=`${e("@A1833:获取差异失败: ")}${de.message}`}finally{Y.value=!1}}function be(H){h.value&&ce(h.value.hash,H)}async function Ve(H,R){try{const ye=await(await fetch("/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:H,context:R})})).json();ye.success?r.success(ye.message):r.error(ye.error||e("@A1833:打开文件失败"))}catch(de){r.error(`${e("@A1833:打开文件失败: ")}${de.message}`)}}async function ke(H,R){try{const ye=await(await fetch("/api/open-with-vscode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:H,context:R})})).json();ye.success?r.success(ye.message):r.error(ye.error||e("@A1833:用VSCode打开文件失败"))}catch(de){r.error(`${e("@A1833:用VSCode打开文件失败: ")}${de.message}`)}}async function A(H){try{const R=wa(H);await navigator.clipboard.writeText(R),r.success(e("@A1833:提交信息已复制到剪贴板"))}catch{r.error(e("@A1833:复制失败"))}}function z(){!n.hasMoreData||D.value||f.value||O(B.value,n.currentPage+1)}function fe(){V.value=[],Q.value=[],N.value="",oe.value=null,n.currentPage=1,O(B.value,1)}function le(){n.currentPage=1,O(B.value,1)}async function Ce(){try{const R=await(await fetch("/api/authors")).json();R.success&&Array.isArray(R.authors)?me.value=R.authors.sort():Ae()}catch{Ae()}}function Ae(){const H=new Set;p.value.forEach(R=>{R.author&&H.add(R.author)}),me.value=Array.from(H).sort()}Ge(()=>p.value,()=>{},{deep:!0});function Se(H,R,de){de.preventDefault(),w.value=de.clientY,ee.value=de.clientX,G.value=H,y.value=!0,Dt(()=>{const Me=M.value;if(Me){const Te=Me.getBoundingClientRect(),ve=window.innerWidth,He=window.innerHeight,nt=8;let pt=de.clientX,mt=de.clientY;pt+Te.width>ve&&(pt=Math.max(nt,de.clientX-Te.width)),mt+Te.height>He&&(mt=Math.max(nt,de.clientY-Te.height)),ee.value=pt,w.value=mt}});const ye=()=>{y.value=!1,document.removeEventListener("click",ye)};setTimeout(()=>{document.addEventListener("click",ye)},0)}async function tt(H){if(H)try{await We.confirm(`${e("@A1833:确定要撤销提交 ")}${H.hash.substring(0,7)}${e("@A1833: 吗?这将创建一个新的提交来撤销这次提交的更改。")}`,"撤销提交确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const de=await(await fetch("/api/revert-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:H.hash})})).json();de.success?(r.success(de.message||"已成功撤销提交"),J(),n.fetchStatus(),n.getBranchStatus()):r.error(de.error||"撤销提交失败")}catch(R){R!=="cancel"&&r.error("撤销提交失败: "+(R.message||R))}}async function ue(H){if(H)try{await We.confirm(`${e("@A1833:确定要将提交 ")}${H.hash.substring(0,7)}${e("@A1833: Cherry-Pick 到当前分支吗?")}`,"Cherry-Pick确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const de=await(await fetch("/api/cherry-pick-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:H.hash})})).json();de.success?(r.success(de.message||"已成功Cherry-Pick提交"),J(),n.fetchStatus(),n.getBranchStatus()):r.error(de.error||"Cherry-Pick提交失败")}catch(R){R!=="cancel"&&r.error("Cherry-Pick提交失败: "+(R.message||R))}}async function st(H){if(H)try{await navigator.clipboard.writeText(H.hash),r.success(`${e("@A1833:已复制提交哈希: ")}${H.hash.substring(0,7)}`)}catch(R){r.error(`${e("@A1833:复制提交哈希失败: ")}${R.message}`)}}async function Qe(H){if(H)try{await We.confirm(`${e("@A1833:确定要将当前分支重置(hard)到提交 ")}${H.hash.substring(0,7)} 吗?
|
|
23
|
+
|
|
24
|
+
警告:这将丢失该提交之后的所有更改!`,"重置确认",{confirmButtonText:"确认重置",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0});const de=await(await fetch("/api/reset-to-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:H.hash})})).json();de.success?(r.success(de.message||"已成功重置到指定提交"),J(),n.fetchStatus(),n.getBranchStatus()):r.error(de.error||"重置到指定提交失败")}catch(R){R!=="cancel"&&r.error("重置到指定提交失败: "+(R.message||R))}}function $t(){if(!n.hasMoreData||D.value||f.value||B.value)return;if(!we.value){Le();return}const{scrollTop:H,scrollHeight:R,clientHeight:de}=we.value;R-H-de<=50&&z()}const Ie=u(!1);function ft(){Ie.value=!Ie.value}return(H,R)=>{var Te;const de=xe,ye=$e,Me=es;return c(),g(Be,null,[s("div",{class:ge(["card",{"fullscreen-mode":Ie.value}])},[s("div",Du,[s("div",Tu,[s("h2",null,i(t(e)("@A1833:提交历史")),1)]),s("div",Eu,[s("button",{onClick:R[0]||(R[0]=ve=>P.value=!P.value),class:ge(["modern-btn btn-icon-32 action-button filter-button",{"active-filter":P.value}])},[o(de,{class:"btn-icon"},{default:a(()=>[o(t(ea))]),_:1})],2),s("button",{onClick:ft,class:ge(["modern-btn btn-icon-32 action-button fullscreen-button",{"active-fullscreen":Ie.value}])},[o(de,{class:"btn-icon"},{default:a(()=>[(c(),q(_s(Ie.value?t(Qt):t(to))))]),_:1})],2),s("button",{onClick:R[1]||(R[1]=ve=>J()),class:"modern-btn btn-icon-32 action-button refresh-button"},[o(t(ws))])])]),P.value?(c(),g("div",Lu,[s("div",Gu,[s("div",Pu,[o(t(Vt),{modelValue:V.value,"onUpdate:modelValue":R[2]||(R[2]=ve=>V.value=ve),placeholder:t(e)("@A1833:选择作者"),multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{prefix:a(()=>[s("span",Vu,i(t(e)("@A1833:作者")),1)]),default:a(()=>[(c(!0),g(Be,null,Re(me.value,ve=>(c(),q(t(Pt),{key:ve,label:ve,value:ve},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),s("div",xu,[o(t(Vt),{modelValue:Q.value,"onUpdate:modelValue":R[3]||(R[3]=ve=>Q.value=ve),placeholder:t(e)("@A1833:选择分支"),multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{prefix:a(()=>[s("span",Ru,i(t(e)("@A1833:分支")),1)]),default:a(()=>[(c(!0),g(Be,null,Re(S.value,ve=>(c(),q(t(Pt),{key:ve,label:ve,value:ve},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),s("div",Iu,[o(t(dt),{modelValue:N.value,"onUpdate:modelValue":R[4]||(R[4]=ve=>N.value=ve),placeholder:t(e)("@A1833:提交信息关键词"),clearable:"",class:"filter-input",size:"small"},{prefix:a(()=>[s("span",Mu,i(t(e)("@A1833:信息")),1)]),_:1},8,["modelValue","placeholder"])]),s("div",zu,[o(t(ta),{modelValue:oe.value,"onUpdate:modelValue":R[5]||(R[5]=ve=>oe.value=ve),type:"daterange","range-separator":t(e)("@A1833:至"),"start-placeholder":t(e)("@A1833:开始日期"),"end-placeholder":t(e)("@A1833:结束日期"),format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",class:"filter-input date-range",size:"small"},{prefix:a(()=>[s("span",Ou,i(t(e)("@A1833:日期")),1)]),_:1},8,["modelValue","range-separator","start-placeholder","end-placeholder"])]),s("div",ju,[o(t(Je),{type:"primary",size:"small",onClick:le,class:"filter-action-button"},{default:a(()=>[X(i(t(e)("@A1833:应用")),1)]),_:1}),o(t(Je),{type:"info",size:"small",onClick:fe,class:"filter-action-button"},{default:a(()=>[X(i(t(e)("@A1833:重置")),1)]),_:1})])])])):W("",!0),s("div",{class:ge(["content-area",{"with-filter":P.value}])},[d.value?(c(),g("div",Uu,i(d.value),1)):(c(),g("div",Nu,[s("div",Ju,[Xe((c(),q(t(sa),{ref_key:"tableRef",ref:ne,data:re.value,stripe:"",border:"",class:"log-table","empty-text":f.value?t(e)("@A1833:加载中..."):t(e)("@A1833:没有匹配的提交记录"),height:"450",onRowContextmenu:Se,onRowClick:R[6]||(R[6]=ve=>he(ve))},{default:a(()=>[o(t(ps),{label:t(e)("@A1833:提交信息"),"min-width":"300"},{default:a(ve=>[s("div",Hu,[s("div",Yu,[ve.row.branch?(c(),g("div",Wu,[(c(!0),g(Be,null,Re(ve.row.branch.split(","),(He,nt)=>(c(),q(t(Rt),{key:nt,size:"small",type:U(He),class:"branch-tag"},{default:a(()=>[X(i(j(He)),1)]),_:2},1032,["type"]))),128))])):W("",!0),s("span",qu,i(ve.row.message),1),o(t(Je),{type:"text",icon:t(kt),size:"small",onClick:wt(He=>A(ve.row.message),["stop"]),class:"copy-message-btn",title:t(e)("@A1833:复制纯净提交信息(不含类型前缀)")},null,8,["icon","onClick","title"])])])]),_:1},8,["label"]),o(t(ps),{prop:"date",label:t(e)("@A1833:日期"),width:"150",resizable:""},null,8,["label"]),o(t(ps),{label:t(e)("@A1833:作者"),width:"100",resizable:""},{default:a(ve=>[o(ye,{content:ve.row.email,placement:"top","show-after":200},{default:a(()=>[s("span",Ku,i(ve.row.author),1)]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])),[[Me,f.value]])])]))],2),o(Ye,{modelValue:k.value,"onUpdate:modelValue":R[7]||(R[7]=ve=>k.value=ve),title:`${t(e)("@A1833:提交详情: ")}${(Te=h.value)!=null&&Te.hash?h.value.hash:t(e)("@A1833:未知")}`,size:"extra-large",type:"flex",heightMode:"fixed","destroy-on-close":"","custom-class":"commit-detail-dialog"},{default:a(()=>[Xe((c(),g("div",Qu,[h.value?(c(),g("div",Zu,[s("div",Xu,[s("div",ed,[s("span",td,i(t(e)("@A1833:日期")),1),s("span",sd,i(h.value.date),1)]),s("div",od,[s("span",ad,i(t(e)("@A1833:提交信息")),1),s("div",{class:"info-message",innerHTML:t(ka)(h.value.message).replace(/\n/g,"<br>")},null,8,nd)])])])):W("",!0),o(Ls,{files:$.value,loading:Y.value,diffContent:x.value,selectedFile:T.value,context:"commit-detail",emptyText:t(e)("@A1833:没有找到变更文件"),onFileSelect:be,onOpenFile:Ve,onOpenWithVscode:ke},null,8,["files","loading","diffContent","selectedFile","emptyText"])])),[[Me,Y.value]])]),_:1},8,["modelValue","title"])],2),Xe(s("div",{class:ge(["context-menu",{"fullscreen-context-menu":Ie.value}]),style:ut({top:w.value+"px",left:ee.value+"px"}),ref_key:"contextMenuRef",ref:M},[s("div",{class:"context-menu-item",onClick:R[8]||(R[8]=ve=>he(G.value))},[R[13]||(R[13]=s("i",{class:"el-icon-view"},null,-1)),X(" "+i(t(e)("@A1833:查看详情")),1)]),s("div",{class:"context-menu-item",onClick:R[9]||(R[9]=ve=>st(G.value))},[R[14]||(R[14]=s("i",{class:"el-icon-document-copy"},null,-1)),X(" "+i(t(e)("@A1833:复制提交哈希")),1)]),s("div",{class:"context-menu-item",onClick:R[10]||(R[10]=ve=>Qe(G.value))},[R[15]||(R[15]=s("i",{class:"el-icon-refresh-right"},null,-1)),X(" "+i(t(e)("@A1833:重置到该提交(hard)")),1)]),s("div",{class:"context-menu-item",onClick:R[11]||(R[11]=ve=>tt(G.value))},[R[16]||(R[16]=s("i",{class:"el-icon-delete"},null,-1)),X(" "+i(t(e)("@A1833:撤销提交 (Revert)")),1)]),s("div",{class:"context-menu-item",onClick:R[12]||(R[12]=ve=>ue(G.value))},[R[17]||(R[17]=s("i",{class:"el-icon-edit"},null,-1)),X(" Cherry"+i(t(e)("@A1833:-Pick 到当前分支")),1)])],6),[[xt,y.value]])],64)}}}),id=De(ld,[["__scopeId","data-v-639097ce"]]),rd={class:"dialog-toolbar"},cd=["disabled"],ud={class:"btn-text"},dd=["disabled"],fd={class:"btn-text"},pd=["disabled"],md={class:"btn-text"},hd={class:"history-scroll"},gd={key:0,class:"loading-state"},vd={class:"loading-text"},Cd={key:2,class:"history-list"},yd=["onClick"],_d={class:"command-info"},Bd={class:"command-text"},bd={class:"command-meta"},kd={class:"timestamp"},wd={class:"duration"},$d={class:"item-actions"},Fd=["onClick"],Sd=["onClick"],Ad={key:0,class:"item-details"},Dd={key:0,class:"output-section"},Td={class:"output-header"},Ed=["onClick"],Ld={class:"output-content"},Gd={key:0,class:"truncation-notice"},Pd={class:"output-header"},Vd={class:"output-content"},xd={key:0,class:"truncation-notice"},Rd={key:2,class:"output-section error"},Id={class:"output-header"},Md={class:"output-content"},zd=Fe({__name:"CommandHistory",setup(E){const C=qe(),n=u([]),l=u(!1),p=u(!1),d=u(!1),m=u(!1),f=u(new Set),B=u(!1),D=u(!1);function L(){D.value=!0,n.value.length===0&&k()}async function k(){try{if(l.value=!0,C.socket&&C.socket.connected)C.socket.emit("request_full_history");else{const ee=await(await fetch("/api/command-history")).json();ee.success?n.value=ee.history:r.error(`${e("@81F0F:加载命令历史失败: ")}${ee.error}`)}}catch(w){r.error(`${e("@81F0F:加载命令历史失败: ")}${w.message}`)}finally{l.value=!1}}async function h(){if(n.value.length===0){r.warning(e("@81F0F:没有可复制的命令历史"));return}try{d.value=!0;const w=n.value.map(ee=>{let G=`# ${Y(ee.timestamp)}${e("@81F0F: (耗时: ")}${T(ee.executionTime)}) - ${ee.success?e("@81F0F:成功"):e("@81F0F:失败")}
|
|
25
|
+
`;if(G+=`${ee.command}
|
|
26
|
+
`,ee.stdout&&(G+=`
|
|
27
|
+
# 输出:
|
|
28
|
+
${ee.stdout}
|
|
29
|
+
`),ee.stderr){const M=me(ee.command)?e("@81F0F:输出信息"):e("@81F0F:错误输出");G+=`
|
|
30
|
+
# ${M}:
|
|
31
|
+
${ee.stderr}
|
|
32
|
+
`}return ee.error&&(G+=`
|
|
33
|
+
# 错误信息:
|
|
34
|
+
${ee.error}
|
|
35
|
+
`),G}).join(`
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
`);await navigator.clipboard.writeText(w),r({message:e("@81F0F:命令历史已复制到剪贴板"),type:"success",zIndex:1e5})}catch(w){r.error(`${e("@81F0F:复制失败: ")}${w.message}`)}finally{d.value=!1}}async function K(){if(n.value.length===0){r.warning(e("@81F0F:没有可复制的命令"));return}try{B.value=!0;const w=n.value.map(ee=>ee.command).join(`
|
|
39
|
+
`);await navigator.clipboard.writeText(w),r({message:e("@81F0F:命令列表已复制到剪贴板"),type:"success",zIndex:1e5})}catch(w){r.error(`${e("@81F0F:复制失败: ")}${w.message}`)}finally{B.value=!1}}async function x(){try{if(await We.confirm(e("@81F0F:确定要清空所有命令历史记录吗?此操作不可恢复。"),e("@81F0F:清空命令历史"),{confirmButtonText:e("@81F0F:确定"),cancelButtonText:e("@81F0F:取消"),type:"warning"}),p.value=!0,C.socket&&C.socket.connected)C.socket.emit("clear_command_history");else{const ee=await(await fetch("/api/clear-command-history",{method:"POST",headers:{"Content-Type":"application/json"}})).json();ee.success?(n.value=[],r.success(e("@81F0F:命令历史已清空"))):r.error(`${e("@81F0F:清空命令历史失败: ")}${ee.error}`)}}catch(w){w!=="cancel"&&w.toString()!=="Error: cancel"&&r.error(`${e("@81F0F:清空命令历史失败: ")}${w.message}`)}finally{p.value=!1}}function Y(w){return new Date(w).toLocaleString()}function T(w){return w<1e3?`${w}ms`:`${(w/1e3).toFixed(2)}s`}function P(w){f.value.has(w)?f.value.delete(w):f.value.add(w)}function V(w){return f.value.has(w)}async function N(w){try{await navigator.clipboard.writeText(w),r({message:e("@81F0F:命令已复制到剪贴板"),type:"success",zIndex:1e5})}catch(ee){r.error(`${e("@81F0F:复制失败: ")}${ee.message}`)}}function oe(w){return w.includes("git push")||w.includes("git-push")}function me(w){return!!oe(w)}async function Q(w){try{let ee="";if(w.stdout&&(ee+=`标准输出:
|
|
40
|
+
${w.stdout}
|
|
41
|
+
|
|
42
|
+
`),w.stderr){const G=me(w.command)?e("@81F0F:输出信息"):e("@81F0F:错误输出");ee+=`${G}:
|
|
43
|
+
${w.stderr}
|
|
44
|
+
|
|
45
|
+
`}w.error&&(ee+=`错误信息:
|
|
46
|
+
${w.error}`),await navigator.clipboard.writeText(ee.trim()),r({message:e("@81F0F:输出已复制到剪贴板"),type:"success",zIndex:1e5})}catch(ee){r.error(`${e("@81F0F:复制失败: ")}${ee.message}`)}}function S(){if(!C.socket){console.error(e("@81F0F:Socket实例不可用"));return}C.socket.on("initial_command_history",w=>{n.value=w.history,m.value=!0}),C.socket.on("command_history_update",w=>{n.value.unshift(w.newCommand),n.value.length>100&&n.value.pop(),m.value=!0}),C.socket.on("full_command_history",w=>{n.value=w.history,l.value=!1,m.value=!0}),C.socket.on("command_history_cleared",w=>{w.success&&(n.value=[],r.success(e("@81F0F:命令历史已清空"))),p.value=!1}),C.socket.on("connect",()=>{m.value=!0,r.success(e("@81F0F:已连接到实时命令历史"))}),C.socket.on("disconnect",()=>{m.value=!1,r.warning(e("@81F0F:实时命令历史连接已断开"))})}function y(){C.socket&&(C.socket.off("initial_command_history"),C.socket.off("command_history_update"),C.socket.off("full_command_history"),C.socket.off("command_history_cleared"))}return at(()=>{S(),C.socket||(console.log(e("@81F0F:尝试初始化Socket连接")),C.initSocketConnection())}),Ws(()=>{y()}),(w,ee)=>{const G=xe,M=$e,re=Rt,$=ht,O=so;return c(),g(Be,null,[o(M,{content:t(e)("@81F0F:查看Git命令历史"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-36",onClick:L},[o(G,{class:"btn-icon"},{default:a(()=>[o(t(Qs))]),_:1})])]),_:1},8,["content"]),o(Ye,{modelValue:D.value,"onUpdate:modelValue":ee[0]||(ee[0]=j=>D.value=j),title:t(e)("@81F0F:Git 命令历史"),"destroy-on-close":"","custom-class":"command-history-dialog","append-to-body":!0},{default:a(()=>[s("div",rd,[o(re,{type:m.value?"success":"danger",size:"small",effect:"dark",class:"socket-status"},{default:a(()=>[X(i(m.value?t(e)("@81F0F:实时更新"):t(e)("@81F0F:未连接")),1)]),_:1},8,["type"]),o(M,{content:t(e)("@81F0F:只复制命令列表(不含输出)"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn copy-commands-button enhanced-btn",onClick:K,disabled:n.value.length===0||B.value},[B.value?(c(),q(G,{key:1,class:"btn-icon is-loading"},{default:a(()=>[o(t(Ct))]),_:1})):(c(),q(G,{key:0,class:"btn-icon"},{default:a(()=>[o(t(kt))]),_:1})),s("span",ud,i(t(e)("@81F0F:命令")),1)],8,cd)]),_:1},8,["content"]),o(M,{content:t(e)("@81F0F:复制完整命令历史(含输出)"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn copy-all-button enhanced-btn",onClick:h,disabled:n.value.length===0||d.value},[d.value?(c(),q(G,{key:1,class:"btn-icon is-loading"},{default:a(()=>[o(t(Ct))]),_:1})):(c(),q(G,{key:0,class:"btn-icon"},{default:a(()=>[o(t(kt))]),_:1})),s("span",fd,i(t(e)("@81F0F:全部")),1)],8,dd)]),_:1},8,["content"]),o(M,{content:t(e)("@81F0F:清空命令历史"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn clear-button enhanced-btn danger-btn",onClick:x,disabled:n.value.length===0||p.value},[p.value?(c(),q(G,{key:1,class:"btn-icon is-loading"},{default:a(()=>[o(t(Ct))]),_:1})):(c(),q(G,{key:0,class:"btn-icon"},{default:a(()=>[o(t(Nt))]),_:1})),s("span",md,i(t(e)("@81F0F:清空")),1)],8,pd)]),_:1},8,["content"])]),s("div",hd,[l.value&&n.value.length===0?(c(),g("div",gd,[o(G,{class:"loading-icon is-loading"},{default:a(()=>[o(t(Ct))]),_:1}),s("div",vd,i(t(e)("@81F0F:加载命令历史...")),1)])):n.value.length===0?(c(),q($,{key:1,description:t(e)("@81F0F:暂无命令历史")},null,8,["description"])):(c(),g("div",Cd,[(c(!0),g(Be,null,Re(n.value,(j,U)=>(c(),g("div",{key:U,class:ge(["history-item",{"is-error":!j.success}])},[s("div",{class:"item-header",onClick:ne=>P(U)},[s("div",_d,[s("div",Bd,[o(re,{size:"small",type:j.success?"success":"danger",effect:"dark",class:"status-tag"},{default:a(()=>[X(i(j.success?t(e)("@81F0F:成功"):t(e)("@81F0F:失败")),1)]),_:2},1032,["type"]),s("code",null,i(j.command),1)]),s("div",bd,[s("span",kd,i(Y(j.timestamp)),1),s("span",wd,i(t(e)("@81F0F:耗时: "))+i(T(j.executionTime)),1)])]),s("div",$d,[o(M,{content:t(e)("@81F0F:复制命令"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn item-copy-button enhanced-btn",onClick:wt(ne=>N(j.command),["stop"])},[o(G,{class:"btn-icon"},{default:a(()=>[o(t(kt))]),_:1})],8,Fd)]),_:2},1032,["content"]),o(M,{content:t(e)("@81F0F:展开/收起"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:ge(["modern-btn expand-button enhanced-btn",{"is-expanded":V(U)}]),onClick:wt(ne=>P(U),["stop"])},[o(G,{class:"btn-icon"},{default:a(()=>[V(U)?(c(),q(t(Zs),{key:0})):(c(),q(t(ot),{key:1}))]),_:2},1024)],10,Sd)]),_:2},1032,["content"])])],8,yd),V(U)?(c(),g("div",Ad,[j.stdout?(c(),g("div",Dd,[s("div",Td,[s("h4",null,i(t(e)("@81F0F:标准输出")),1),o(M,{content:t(e)("@81F0F:复制输出"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn output-copy-button enhanced-btn",onClick:ne=>Q(j)},[o(G,{class:"btn-icon"},{default:a(()=>[o(t(kt))]),_:1})],8,Ed)]),_:2},1032,["content"])]),s("pre",Ld,i(j.stdout),1),j.isStdoutTruncated?(c(),g("div",Gd,[o(O,{type:"info",closable:!1,"show-icon":""},{default:a(()=>[X(i(t(e)("@81F0F:输出内容过长已被截断,请直接执行命令查看完整输出")),1)]),_:1})])):W("",!0)])):W("",!0),j.stderr?(c(),g("div",{key:1,class:ge(["output-section",me(j.command)?"":"error"])},[s("div",Pd,[s("h4",null,i(me(j.command)?t(e)("@81F0F:输出信息"):t(e)("@81F0F:错误输出")),1)]),s("pre",Vd,i(j.stderr),1),j.isStderrTruncated?(c(),g("div",xd,[o(O,{type:"info",closable:!1,"show-icon":""},{default:a(()=>[X(i(me(j.command)?t(e)("@81F0F:输出信息"):t(e)("@81F0F:错误输出"))+i(t(e)("@81F0F:内容过长已被截断,请直接执行命令查看完整输出")),1)]),_:2},1024)])):W("",!0)],2)):W("",!0),j.error?(c(),g("div",Rd,[s("div",Id,[s("h4",null,i(t(e)("@81F0F:错误信息")),1)]),s("pre",Md,i(j.error),1)])):W("",!0)])):W("",!0)],2))),128))]))])]),_:1},8,["modelValue","title"])],64)}}}),Od=De(zd,[["__scopeId","data-v-ab0c3758"]]),jd={class:"inline-card"},Ud={key:0,class:"inline-card__icon"},Nd={class:"inline-card__content"},Jd={class:"inline-card__actions"},Hd=Fe({__name:"InlineCard",setup(E){const C=oa(),n=se(()=>{var p;const l=(p=C.icon)==null?void 0:p.call(C);return Array.isArray(l)?l.length>0:!!l});return(l,p)=>(c(),g("div",jd,[n.value?(c(),g("div",Ud,[gt(l.$slots,"icon",{},void 0,!0)])):W("",!0),s("div",Nd,[gt(l.$slots,"content",{},()=>[gt(l.$slots,"default",{},void 0,!0)],!0)]),s("div",Jd,[gt(l.$slots,"actions",{},void 0,!0)])]))}}),ys=De(Hd,[["__scopeId","data-v-a76615cd"]]),Yd=["element-loading-text"],Wd={class:"info-section"},qd={class:"info-card"},Kd={class:"info-icon"},Qd={class:"info-content"},Zd={class:"info-title"},Xd={class:"info-desc"},ef={class:"basic-info-section"},tf={class:"basic-info-grid"},sf={class:"settings-section"},of={class:"section-title"},af={class:"settings-grid"},nf={class:"setting-row"},lf={class:"setting-label"},rf={class:"setting-row"},cf={class:"setting-label"},uf={class:"setting-row"},df={class:"setting-label"},ff={class:"setting-row"},pf={class:"setting-label"},mf={class:"setting-row"},hf={class:"setting-label"},gf={class:"user-settings-footer"},vf={class:"footer-actions"},Cf=["disabled"],yf=["disabled"],_f=Fe({__name:"GitGlobalSettingsDialog",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(E,{emit:C}){const n=qe(),l=E,p=C,d=u(!1),m=u(!1),f=u(""),B=u(""),D=u(!1),L=u("false"),k=u(!1),h=u("true"),K=u("main");let x="",Y="",T=!1,P="false",V=!1,N="true",oe="main";Ge(()=>l.modelValue,async G=>{if(d.value=G,G){f.value=n.userName,B.value=n.userEmail;try{m.value=!0,await y()}finally{m.value=!1}x=f.value,Y=B.value,T=D.value,P=L.value,V=k.value,N=h.value,oe=K.value}},{immediate:!0});function me(G){p("update:modelValue",G)}async function Q(G){try{const re=await(await fetch("/api/exec",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:`git config --global --get ${G}`})})).json();if(re.success)return String(re.stdout||"").trim()}catch{}return""}async function S(G,M){const $=await(await fetch("/api/exec",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:`git config --global ${G} ${M}`})})).json();if(!$.success)throw new Error($.error||`${e("@42BB9:设置 ")}${G}${e("@42BB9: 失败")}`)}async function y(){const[G,M,re,$,O]=await Promise.all([Q("push.autoSetupRemote"),Q("pull.rebase"),Q("fetch.prune"),Q("core.autocrlf"),Q("init.defaultBranch")]);D.value=(G||"false").toLowerCase()==="true";const j=(M||"false").toLowerCase();L.value=j==="true"||j==="merges"?j:"false",k.value=(re||"false").toLowerCase()==="true";const U=($||"true").toLowerCase();h.value=U==="true"||U==="input"?U:"false",K.value=O||"main"}async function w(){const G=[];try{D.value!==T&&G.push(S("push.autoSetupRemote",D.value?"true":"false")),L.value!==P&&G.push(S("pull.rebase",L.value)),k.value!==V&&G.push(S("fetch.prune",k.value?"true":"false")),h.value!==N&&G.push(S("core.autocrlf",h.value));const M=(K.value||"").trim();return M&&M!==oe&&G.push(S("init.defaultBranch",M)),G.length===0||(await Promise.all(G),r.success(e("@42BB9:已保存变更的 Git 配置")),T=D.value,P=L.value,V=k.value,N=h.value,oe=M||oe),!0}catch(M){return r.error(M.message),!1}}async function ee(){if(!f.value||!B.value){r.warning(e("@42BB9:用户名和邮箱不能为空"));return}let G=!0;(f.value!==x||B.value!==Y)&&(G=await n.restoreUserConfig(f.value,B.value),G&&(x=f.value,Y=B.value));const M=await w();G&&M&&(f.value===x&&B.value,d.value=!1)}return(G,M)=>{const re=xe,$=dt,O=Xt,j=$e,U=Fs,ne=Pt,we=Vt,Pe=Zt,Le=es;return c(),q(Ye,{modelValue:d.value,"onUpdate:modelValue":[M[8]||(M[8]=_e=>d.value=_e),me],title:t(e)("@42BB9:Git 全局设置"),size:"large","destroy-on-close":!0,"custom-class":"user-settings-dialog"},{footer:a(()=>[s("div",gf,[M[9]||(M[9]=s("div",null,null,-1)),s("div",vf,[s("button",{type:"button",class:"footer-btn cancel-btn",onClick:M[7]||(M[7]=_e=>d.value=!1),disabled:m.value},i(t(e)("@42BB9:取消")),9,Cf),s("button",{type:"button",class:"footer-btn primary-btn",onClick:ee,disabled:m.value},[o(re,null,{default:a(()=>[o(t(ct))]),_:1}),s("span",null,i(t(e)("@42BB9:保存设置")),1)],8,yf)])])]),default:a(()=>[Xe((c(),g("div",{class:"user-settings-content","element-loading-text":t(e)("@42BB9:正在加载配置..."),"element-loading-background":"rgba(0, 0, 0, 0.15)"},[s("div",Wd,[s("div",qd,[s("div",Kd,[o(re,null,{default:a(()=>[o(t(vt))]),_:1})]),s("div",Qd,[s("p",Zd,i(t(e)("@42BB9:全局配置")),1),s("p",Xd,i(t(e)("@42BB9:这些设置将影响全局 Git 配置,对所有 Git 仓库生效")),1)])])]),o(Pe,{class:"user-form","label-width":"auto",model:{tempUserName:f.value,tempUserEmail:B.value}},{default:a(()=>[s("div",ef,[s("div",tf,[o(O,{class:"form-item",label:t(e)("@42BB9:用户名")},{default:a(()=>[o($,{modelValue:f.value,"onUpdate:modelValue":M[0]||(M[0]=_e=>f.value=_e),placeholder:t(e)("@42BB9:请输入 Git 用户名"),class:"modern-input"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(O,{class:"form-item",label:t(e)("@42BB9:邮箱地址")},{default:a(()=>[o($,{modelValue:B.value,"onUpdate:modelValue":M[1]||(M[1]=_e=>B.value=_e),placeholder:t(e)("@42BB9:请输入 Git 邮箱地址"),class:"modern-input"},null,8,["modelValue","placeholder"])]),_:1},8,["label"])])]),s("div",sf,[s("div",of,[o(re,{class:"title-icon"},{default:a(()=>[o(t(Kt))]),_:1}),s("span",null,i(t(e)("@42BB9:高级配置")),1)]),s("div",af,[s("div",nf,[s("label",lf,[X(i(t(e)("@42BB9:自动设置上游"))+" ",1),o(j,{content:t(e)("@42BB9:首次 git push 时,自动为当前分支创建远程同名分支并建立跟踪关系(等同于 push -u)。"),placement:"top","show-after":200},{default:a(()=>[o(re,{class:"qmark"},{default:a(()=>[o(t(vt))]),_:1})]),_:1},8,["content"])]),o(U,{modelValue:D.value,"onUpdate:modelValue":M[2]||(M[2]=_e=>D.value=_e)},null,8,["modelValue"])]),s("div",rf,[s("label",cf,i(t(e)("@42BB9:拉取策略")),1),o(we,{modelValue:L.value,"onUpdate:modelValue":M[3]||(M[3]=_e=>L.value=_e),class:"modern-input",size:"default"},{default:a(()=>[o(ne,{label:t(e)("@42BB9:merge (默认)"),value:"false"},null,8,["label"]),o(ne,{label:"rebase",value:"true"}),o(ne,{label:t(e)("@42BB9:rebase(保留合并)"),value:"merges"},null,8,["label"])]),_:1},8,["modelValue"])]),s("div",uf,[s("label",df,[X(i(t(e)("@42BB9:自动清理远程分支"))+" ",1),o(j,{content:t(e)("@42BB9:在 git fetch 时自动 prune,移除已在远程删除但本地仍保留的远程分支引用。"),placement:"top","show-after":200},{default:a(()=>[o(re,{class:"qmark"},{default:a(()=>[o(t(vt))]),_:1})]),_:1},8,["content"])]),o(U,{modelValue:k.value,"onUpdate:modelValue":M[4]||(M[4]=_e=>k.value=_e)},null,8,["modelValue"])]),s("div",ff,[s("label",pf,i(t(e)("@42BB9:换行符处理")),1),o(we,{modelValue:h.value,"onUpdate:modelValue":M[5]||(M[5]=_e=>h.value=_e),class:"modern-input",size:"default"},{default:a(()=>[o(ne,{label:"true (Windows)",value:"true"}),o(ne,{label:"input",value:"input"}),o(ne,{label:"false",value:"false"})]),_:1},8,["modelValue"])]),s("div",mf,[s("label",hf,[X(i(t(e)("@42BB9:默认初始化分支"))+" ",1),o(j,{content:t(e)("@42BB9:新建仓库时(git init)默认创建的分支名,常见为 main 或 master。"),placement:"top","show-after":200},{default:a(()=>[o(re,{class:"qmark"},{default:a(()=>[o(t(vt))]),_:1})]),_:1},8,["content"])]),o($,{modelValue:K.value,"onUpdate:modelValue":M[6]||(M[6]=_e=>K.value=_e),placeholder:t(e)("@42BB9:例如: main"),class:"modern-input",size:"default"},null,8,["modelValue","placeholder"])])])])]),_:1},8,["model"])],8,Yd)),[[Le,m.value]])]),_:1},8,["modelValue","title"])}}}),Bf=De(_f,[["__scopeId","data-v-d8e7259a"]]),bf={"zh-CN":oo,"en-US":aa};function kf(E){return bf[E]||oo}const mo=ks("locale",()=>{const E=u(va()),C=se(()=>kf(E.value));function n(l){ga(l),E.value=l}return{currentLocale:E,elementPlusLocale:C,changeLocale:n}}),wf={class:"language-switcher"},$f={class:"language-text"},Ff=Fe({__name:"LanguageSwitcher",setup(E){const C=mo(),n=se(()=>Us[C.currentLocale]),l=p=>{C.changeLocale(p)};return(p,d)=>(c(),q(t(na),{onCommand:l,trigger:"click"},{dropdown:a(()=>[o(t(ia),null,{default:a(()=>[(c(!0),g(Be,null,Re(t(ao),m=>(c(),q(t(la),{key:m,command:m,disabled:m===t(C).currentLocale},{default:a(()=>[X(i(t(Us)[m]),1)]),_:2},1032,["command","disabled"]))),128))]),_:1})]),default:a(()=>[s("span",wf,[o(t(xe),{class:"language-icon"},{default:a(()=>d[0]||(d[0]=[s("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[s("circle",{cx:"12",cy:"12",r:"10"}),s("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),s("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})],-1)])),_:1}),s("span",$f,i(n.value),1)])]),_:1}))}}),Sf=De(Ff,[["__scopeId","data-v-f58b2efd"]]),Af="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",Df={class:"main-header app-header"},Tf={class:"header-left"},Ef=["src"],Lf={class:"header-info"},Gf={key:0,class:"header-actions"},Pf={key:0,class:"command-history-section"},Vf={class:"user-name"},xf={class:"user-label"},Rf={class:"user-warning"},If={class:"main-container"},Mf={key:0,class:"loading-container"},zf={class:"loading-spinner"},Of={class:"loading-text"},jf={key:1,class:"grid-layout"},Uf={class:"git-status-panel"},Nf={key:0,class:"commit-form-panel"},Jf={class:"tips"},Hf={class:"code-block"},Yf={key:1,class:"commit-form-panel"},Wf={class:"tips"},qf={key:2,class:"log-list-panel"},Kf={class:"create-branch-content"},Qf={class:"form-label"},Zf={class:"form-label"},Xf={class:"create-branch-footer"},ep={class:"footer-actions"},tp=["disabled"],sp={class:"main-footer app-footer p-4"},op={key:0,class:"branch-info"},ap=["aria-label","title"],np={key:1},lp={class:"repo-url-label"},ip={class:"repo-url"},rp=Fe({__name:"App",setup(E){const C=u(""),n=u(null),l=u(null),p=u(null),d=qe(),m=et(),f=mo(),B=u(!1),D=se(()=>m.currentDirectory),L=u(!1);function k(){L.value=!L.value;const te=document.documentElement;L.value?(te.setAttribute("data-theme","dark"),localStorage.setItem("theme","dark")):(te.removeAttribute("data-theme"),localStorage.setItem("theme","light"))}function h(){const te=localStorage.getItem("theme"),J=window.matchMedia("(prefers-color-scheme: dark)").matches;(te==="dark"||!te&&J)&&(L.value=!0,document.documentElement.setAttribute("data-theme","dark"))}function K(){m.config&&(C.value=`${e("@F13B4:默认提交信息: ")}${m.config.defaultCommitMessage}`)}async function x(){try{const J=await(await fetch("/api/current_directory")).json();return m.setCurrentDirectory(J.directory||e("@F13B4:未知目录")),J}catch(te){return console.error("获取当前目录失败:",te),{directory:e("@F13B4:未知目录"),isGitRepo:!1}}}at(async()=>{console.log(e("@F13B4:---------- 页面初始化开始 ----------")),h();try{const te=await x();m.isLoaded||await m.loadConfig(),K(),d.isGitRepo=te.isGitRepo===!0,d.lastCheckedTime=Date.now(),d.isGitRepo?await Promise.all([d.getCurrentBranch(!0),d.getAllBranches(),d.getUserInfo(),d.getRemoteUrl(),d.getBranchStatus(!0)]):r.warning(e("@F13B4:当前目录不是Git仓库,部分功能将不可用"))}catch(te){console.error("初始化失败:",te)}finally{B.value=!0,console.log(e("@F13B4:---------- 页面初始化完成 ----------")),setTimeout(()=>{j()},100)}});const Y=u(!1),T=u(""),P=u("");async function V(){await d.createBranch(T.value,P.value)&&(Y.value=!1,T.value="",l.value&&l.value.refreshStatus(),d.refreshLog())}function N(){P.value=d.currentBranch,Y.value=!0}async function oe(te){await d.changeBranch(te)&&(l.value&&l.value.refreshStatus(),d.refreshLog())}const me=u(!1);function Q(){me.value=!0}let S=!1,y=!1,w=!1,ee=0,G=0,M="",re="",$=null;function O(){const te=document.querySelector(".grid-layout");if(!te)return;const J=getComputedStyle(te).gridTemplateColumns.split(" "),he=getComputedStyle(te).gridTemplateRows.split(" ");if(J.length>=3&&he.length>=3){const ce=parseFloat(J[0]),be=parseFloat(J[2]),Ve=ce+be,ke=ce/Ve,A=parseFloat(he[0]),z=parseFloat(he[2]),fe=A+z,le=A/fe;localStorage.setItem("zen-gitsync-layout-left-ratio",ke.toString()),localStorage.setItem("zen-gitsync-layout-top-ratio",le.toString()),console.log(`${e("@F13B4:布局比例已保存 - 左侧: ")}${(ke*100).toFixed(0)}${e("@F13B4:%, 上方: ")}${(le*100).toFixed(0)}%`),localStorage.setItem("zen-gitsync-layout-bottom-left-ratio",ke.toString()),console.log(`${e("@F13B4:底部布局比例已保存 - 左侧: ")}${(ke*100).toFixed(0)}%`)}}function j(){const te=document.querySelector(".grid-layout");if(!te)return;const J=localStorage.getItem("zen-gitsync-layout-left-ratio"),he=localStorage.getItem("zen-gitsync-layout-top-ratio");if(J){const ce=parseFloat(J),be=1-ce;te.style.gridTemplateColumns=`${ce}fr 8px ${be}fr`,console.log(`${e("@F13B4:已恢复左侧比例: ")}${(ce*100).toFixed(0)}%`)}else te.style.gridTemplateColumns="1fr 8px 3fr";if(he){const ce=parseFloat(he),be=1-ce;te.style.gridTemplateRows=`${ce}fr 8px ${be}fr`,console.log(`${e("@F13B4:已恢复上方比例: ")}${(ce*100).toFixed(0)}%`)}}function U(te){var ce;const J=te.currentTarget;if(!J||!J.id)return;$=J.id,$==="v-resizer"?S=!0:$==="v-resizer-bottom"&&(y=!0),ee=te.clientX;const he=document.querySelector(".grid-layout");M=getComputedStyle(he).gridTemplateColumns,(ce=document.getElementById($))==null||ce.classList.add("active"),document.addEventListener("mousemove",ne),document.addEventListener("mouseup",we),te.preventDefault()}function ne(te){if(!S&&!y)return;const J=document.querySelector(".grid-layout"),he=te.clientX-ee,ce=M.split(" ");if(ce.length>=3){const be=parseFloat(ce[0]),Ve=parseFloat(ce[2]),ke=be+Ve,A=(be+he/J.clientWidth*ke)/ke,z=1-A,fe=.1,le=.5;A<fe?J.style.gridTemplateColumns=`${fe}fr 8px ${1-fe}fr`:A>le?J.style.gridTemplateColumns=`${le}fr 8px ${1-le}fr`:J.style.gridTemplateColumns=`${A}fr 8px ${z}fr`}}function we(){var te,J;S=!1,y=!1,(te=document.getElementById("v-resizer"))==null||te.classList.remove("active"),(J=document.getElementById("v-resizer-bottom"))==null||J.classList.remove("active"),document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",we),O()}function Pe(te){var he;w=!0,G=te.clientY;const J=document.querySelector(".grid-layout");re=getComputedStyle(J).gridTemplateRows,(he=document.getElementById("h-resizer"))==null||he.classList.add("active"),document.addEventListener("mousemove",Le),document.addEventListener("mouseup",_e),te.preventDefault()}function Le(te){if(!w)return;const J=document.querySelector(".grid-layout"),he=te.clientY-G,ce=re.split(" ");if(ce.length>=3){const be=parseFloat(ce[0]),Ve=parseFloat(ce[2]),ke=be+Ve,A=(be+he/J.clientHeight*ke)/ke,z=1-A,fe=.2,le=.8;A<fe?J.style.gridTemplateRows=`${fe}fr 8px ${1-fe}fr`:A>le?J.style.gridTemplateRows=`${le}fr 8px ${1-le}fr`:J.style.gridTemplateRows=`${A}fr 8px ${z}fr`}}function _e(){var te;w=!1,(te=document.getElementById("h-resizer"))==null||te.classList.remove("active"),document.removeEventListener("mousemove",Le),document.removeEventListener("mouseup",_e),O()}return(te,J)=>{const he=xe,ce=$e,be=eo,Ve=Je,ke=dt,A=Xt,z=Pt,fe=Vt,le=Zt;return c(),q(t(ua),{locale:t(f).elementPlusLocale},{default:a(()=>[s("header",Df,[s("div",Tf,[s("img",{src:t(Af),alt:"Zen GitSync Logo",class:"logo"},null,8,Ef),J[9]||(J[9]=s("h1",null,"Zen GitSync",-1))]),s("div",Lf,[t(d).isGitRepo?(c(),g("div",Gf,[t(d).isGitRepo?(c(),g("div",Pf,[o(Od)])):W("",!0),o(ce,{content:t(e)("@F13B4:编辑项目配置"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-36 btn-scale-on-hover",onClick:J[0]||(J[0]=Ce=>{var Ae;return(Ae=p.value)==null?void 0:Ae.openConfigEditor()})},[o(he,{class:"btn-icon"},{default:a(()=>[o(t(rt))]),_:1})])]),_:1},8,["content"]),o(ce,{content:L.value?t(e)("@F13B4:切换到浅色主题"):t(e)("@F13B4:切换到深色主题"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-36",onClick:k},[o(he,{class:"btn-icon"},{default:a(()=>[L.value?(c(),q(t(ra),{key:0})):(c(),q(t(ca),{key:1}))]),_:1})])]),_:1},8,["content"]),o(ce,{content:t(e)("@F13B4:Git 操作"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-36 btn-rotate-on-hover",onClick:J[1]||(J[1]=Ce=>{var Ae;return(Ae=p.value)==null?void 0:Ae.toggleGitOperationsDrawer()})},[o(he,{class:"btn-icon"},{default:a(()=>[o(t(Os))]),_:1})])]),_:1},8,["content"])])):W("",!0),o(Sf),o(ys,{id:"user-info",class:"user-info-card",compact:""},{content:a(()=>[t(d).userName&&t(d).userEmail?(c(),q(ce,{key:0,content:t(d).userEmail,placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("span",Vf,i(t(d).userName),1)]),_:1},8,["content"])):(c(),g(Be,{key:1},[s("span",xf,i(t(e)("@F13B4:用户: ")),1),s("span",Rf,i(t(e)("@F13B4:未配置")),1)],64))]),actions:a(()=>[o(ce,{content:t(e)("@F13B4:用户设置"),placement:"bottom",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-28",onClick:Q},[o(he,{class:"btn-icon"},{default:a(()=>[o(t(Kt))]),_:1})])]),_:1},8,["content"])]),_:1})])]),s("main",If,[B.value?(c(),g("div",jf,[s("div",Uf,[o(di,{ref_key:"gitStatusRef",ref:l,"initial-directory":D.value},null,8,["initial-directory"])]),s("div",{class:"vertical-resizer",id:"v-resizer",onMousedown:U},null,32),t(d).isGitRepo?(c(),g("div",Nf,[!t(d).userName||!t(d).userEmail?(c(),q(be,{key:0,shadow:"hover"},{header:a(()=>[s("h2",null,"Git"+i(t(e)("@F13B4:用户未配置")),1)]),default:a(()=>[s("p",null,i(t(e)("@F13B4:请先配置Git用户信息才能进行提交操作。")),1),s("div",Jf,[s("h3",null,i(t(e)("@F13B4:您可以通过以下方式配置:")),1),s("ol",null,[s("li",null,i(t(e)("@F13B4:点击右上角的设置按钮,配置用户名和邮箱")),1),s("li",null,i(t(e)("@F13B4:或者使用命令行配置:")),1),s("div",Hf,[X(" git config "+i(t(e)('@F13B4:--global user.name "您的用户名"')),1),J[11]||(J[11]=s("br",null,null,-1)),X(" git config "+i(t(e)('@F13B4:--global user.email "您的邮箱"')),1)])]),o(Ve,{type:"primary",onClick:Q},{default:a(()=>[X(i(t(e)("@F13B4:立即配置")),1)]),_:1})])]),_:1})):(c(),q(Au,{key:1,ref_key:"commitFormRef",ref:p},null,512))])):(c(),g("div",Yf,[o(be,{shadow:"hover"},{header:a(()=>[s("h2",null,"Git"+i(t(e)("@F13B4:仓库初始化")),1)]),default:a(()=>[s("p",null,i(t(e)("@F13B4:当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。")),1),s("div",Wf,[s("h3",null,i(t(e)("@F13B4:可以使用以下命令初始化仓库:")),1),J[12]||(J[12]=s("div",{class:"code-block"},"git init",-1))])]),_:1})])),s("div",{class:"horizontal-resizer",id:"h-resizer",onMousedown:Pe},null,32),t(d).isGitRepo?(c(),g("div",qf,[o(id,{ref_key:"logListRef",ref:n},null,512)])):W("",!0),o(Ye,{modelValue:Y.value,"onUpdate:modelValue":J[5]||(J[5]=Ce=>Y.value=Ce),title:t(e)("@F13B4:创建新分支"),size:"small","destroy-on-close":!0,"custom-class":"create-branch-dialog"},{footer:a(()=>[s("div",Xf,[s("div",ep,[s("button",{type:"button",class:"footer-btn cancel-btn",onClick:J[4]||(J[4]=Ce=>Y.value=!1)},i(t(e)("@F13B4:取消")),1),s("button",{type:"button",class:"footer-btn primary-btn",onClick:V,disabled:t(d).isCreatingBranch},[t(d).isCreatingBranch?(c(),q(he,{key:1,class:"is-loading"},{default:a(()=>J[13]||(J[13]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("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 32z"})],-1)])),_:1})):(c(),q(he,{key:0},{default:a(()=>[o(t(ct))]),_:1})),s("span",null,i(t(e)("@F13B4:创建")),1)],8,tp)])])]),default:a(()=>[s("div",Kf,[o(le,{model:{newBranchName:T.value,selectedBaseBranch:P.value},"label-position":"top"},{default:a(()=>[o(A,null,{label:a(()=>[s("div",Qf,[o(he,{class:"label-icon"},{default:a(()=>[o(t(js))]),_:1}),s("span",null,i(t(e)("@F13B4:新分支名称")),1)])]),default:a(()=>[o(ke,{modelValue:T.value,"onUpdate:modelValue":J[2]||(J[2]=Ce=>T.value=Ce),placeholder:t(e)("@F13B4:请输入新分支名称"),class:"modern-input",size:"large",onKeyup:Ds(V,["enter"])},null,8,["modelValue","placeholder"])]),_:1}),o(A,null,{label:a(()=>[s("div",Zf,[o(he,{class:"label-icon"},{default:a(()=>[o(t(Os))]),_:1}),s("span",null,i(t(e)("@F13B4:基于分支")),1)])]),default:a(()=>[o(fe,{modelValue:P.value,"onUpdate:modelValue":J[3]||(J[3]=Ce=>P.value=Ce),placeholder:t(e)("@F13B4:选择基础分支"),class:"modern-select",size:"large",style:{width:"100%"}},{default:a(()=>[(c(!0),g(Be,null,Re(t(d).allBranches,Ce=>(c(),q(z,{key:Ce,label:Ce,value:Ce},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1})]),_:1},8,["model"])])]),_:1},8,["modelValue","title"])])):(c(),g("div",Mf,[o(be,{class:"loading-card"},{default:a(()=>[s("div",zf,[o(he,{class:"is-loading"},{default:a(()=>J[10]||(J[10]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("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})]),s("div",Of,i(t(e)("@F13B4:加载中...")),1)]),_:1})]))]),s("footer",sp,[t(d).currentBranch?(c(),g("div",op,[o(ys,{class:"branch-wrapper",compact:""},{content:a(()=>[o(ce,{content:t(e)("@F13B4:当前分支"),placement:"top",effect:"dark","show-after":200},{default:a(()=>[s("span",{class:"branch-label","aria-label":t(e)("@F13B4:当前分支"),title:t(e)("@F13B4:当前分支")},[o(he,{class:"branch-icon"},{default:a(()=>J[14]||(J[14]=[s("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[s("path",{fill:"currentColor",d:"M256 160a96 96 0 1 1 0 192 96 96 0 0 1 0-192zm0 512a96 96 0 1 1 0 192 96 96 0 0 1 0-192zm512-480a96 96 0 1 1 0 192 96 96 0 0 1 0-192zM352 256h288a128 128 0 0 1 128 128v48a144 144 0 0 1-144 144H368a16 16 0 0 0-16 16v64h-96v-64a112 112 0 0 1 112-112h256a80 80 0 0 0 80-80v-16a64 64 0 0 0-64-64H352v-64z"})],-1)])),_:1})],8,ap)]),_:1},8,["content"]),o(fe,{modelValue:t(d).currentBranch,"onUpdate:modelValue":J[6]||(J[6]=Ce=>t(d).currentBranch=Ce),onChange:oe,loading:t(d).isChangingBranch,class:"branch-select"},{default:a(()=>[(c(!0),g(Be,null,Re(t(d).allBranches,Ce=>(c(),q(z,{key:Ce,label:Ce,value:Ce},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),actions:a(()=>[s("button",{class:"modern-btn btn-icon-28",onClick:N},[o(he,{class:"btn-icon"},{default:a(()=>[o(t(js))]),_:1})])]),_:1})])):W("",!0),t(d).remoteUrl?(c(),g("div",np,[o(ys,{class:"footer-right",compact:""},{content:a(()=>[s("span",lp,i(t(e)("@F13B4:远程仓库:")),1),o(ce,{content:t(d).remoteUrl,placement:"top",effect:"dark","show-after":300},{default:a(()=>[s("span",ip,i(t(d).remoteUrl),1)]),_:1},8,["content"])]),actions:a(()=>[o(ce,{content:t(e)("@F13B4:复制仓库地址"),placement:"top",effect:"dark","show-after":200},{default:a(()=>[s("button",{class:"modern-btn btn-icon-28",onClick:J[7]||(J[7]=Ce=>t(d).copyRemoteUrl())},[o(he,{class:"btn-icon"},{default:a(()=>[o(t(Bs))]),_:1})])]),_:1},8,["content"])]),_:1})])):W("",!0)]),o(Bf,{modelValue:me.value,"onUpdate:modelValue":J[8]||(J[8]=Ce=>me.value=Ce)},null,8,["modelValue"])]),_:1},8,["locale"])}}}),cp=De(rp,[["__scopeId","data-v-902d8179"]]),Gs=da(cp);Gs.use(fa());Gs.use(ts);Gs.mount("#app");
|