zen-gitsync 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ui/client/components.d.ts +1 -0
- package/src/ui/client/src/components/CommitForm.vue +1032 -178
- package/src/ui/client/src/components/GitStatus.vue +572 -135
- package/src/ui/client/src/components/LogList.vue +907 -223
- package/src/ui/client/src/stores/gitLogStore.ts +25 -5
- package/src/ui/client/src/stores/gitStore.ts +129 -1
- package/src/ui/client/stats.html +1 -1
- package/src/ui/client/vite.config.ts +2 -0
- package/src/ui/public/assets/index-C3BbS3PG.css +1 -0
- package/src/ui/public/assets/index-P9BcPWc5.js +20 -0
- package/src/ui/public/assets/vendor-eqaTZKOh.js +45 -0
- package/src/ui/public/index.html +3 -3
- package/src/ui/server/index.js +473 -50
- package/src/ui/public/assets/index-DaPynzAr.js +0 -10
- package/src/ui/public/assets/index-qfIezZmd.css +0 -1
- package/src/ui/public/assets/vendor-BcSuWc8z.js +0 -45
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.card[data-v-05fe3eaf]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;border:1px solid rgba(0,0,0,.03);height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden}.status-header[data-v-05fe3eaf]{display:flex;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid #f0f0f0;height:36px}.status-header h2[data-v-05fe3eaf]{margin:0;font-size:16px;font-weight:500;color:#303133}.header-actions[data-v-05fe3eaf]{display:flex;align-items:center}.card-content[data-v-05fe3eaf]{padding:15px;overflow-y:auto;flex:1;display:flex;flex-direction:column;min-height:300px}.current-directory[data-v-05fe3eaf]{display:flex;align-items:center;margin-bottom:16px;padding:10px;background-color:#f8f9fa;border-radius:6px;font-family:monospace;border:1px solid #f0f0f0}.current-directory .el-icon[data-v-05fe3eaf]{margin-right:8px;color:#409eff}.current-directory span[data-v-05fe3eaf]{flex-grow:1;word-break:break-all;margin-right:10px}.status-box[data-v-05fe3eaf]{white-space:pre-wrap;font-family:monospace;background-color:#f8f9fa;padding:16px;border-radius:6px;margin-bottom:20px;max-height:200px;overflow-y:auto;border:1px solid #f0f0f0;font-size:14px;line-height:1.5}.file-list-container[data-v-05fe3eaf]{flex:1;overflow:hidden;display:flex;flex-direction:column;margin-bottom:0;gap:12px;height:auto;min-height:100px}.file-group[data-v-05fe3eaf]{background-color:#f8f9fa;border-radius:6px;overflow:hidden;border:1px solid #ebeef5;margin-bottom:12px;display:flex;flex-direction:column}.file-group[data-v-05fe3eaf]{flex:0 1 auto}.file-group[data-v-05fe3eaf]:last-child{margin-bottom:0;flex:1 1 auto}.file-group-header[data-v-05fe3eaf]{font-size:14px;font-weight:700;padding:8px 12px;background-color:#f0f2f5;color:#606266;border-bottom:1px solid #ebeef5;flex-shrink:0}.file-list[data-v-05fe3eaf]{overflow-y:auto;min-height:40px;max-height:200px;flex-grow:1;padding:0;margin:0;scrollbar-width:thin;scrollbar-color:rgba(144,147,153,.3) transparent}.file-list[data-v-05fe3eaf]::-webkit-scrollbar{width:6px;height:6px}.file-list[data-v-05fe3eaf]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:4px}.file-list[data-v-05fe3eaf]::-webkit-scrollbar-thumb:hover{background-color:#90939980}.file-list[data-v-05fe3eaf]::-webkit-scrollbar-track{background-color:transparent}.file-list[data-v-05fe3eaf]:empty{display:none}.file-list[data-v-05fe3eaf]:has(.empty-file-group){overflow-y:hidden}.empty-file-container[data-v-05fe3eaf]{overflow-y:hidden!important;display:flex;flex-direction:column;align-items:stretch;flex:1}.empty-file-group[data-v-05fe3eaf]{padding:16px;text-align:center;color:#909399;font-size:13px;font-style:italic;display:flex;align-items:center;justify-content:center;min-height:50px;background-color:#f8f9fa;border-radius:4px;margin:8px}.file-group[data-v-05fe3eaf]:nth-child(1){flex:0 1 auto}.file-group[data-v-05fe3eaf]:nth-child(2){flex:0 1 auto}.file-group[data-v-05fe3eaf]:nth-child(3){flex:1 1 auto}.file-item[data-v-05fe3eaf]{padding:8px 12px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ebeef5;cursor:pointer;transition:background-color .2s}.file-item[data-v-05fe3eaf]:last-child{border-bottom:none}.file-item[data-v-05fe3eaf]:hover{background-color:#ecf5ff}.file-info[data-v-05fe3eaf]{display:flex;align-items:center;flex-grow:1;overflow:hidden;white-space:nowrap;gap:8px}.file-status-indicator[data-v-05fe3eaf]{width:6px;height:6px;border-radius:50%;background-color:#409eff;flex-shrink:0}.file-status-indicator.added[data-v-05fe3eaf]{background-color:#67c23a}.file-status-indicator.modified[data-v-05fe3eaf]{background-color:#409eff}.file-status-indicator.deleted[data-v-05fe3eaf]{background-color:#f56c6c}.file-status-indicator.untracked[data-v-05fe3eaf]{background-color:#e6a23c}.file-path-container[data-v-05fe3eaf]{display:flex;flex-direction:column;overflow:hidden}.file-name[data-v-05fe3eaf]{font-weight:500;color:#303133;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.file-directory[data-v-05fe3eaf]{font-size:12px;color:#909399;max-width:200px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.file-actions[data-v-05fe3eaf]{display:flex;gap:5px;opacity:0;transition:opacity .2s}.file-item:hover .file-actions[data-v-05fe3eaf]{opacity:1}.empty-status[data-v-05fe3eaf]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;background-color:#f9f9f9;border-radius:8px;margin-top:10px}.empty-icon[data-v-05fe3eaf]{width:60px;height:60px;display:flex;align-items:center;justify-content:center;background-color:#ebeef5;border-radius:50%;margin-bottom:15px;font-size:24px;color:#909399;animation:pulse-05fe3eaf 2s infinite ease-in-out}@keyframes pulse-05fe3eaf{0%{transform:scale(1);opacity:.7}50%{transform:scale(1.05);opacity:1}to{transform:scale(1);opacity:.7}}.empty-text[data-v-05fe3eaf]{font-size:16px;font-weight:500;color:#606266;margin-bottom:5px}.empty-subtext[data-v-05fe3eaf]{font-size:14px;color:#909399;margin-bottom:20px}.branch-info[data-v-05fe3eaf]{margin-top:15px;padding:10px 15px;background-color:#ebeef5;border-radius:6px;text-align:left;width:100%;max-width:400px}.branch-info p[data-v-05fe3eaf]{margin:5px 0;font-size:14px;color:#606266}.branch-sync-info[data-v-05fe3eaf]{display:flex;align-items:center;gap:5px;font-size:13px;margin-top:5px;padding:5px 8px;border-radius:4px;background-color:#f5f7fa}.branch-sync-info.warning[data-v-05fe3eaf]{color:#e6a23c;background-color:#fdf6ec}.branch-sync-info.info[data-v-05fe3eaf]{color:#909399;background-color:#f4f4f5}.branch-sync-info.success[data-v-05fe3eaf]{color:#67c23a;background-color:#f0f9eb}.card-content[data-v-05fe3eaf]:empty{display:flex;align-items:center;justify-content:center;background-color:#f8f9fa;border-radius:6px;border:1px dashed #dcdfe6;color:#909399;height:100%}.card-content[data-v-05fe3eaf]:empty:after{content:"没有Git状态信息可显示";font-size:14px}.browser-current-path[data-v-05fe3eaf]{font-family:monospace;margin-bottom:15px;padding:10px;background-color:#f5f7fa;border-radius:6px;overflow-x:auto;white-space:nowrap;border:1px solid #ebeef5}.browser-error[data-v-05fe3eaf]{color:#f56c6c;margin:10px 0;padding:10px;background-color:#fef0f0;border-radius:4px;border-left:3px solid #f56c6c}.browser-nav[data-v-05fe3eaf]{display:flex;gap:10px;margin-bottom:10px}.no-padding-left[data-v-05fe3eaf]{padding-left:12px}.directory-browser[data-v-05fe3eaf]{height:400px;border:1px solid #ebeef5;border-radius:6px;overflow:hidden;display:flex;flex-direction:column}.directory-items-container[data-v-05fe3eaf]{flex:1;overflow-y:auto;background-color:#f8f9fa;padding:10px}.directory-items[data-v-05fe3eaf]{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.directory-item[data-v-05fe3eaf]{display:flex;align-items:center;padding:8px;cursor:pointer;border-radius:4px;background-color:#fff;border:1px solid #ebeef5;transition:all .2s;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;gap:5px}.directory-item[data-v-05fe3eaf]:hover{background-color:#ecf5ff;border-color:#c6e2ff}.directory-item.directory[data-v-05fe3eaf]{background-color:#f0f7ff;color:#409eff}.directory-item .el-icon[data-v-05fe3eaf]{margin-right:5px;flex-shrink:0}.directory-item.directory .el-icon[data-v-05fe3eaf]{color:#409eff}.directory-item.file .el-icon[data-v-05fe3eaf]{color:#909399}.directory-buttons[data-v-05fe3eaf]{display:flex;gap:10px;margin-top:10px}.branch-sync-status[data-v-05fe3eaf]{display:flex;align-items:center;padding:12px 15px;background-color:#f8f9fa;border-radius:4px;margin-bottom:15px;border-left:3px solid #e6a23c}.git-status-message[data-v-05fe3eaf]{padding:12px 15px;background-color:#f8f9fa;border-radius:4px;margin-bottom:15px;border-left:3px solid #67c23a}.git-status-message p[data-v-05fe3eaf]{margin:0;display:flex;align-items:center;gap:8px;font-size:14px;color:#606266}.sync-status-content[data-v-05fe3eaf]{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.status-badges[data-v-05fe3eaf]{display:flex;flex-direction:column;gap:8px;width:100%}.status-badge[data-v-05fe3eaf]{display:flex;align-items:center;width:100%}.status-badge.el-tag--warning[data-v-05fe3eaf]{background-color:#fdf6ec;border-color:#faecd8}.status-badge.el-tag--info[data-v-05fe3eaf]{background-color:#f4f4f5;border-color:#e9e9eb}.badge-content[data-v-05fe3eaf]{display:flex;align-items:center;gap:6px;font-size:13px}.diff-dialog[data-v-05fe3eaf]{height:calc(100vh - 150px)}.diff-dialog-header[data-v-05fe3eaf]{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #ebeef5;background-color:#f9f9fb}.file-title[data-v-05fe3eaf]{display:flex;align-items:center;font-size:16px;font-weight:500;color:#303133;gap:10px;overflow:hidden}.file-icon[data-v-05fe3eaf]{color:#409eff;font-size:20px}.file-path[data-v-05fe3eaf]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:monospace}.diff-content[data-v-05fe3eaf]{flex:1;overflow-y:auto;padding:10px 20px;background-color:#fafafa}[data-v-05fe3eaf] .el-dialog__body{height:calc(100vh - 320px);overflow:auto}.diff-formatted[data-v-05fe3eaf]{font-family:Consolas,Courier New,monospace;font-size:14px;line-height:1.5;white-space:pre-wrap;padding-bottom:20px}.no-diff[data-v-05fe3eaf]{display:flex;align-items:center;justify-content:center;height:100%;color:#909399;font-size:14px}.file-navigation[data-v-05fe3eaf]{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;border-top:1px solid #ebeef5;background-color:#f9f9fb}.counter-tag[data-v-05fe3eaf]{font-family:monospace;font-size:14px;padding:6px 12px;min-width:80px;text-align:center}.nav-button[data-v-05fe3eaf]{min-width:120px}.diff-formatted[data-v-05fe3eaf]::-webkit-scrollbar,.diff-content[data-v-05fe3eaf]::-webkit-scrollbar{width:6px;height:6px}.diff-formatted[data-v-05fe3eaf]::-webkit-scrollbar-thumb,.diff-content[data-v-05fe3eaf]::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:4px}.diff-formatted[data-v-05fe3eaf]::-webkit-scrollbar-thumb:hover,.diff-content[data-v-05fe3eaf]::-webkit-scrollbar-thumb:hover{background-color:#90939980}.diff-formatted[data-v-05fe3eaf]::-webkit-scrollbar-track,.diff-content[data-v-05fe3eaf]::-webkit-scrollbar-track{background-color:transparent}.diff-formatted[data-v-05fe3eaf],.diff-content[data-v-05fe3eaf]{scrollbar-width:thin;scrollbar-color:rgba(144,147,153,.3) transparent}.diff-header{font-weight:700;background-color:#e6f1fc;padding:5px;margin:8px 0;border-radius:4px;color:#0366d6;border-bottom:1px solid #c8e1ff}.diff-old-file,.diff-new-file{color:#586069;padding:2px 5px;font-family:monospace}.diff-old-file{color:#cb2431}.diff-new-file{color:#22863a}.diff-hunk-header{color:#6f42c1;background-color:#f1f8ff;padding:2px 5px;margin:5px 0;border-radius:3px;font-family:monospace}.diff-added{background-color:#e6ffed;color:#22863a;padding:0 5px;border-left:4px solid #22863a;font-family:monospace;display:block;margin:2px 0}.diff-removed{background-color:#ffeef0;color:#cb2431;padding:0 5px;border-left:4px solid #cb2431;font-family:monospace;display:block;margin:2px 0}.diff-context{color:#444;padding:0 5px;font-family:monospace;display:block;margin:2px 0;background-color:#fafbfc}.auto-update-switch .el-switch__core{transition:all .3s ease-in-out;box-shadow:0 2px 5px #0000001a}.auto-update-switch .el-switch__core:hover{box-shadow:0 2px 8px #0003}.auto-update-switch.is-checked .el-switch__core{box-shadow:0 2px 5px #67c23a4d}.auto-update-switch.is-checked .el-switch__core:hover{box-shadow:0 2px 8px #67c23a80}@keyframes snakeBorder-ce8851cb{0%,to{border-top:2px solid #409EFF;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent}25%{border-top:2px solid #409EFF;border-right:2px solid #67C23A;border-bottom:2px solid transparent;border-left:2px solid transparent}50%{border-top:2px solid transparent;border-right:2px solid #67C23A;border-bottom:2px solid #409EFF;border-left:2px solid transparent}75%{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid #409EFF;border-left:2px solid #67C23A}}@keyframes glowPulse-ce8851cb{0%,to{box-shadow:0 0 8px #409eff66}50%{box-shadow:0 0 12px #67c23a80}}.card[data-v-ce8851cb]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;border:1px solid rgba(0,0,0,.03);height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden;position:relative}.card-header[data-v-ce8851cb]{padding:8px 16px;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;align-items:center;height:36px}.card-header h2[data-v-ce8851cb]{margin:0;font-size:16px;font-weight:500;color:#303133}.card-content[data-v-ce8851cb]{padding:15px;overflow-y:auto;flex:1}.layout-container[data-v-ce8851cb]{display:flex;flex-direction:column;gap:15px;height:100%}.commit-section[data-v-ce8851cb]{flex:1;min-width:0}.actions-section[data-v-ce8851cb]{width:100%;flex-shrink:0}.actions-section h3[data-v-ce8851cb]{margin-top:0;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #dcdfe6;font-size:16px;color:#303133;font-weight:500}.operations-wrapper[data-v-ce8851cb]{display:flex;gap:10px}.action-groups[data-v-ce8851cb]{display:flex;flex-direction:column;gap:12px}.action-group[data-v-ce8851cb]{background-color:#f9f9f9;border-radius:6px;padding:8px 10px;box-shadow:0 1px 3px #0000000d;border-left:3px solid #409EFF;flex:1}.action-group[data-v-ce8851cb]:nth-child(2){border-left-color:#e6a23c}.action-group[data-v-ce8851cb]:nth-child(3){border-left-color:#909399}.group-title[data-v-ce8851cb]{font-size:13px;font-weight:700;margin-bottom:8px;color:#606266;text-align:left;display:block;position:relative;padding-left:6px;border-bottom:1px solid rgba(0,0,0,.06);padding-bottom:6px}.group-buttons[data-v-ce8851cb]{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;padding:0}.action-button[data-v-ce8851cb]{font-size:14px;font-weight:500;flex:1;min-width:100px;border-radius:4px;height:36px;padding:0 10px}.action-button[data-v-ce8851cb]:hover{transform:translateY(-1px);box-shadow:0 2px 5px #00000026}.action-button[data-v-ce8851cb]:active{transform:translateY(0)}.command-text[data-v-ce8851cb],.command-text-long[data-v-ce8851cb]{display:none}.standard-commit-form[data-v-ce8851cb]{display:flex;flex-direction:column;gap:15px;margin-bottom:15px}.standard-commit-header[data-v-ce8851cb]{display:flex;flex-direction:column;gap:10px;width:100%}.type-select[data-v-ce8851cb]{width:100%}.scope-container[data-v-ce8851cb]{display:flex;align-items:center;gap:5px;width:100%}.scope-input[data-v-ce8851cb]{flex-grow:1}.description-container[data-v-ce8851cb]{display:flex;align-items:center;gap:5px;width:100%}.description-input[data-v-ce8851cb]{flex-grow:1}.settings-button[data-v-ce8851cb]{flex-shrink:0}.preview-section[data-v-ce8851cb]{background-color:#f5f7fa;padding:10px;border-radius:4px;margin-top:10px}.preview-title[data-v-ce8851cb]{font-weight:700;margin-bottom:5px}.preview-content[data-v-ce8851cb]{white-space:pre-wrap;font-family:monospace;margin:0;padding:10px;background-color:#ebeef5;border-radius:4px}.template-container[data-v-ce8851cb]{display:flex;flex-direction:column;height:calc(85vh - 100px);overflow-y:auto;padding:5px}.template-form[data-v-ce8851cb]{margin-bottom:20px;background-color:#f8f9fa;padding:15px;border-radius:6px;border:1px solid #ebeef5}.template-form-buttons[data-v-ce8851cb]{display:flex;gap:10px;margin-top:12px;justify-content:flex-end}.template-input[data-v-ce8851cb]{flex-grow:1}.template-list[data-v-ce8851cb]{overflow-y:auto;height:100%}.template-list h3[data-v-ce8851cb]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.template-item[data-v-ce8851cb]{margin-bottom:10px;transition:all .2s ease;border:1px solid #ebeef5}.template-item[data-v-ce8851cb]:hover{background-color:#f5f7fa;transform:translateY(-2px);box-shadow:0 2px 12px #0000001a}.template-content[data-v-ce8851cb]{flex-grow:1;margin-right:10px;word-break:break-all;padding:5px 0;color:#303133;font-weight:500}.template-actions[data-v-ce8851cb]{display:flex;gap:8px;justify-content:flex-end;min-width:180px;flex-shrink:0}.options-row[data-v-ce8851cb]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.code-command[data-v-ce8851cb]{background-color:#2d2d2d;color:#f8f8f2;font-family:Courier New,Courier,monospace;padding:10px;border-radius:4px;overflow-x:auto;white-space:pre;font-size:14px}@media (min-width: 768px){.layout-container[data-v-ce8851cb]{flex-direction:row}.commit-section[data-v-ce8851cb]{flex:3}.actions-section[data-v-ce8851cb]{width:320px}.operations-wrapper[data-v-ce8851cb]{flex-direction:column}}.git-config-warning[data-v-ce8851cb]{width:100%}.config-command[data-v-ce8851cb]{background-color:#2d2d2d;color:#f8f8f2;font-family:Courier New,Courier,monospace;padding:10px;border-radius:4px;margin-top:10px;white-space:pre}@keyframes pushing-pulse-ce8851cb{0%{box-shadow:0 0 #67c23a66}70%{box-shadow:0 0 0 15px #67c23a00}to{box-shadow:0 0 #67c23a00}}@keyframes pushing-border-ce8851cb{0%{border-color:#67c23a}50%{border-color:#85ce61}to{border-color:#67c23a}}.card.is-pushing[data-v-ce8851cb]{animation:pushing-border-ce8851cb 1.5s infinite ease-in-out;box-shadow:0 4px 12px #0000001a;transition:all .3s ease}.push-button[data-v-ce8851cb]{background-color:#67c23a;border-color:#67c23a}.push-button[data-v-ce8851cb]:hover{background-color:#85ce61;border-color:#85ce61}.push-button.is-loading[data-v-ce8851cb],.push-button.is-loading[data-v-ce8851cb]:hover,.push-button.is-loading[data-v-ce8851cb]:focus{animation:pushing-pulse-ce8851cb 1.5s infinite;background-color:#67c23a!important;border-color:#67c23a!important}.el-button.push-button.is-loading .el-loading-spinner[data-v-ce8851cb]{color:#fff!important}@keyframes one-click-push-glow-ce8851cb{0%{box-shadow:0 0 5px #67c23a80}50%{box-shadow:0 0 20px #67c23acc}to{box-shadow:0 0 5px #67c23a80}}.action-button.one-click-push[data-v-ce8851cb]{position:relative;overflow:hidden}.action-button.one-click-push.is-loading[data-v-ce8851cb],.action-button.one-click-push.is-loading[data-v-ce8851cb]:hover{animation:one-click-push-glow-ce8851cb 1.5s infinite;background-color:#67c23a!important;border-color:#67c23a!important}@keyframes push-success-ce8851cb{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.push-success-indicator[data-v-ce8851cb]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#fff;border-radius:12px;padding:20px 30px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;align-items:center;justify-content:center;animation:push-success-ce8851cb .5s ease-out;z-index:9999;width:200px;height:200px}.push-success-icon[data-v-ce8851cb]{font-size:64px;color:#67c23a;margin-bottom:16px;animation:bounce-ce8851cb .8s ease-in-out}@keyframes bounce-ce8851cb{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-20px)}60%{transform:translateY(-10px)}}.push-success-text[data-v-ce8851cb]{font-size:20px;font-weight:700;color:#303133;text-align:center}.reset-button[data-v-ce8851cb]{background-color:#909399;border-color:#909399}.reset-button[data-v-ce8851cb]:hover{background-color:#a6a9ad;border-color:#a6a9ad}.el-button+.el-button[data-v-ce8851cb]{margin-left:0}.pushing-indicator[data-v-ce8851cb]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#409eff;border-radius:12px;padding:20px 30px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;width:200px;height:200px;color:#fff}.pushing-spinner[data-v-ce8851cb]{margin-bottom:16px}.pushing-text[data-v-ce8851cb]{font-size:20px;font-weight:700;text-align:center}.circular[data-v-ce8851cb]{height:64px;width:64px;animation:pushing-rotate-ce8851cb 2s linear infinite}.path[data-v-ce8851cb]{stroke:#fff;stroke-width:4;stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0;animation:pushing-dash-ce8851cb 1.5s ease-in-out infinite}@keyframes pushing-rotate-ce8851cb{to{transform:rotate(360deg)}}@keyframes pushing-dash-ce8851cb{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.message-template-container[data-v-ce8851cb]{display:flex;flex-direction:column;height:calc(100vh - 278px);overflow:hidden}.templates-container[data-v-ce8851cb]{display:flex;gap:20px;margin-top:15px;flex:1;overflow:hidden}.message-templates-list[data-v-ce8851cb]{flex:3;display:flex;flex-direction:column;border-right:1px solid #ebeef5;padding-right:15px;height:calc(100vh - 432px)}.message-templates-list h3[data-v-ce8851cb]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.current-default-message[data-v-ce8851cb]{flex:2;display:flex;flex-direction:column;gap:15px;padding-left:15px}.current-default-message h3[data-v-ce8851cb]{margin-top:0;margin-bottom:15px;font-size:16px;font-weight:500;color:#303133;padding-bottom:8px;border-bottom:1px solid #ebeef5}.templates-scroll-area[data-v-ce8851cb]{overflow-y:auto;padding-right:5px;flex:1}.default-message-card[data-v-ce8851cb]{margin-bottom:15px;box-shadow:0 2px 8px #00000014;border-radius:4px;transition:all .3s ease}.default-message-card[data-v-ce8851cb]:hover{box-shadow:0 4px 12px #0000001f}.default-message-content[data-v-ce8851cb]{padding:12px 15px;background-color:#f0f9eb;border-left:3px solid #67c23a;font-weight:500;word-break:break-all;min-height:60px;display:flex;align-items:center;border-radius:0 4px 4px 0;color:#303133}.message-help-text[data-v-ce8851cb]{background-color:#f8f9fa;border-radius:4px;padding:15px;font-size:14px;color:#606266;border-left:3px solid #909399;margin-top:auto;box-shadow:0 2px 8px #0000000d}.message-help-text h4[data-v-ce8851cb]{margin-top:0;margin-bottom:10px;color:#303133;font-size:15px}.message-help-text p[data-v-ce8851cb]{margin:8px 0;line-height:1.5}.git-cmd-tooltip{font-family:Consolas,Courier New,monospace!important;font-size:13px!important;font-weight:500!important;color:#303133!important;background-color:#f5f7fa!important;border:1px solid #dcdfe6!important;border-radius:4px!important;padding:8px 12px!important;box-shadow:0 2px 12px #0000001a!important}.template-dialog .el-dialog__header,.message-template-dialog .el-dialog__header{padding:15px 20px;margin-right:0;border-bottom:1px solid #ebeef5;background-color:#f8f9fa}.template-dialog .el-dialog__title,.message-template-dialog .el-dialog__title{font-size:16px;font-weight:600;color:#303133}.template-dialog .el-dialog__body,.message-template-dialog .el-dialog__body{padding:20px}.template-dialog .el-dialog__headerbtn,.message-template-dialog .el-dialog__headerbtn{top:15px;right:20px}.template-dialog .el-input__inner,.message-template-dialog .el-input__inner{height:40px;line-height:40px}.template-dialog .el-button,.message-template-dialog .el-button{border-radius:4px;font-weight:500}.template-dialog .el-card,.message-template-dialog .el-card{border-radius:4px;overflow:hidden}.template-dialog .el-card__body,.message-template-dialog .el-card__body{padding:12px 15px}.template-dialog .el-empty__image,.message-template-dialog .el-empty__image{width:80px;height:80px}.card[data-v-b43b7b4e]{background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #00000008;height:100%;width:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.03);overflow:hidden}.log-header[data-v-b43b7b4e]{display:flex;justify-content:space-between;align-items:center;margin-bottom:0;padding:8px 16px;background-color:#fff;border-bottom:1px solid #f0f0f0;position:sticky;top:0;z-index:100;height:36px;flex-shrink:0}.header-left[data-v-b43b7b4e]{display:flex;align-items:center;gap:8px}.log-header h2[data-v-b43b7b4e]{margin:0;font-size:16px;font-weight:500}.log-actions[data-v-b43b7b4e]{display:flex;gap:8px}.content-area[data-v-b43b7b4e]{padding:10px 0;flex:1;min-height:100px;height:calc(100% - 52px);display:flex;flex-direction:column}.content-area>div[data-v-b43b7b4e]{flex:1;display:flex;flex-direction:column}.el-table[data-v-b43b7b4e]{--el-table-border-color: #f0f0f0;--el-table-header-bg-color: #f8f9fa;border-radius:4px;overflow:hidden}.log-actions[data-v-b43b7b4e]{display:flex;gap:12px}.branch-container[data-v-b43b7b4e]{display:flex;flex-wrap:wrap;gap:4px}.branch-tag[data-v-b43b7b4e]{margin-right:4px}.commit-count[data-v-b43b7b4e]{margin-bottom:10px;font-size:14px;color:#606266;text-align:right}.graph-view[data-v-b43b7b4e]{width:100%;flex:1;display:flex;flex-direction:column;overflow-y:auto}.graph-container[data-v-b43b7b4e]{width:100%;flex:1;min-height:500px;border:1px solid #ebeef5;border-radius:4px;padding:10px;background-color:#fff;position:relative}.graph-container svg[data-v-b43b7b4e]{transform-origin:top left;transition:transform .2s ease}.graph-controls[data-v-b43b7b4e]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.zoom-controls[data-v-b43b7b4e]{display:flex;gap:8px}.zoom-slider[data-v-b43b7b4e]{width:200px}.scale-info[data-v-b43b7b4e]{font-size:14px;color:#606266}.refresh-button-animated[data-v-b43b7b4e]{animation:pulse-b43b7b4e 1s}.refresh-notification[data-v-b43b7b4e]{background-color:#f0f9eb;color:#67c23a;padding:10px 15px;border-radius:8px;font-size:14px;border-left:4px solid #67c23a;animation:fadeOut-b43b7b4e 2s forwards;position:fixed;top:20px;right:20px;z-index:9999;box-shadow:0 4px 12px #0000001a;max-width:300px;text-align:center}@keyframes pulse-b43b7b4e{0%{transform:scale(1)}50%{transform:scale(1.2)}to{transform:scale(1)}}@keyframes fadeOut-b43b7b4e{0%{opacity:0;transform:translateY(-20px)}20%{opacity:1;transform:translateY(0)}80%{opacity:1}to{opacity:0}}.author-name[data-v-b43b7b4e]{cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:100%}.commit-hash[data-v-b43b7b4e]{cursor:pointer;color:#409eff;font-family:monospace}.commit-hash[data-v-b43b7b4e]:hover{text-decoration:underline}.commit-detail-container[data-v-b43b7b4e]{display:flex;flex-direction:column;gap:20px}.commit-info[data-v-b43b7b4e]{padding:12px;background-color:#f5f7fa;border-radius:8px;font-size:14px;display:flex;flex-direction:column;gap:12px}.commit-info-header[data-v-b43b7b4e]{display:flex;flex-wrap:wrap;gap:15px;align-items:center;background-color:#fff;padding:10px;border-radius:4px;border:1px solid #e4e7ed}.info-item[data-v-b43b7b4e]{display:flex;align-items:center;gap:5px}.item-label[data-v-b43b7b4e]{font-weight:700;color:#606266;white-space:nowrap}.item-value[data-v-b43b7b4e]{color:#333;word-break:break-all}.commit-message-container[data-v-b43b7b4e]{display:flex;flex-direction:column;gap:5px}.message-label[data-v-b43b7b4e]{font-weight:700;color:#606266}.message-content[data-v-b43b7b4e]{background-color:#fff;padding:12px;border-radius:4px;font-family:monospace;white-space:pre-wrap;line-height:1.5;border:1px solid #e4e7ed;border-left:4px solid #409EFF}.commit-files-diff[data-v-b43b7b4e]{margin-top:5px;display:flex;gap:20px;height:60vh}.files-list[data-v-b43b7b4e]{width:25%;overflow-y:auto;background-color:#f5f7fa;border-radius:8px;padding:10px}.files-list h3[data-v-b43b7b4e]{margin-top:0;padding-bottom:10px;border-bottom:1px solid #dcdfe6;font-size:16px}.files-list ul[data-v-b43b7b4e]{list-style:none;padding:0;margin:0}.files-list li[data-v-b43b7b4e]{padding:8px 10px;cursor:pointer;border-radius:4px;margin-bottom:5px;font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.files-list li[data-v-b43b7b4e]:hover{background-color:#ecf5ff}.files-list li.active-file[data-v-b43b7b4e]{background-color:#409eff;color:#fff}.file-diff[data-v-b43b7b4e]{flex:1;display:flex;flex-direction:column;background-color:#f5f7fa;border-radius:8px;padding:10px;overflow:hidden}.file-diff h3[data-v-b43b7b4e]{margin-top:0;padding-bottom:10px;border-bottom:1px solid #dcdfe6;font-size:16px}.diff-content[data-v-b43b7b4e]{flex:1;overflow-y:auto;background-color:#fff;padding:10px;border-radius:4px;font-family:monospace;font-size:13px;line-height:1.5}.diff-header[data-v-b43b7b4e]{font-weight:700;color:#409eff}.diff-old-file[data-v-b43b7b4e]{color:#e6a23c}.diff-new-file[data-v-b43b7b4e]{color:#67c23a}.diff-hunk-header[data-v-b43b7b4e]{font-weight:700;color:#409eff}.diff-added[data-v-b43b7b4e]{background-color:#f0f9eb;color:#67c23a}.diff-removed[data-v-b43b7b4e]{background-color:#fef2f2;color:#f56c6c}.diff-context[data-v-b43b7b4e]{background-color:#f5f7fa}[data-v-b43b7b4e] .commit-detail-dialog{--el-dialog-margin-top: 7vh}.history-controls[data-v-b43b7b4e]{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;position:sticky;top:52px;z-index:90;background-color:#fff;padding:5px 0;transition:box-shadow .3s ease,background-color .3s ease,padding .2s ease}.content-area:not(:hover) .history-controls[data-v-b43b7b4e]:not(:hover){box-shadow:0 2px 8px #0000000f}.history-stats[data-v-b43b7b4e]{display:flex;align-items:center}.record-count[data-v-b43b7b4e]{display:flex;align-items:center;height:36px;padding-left:15px;padding-right:15px}.record-count[data-v-b43b7b4e] .el-icon{margin-right:6px}.filter-badge[data-v-b43b7b4e] .el-badge__content{background-color:#409eff}.filter-panel[data-v-b43b7b4e]{background-color:#f5f7fa;border-radius:8px;padding:15px;margin-bottom:15px;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000000d;position:sticky;top:98px;z-index:89;transition:box-shadow .3s ease,background-color .3s ease,transform .2s ease}.content-area:not(:hover) .filter-panel[data-v-b43b7b4e]:not(:hover){box-shadow:0 3px 16px #0000001a}.filter-panel[data-v-b43b7b4e]:hover{box-shadow:0 4px 20px #00000026}.filter-form[data-v-b43b7b4e]{display:flex;flex-wrap:wrap;gap:15px;align-items:flex-end}.filter-item[data-v-b43b7b4e]{display:flex;flex-direction:column;gap:5px}.filter-label[data-v-b43b7b4e]{font-size:13px;color:#606266;font-weight:700}.filter-input[data-v-b43b7b4e]{width:200px}.filter-input.date-range[data-v-b43b7b4e]{width:350px}.filter-actions[data-v-b43b7b4e]{display:flex;align-items:center;gap:10px}.log-table[data-v-b43b7b4e]{transition:margin-top .3s ease;min-height:200px;height:100%}.log-table.has-filter[data-v-b43b7b4e]{margin-top:10px}.log-table.has-sticky-controls[data-v-b43b7b4e]{margin-top:52px!important}.log-table.has-sticky-filter[data-v-b43b7b4e]{margin-top:140px!important}.el-table__empty-block[data-v-b43b7b4e]{min-height:200px;justify-content:center;align-items:center}.content-area>div[data-v-b43b7b4e]:not(.graph-view){display:flex;flex-direction:column;height:100%}.table-view-container[data-v-b43b7b4e]{display:flex;flex-direction:column;flex:1;height:100%;overflow-y:auto}.log-table[data-v-b43b7b4e]{width:100%;flex:1}.table-view-container .el-table[data-v-b43b7b4e]{flex:1;width:100%}.table-view-container .el-table__inner-wrapper[data-v-b43b7b4e],.table-view-container .el-table__body-wrapper[data-v-b43b7b4e]{width:100%}.filter-panel.filter-sticky[data-v-b43b7b4e]{background-color:#f5f7faf7;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);box-shadow:0 3px 10px #0000001f;border-top:none}.history-controls.controls-sticky[data-v-b43b7b4e]{box-shadow:0 2px 8px #0000001a;background-color:#fffffffa;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);padding:8px 0;border-bottom:1px solid rgba(0,0,0,.05)}.filter-panel-header[data-v-b43b7b4e]{background-color:#f5f7fa;padding:10px 16px;border-bottom:1px solid #e4e7ed;position:sticky;top:36px;z-index:99;transition:all .3s ease;flex-shrink:0;margin-bottom:0;box-shadow:0 2px 8px #0000000d}.filter-panel-header .filter-form[data-v-b43b7b4e]{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;justify-content:flex-start}.filter-panel-header .filter-item[data-v-b43b7b4e]{margin-right:12px}.filter-panel-header .filter-label[data-v-b43b7b4e]{font-size:12px;color:#606266;margin-bottom:4px}.filter-panel-header .filter-input[data-v-b43b7b4e]{width:180px}.filter-panel-header .filter-input.date-range[data-v-b43b7b4e]{width:320px}.content-area.with-filter[data-v-b43b7b4e]{height:calc(100% - 112px)}.record-count[data-v-b43b7b4e]{display:flex;align-items:center;height:24px;padding-left:8px;padding-right:8px;margin-left:8px}.record-count[data-v-b43b7b4e] .el-icon{margin-right:4px;font-size:12px}.table-view-container[data-v-b43b7b4e]{display:flex;flex-direction:column;flex:1;min-height:400px}.log-table[data-v-b43b7b4e]{width:100%;height:100%;min-height:300px;flex:1}.history-controls[data-v-b43b7b4e],.filter-panel[data-v-b43b7b4e]{display:none}.log-table.has-filter[data-v-b43b7b4e],.log-table.has-sticky-controls[data-v-b43b7b4e],.log-table.has-sticky-filter[data-v-b43b7b4e]{margin-top:0!important}.load-more-container[data-v-b43b7b4e]{display:flex;flex-direction:column;align-items:center;padding:15px 0;border-top:1px dashed #ebeef5;gap:10px;display:none}.pagination-info[data-v-b43b7b4e]{font-size:13px;color:#909399;margin-bottom:5px}.loading-more[data-v-b43b7b4e]{display:flex;align-items:center;color:#909399;font-size:14px}.loading-spinner[data-v-b43b7b4e]{width:20px;height:20px;margin-right:10px;border:2px solid #dcdfe6;border-top-color:#409eff;border-radius:50%;animation:spinner-b43b7b4e 1s linear infinite}@keyframes spinner-b43b7b4e{to{transform:rotate(360deg)}}.load-more-button[data-v-b43b7b4e]{cursor:pointer;color:#409eff;font-size:14px;padding:6px 16px;border:1px solid #d9ecff;background-color:#ecf5ff;border-radius:4px;transition:all .3s}.load-more-button[data-v-b43b7b4e]:hover{background-color:#d9ecff}.no-more-data[data-v-b43b7b4e]{color:#909399;font-size:14px;font-style:italic;display:flex;flex-direction:column;align-items:center}.total-loaded[data-v-b43b7b4e]{font-size:12px;margin-top:5px;color:#c0c4cc}.context-menu[data-v-b43b7b4e]{position:fixed;background:#fff;border:1px solid #dcdfe6;border-radius:4px;box-shadow:0 2px 12px #0000001a;padding:8px 0;z-index:3000;min-width:180px}.context-menu-item[data-v-b43b7b4e]{padding:8px 16px;cursor:pointer;font-size:14px;display:flex;align-items:center}.context-menu-item[data-v-b43b7b4e]:hover{background-color:#f5f7fa}.context-menu-item i[data-v-b43b7b4e]{margin-right:8px}.el-table .el-table__cell .cell{word-break:break-all}body{font-family:Arial,sans-serif;margin:0;padding:0;background-color:#f5f5f5;overflow:hidden;height:100vh}.main-container{position:fixed;top:60px;bottom:60px;left:0;right:0;padding:10px;overflow:hidden}.grid-layout{display:grid;grid-template-columns:1fr 8px 3fr;grid-template-rows:1fr 8px 1fr;grid-template-areas:"git-status v-resizer commit-form" "h-resizer h-resizer h-resizer" "log-list log-list log-list";gap:10px;height:100%}.git-status-panel{grid-area:git-status;overflow:hidden;max-height:100%;padding:0}.commit-form-panel{grid-area:commit-form;overflow:hidden;max-height:100%;padding:0}.log-list-panel{grid-area:log-list;overflow:hidden;max-height:100%;padding:0}.card{background-color:#fff;border-radius:8px;box-shadow:0 4px 12px #0000000d;border:1px solid rgba(0,0,0,.03);height:100%;overflow:hidden;display:flex;flex-direction:column}.main-header{background-color:#24292e;color:#fff;padding:15px 20px;display:flex;justify-content:space-between;align-items:center;position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 2px 10px #0003;height:60px;box-sizing:border-box}.header-left{display:flex;align-items:center;gap:10px}.logo{height:32px;width:auto}h1{margin:0;font-size:24px}.header-info{display:flex;flex-direction:column;align-items:flex-end;gap:5px}#branch-info,#user-info{background-color:#ffffff1a;padding:4px 8px;border-radius:4px;font-size:14px}.branch-label,.user-label,.user-name{font-weight:700;margin-right:5px}.user-email{color:#e0e0e0}.branch-name{font-family:monospace}.status-box{background-color:#f6f8fa;border:1px solid #e1e4e8;border-radius:3px;padding:15px;white-space:pre-wrap;font-family:monospace;overflow-y:auto}.tips{margin-top:20px;padding:15px;background-color:#f5f7fa;border-radius:5px;border-left:4px solid #409eff}.tips h3{margin-top:0;font-size:16px;margin-bottom:10px}.code-block{background-color:#2d2d2d;color:#f8f8f2;font-family:monospace;padding:10px 15px;border-radius:4px;margin-bottom:10px}.loading-container{display:flex;justify-content:center;align-items:center;height:100%}.loading-card{width:300px;text-align:center;padding:30px}.loading-spinner{font-size:48px;margin-bottom:20px;color:#409eff}.loading-text{font-size:18px;color:#606266}.user-settings-btn{margin-left:10px}.user-warning{color:#e6a23c;font-weight:700}.main-footer{background-color:#24292e;color:#fff;padding:10px 20px;display:flex;justify-content:space-between;align-items:center;position:fixed;bottom:0;left:0;right:0;z-index:100;box-shadow:0 -2px 10px #0000001a;height:60px;box-sizing:border-box}@media (max-width: 768px){.grid-layout{grid-template-columns:1fr;grid-template-rows:auto auto auto auto auto;grid-template-areas:"git-status" "v-resizer" "commit-form" "h-resizer" "log-list";gap:10px}.vertical-resizer{height:10px;cursor:row-resize}.vertical-resizer:after{width:30px;height:4px}.git-status-panel,.commit-form-panel,.log-list-panel{padding:0;max-height:none}.git-status-panel,.commit-form-panel{max-height:30vh}.log-list-panel{max-height:40vh}}.logo[data-v-8ba54a98]{will-change:filter;transition:filter .3s}.logo[data-v-8ba54a98]:hover{filter:drop-shadow(0 0 2em #42b883aa)}.branch-info[data-v-8ba54a98]{display:flex;align-items:center;gap:10px}.branch-wrapper[data-v-8ba54a98]{display:flex;align-items:center;background-color:#ffffff26;border-radius:4px;padding:8px 12px;box-shadow:0 2px 4px #0003;transition:all .3s}.branch-wrapper[data-v-8ba54a98]:hover{background-color:#fff3}.branch-label[data-v-8ba54a98]{font-weight:700;margin-right:10px;color:#fff}.branch-select[data-v-8ba54a98]{width:200px;margin-right:10px}.create-branch-btn[data-v-8ba54a98]{background-color:#2ea44f;border-color:#2ea44f;transition:all .3s;box-shadow:0 2px 4px #0003}.create-branch-btn[data-v-8ba54a98]:hover{background-color:#3bbc63;border-color:#3bbc63;transform:translateY(-2px);box-shadow:0 4px 8px #0003}.footer-right[data-v-8ba54a98]{display:flex;align-items:center;gap:10px;color:#ffffffe6;font-size:13px;background-color:#ffffff1a;padding:8px 12px;border-radius:4px;box-shadow:0 2px 4px #0003}.vertical-resizer[data-v-8ba54a98]{grid-area:v-resizer;background-color:#e8e8e8;cursor:col-resize;transition:background-color .2s,box-shadow .2s;position:relative;z-index:10;border-radius:8px;box-shadow:0 0 3px #0000001a}.vertical-resizer[data-v-8ba54a98]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:50px;background-color:#a0a0a0;border-radius:4px;transition:background-color .2s,width .2s,box-shadow .2s}.vertical-resizer[data-v-8ba54a98]:hover,.vertical-resizer.active[data-v-8ba54a98]{background-color:#d0d0d0;box-shadow:0 0 5px #0003}.vertical-resizer[data-v-8ba54a98]:hover:after,.vertical-resizer.active[data-v-8ba54a98]:after{background-color:#409eff;width:6px;box-shadow:0 0 8px #409eff99}.horizontal-resizer[data-v-8ba54a98]{grid-area:h-resizer;background-color:#e8e8e8;cursor:row-resize;transition:background-color .2s,box-shadow .2s;position:relative;z-index:10;border-radius:8px;box-shadow:0 0 3px #0000001a}.horizontal-resizer[data-v-8ba54a98]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:50px;height:4px;background-color:#a0a0a0;border-radius:4px;transition:background-color .2s,height .2s,box-shadow .2s}.horizontal-resizer[data-v-8ba54a98]:hover,.horizontal-resizer.active[data-v-8ba54a98]{background-color:#d0d0d0;box-shadow:0 0 5px #0003}.horizontal-resizer[data-v-8ba54a98]:hover:after,.horizontal-resizer.active[data-v-8ba54a98]:after{background-color:#409eff;height:6px;box-shadow:0 0 8px #409eff99}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{d as Dt,r as u,E as n,o as qe,a as Kt,l as Qt,b as it,c as $e,w as at,e as es,f as g,g as d,h as e,i as t,j as Tt,u as l,k as a,m as jt,n as _t,p as Ct,q as Se,s as Et,t as Pt,v as ts,x as rt,y as wt,z as $,A as h,B as N,C as le,D as Lt,F as $t,G as _e,H as ke,I as st,J as ct,K as Ut,L as Ot,M as ut,N as Je,O as Ge,P as Mt,Q as ss,R as zt,S as Ne,T as Vt,U as lt,V as Gt,W as Ft,X as Ye,Y as ot,Z as nt,_ as St,$ as as,a0 as et,a1 as ls,a2 as os,a3 as It,a4 as Nt,a5 as ns,a6 as is,a7 as rs,a8 as cs,a9 as us,aa as At,ab as ds,ac as ps,ad as fs,ae as vs,af as ms,ag as gs,ah as ys,ai as He,aj as hs,ak as _s,al as ws,am as $s,an as bs,ao as ks}from"./vendor-eqaTZKOh.js";(function(){const v=document.createElement("link").relList;if(v&&v.supports&&v.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))_(i);new MutationObserver(i=>{for(const D of i)if(D.type==="childList")for(const z of D.addedNodes)z.tagName==="LINK"&&z.rel==="modulepreload"&&_(z)}).observe(document,{childList:!0,subtree:!0});function b(i){const D={};return i.integrity&&(D.integrity=i.integrity),i.referrerPolicy&&(D.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?D.credentials="include":i.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function _(i){if(i.ep)return;i.ep=!0;const D=b(i);fetch(i.href,D)}})();const Oe=Dt("git",()=>{const Q=u(""),v=u([]),b=u(""),_=u(""),i=u(!1),D=u(!1),z=u(!1),oe=u(0),ee=u(0),j=u(0),E=u(!1),P=u("");function I(){Q.value="",v.value=[],b.value="",_.value="",i.value=!1,D.value=!1,z.value=!1,oe.value=0,ee.value=0,j.value=0,E.value=!1,P.value=""}async function te(){if(z.value)try{const T=await(await fetch("/api/branch-status")).json();T&&(ee.value=T.ahead||0,j.value=T.behind||0,E.value=T.hasUpstream||!1,P.value=T.upstreamBranch||"",console.log(`分支状态更新:领先 ${ee.value} 个提交,落后 ${j.value} 个提交,上游分支:${E.value?P.value:"无"}`))}catch(C){console.error("获取分支状态失败:",C),ee.value=0,j.value=0,E.value=!1,P.value=""}}async function re(){const C=Date.now();if(C-oe.value<1e3)return console.log("使用缓存的Git仓库状态:",z.value?"是":"不是"),z.value;try{const K=await(await fetch("/api/current_directory")).json();return z.value=K.isGitRepo===!0,oe.value=C,console.log(`当前目录${z.value?"是":"不是"}Git仓库`),z.value}catch(T){return console.error("检查Git仓库状态失败:",T),z.value=!1,oe.value=C,!1}}async function O(){try{const T=await(await fetch("/api/branch")).json();T.branch&&(Q.value=T.branch,await te())}catch(C){console.error("获取分支信息失败:",C)}}async function H(){try{const T=await(await fetch("/api/branches")).json();T.branches&&Array.isArray(T.branches)&&(v.value=T.branches)}catch(C){console.error("获取所有分支信息失败:",C)}}async function J(C){console.log("切换到分支:",C);try{i.value=!0;const K=await(await fetch("/api/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:C})})).json();return K.success?(n({message:`已切换到分支: ${C}`,type:"success"}),O(),!0):(n({message:`切换分支失败: ${K.error}`,type:"error"}),!1)}catch(T){return n({message:`切换分支失败: ${T.message}`,type:"error"}),!1}finally{i.value=!1}}async function G(){try{const T=await(await fetch("/api/user-info")).json();T.name&&T.email&&(b.value=T.name,_.value=T.email)}catch(C){console.error("获取用户信息失败:",C)}}async function ne(C,T){if(!C.trim())return n({message:"分支名称不能为空",type:"warning"}),!1;try{D.value=!0;const ue=await(await fetch("/api/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newBranchName:C,baseBranch:T||Q.value})})).json();return ue.success?(n({message:`已创建并切换到分支: ${C}`,type:"success"}),O(),H(),!0):(n({message:`创建分支失败: ${ue.error}`,type:"error"}),!1)}catch(K){return n({message:`创建分支失败: ${K.message}`,type:"error"}),!1}finally{D.value=!1}}async function ie(){await re()?(O(),H(),G()):(Q.value="",v.value=[],b.value="",_.value="")}async function se(){try{const T=await(await fetch("/api/clear-user-config",{method:"POST"})).json();return T.success?(b.value="",_.value="",n({message:"已清除Git用户配置",type:"success"}),!0):(n({message:`清除配置失败: ${T.error}`,type:"error"}),!1)}catch(C){return n({message:`清除配置失败: ${C.message}`,type:"error"}),!1}}async function Y(C,T){try{const ue=await(await fetch("/api/restore-user-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:C,email:T})})).json();return ue.success?(b.value=C,_.value=T,n({message:"已恢复Git用户配置",type:"success"}),!0):(n({message:`恢复配置失败: ${ue.error}`,type:"error"}),!1)}catch(K){return n({message:`恢复配置失败: ${K.message}`,type:"error"}),!1}}async function q(){if(!z.value)return n({message:"当前目录不是Git仓库",type:"warning"}),!1;try{const T=await(await fetch("/api/pull",{method:"POST"})).json();return T.success?(n({message:"拉取成功",type:"success"}),await te(),!0):(n({message:`拉取失败: ${T.error}`,type:"error"}),!1)}catch(C){return n({message:`拉取失败: ${C.message}`,type:"error"}),!1}}async function Z(){if(!z.value)return n({message:"当前目录不是Git仓库",type:"warning"}),!1;try{const T=await(await fetch("/api/fetch-all",{method:"POST"})).json();return T.success?(n({message:"获取所有远程分支信息成功",type:"success"}),await te(),!0):(n({message:`获取远程分支信息失败: ${T.error}`,type:"error"}),!1)}catch(C){return n({message:`获取远程分支信息失败: ${C.message}`,type:"error"}),!1}}return{currentBranch:Q,allBranches:v,userName:b,userEmail:_,isChangingBranch:i,isCreatingBranch:D,isGitRepo:z,lastCheckedTime:oe,branchAhead:ee,branchBehind:j,hasUpstream:E,upstreamBranch:P,$reset:I,checkGitRepo:re,getCurrentBranch:O,getAllBranches:H,changeBranch:J,getUserInfo:G,createBranch:ne,loadInitialData:ie,clearUserConfig:se,restoreUserConfig:Y,getBranchStatus:te,gitPull:q,gitFetchAll:Z}}),bt=300,xt=Dt("gitLog",()=>{const Q=Oe();let v=null;const b=u(!0),_=u([]),i=u({staged:[],unstaged:[],untracked:[]}),D=u(""),z=u([]),oe=u(!1),ee=u(!1),j=u(!1),E=u(!1),P=u(!1),I=u(!1);function te(){v&&v.disconnect();try{const m="http://localhost:3000";if(console.log("尝试连接Socket.IO服务器:",m),v=Qt(m,{reconnectionDelayMax:1e4,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3,timeout:2e4,autoConnect:!0,forceNew:!0,transports:["websocket","polling"]}),!v){console.error("Socket.IO初始化失败: socket为null");return}console.log("Socket.IO初始化成功,socket ID:",v.id||"未连接"),v.on("connect",()=>{console.log("成功连接到Socket.IO服务器"),b.value&&v&&v.emit("start_monitoring")}),v.on("disconnect",y=>{console.log("与Socket.IO服务器断开连接:",y)}),v.on("git_status_update",y=>{if(!b.value)return;console.log("收到Git状态更新通知:",new Date().toLocaleTimeString()),y.status&&(D.value=y.status),y.porcelain!==void 0&&O(y.porcelain),z.value.length>0&&H(!1)}),v.on("monitoring_status",y=>{console.log("文件监控状态:",y.active?"已启动":"已停止")}),v.on("connect_error",y=>{console.error("Socket连接错误:",y.message)}),v.on("connect_timeout",()=>{console.error("Socket连接超时")}),v.on("reconnect",y=>{console.log(`Socket重连成功,尝试次数: ${y}`),b.value&&(console.log("重连后重新发送start_monitoring请求"),v==null||v.emit("start_monitoring"))}),v.on("reconnect_attempt",y=>{console.log(`Socket尝试重连,第 ${y} 次尝试`)}),v.on("reconnect_error",y=>{console.error("Socket重连错误:",y.message)}),v.on("reconnect_failed",()=>{console.error("Socket重连失败,已达到最大重试次数")}),v&&!v.connected&&(console.log("Socket未连接,尝试手动连接..."),v.connect())}catch(m){console.error("Socket.IO连接初始化失败:",m)}}function re(){if(console.log("toggleAutoUpdate调用,当前值:",b.value),!v){console.error("无法切换自动更新状态: socket连接不存在"),n.error("无法连接到服务器,自动更新可能不会生效"),console.log("尝试重新建立socket连接..."),te(),localStorage.setItem("zen-gitsync-auto-update",b.value.toString());return}try{b.value?(console.log("发送start_monitoring命令..."),v.emit("start_monitoring"),n.success("自动更新已启用")):(console.log("发送stop_monitoring命令..."),v.emit("stop_monitoring"),n.info("自动更新已禁用")),localStorage.setItem("zen-gitsync-auto-update",b.value.toString()),console.log("已保存自动更新设置到本地存储:",b.value)}catch(m){console.error("切换自动更新状态时出错:",m),n.error(`切换自动更新失败: ${m.message}`)}}function O(m){if(m===void 0||m===""){z.value=[];return}const y=m.split(`
|
|
2
|
+
`),W=[];for(const X of y){const ve=X.match(/^([ MADRCU\?]{2})\s+(.+)$/);if(ve){let de="";const S=ve[1],c=S.charAt(0),F=S.charAt(1);c==="A"||c==="M"||c==="D"||c==="R"?de="added":c===" "&&F==="M"?de="modified":c===" "&&F==="D"?de="deleted":S==="??"?de="untracked":de="other",W.push({path:ve[2],type:de})}}z.value=W}async function H(m=!0){if(!Q.isGitRepo){console.log("当前目录不是Git仓库,跳过加载提交历史");return}try{oe.value=!0,console.log("开始加载提交历史...");const y=new Date().getTime(),X=await(await fetch(`/api/log?page=1&_t=${y}`)).json();X&&X.data&&Array.isArray(X.data)?(_.value=[...X.data],console.log(`提交历史加载完成,共 ${_.value.length} 条记录`)):(console.warn("API返回的提交历史格式不正确:",X),_.value=[]),m&&n({message:"提交历史已更新",type:"success"})}catch(y){console.error("获取提交历史失败:",y),m&&n({message:`获取提交历史失败: ${y.message}`,type:"error"})}finally{oe.value=!1}}async function J(){if(!Q.isGitRepo){console.log("当前目录不是Git仓库,跳过加载Git状态");return}try{ee.value=!0;const y=await(await fetch("/api/status")).json();y.status&&(D.value=y.status,i.value={staged:y.status.staged||[],unstaged:y.status.unstaged||[],untracked:y.status.untracked||[]}),await G()}catch(m){console.error("获取Git状态失败:",m),n({message:`获取Git状态失败: ${m.message}`,type:"error"})}finally{ee.value=!1}}async function G(){if(console.log("开始获取Git状态(porcelain格式)..."),!Q.isGitRepo){console.log("当前目录不是Git仓库,跳过加载Git状态");return}try{const y=await(await fetch("/api/status_porcelain")).json();y.status!==void 0?O(y.status):z.value=[]}catch(m){console.error("获取Git状态(porcelain)失败:",m),n({message:`获取Git状态(porcelain)失败: ${m.message}`,type:"error"}),z.value=[]}}async function ne(){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{j.value=!0;const y=await(await fetch("/api/add",{method:"POST"})).json();return y.success?(n({message:"文件已添加到暂存区",type:"success"}),J(),!0):(n({message:`添加文件失败: ${y.error}`,type:"error"}),!1)}catch(m){return n({message:`添加文件失败: ${m.message}`,type:"error"}),!1}finally{j.value=!1}}async function ie(m){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{j.value=!0;const W=await(await fetch("/api/add-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:m})})).json();return W.success?(n({message:"文件已暂存",type:"success"}),J(),!0):(n({message:`暂存文件失败: ${W.error}`,type:"error"}),!1)}catch(y){return n({message:`暂存文件失败: ${y.message}`,type:"error"}),!1}finally{j.value=!1}}async function se(m){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{I.value=!0;const W=await(await fetch("/api/unstage-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:m})})).json();return W.success?(n({message:"已取消暂存文件",type:"success"}),J(),!0):(n({message:`取消暂存失败: ${W.error}`,type:"error"}),!1)}catch(y){return n({message:`取消暂存失败: ${y.message}`,type:"error"}),!1}finally{I.value=!1}}function Y(m){return new Promise(y=>setTimeout(y,m))}async function q(m,y=!1){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{E.value=!0;const X=await(await fetch("/api/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:m,hasNewlines:m.includes(`
|
|
3
|
+
`),noVerify:y})})).json();return X.success?(n({message:"提交成功",type:"success"}),J(),H(),Q.getBranchStatus(),!0):(n({message:`提交失败: ${X.error}`,type:"error"}),!1)}catch(W){return n({message:`提交失败: ${W.message}`,type:"error"}),!1}finally{E.value=!1}}async function Z(){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{P.value=!0;const y=await(await fetch("/api/push",{method:"POST"})).json();return y.success?(n({message:"推送成功",type:"success"}),J(),H(),Q.getBranchStatus(),!0):(n({message:`推送失败: ${y.error}`,type:"error"}),!1)}catch(m){return n({message:`推送失败: ${m.message}`,type:"error"}),!1}finally{P.value=!1}}async function C(m,y=!1){return await ne()?(await Y(bt),await q(m,y)):!1}async function T(m,y=!1){try{return!await ne()||(await Y(bt),!await q(m,y))?!1:(await Y(bt),await Z())}catch(W){try{(await(await fetch("/api/remove-lock",{method:"POST"})).json()).success&&n({message:"已清理锁定文件,请重试操作",type:"warning"})}catch(X){console.error("清理锁定文件失败:",X)}return n({message:`操作失败: ${W.message}`,type:"error"}),J(),H(),Q.getBranchStatus(),!1}}async function K(){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{I.value=!0;const y=await(await fetch("/api/reset-head",{method:"POST"})).json();return y.success?(n({message:"已重置暂存区",type:"success"}),J(),!0):(n({message:`重置暂存区失败: ${y.error}`,type:"error"}),!1)}catch(m){return n({message:`重置暂存区失败: ${m.message}`,type:"error"}),!1}finally{I.value=!1}}async function ue(m){if(!Q.isGitRepo)return n.warning("当前目录不是Git仓库"),!1;try{I.value=!0;const W=await(await fetch("/api/reset-to-remote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:m})})).json();return W.success?(n({message:`已重置分支 ${m} 到远程状态`,type:"success"}),J(),H(),!0):(n({message:`重置分支失败: ${W.error}`,type:"error"}),!1)}catch(y){return n({message:`重置分支失败: ${y.message}`,type:"error"}),!1}finally{I.value=!1}}return qe(()=>{const m=localStorage.getItem("zen-gitsync-auto-update");m!==null&&(b.value=m==="true"),te()}),Kt(()=>{v&&(v.disconnect(),v=null)}),{log:_,status:i,statusText:D,fileList:z,isLoadingLog:oe,isLoadingStatus:ee,isAddingFiles:j,isResetting:I,isCommiting:E,isPushing:P,autoUpdateEnabled:b,fetchLog:H,fetchStatus:J,fetchStatusPorcelain:G,parseStatusPorcelain:O,addToStage:ne,addFileToStage:ie,unstageFile:se,commitChanges:q,pushToRemote:Z,addAndCommit:C,addCommitAndPush:T,resetHead:K,resetToRemote:ue,toggleAutoUpdate:re}}),Cs={class:"card"},Ss={class:"status-header"},Ts={class:"header-actions"},Ls={class:"card-content"},Vs={class:"current-directory"},xs={key:0,class:"status-box"},Rs={class:"empty-status"},Bs={key:1},zs={key:0,class:"branch-sync-status"},Gs={class:"sync-status-content"},As={class:"status-badges"},Ds={class:"badge-content"},js={class:"badge-content"},Es={key:1,class:"git-status-message"},Ps={key:2,class:"file-list-container"},Us={key:0,class:"file-group"},Os={class:"file-list"},Ms=["onClick"],Fs={class:"file-info"},Is={class:"file-path-container"},Ns={class:"file-name"},Hs={class:"file-directory"},Ws={class:"file-actions"},Js={key:1,class:"file-group"},Ys={class:"file-list"},qs=["onClick"],Zs={class:"file-info"},Xs={class:"file-path-container"},Ks={class:"file-name"},Qs={class:"file-directory"},ea={class:"file-actions"},ta={key:2,class:"file-group"},sa={class:"file-list"},aa=["onClick"],la={class:"file-info"},oa={class:"file-path-container"},na={class:"file-name"},ia={class:"file-directory"},ra={class:"file-actions"},ca={key:3,class:"empty-status"},ua={class:"empty-icon"},da={class:"branch-info"},pa={key:0},fa={key:0,class:"branch-sync-info warning"},va={key:1,class:"branch-sync-info info"},ma={key:2,class:"branch-sync-info success"},ga={class:"directory-buttons"},ya={class:"browser-current-path"},ha={key:0,class:"browser-error"},_a={class:"directory-browser"},wa={class:"browser-nav"},$a={class:"directory-items-container"},ba={class:"directory-items"},ka=["onClick"],Ca={class:"diff-dialog-header"},Sa={class:"file-title"},Ta={class:"file-path"},La={class:"header-actions"},Va={class:"diff-content"},xa=["innerHTML"],Ra={key:1,class:"no-diff"},Ba={class:"file-navigation"},za={class:"file-counter"},Ga=it({__name:"GitStatus",props:{initialDirectory:{type:String,default:""}},setup(Q,{expose:v}){const b=Q,_=xt(),i=Oe(),D=$e(()=>_.isLoadingStatus),z=u(""),oe=u(""),ee=u(!1),j=u(!1),E=u(-1),P=u(!1),I=u(""),te=u(!1),re=u(!1),O=u(""),H=u([]),J=u(!1),G=u(""),ne=u(!1),ie=u(!1),se=u(b.initialDirectory||"");async function Y(){try{if(!se.value){const r=await(await fetch("/api/current_directory")).json();se.value=r.directory||"未知目录"}if(!i.isGitRepo)return;await _.fetchStatus(),await i.getBranchStatus(),n({message:"Git 状态已刷新",type:"success"})}catch(w){n({message:"刷新失败: "+w.message,type:"error"})}}function q(w){if(!w)return"";const r=w.split(`
|
|
4
|
+
`);function A(U){return U.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return r.map(U=>{const k=A(U);return U.startsWith("diff --git")?`<div class="diff-header">${k}</div>`:U.startsWith("---")?`<div class="diff-old-file">${k}</div>`:U.startsWith("+++")?`<div class="diff-new-file">${k}</div>`:U.startsWith("@@")?`<div class="diff-hunk-header">${k}</div>`:U.startsWith("+")?`<div class="diff-added">${k}</div>`:U.startsWith("-")?`<div class="diff-removed">${k}</div>`:`<div class="diff-context">${k}</div>`}).join("")}async function Z(w){try{j.value=!0,z.value=w,E.value=_.fileList.findIndex(A=>A.path===w);const r=_.fileList[E.value];if(r&&r.type==="untracked"){try{const U=await(await fetch(`/api/file-content?file=${encodeURIComponent(w)}`)).json();U.success&&U.content?oe.value=`diff --git a/${w} b/${w}
|
|
5
|
+
新文件: ${w}
|
|
6
|
+
--- /dev/null
|
|
7
|
+
+++ b/${w}
|
|
8
|
+
@@ -0,0 +1,${U.content.split(`
|
|
9
|
+
`).length} @@
|
|
10
|
+
`+U.content.split(`
|
|
11
|
+
`).map(k=>`+${k}`).join(`
|
|
12
|
+
`):oe.value=`这是一个新文件,尚未被Git跟踪。
|
|
13
|
+
添加到暂存区后可以提交该文件。`}catch(A){console.error("获取未跟踪文件内容失败:",A),oe.value=`这是一个新文件,尚未被Git跟踪。
|
|
14
|
+
添加到暂存区后可以提交该文件。`}ee.value=!0}else{const U=await(await fetch(`/api/diff?file=${encodeURIComponent(w)}`)).json();oe.value=U.diff||"没有变更",ee.value=!0}}catch(r){n({message:"获取文件差异失败: "+r.message,type:"error"}),oe.value="获取差异失败: "+r.message}finally{j.value=!1}}async function C(){if(_.fileList.length===0||E.value<=0)return;const w=E.value-1,r=_.fileList[w];await Z(r.path)}async function T(){if(_.fileList.length===0||E.value>=_.fileList.length-1)return;const w=E.value+1,r=_.fileList[w];await Z(r.path)}function K(){I.value=se.value,P.value=!0}function ue(){G.value="",O.value=I.value||se.value,re.value=!0,m(O.value)}async function m(w){try{J.value=!0,G.value="";let r=w;/^[A-Za-z]:$/.test(r)&&(r+="/");const A=await fetch(`/api/browse_directory?path=${encodeURIComponent(r)}`);if(A.status===403){const k=await A.json();G.value=k.error||"目录浏览功能未启用";return}if(!A.ok){const k=await A.json();G.value=k.error||"获取目录内容失败";return}const U=await A.json();U.success?(H.value=U.items,O.value=U.currentPath):G.value=U.error||"获取目录内容失败"}catch(r){G.value=`获取目录内容失败: ${r.message}`}finally{J.value=!1}}function y(){if(/^[A-Za-z]:$/.test(O.value)||/^[A-Za-z]:[\\/]$/.test(O.value)||O.value==="/")return;let w=O.value.split(/[/\\]/);w.pop();let r=w.join("/");w.length===1&&/^[A-Za-z]:$/.test(w[0])&&(r=w[0]+"/"),r&&m(r)}function W(w){w.type==="directory"&&m(w.path)}function X(){I.value=O.value,re.value=!1}async function ve(){if(!I.value){n.warning("目录路径不能为空");return}try{te.value=!0;const r=await(await fetch("/api/change_directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:I.value})})).json();r.success?(n.success("已切换工作目录"),se.value=r.directory,P.value=!1,i.isGitRepo=r.isGitRepo,r.isGitRepo?(await Promise.all([i.getCurrentBranch(),i.getAllBranches(),i.getUserInfo()]),await Y()):(n.warning("当前目录不是一个Git仓库"),i.$reset())):n.error(r.error||"切换目录失败")}catch(w){n.error(`切换目录失败: ${w.message}`)}finally{te.value=!1}}function de(w){Z(w.path)}async function S(w){await _.addFileToStage(w)}async function c(w){await _.unstageFile(w)}async function F(){await Y()}async function M(){ne.value=!0;try{await i.gitPull(),await Y()}finally{ne.value=!1}}async function ge(){ie.value=!0;try{await i.gitFetchAll(),await Y()}finally{ie.value=!1}}async function we(w){try{await lt.confirm(`确定要撤回文件 "${w}" 的所有修改吗?此操作无法撤销。`,"撤回修改",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const A=await(await fetch("/api/revert_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:w})})).json();A.success?(n.success("已撤回文件修改"),await Y()):n.error(A.error?`撤回失败: ${A.error}`:"撤回文件修改失败,请重试")}catch(r){if(r==="cancel"||r.message==="cancel")return;const A=r.message||"未知错误";A!=="undefined"?n.error(`撤回文件修改失败: ${A}`):n.error("撤回文件修改失败,请重试")}}function pe(w){const r=w.split("/");return r[r.length-1]}function fe(w){const r=w.split("/");return r.length<=1?"":r.slice(0,-1).join("/")}return qe(()=>{Y(),i.isGitRepo&&i.getBranchStatus()}),at(()=>_.autoUpdateEnabled,(w,r)=>{console.log(`自动更新状态变更: ${r} -> ${w}`),_.toggleAutoUpdate()},{immediate:!1}),v({refreshStatus:F}),(w,r)=>{const A=jt,U=Tt,k=Se,me=rt,Le=Lt,je=es("ArrowDown"),Ve=ut,Ee=Ot,Pe=Ut,xe=ct,Ae=Mt;return d(),g("div",Cs,[e("div",Ss,[r[6]||(r[6]=e("h2",null,"Git 状态",-1)),e("div",Ts,[t(U,{content:l(_).autoUpdateEnabled?"禁用自动更新文件状态":"启用自动更新文件状态",placement:"top","hide-after":1e3},{default:a(()=>[t(A,{modelValue:l(_).autoUpdateEnabled,"onUpdate:modelValue":r[0]||(r[0]=L=>l(_).autoUpdateEnabled=L),style:{"--el-switch-on-color":"#67C23A","--el-switch-off-color":"#909399","margin-right":"10px"},"inline-prompt":"","active-icon":l(Ct),"inactive-icon":l(_t),class:"auto-update-switch"},null,8,["modelValue","active-icon","inactive-icon"])]),_:1},8,["content"]),t(U,{content:"Git Pull (拉取远程更新)",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"primary",icon:l(Et),circle:"",size:"small",onClick:M,loading:ne.value,disabled:!l(i).hasUpstream},null,8,["icon","loading","disabled"])]),_:1}),t(U,{content:"Git Fetch All (获取所有远程分支)",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"info",icon:l(Pt),circle:"",size:"small",onClick:ge,loading:ie.value},null,8,["icon","loading"])]),_:1}),t(U,{content:"刷新状态",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"primary",icon:l(ts),circle:"",size:"small",onClick:F,loading:D.value},null,8,["icon","loading"])]),_:1})])]),e("div",Ls,[e("div",Vs,[t(me,null,{default:a(()=>[t(l(wt))]),_:1}),e("span",null,$(se.value),1),t(k,{type:"primary",size:"small",onClick:K,plain:""},{default:a(()=>r[7]||(r[7]=[h(" 切换目录 ")])),_:1})]),l(i).isGitRepo?(d(),g("div",Bs,[l(i).hasUpstream&&(l(i).branchAhead>0||l(i).branchBehind>0)?(d(),g("div",zs,[e("div",Gs,[t(U,{content:"本地分支与远程分支的状态对比",placement:"top"},{default:a(()=>[e("div",As,[l(i).branchAhead>0?(d(),le(Le,{key:0,size:"small",type:"warning",class:"status-badge"},{default:a(()=>[e("span",Ds,[t(me,null,{default:a(()=>[t(l($t))]),_:1}),h(" 你的分支领先 'origin/"+$(l(i).currentBranch)+"' "+$(l(i).branchAhead)+" 个提交 ",1)])]),_:1})):N("",!0),l(i).branchBehind>0?(d(),le(Le,{key:1,size:"small",type:"info",class:"status-badge"},{default:a(()=>[e("span",js,[t(me,null,{default:a(()=>[t(je)]),_:1}),h(" 你的分支落后 'origin/"+$(l(i).currentBranch)+"' "+$(l(i).branchBehind)+" 个提交 ",1)])]),_:1})):N("",!0)])]),_:1})])])):N("",!0),!l(i).hasUpstream||l(i).branchAhead===0&&l(i).branchBehind===0?(d(),g("div",Es,[e("p",null,[r[10]||(r[10]=h("当前工作在 ")),t(Le,{size:"small",type:"success"},{default:a(()=>[h($(l(i).currentBranch),1)]),_:1}),r[11]||(r[11]=h(" 分支"))])])):N("",!0),l(_).fileList.length?(d(),g("div",Ps,[l(_).fileList.some(L=>L.type==="added")?(d(),g("div",Us,[r[13]||(r[13]=e("div",{class:"file-group-header"},"已暂存的更改",-1)),e("div",Os,[(d(!0),g(_e,null,ke(l(_).fileList.filter(L=>L.type==="added"),L=>(d(),g("div",{key:L.path,class:"file-item",onClick:Ce=>de(L)},[e("div",Fs,[e("div",Is,[e("span",Ns,$(pe(L.path)),1),e("span",Hs,$(fe(L.path)),1)])]),e("div",Ws,[t(U,{content:"取消暂存",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"warning",size:"small",circle:"",onClick:Ne(Ce=>c(L.path),["stop"])},{default:a(()=>r[12]||(r[12]=[h("-")])),_:2},1032,["onClick"])]),_:2},1024)])],8,Ms))),128))])])):N("",!0),l(_).fileList.some(L=>L.type==="modified"||L.type==="deleted")?(d(),g("div",Js,[r[15]||(r[15]=e("div",{class:"file-group-header"},"未暂存的更改",-1)),e("div",Ys,[(d(!0),g(_e,null,ke(l(_).fileList.filter(L=>L.type==="modified"||L.type==="deleted"),L=>(d(),g("div",{key:L.path,class:"file-item",onClick:Ce=>de(L)},[e("div",Zs,[e("div",{class:Ge(["file-status-indicator",L.type])},null,2),e("div",Xs,[e("span",Ks,$(pe(L.path)),1),e("span",Qs,$(fe(L.path)),1)])]),e("div",ea,[t(U,{content:"添加到暂存区",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"success",size:"small",circle:"",onClick:Ne(Ce=>S(L.path),["stop"])},{default:a(()=>r[14]||(r[14]=[h("+")])),_:2},1032,["onClick"])]),_:2},1024),t(U,{content:"撤回修改",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"danger",size:"small",icon:l(Vt),circle:"",onClick:Ne(Ce=>we(L.path),["stop"])},null,8,["icon","onClick"])]),_:2},1024)])],8,qs))),128))])])):N("",!0),l(_).fileList.some(L=>L.type==="untracked")?(d(),g("div",ta,[r[18]||(r[18]=e("div",{class:"file-group-header"},"未跟踪的文件",-1)),e("div",sa,[(d(!0),g(_e,null,ke(l(_).fileList.filter(L=>L.type==="untracked"),L=>(d(),g("div",{key:L.path,class:"file-item",onClick:Ce=>de(L)},[e("div",la,[r[16]||(r[16]=e("div",{class:"file-status-indicator untracked"},null,-1)),e("div",oa,[e("span",na,$(pe(L.path)),1),e("span",ia,$(fe(L.path)),1)])]),e("div",ra,[t(U,{content:"添加到暂存区",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"success",size:"small",circle:"",onClick:Ne(Ce=>S(L.path),["stop"])},{default:a(()=>r[17]||(r[17]=[h("+")])),_:2},1032,["onClick"])]),_:2},1024),t(U,{content:"删除文件",placement:"top","hide-after":1e3},{default:a(()=>[t(k,{type:"danger",size:"small",icon:l(_t),circle:"",onClick:Ne(Ce=>we(L.path),["stop"])},null,8,["icon","onClick"])]),_:2},1024)])],8,aa))),128))])])):N("",!0)])):l(i).isGitRepo?(d(),g("div",ca,[e("div",ua,[t(me,null,{default:a(()=>[t(l(st))]),_:1})]),r[21]||(r[21]=e("div",{class:"empty-text"},"没有检测到任何更改",-1)),r[22]||(r[22]=e("div",{class:"empty-subtext"},"工作区是干净的",-1)),e("div",da,[e("p",null,[r[19]||(r[19]=h("当前工作在 ")),t(Le,{size:"small",type:"success"},{default:a(()=>[h($(l(i).currentBranch),1)]),_:1}),r[20]||(r[20]=h(" 分支"))]),l(i).hasUpstream?(d(),g("div",pa,[l(i).branchAhead>0?(d(),g("span",fa,[t(me,null,{default:a(()=>[t(l($t))]),_:1}),h(" 你的分支领先 'origin/"+$(l(i).currentBranch)+"' "+$(l(i).branchAhead)+" 个提交 ",1)])):l(i).branchBehind>0?(d(),g("span",va,[t(me,null,{default:a(()=>[t(je)]),_:1}),h(" 你的分支落后 'origin/"+$(l(i).currentBranch)+"' "+$(l(i).branchBehind)+" 个提交 ",1)])):(d(),g("span",ma,[t(me,null,{default:a(()=>[t(l(Ct))]),_:1}),h(" 你的分支与 'origin/"+$(l(i).currentBranch)+"' 同步 ",1)]))])):N("",!0)])])):N("",!0)])):(d(),g("div",xs,[e("div",Rs,[r[9]||(r[9]=e("p",null,"当前目录不是Git仓库",-1)),t(k,{type:"primary",size:"small",onClick:K},{default:a(()=>r[8]||(r[8]=[h(" 切换目录 ")])),_:1})])]))]),t(xe,{modelValue:P.value,"onUpdate:modelValue":r[2]||(r[2]=L=>P.value=L),title:"切换工作目录",width:"500px"},{default:a(()=>[t(Pe,null,{default:a(()=>[t(Ee,{label:"目录路径"},{default:a(()=>[t(Ve,{modelValue:I.value,"onUpdate:modelValue":r[1]||(r[1]=L=>I.value=L),placeholder:"请输入目录路径",clearable:""},null,8,["modelValue"]),e("div",ga,[t(k,{onClick:ue,type:"primary",plain:"",class:"no-padding-left"},{default:a(()=>[t(me,null,{default:a(()=>[t(l(wt))]),_:1}),r[23]||(r[23]=h(" 浏览 "))]),_:1}),t(k,{onClick:ve,loading:te.value,type:"primary"},{default:a(()=>r[24]||(r[24]=[h(" 切换 ")])),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["modelValue"]),t(xe,{modelValue:re.value,"onUpdate:modelValue":r[3]||(r[3]=L=>re.value=L),title:"浏览目录",width:"600px"},{default:a(()=>[e("div",ya,[e("span",null,"当前路径: "+$(O.value),1)]),G.value?(d(),g("div",ha,$(G.value),1)):N("",!0),Je((d(),g("div",_a,[e("div",wa,[t(k,{onClick:y,disabled:!O.value||J.value,size:"small",class:"no-padding-left"},{default:a(()=>[t(me,null,{default:a(()=>[t(l($t))]),_:1}),r[25]||(r[25]=h(" 上级目录 "))]),_:1},8,["disabled"]),t(k,{onClick:X,type:"primary",size:"small",class:"no-padding-left"},{default:a(()=>r[26]||(r[26]=[h(" 选择当前目录 ")])),_:1})]),e("div",$a,[e("ul",ba,[(d(!0),g(_e,null,ke(H.value,L=>(d(),g("li",{key:L.path,class:Ge(["directory-item",L.type]),onClick:Ce=>W(L)},[L.type==="directory"?(d(),le(me,{key:0},{default:a(()=>[t(l(wt))]),_:1})):(d(),le(me,{key:1},{default:a(()=>[t(l(st))]),_:1})),e("span",null,$(L.name),1)],10,ka))),128))])])])),[[Ae,J.value]])]),_:1},8,["modelValue"]),t(xe,{modelValue:ee.value,"onUpdate:modelValue":r[5]||(r[5]=L=>ee.value=L),width:"80vw",top:"70px","destroy-on-close":"",class:"diff-dialog","show-close":!1,style:{height:"calc(100vh - 140px)"},"modal-append-to-body":!1,"close-on-click-modal":!1},{header:a(()=>[e("div",Ca,[e("div",Sa,[t(me,{class:"file-icon"},{default:a(()=>[t(l(st))]),_:1}),e("span",Ta,$(z.value),1)]),e("div",La,[t(k,{onClick:r[4]||(r[4]=L=>ee.value=!1),circle:"",size:"small",icon:l(_t),class:"close-button"},null,8,["icon"])])])]),footer:a(()=>[e("div",Ba,[t(k,{type:"primary",icon:l(ss),onClick:C,disabled:E.value<=0||l(_).fileList.length===0,plain:"",class:"nav-button"},{default:a(()=>r[27]||(r[27]=[h(" 上一个文件 ")])),_:1},8,["icon","disabled"]),e("div",za,[t(Le,{type:"info",effect:"plain",class:"counter-tag"},{default:a(()=>[h($(E.value+1)+" / "+$(l(_).fileList.length),1)]),_:1})]),t(k,{type:"primary",icon:l(zt),onClick:T,disabled:E.value>=l(_).fileList.length-1||l(_).fileList.length===0,plain:"",class:"nav-button"},{icon:a(()=>[t(me,{class:"el-icon--right"},{default:a(()=>[t(l(zt))]),_:1})]),default:a(()=>[r[28]||(r[28]=h(" 下一个文件 "))]),_:1},8,["icon","disabled"])])]),default:a(()=>[Je((d(),g("div",Va,[oe.value?(d(),g("div",{key:0,innerHTML:q(oe.value),class:"diff-formatted"},null,8,xa)):(d(),g("div",Ra,"该文件没有差异或是新文件"))])),[[Ae,j.value]])]),_:1},8,["modelValue"])])}}}),dt=(Q,v)=>{const b=Q.__vccOpts||Q;for(const[_,i]of v)b[_]=i;return b},Aa=dt(Ga,[["__scopeId","data-v-05fe3eaf"]]),Da={key:0,class:"pushing-indicator"},ja={key:0,class:"push-success-indicator"},Ea={class:"card-content"},Pa={class:"layout-container"},Ua={key:0,class:"git-config-warning"},Oa={class:"commit-section"},Ma={class:"commit-options"},Fa={class:"options-row"},Ia={class:"commit-mode-toggle"},Na={class:"no-verify-toggle"},Ha={key:0,class:"commit-form"},Wa={class:"description-container"},Ja={class:"input-actions"},Ya={class:"preview-section"},qa={class:"preview-content code-command"},Za={key:1,class:"standard-commit-form"},Xa={class:"standard-commit-header"},Ka={class:"scope-container"},Qa={class:"description-container"},el={class:"preview-section"},tl={class:"preview-content"},sl={class:"preview-content code-command"},al={class:"actions-section"},ll={class:"action-groups"},ol={class:"operations-wrapper"},nl={class:"action-group"},il={class:"group-buttons"},rl={key:0},cl={key:0},ul={key:0},dl={key:0},pl={class:"action-group"},fl={class:"group-buttons"},vl={class:"action-group reset-group"},ml={class:"group-buttons"},gl={key:0},yl={class:"template-container"},hl={class:"template-form"},_l={class:"template-form-buttons"},wl={class:"template-list"},$l={class:"template-content"},bl={class:"template-actions"},kl={class:"template-container"},Cl={class:"template-form"},Sl={class:"template-form-buttons"},Tl={class:"template-list"},Ll={class:"template-content"},Vl={class:"template-actions"},xl={class:"template-container message-template-container"},Rl={class:"template-form"},Bl={class:"template-form-buttons"},zl={class:"templates-container"},Gl={class:"message-templates-list"},Al={class:"templates-scroll-area"},Dl={class:"template-content"},jl={class:"template-actions"},El={class:"current-default-message"},Pl={class:"default-message-content"},Ul={class:"message-help-text"},Ol=it({__name:"CommitForm",setup(Q){const v=xt(),b=Oe(),_=u(""),i=u(!1),D=u(!1),z=u(!1),oe=u(!1),ee=u("输入提交信息..."),j=u(""),E=u(!1),P=u("feat"),I=u(""),te=u(""),re=u(""),O=u(""),H=u([]),J=u(!1),G=u(""),ne=u(!1),ie=u(""),se=u(-1),Y=u([]),q=u(!1),Z=u(""),C=u(!1),T=u(""),K=u(-1),ue=u(!1),m=u(""),y=u(!1),W=[{value:"feat",label:"feat: 新功能"},{value:"fix",label:"fix: 修复bug"},{value:"docs",label:"docs: 文档修改"},{value:"style",label:"style: 样式修改"},{value:"refactor",label:"refactor: 代码重构"},{value:"test",label:"test: 测试代码"},{value:"chore",label:"chore: 构建/工具修改"}],X=u([]),ve=u(!1),de=u(""),S=u(-1);at(E,p=>{localStorage.setItem("zen-gitsync-standard-commit",p.toString())}),at(y,p=>{localStorage.setItem("zen-gitsync-skip-hooks",p.toString())});const c=$e(()=>{if(!E.value)return _.value||j.value;let p=`${P.value||""}`;return I.value&&(p+=`(${I.value})`),p+=`: ${te.value}`,re.value&&(p+=`
|
|
15
|
+
|
|
16
|
+
${re.value}`),O.value&&(p+=`
|
|
17
|
+
|
|
18
|
+
${O.value}`),p}),F=$e(()=>{let p=`git commit -m "${c.value}"`;return y.value&&(p+=" --no-verify"),p});async function M(){try{const s=await(await fetch("/api/config/getConfig")).json();ee.value=`输入提交信息 (默认: ${s.defaultCommitMessage})`,j.value=s.defaultCommitMessage||"",s.descriptionTemplates&&Array.isArray(s.descriptionTemplates)&&(H.value=s.descriptionTemplates),s.scopeTemplates&&Array.isArray(s.scopeTemplates)&&(Y.value=s.scopeTemplates),s.messageTemplates&&Array.isArray(s.messageTemplates)&&(X.value=s.messageTemplates)}catch(p){console.error("加载配置失败:",p)}}async function ge(){if(!G.value.trim()){n({message:"请输入模板内容",type:"warning"});return}try{if(ne.value)await we();else{if(H.value.includes(G.value)){n({message:"该模板已存在",type:"warning"});return}H.value.push(G.value);const s=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:G.value,type:"description"})})).json();s.success?(n({message:"模板保存成功!",type:"success"}),G.value=""):n({message:"模板保存失败: "+s.error,type:"error"})}}catch(p){n({message:"模板保存失败: "+p.message,type:"error"})}}async function we(){try{if(se.value>=0){const p=ie.value,s=G.value;H.value[se.value]=s;const he=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:p,newTemplate:s,type:"description"})})).json();he.success?(n({message:"模板更新成功!",type:"success"}),ne.value=!1,ie.value="",se.value=-1,G.value=""):n({message:"模板更新失败: "+he.error,type:"error"})}}catch(p){n({message:"模板更新失败: "+p.message,type:"error"})}}function pe(p,s){ne.value=!0,ie.value=p,se.value=s,G.value=p}function fe(){ne.value=!1,ie.value="",se.value=-1,G.value=""}async function w(){if(!Z.value.trim()){n({message:"请输入模板内容",type:"warning"});return}try{if(C.value)await r();else{if(Y.value.includes(Z.value)){n({message:"该模板已存在",type:"warning"});return}Y.value.push(Z.value);const s=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:Z.value,type:"scope"})})).json();s.success?(n({message:"作用域模板保存成功!",type:"success"}),Z.value=""):n({message:"作用域模板保存失败: "+s.error,type:"error"})}}catch(p){n({message:"作用域模板保存失败: "+p.message,type:"error"})}}async function r(){try{if(K.value>=0){const p=T.value,s=Z.value;Y.value[K.value]=s;const he=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:p,newTemplate:s,type:"scope"})})).json();he.success?(n({message:"作用域模板更新成功!",type:"success"}),C.value=!1,T.value="",K.value=-1,Z.value=""):n({message:"作用域模板更新失败: "+he.error,type:"error"})}}catch(p){n({message:"作用域模板更新失败: "+p.message,type:"error"})}}function A(p,s){C.value=!0,T.value=p,K.value=s,Z.value=p}function U(){C.value=!1,T.value="",K.value=-1,Z.value=""}async function k(p){try{const s=H.value.indexOf(p);s!==-1&&H.value.splice(s,1);const he=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:p,type:"description"})})).json();he.success?n({message:"模板删除成功!",type:"success"}):n({message:"模板删除失败: "+he.error,type:"error"})}catch(s){n({message:"模板删除失败: "+s.message,type:"error"})}}async function me(p){try{const s=Y.value.indexOf(p);s!==-1&&Y.value.splice(s,1);const he=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:p,type:"scope"})})).json();he.success?n({message:"作用域模板删除成功!",type:"success"}):n({message:"作用域模板删除失败: "+he.error,type:"error"})}catch(s){n({message:"作用域模板删除失败: "+s.message,type:"error"})}}function Le(p){te.value=p,J.value=!1}function je(p){I.value=p,q.value=!1}function Ve(){J.value=!0}function Ee(){q.value=!0}async function Pe(){try{await v.addToStage()&&v.fetchStatus()}catch(p){n({message:`添加文件失败: ${p.message}`,type:"error"})}}async function xe(){if(!c.value.trim()){n({message:"提交信息不能为空",type:"warning"});return}try{await v.commitChanges(c.value,y.value)&&(Me(),v.fetchStatus(),v.fetchLog(),b.getBranchStatus())}catch(p){n({message:`提交失败: ${p.message}`,type:"error"})}}function Ae(){D.value=!0,setTimeout(()=>{D.value=!1},2e3)}async function L(){i.value=!0;try{await v.pushToRemote(),Ae(),b.getBranchStatus()}catch(p){n({message:`推送失败: ${p.message}`,type:"error"})}finally{i.value=!1}}async function Ce(){z.value=!0;try{await b.gitPull(),await v.fetchStatus()}catch(p){n({message:`拉取失败: ${p.message}`,type:"error"})}finally{z.value=!1}}async function pt(){oe.value=!0;try{await b.gitFetchAll(),await v.fetchStatus()}catch(p){n({message:`获取远程分支信息失败: ${p.message}`,type:"error"})}finally{oe.value=!1}}async function ft(){if(!c.value.trim()){n({message:"提交信息不能为空",type:"warning"});return}try{await v.addAndCommit(c.value,y.value),Me(),v.fetchStatus(),v.fetchLog()}catch(p){n({message:`暂存并提交失败: ${p.message}`,type:"error"})}}async function vt(){if(!c.value.trim()){n({message:"提交信息不能为空",type:"warning"});return}try{i.value=!0,await v.addCommitAndPush(c.value,y.value),Me(),b.getCurrentBranch(),v.fetchLog(),b.getBranchStatus(),i.value=!1,Ae()}catch(p){n({message:`暂存、提交并推送失败: ${p.message}`,type:"error"}),i.value=!1}}async function Ze(){try{await lt.confirm(`确定要重置当前分支 "${b.currentBranch}" 到远程状态吗?这将丢失所有未推送的提交和本地更改。`,"重置到远程分支",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await v.resetToRemote(b.currentBranch)&&(v.fetchStatus(),v.fetchLog())}catch(p){p!=="cancel"&&n({message:`重置到远程分支失败: ${p.message}`,type:"error"})}}function Me(){_.value="",te.value="",re.value="",O.value=""}function Xe(){m.value=j.value,ue.value=!0}async function mt(){if(!m.value.trim()){n({message:"请输入默认提交信息",type:"warning"});return}try{const s=await(await fetch("/api/config/saveDefaultMessage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultCommitMessage:m.value})})).json();s.success?(j.value=m.value,ee.value=`输入提交信息 (默认: ${j.value})`,n({message:"默认提交信息保存成功!",type:"success"})):n({message:"保存失败: "+s.error,type:"error"})}catch(p){n({message:"保存失败: "+p.message,type:"error"})}}const Fe=$e(()=>v.fileList.some(p=>["modified","deleted","untracked"].includes(p.type))),Ie=$e(()=>v.fileList.filter(p=>["modified","deleted","untracked"].includes(p.type)).length),f=$e(()=>v.fileList.filter(p=>p.type==="added").length),o=$e(()=>f.value>0),x=$e(()=>v.fileList.length>0),V=$e(()=>b.branchAhead>0),ce=$e(()=>b.branchBehind>0),ye=$e(()=>b.hasUpstream&&(V.value||o.value&&c.value.trim())),be=$e(()=>o.value),B=$e(()=>b.hasUpstream&&(V.value||ce.value||x.value));async function Ue(){if(!m.value.trim()){n({message:"请输入模板内容",type:"warning"});return}try{if(ve.value)await gt();else{if(X.value.includes(m.value)){n({message:"该模板已存在",type:"warning"});return}X.value.push(m.value);const s=await(await fetch("/api/config/save-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:m.value,type:"message"})})).json();s.success?(n({message:"提交信息模板保存成功!",type:"success"}),m.value=""):n({message:"模板保存失败: "+s.error,type:"error"})}}catch(p){n({message:"模板保存失败: "+p.message,type:"error"})}}async function gt(){try{if(S.value>=0){const p=de.value,s=m.value;X.value[S.value]=s;const he=await(await fetch("/api/config/update-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldTemplate:p,newTemplate:s,type:"message"})})).json();he.success?(n({message:"提交信息模板更新成功!",type:"success"}),ve.value=!1,de.value="",S.value=-1,m.value=""):n({message:"模板更新失败: "+he.error,type:"error"})}}catch(p){n({message:"模板更新失败: "+p.message,type:"error"})}}function Wt(p,s){ve.value=!0,de.value=p,S.value=s,m.value=p}function Jt(){ve.value=!1,de.value="",S.value=-1,m.value=""}async function Yt(p){try{const s=X.value.indexOf(p);s!==-1&&X.value.splice(s,1);const he=await(await fetch("/api/config/delete-template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:p,type:"message"})})).json();he.success?n({message:"提交信息模板删除成功!",type:"success"}):n({message:"模板删除失败: "+he.error,type:"error"})}catch(s){n({message:"模板删除失败: "+s.message,type:"error"})}}function qt(p){_.value=p,m.value=p}return qe(()=>{M();const p=localStorage.getItem("zen-gitsync-standard-commit");p!==null&&(E.value=p==="true");const s=localStorage.getItem("zen-gitsync-skip-hooks");s!==null&&(y.value=s==="true"),b.getBranchStatus()}),(p,s)=>{const De=rt,he=Ft,Rt=jt,Te=Tt,Re=ut,ae=Se,Zt=ot,Xt=nt,Ke=It,yt=ns,Qe=Nt,ht=ct,Bt=Lt;return d(),g("div",{class:Ge(["card",{"is-pushing":l(v).isPushing||i.value}])},[s[57]||(s[57]=e("div",{class:"card-header"},[e("h2",null,"提交更改")],-1)),t(Gt,{name:"el-fade-in-linear"},{default:a(()=>[i.value?(d(),g("div",Da,s[14]||(s[14]=[e("div",{class:"pushing-spinner"},[e("svg",{viewBox:"0 0 50 50",class:"circular"},[e("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})])],-1),e("div",{class:"pushing-text"},"正在推送...",-1)]))):N("",!0)]),_:1}),t(Gt,{name:"el-fade-in-linear"},{default:a(()=>[D.value?(d(),g("div",ja,[t(De,{class:"push-success-icon"},{default:a(()=>[t(l(Ct))]),_:1}),s[15]||(s[15]=e("div",{class:"push-success-text"},"推送成功!",-1))])):N("",!0)]),_:1}),e("div",Ea,[e("div",Pa,[l(b).userName===""||l(b).userEmail===""?(d(),g("div",Ua,[t(he,{title:"Git用户信息未配置",type:"warning",closable:!1,"show-icon":""},{default:a(()=>s[16]||(s[16]=[e("p",null,"您需要配置Git用户名和邮箱才能提交代码。请使用以下命令配置:",-1),e("pre",{class:"config-command"},`git config --global user.name "Your Name"
|
|
19
|
+
git config --global user.email "your.email@example.com"`,-1)])),_:1})])):(d(),g(_e,{key:1},[e("div",Oa,[e("div",Ma,[e("div",Fa,[e("div",Ia,[t(Rt,{modelValue:E.value,"onUpdate:modelValue":s[0]||(s[0]=R=>E.value=R),"active-text":"标准化提交","inactive-text":"普通提交"},null,8,["modelValue"])]),e("div",Na,[t(Te,{content:"跳过 Git 钩子检查 (--no-verify)",placement:"top"},{default:a(()=>[t(Rt,{modelValue:y.value,"onUpdate:modelValue":s[1]||(s[1]=R=>y.value=R),"active-text":"跳过钩子 (--no-verify)"},null,8,["modelValue"])]),_:1})])])]),E.value?(d(),g("div",Za,[e("div",Xa,[t(Xt,{modelValue:P.value,"onUpdate:modelValue":s[3]||(s[3]=R=>P.value=R),placeholder:"提交类型",class:"type-select",clearable:""},{default:a(()=>[(d(),g(_e,null,ke(W,R=>t(Zt,{key:R.value,label:R.label,value:R.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),e("div",Ka,[t(Re,{modelValue:I.value,"onUpdate:modelValue":s[4]||(s[4]=R=>I.value=R),placeholder:"作用域(可选)",class:"scope-input",clearable:""},null,8,["modelValue"]),t(ae,{type:"primary",icon:l(Ye),circle:"",size:"small",class:"settings-button",onClick:Ee},null,8,["icon"])]),e("div",Qa,[t(Re,{modelValue:te.value,"onUpdate:modelValue":s[5]||(s[5]=R=>te.value=R),placeholder:"简短描述(必填)",class:"description-input",clearable:""},null,8,["modelValue"]),t(ae,{type:"primary",icon:l(Ye),circle:"",size:"small",class:"settings-button",onClick:Ve},null,8,["icon"])])]),t(Re,{modelValue:re.value,"onUpdate:modelValue":s[6]||(s[6]=R=>re.value=R),type:"textarea",rows:4,placeholder:"正文(可选):详细描述本次提交的内容和原因",class:"body-input",clearable:""},null,8,["modelValue"]),t(Re,{modelValue:O.value,"onUpdate:modelValue":s[7]||(s[7]=R=>O.value=R),placeholder:"页脚(可选):如 Closes #123",class:"footer-input",clearable:""},null,8,["modelValue"]),e("div",el,[s[18]||(s[18]=e("div",{class:"preview-title"},"提交信息预览:",-1)),e("pre",tl,$(c.value),1),s[19]||(s[19]=e("div",{class:"preview-title",style:{"margin-top":"10px"}},"Git提交命令预览:",-1)),e("pre",sl,$(F.value),1)])])):(d(),g("div",Ha,[e("div",Wa,[t(Re,{modelValue:_.value,"onUpdate:modelValue":s[2]||(s[2]=R=>_.value=R),placeholder:ee.value,type:"textarea",rows:6,resize:"none",class:"commit-message-input"},null,8,["modelValue","placeholder"]),e("div",Ja,[t(ae,{type:"primary",icon:l(Ye),circle:"",size:"small",class:"settings-button",onClick:Xe},null,8,["icon"])])]),e("div",Ya,[s[17]||(s[17]=e("div",{class:"preview-title"},"Git提交命令预览:",-1)),e("pre",qa,'git commit -m "'+$(c.value||"<提交信息>")+'"'+$(y.value?" --no-verify":""),1)])]))]),e("div",al,[s[32]||(s[32]=e("h3",null,"Git 操作",-1)),e("div",ll,[e("div",ol,[e("div",nl,[s[25]||(s[25]=e("div",{class:"group-title"},"基础操作",-1)),e("div",il,[t(Te,{content:Fe.value?`暂存${Ie.value}个待更改文件`:"git add .",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"primary",onClick:Pe,loading:l(v).isAddingFiles,disabled:!Fe.value,class:"action-button"},{default:a(()=>[s[20]||(s[20]=h(" 暂存更改 ")),Ie.value>0?(d(),g("span",rl,"("+$(Ie.value)+")",1)):N("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),t(Te,{content:o.value?`提交${f.value}个已暂存文件`:"git commit",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"primary",onClick:xe,loading:l(v).isLoadingStatus,disabled:!o.value||!c.value.trim(),class:"action-button"},{default:a(()=>[s[21]||(s[21]=h(" 提交 ")),f.value>0?(d(),g("span",cl,"("+$(f.value)+")",1)):N("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["content"]),t(Te,{content:V.value?`推送${l(b).branchAhead}个本地提交`:"git push",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"primary",icon:l(as),onClick:L,loading:l(v).isPushing,disabled:!ye.value,class:Ge(["action-button","push-button",{"is-loading":l(v).isPushing||i.value}]),style:St(V.value?{backgroundColor:"#67c23a !important",borderColor:"#67c23a !important"}:{})},{default:a(()=>[s[22]||(s[22]=h(" 推送 ")),V.value?(d(),g("span",ul,"("+$(l(b).branchAhead)+")",1)):N("",!0)]),_:1},8,["icon","loading","disabled","class","style"])]),_:1},8,["content"]),t(Te,{content:ce.value?`拉取${l(b).branchBehind}个远程提交`:"git pull",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"primary",icon:l(Et),onClick:Ce,loading:z.value,disabled:!l(b).hasUpstream,class:"action-button",style:St(ce.value?{color:"white",backgroundColor:"#E6A23C",borderColor:"#E6A23C"}:{})},{default:a(()=>[s[23]||(s[23]=h(" 拉取 ")),ce.value?(d(),g("span",dl,"("+$(l(b).branchBehind)+")",1)):N("",!0)]),_:1},8,["icon","loading","disabled","style"])]),_:1},8,["content"]),t(Te,{content:"git fetch --all",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"info",icon:l(Pt),onClick:pt,loading:oe.value,class:"action-button"},{default:a(()=>s[24]||(s[24]=[h(" 获取所有远程分支 ")])),_:1},8,["icon","loading"])]),_:1})])]),e("div",pl,[s[28]||(s[28]=e("div",{class:"group-title"},"组合操作",-1)),e("div",fl,[t(Te,{content:"git add + git commit",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"primary",icon:l(et),onClick:ft,loading:l(v).isAddingFiles||l(v).isCommiting,disabled:!Fe.value||!c.value.trim(),class:"action-button"},{default:a(()=>s[26]||(s[26]=[h(" 暂存并提交 ")])),_:1},8,["icon","loading","disabled"])]),_:1}),t(Te,{content:"git add + git commit + git push",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"success",icon:l(ls),onClick:vt,loading:l(v).isAddingFiles||l(v).isCommiting||l(v).isPushing,disabled:!x.value||!c.value.trim()||!l(b).hasUpstream,class:Ge(["action-button","one-click-push",{"is-loading":l(v).isAddingFiles||l(v).isCommiting||l(v).isPushing}])},{default:a(()=>s[27]||(s[27]=[h(" 一键推送 ")])),_:1},8,["icon","loading","disabled","class"])]),_:1})])])]),e("div",vl,[s[31]||(s[31]=e("div",{class:"group-title"},"重置操作",-1)),e("div",ml,[t(Te,{content:be.value?`撤销${f.value}个已暂存文件`:"git reset HEAD",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"warning",icon:l(Vt),onClick:l(v).resetHead,loading:l(v).isResetting,disabled:!be.value,class:"action-button reset-button"},{default:a(()=>[s[29]||(s[29]=h(" 重置暂存区 ")),f.value>0?(d(),g("span",gl,"("+$(f.value)+")",1)):N("",!0)]),_:1},8,["icon","onClick","loading","disabled"])]),_:1},8,["content"]),t(Te,{content:"git reset --hard origin/branch",placement:"top",effect:"light","popper-class":"git-cmd-tooltip"},{default:a(()=>[t(ae,{type:"danger",icon:l(os),onClick:Ze,loading:l(v).isResetting,disabled:!B.value,class:"action-button danger-button"},{default:a(()=>s[30]||(s[30]=[h(" 重置到远程 ")])),_:1},8,["icon","loading","disabled"])]),_:1})])])])])],64))]),t(ht,{title:"简短描述模板设置",modelValue:J.value,"onUpdate:modelValue":s[9]||(s[9]=R=>J.value=R),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"template-dialog"},{default:a(()=>[e("div",yl,[e("div",hl,[t(Re,{modelValue:G.value,"onUpdate:modelValue":s[8]||(s[8]=R=>G.value=R),placeholder:ne.value?"编辑模板内容":"输入新模板内容",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",_l,[ne.value?(d(),le(ae,{key:0,onClick:fe},{default:a(()=>s[33]||(s[33]=[h("取消")])),_:1})):N("",!0),t(ae,{type:"primary",onClick:ge,disabled:!G.value.trim()},{default:a(()=>[h($(ne.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"])])]),e("div",wl,[s[37]||(s[37]=e("h3",null,"已保存模板",-1)),H.value.length===0?(d(),le(Ke,{key:0,description:"暂无保存的模板"})):N("",!0),(d(!0),g(_e,null,ke(H.value,(R,Be)=>(d(),le(Qe,{key:Be,class:"template-item"},{default:a(()=>[t(yt,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:a(()=>[e("div",$l,$(R),1),e("div",bl,[t(ae,{type:"primary",size:"small",onClick:ze=>Le(R)},{default:a(()=>s[34]||(s[34]=[h("使用")])),_:2},1032,["onClick"]),t(ae,{type:"warning",size:"small",icon:l(et),onClick:ze=>pe(R,Be)},{default:a(()=>s[35]||(s[35]=[h("编辑")])),_:2},1032,["icon","onClick"]),t(ae,{type:"danger",size:"small",onClick:ze=>k(R)},{default:a(()=>s[36]||(s[36]=[h("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])])]),_:1},8,["modelValue"]),t(ht,{title:"作用域模板设置",modelValue:q.value,"onUpdate:modelValue":s[11]||(s[11]=R=>q.value=R),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"template-dialog"},{default:a(()=>[e("div",kl,[e("div",Cl,[t(Re,{modelValue:Z.value,"onUpdate:modelValue":s[10]||(s[10]=R=>Z.value=R),placeholder:C.value?"编辑作用域模板内容":"输入新作用域模板",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",Sl,[C.value?(d(),le(ae,{key:0,onClick:U},{default:a(()=>s[38]||(s[38]=[h("取消")])),_:1})):N("",!0),t(ae,{type:"primary",onClick:w,disabled:!Z.value.trim()},{default:a(()=>[h($(C.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"])])]),e("div",Tl,[s[42]||(s[42]=e("h3",null,"已保存作用域",-1)),Y.value.length===0?(d(),le(Ke,{key:0,description:"暂无保存的作用域"})):N("",!0),(d(!0),g(_e,null,ke(Y.value,(R,Be)=>(d(),le(Qe,{key:Be,class:"template-item"},{default:a(()=>[t(yt,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:a(()=>[e("div",Ll,$(R),1),e("div",Vl,[t(ae,{type:"primary",size:"small",onClick:ze=>je(R)},{default:a(()=>s[39]||(s[39]=[h("使用")])),_:2},1032,["onClick"]),t(ae,{type:"warning",size:"small",icon:l(et),onClick:ze=>A(R,Be)},{default:a(()=>s[40]||(s[40]=[h("编辑")])),_:2},1032,["icon","onClick"]),t(ae,{type:"danger",size:"small",onClick:ze=>me(R)},{default:a(()=>s[41]||(s[41]=[h("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])])]),_:1},8,["modelValue"]),t(ht,{title:"默认提交信息设置",modelValue:ue.value,"onUpdate:modelValue":s[13]||(s[13]=R=>ue.value=R),width:"80vw",top:"70px",style:{height:"calc(100vh - 140px)"},"close-on-click-modal":!1,class:"message-template-dialog"},{default:a(()=>[e("div",xl,[e("div",Rl,[t(Re,{modelValue:m.value,"onUpdate:modelValue":s[12]||(s[12]=R=>m.value=R),placeholder:ve.value?"编辑模板内容":"输入新模板内容",class:"template-input",clearable:""},null,8,["modelValue","placeholder"]),e("div",Bl,[ve.value?(d(),le(ae,{key:0,onClick:Jt},{default:a(()=>s[43]||(s[43]=[h("取消")])),_:1})):N("",!0),t(ae,{type:"primary",onClick:Ue,disabled:!m.value.trim()},{default:a(()=>[h($(ve.value?"更新模板":"添加模板"),1)]),_:1},8,["disabled"]),t(ae,{type:"success",onClick:mt,disabled:!m.value.trim()},{default:a(()=>s[44]||(s[44]=[h(" 设为默认提交信息 ")])),_:1},8,["disabled"])])]),e("div",zl,[e("div",Gl,[s[48]||(s[48]=e("h3",null,"已保存模板",-1)),e("div",Al,[X.value.length===0?(d(),le(Ke,{key:0,description:"暂无保存的模板"})):N("",!0),(d(!0),g(_e,null,ke(X.value,(R,Be)=>(d(),le(Qe,{key:Be,class:"template-item"},{default:a(()=>[t(yt,{justify:"space-between",align:"middle",style:{width:"100%"}},{default:a(()=>[e("div",Dl,$(R),1),e("div",jl,[t(ae,{type:"primary",size:"small",onClick:ze=>qt(R)},{default:a(()=>s[45]||(s[45]=[h("使用")])),_:2},1032,["onClick"]),t(ae,{type:"warning",size:"small",icon:l(et),onClick:ze=>Wt(R,Be)},{default:a(()=>s[46]||(s[46]=[h("编辑")])),_:2},1032,["icon","onClick"]),t(ae,{type:"danger",size:"small",onClick:ze=>Yt(R)},{default:a(()=>s[47]||(s[47]=[h("删除")])),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024))),128))])]),e("div",El,[s[56]||(s[56]=e("h3",null,"当前默认提交信息",-1)),j.value?(d(),le(Qe,{key:0,class:"default-message-card"},{default:a(()=>[e("div",Pl,$(j.value),1)]),_:1})):(d(),le(Ke,{key:1,description:"尚未设置默认提交信息","image-size":100})),e("div",Ul,[s[54]||(s[54]=e("h4",null,"关于默认提交信息",-1)),s[55]||(s[55]=e("p",null,"默认提交信息将在未输入提交信息时自动使用。",-1)),e("p",null,[s[51]||(s[51]=h("你可以通过点击左侧模板的")),t(Bt,{size:"small",type:"primary"},{default:a(()=>s[49]||(s[49]=[h("使用")])),_:1}),s[52]||(s[52]=h("按钮先选择喜欢的模板,然后点击上方")),t(Bt,{size:"small",type:"success"},{default:a(()=>s[50]||(s[50]=[h("设为默认提交信息")])),_:1}),s[53]||(s[53]=h("按钮保存。"))])])])])])]),_:1},8,["modelValue"])])],2)}}}),Ml=dt(Ol,[["__scopeId","data-v-ce8851cb"]]),Fl={class:"card"},Il={key:0,class:"refresh-notification"},Nl={class:"log-header"},Hl={class:"log-actions"},Wl={key:1,class:"filter-panel-header"},Jl={class:"filter-form"},Yl={class:"filter-item"},ql={class:"filter-item"},Zl={class:"filter-item"},Xl={class:"filter-item"},Kl={class:"filter-actions"},Ql={key:0},eo={key:1},to={key:0,class:"graph-view"},so={key:0,class:"commit-count"},ao={class:"graph-controls"},lo={class:"zoom-controls"},oo={class:"scale-info"},no={key:1,class:"table-view-container"},io=["onClick"],ro={class:"author-name"},co={key:0,class:"branch-container"},uo={key:0,class:"load-more-container"},po={class:"pagination-info"},fo={key:0,class:"loading-more"},vo={key:2,class:"no-more-data"},mo={key:0,class:"total-loaded"},go={class:"commit-detail-container"},yo={key:0,class:"commit-info"},ho={class:"commit-info-header"},_o={class:"info-item"},wo={class:"item-value"},$o={class:"info-item"},bo={class:"item-value"},ko={class:"info-item"},Co={class:"item-value"},So={class:"commit-message-container"},To=["innerHTML"],Lo={class:"commit-files-diff"},Vo={class:"files-list"},xo={key:1},Ro=["onClick"],Bo={class:"file-diff"},zo={key:0},Go={key:1},Ao=["innerHTML"],We=.5,tt=1.5,kt=.1,Do=it({__name:"LogList",setup(Q,{expose:v}){const b=xt(),_=Oe();let i=[];const D=u(i),z=u(""),oe=u(!1),ee=$e(()=>b.isLoadingLog||oe.value),j=u(!1),E=u(0),P=u(!1),I=u(null),te=u(1),re=u(!0),O=u(!1),H=u(null),J=u(!1),G=u(null),ne=u([]),ie=u(""),se=u(!1),Y=u(""),q=u(1),Z=u(!1),C=u(!1),T=u([]),K=u(""),ue=u(null),m=u([]),y=u([]),W=u([]),X=u(!1),ve=u(0),de=u(0),S=u(null),c=$e(()=>D.value);async function F(f=!1,o=1){if(!Oe().isGitRepo){z.value="当前目录不是Git仓库";return}try{o>1?O.value=!0:oe.value=!0,console.log(`加载提交历史: page=${o}, all=${f}`);const V=new URLSearchParams;V.append("page",o.toString()),V.append("all",f.toString()),T.value.length>0&&V.append("author",T.value.join(",")),y.value.length>0&&V.append("branch",y.value.join(",")),K.value&&V.append("message",K.value),ue.value&&Array.isArray(ue.value)&&ue.value.length===2&&(V.append("dateFrom",ue.value[0]),V.append("dateTo",ue.value[1])),V.append("_t",Date.now().toString());const ye=await(await fetch(`/api/log?${V.toString()}`)).json();if(!ye||!ye.data||!Array.isArray(ye.data)){console.error("API返回的数据格式不正确:",ye),z.value="加载提交历史失败: 服务器返回数据格式不正确";return}const be=o>1;be?ye.data.forEach(B=>i.push(B)):(i.length=0,ye.data.forEach(B=>i.push(B))),D.value=[...i],te.value=o,E.value=ye.total||i.length,re.value=ye.hasMore===!0,re.value||console.log("已加载所有提交记录"),be||(Z.value=!0,setTimeout(()=>{Z.value=!1},2e3)),!be&&P.value&&setTimeout(M,0),z.value=""}catch(V){z.value="加载提交历史失败: "+(V instanceof Error?V.message:String(V)),console.error("加载日志失败:",V),o>1&&(re.value=!1)}finally{o>1?O.value=!1:oe.value=!1}}async function M(){if(console.log(`开始渲染图表...数据长度: ${i.length}`),!I.value){console.error("图表容器未找到");return}if(i.length===0){console.error("没有日志数据可渲染");return}try{I.value.innerHTML="",console.log(`创建gitgraph实例,分支: ${_.currentBranch||"main"}`);const f=ws(I.value,{orientation:"vertical-reverse",template:"metro",author:"提交者 <committer@example.com>"}),o={},x=f.branch(_.currentBranch||"main");o[_.currentBranch||"main"]=x,console.log(`开始创建提交图...共${i.length}条提交`),i.forEach((V,ce)=>{let ye=x;if(V.branch){const be=pe(V.branch.split(",")[0]);o[be]||(o[be]=f.branch(be)),ye=o[be]}ye.commit({hash:V.hash,subject:V.message,author:`${V.author} <${V.email}>`}),ce%10===0&&console.log(`已渲染 ${ce+1}/${i.length} 个提交`)}),console.log("图表渲染完成"),setTimeout(()=>{Ee()},100)}catch(f){console.error("渲染图表失败:",f),z.value="渲染图表失败: "+(f instanceof Error?f.message:String(f))}}function ge(){P.value=!P.value,P.value&&i.length>0&&setTimeout(M,0)}function we(){F(!j.value)}function pe(f){return f.includes("HEAD -> ")?f.replace("HEAD -> ",""):f.includes("origin/")?f:f.trim()}function fe(f){return f.includes("HEAD")?"success":f.includes("origin/")?"warning":"info"}const w=u(null),r=u(null);function A(f){if(P.value||!re.value||O.value||ee.value)return;const o=f.target,{scrollTop:x,scrollHeight:V,clientHeight:ce}=o,ye=V-x-ce;console.log("表格滚动:",{scrollTop:x,scrollHeight:V,clientHeight:ce,scrollDistance:ye}),ye<=20&&(console.log("已滚动到底部,加载更多数据"),Ce())}function U(){w.value&&(r.value=w.value.$el.querySelector(".el-table__body-wrapper"),r.value?(console.log("添加表格滚动监听"),r.value.addEventListener("scroll",A,!0)):console.error("未找到表格的body-wrapper元素"))}function k(){r.value&&(console.log("移除表格滚动监听"),r.value.removeEventListener("scroll",A,!0),r.value=null)}qe(()=>{_.isGitRepo?(b.log.length>0?(console.log("使用已加载的日志数据"),i.length=0,b.log.forEach(f=>i.push(f)),E.value=b.log.length,P.value&&setTimeout(()=>{console.log(`准备渲染图表,数据长度: ${i.length}`),M()},100)):(console.log("初始加载日志数据"),F()),vt(),Me()):z.value="当前目录不是Git仓库",is(()=>{setTimeout(()=>{U()},500)})}),rs(()=>{k(),H.value!==null&&(window.clearInterval(H.value),H.value=null)});const me=()=>{if(!_.isGitRepo){z.value="当前目录不是Git仓库";return}te.value=1,re.value=!0,F(j.value,1)};at(()=>b.log,f=>{console.log("监听到gitLogStore.log变化,更新图表数据");try{i.length=0,Array.isArray(f)&&f.forEach(o=>o&&i.push(o)),E.value=i.length,te.value=1,D.value=[...i],Z.value=!0,setTimeout(()=>{Z.value=!1},2e3),console.log(`数据更新完成,共${D.value.length}条记录,准备渲染图表`),P.value&&i.length>0&&setTimeout(M,0)}catch(o){console.error("更新日志数据失败:",o)}},{immediate:!0}),v({refreshLog:me});function Le(){q.value<tt&&(q.value=Math.min(tt,q.value+kt),Ve())}function je(){q.value>We&&(q.value=Math.max(We,q.value-kt),Ve())}function Ve(){if(!I.value)return;const f=I.value.querySelector("svg");f&&(f.style.transform=`scale(${q.value})`,f.style.transformOrigin="top left")}function Ee(){if(!I.value)return;const f=I.value.querySelector("svg");if(!f)return;const o=f.getBoundingClientRect().width/q.value,x=I.value.clientWidth;o>x?q.value=Math.max(We,x/o):q.value=1,Ve()}async function Pe(f){if(f){G.value=f,J.value=!0,se.value=!0,ne.value=[],ie.value="",Y.value="",console.log("提交详情对象:",JSON.stringify(f,null,2)),console.log("哈希值类型和长度:",typeof f.hash,f.hash?f.hash.length:0),console.log("提交信息类型和长度:",typeof f.message,f.message?f.message.length:0),console.log("提交分支:",f.branch);try{if(console.log(`获取提交详情: ${f.hash}`),!f.hash||f.hash.length<7){console.error("无效的提交哈希值:",f.hash),ie.value="无效的提交哈希值",se.value=!1;return}const o=await fetch(`/api/commit-files?hash=${f.hash}`);console.log("API响应状态: ",o.status);const x=await o.json();console.log("文件列表数据: ",x),x.success&&Array.isArray(x.files)?(ne.value=x.files,ne.value.length>0?await xe(f.hash,ne.value[0]):(console.log("没有找到变更文件"),ie.value="该提交没有变更文件")):(console.error("获取提交文件列表失败:",x.error||"未知错误"),ie.value=`获取文件列表失败: ${x.error||"未知错误"}`)}catch(o){console.error("获取提交详情失败:",o),ie.value=`获取提交详情失败: ${o.message}`}finally{se.value=!1}}}async function xe(f,o){se.value=!0,Y.value=o;try{console.log(`获取文件差异: hash=${f}, file=${o}`);const x=await fetch(`/api/commit-file-diff?hash=${f}&file=${encodeURIComponent(o)}`);console.log("差异API响应状态: ",x.status);const V=await x.json();console.log("差异数据: ",V.success,typeof V.diff),V.success?ie.value=V.diff||"没有变更内容":(console.error("获取差异失败: ",V.error),ie.value=`获取差异失败: ${V.error||"未知错误"}`)}catch(x){console.error("获取文件差异失败:",x),ie.value=`获取差异失败: ${x.message}`}finally{se.value=!1}}function Ae(f){if(!f)return"";const o=f.split(`
|
|
20
|
+
`);function x(V){return V.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return o.map(V=>{const ce=x(V);return V.startsWith("diff --git")?`<div class="diff-header">${ce}</div>`:V.startsWith("---")?`<div class="diff-old-file">${ce}</div>`:V.startsWith("+++")?`<div class="diff-new-file">${ce}</div>`:V.startsWith("@@")?`<div class="diff-hunk-header">${ce}</div>`:V.startsWith("+")?`<div class="diff-added">${ce}</div>`:V.startsWith("-")?`<div class="diff-removed">${ce}</div>`:`<div class="diff-context">${ce}</div>`}).join("")}function L(f){return f?(console.log("格式化前的提交信息:",f),console.log("提交信息中的换行符数量:",(f.match(/\n/g)||[]).length),f.trim()):"(无提交信息)"}function Ce(){!re.value||O.value||ee.value||(console.log(`加载更多日志,页码: ${te.value+1}`),F(j.value,te.value+1))}function pt(){T.value=[],y.value=[],K.value="",ue.value=null,te.value=1,F(j.value,1)}function ft(){te.value=1,F(j.value,1)}async function vt(){try{console.log("获取所有可用作者...");const o=await(await fetch("/api/authors")).json();o.success&&Array.isArray(o.authors)?(m.value=o.authors.sort(),console.log(`获取到${m.value.length}位作者`)):(console.warn("从API获取作者列表失败,将从现有日志中提取作者列表"),Ze())}catch(f){console.error("获取作者列表失败:",f),Ze()}}function Ze(){const f=new Set;D.value.forEach(o=>{o.author&&f.add(o.author)}),m.value=Array.from(f).sort(),console.log(`从现有日志中提取了${m.value.length}位作者`)}async function Me(){try{console.log("获取所有可用分支...");const o=await(await fetch("/api/branches")).json();o.branches&&Array.isArray(o.branches)?(W.value=o.branches.sort(),console.log(`获取到${W.value.length}个分支`)):(console.warn("获取分支列表失败"),Xe())}catch(f){console.error("获取分支列表失败:",f),Xe()}}function Xe(){const f=new Set;D.value.forEach(o=>{o.branch&&o.branch.split(",").forEach(V=>{const ce=pe(V.trim());ce&&f.add(ce)})}),W.value=Array.from(f).sort(),console.log(`从日志中提取了${W.value.length}个分支`)}function mt(f,o,x){console.log("handleContextMenu",f,o,x),x.preventDefault(),ve.value=x.clientY,de.value=x.clientX,S.value=f,X.value=!0;const V=()=>{X.value=!1,document.removeEventListener("click",V)};setTimeout(()=>{document.addEventListener("click",V)},0)}async function Fe(f){if(f)try{await lt.confirm(`确定要撤销提交 ${f.hash.substring(0,7)} 吗?这将创建一个新的提交来撤销这次提交的更改。`,"撤销提交确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const x=await(await fetch("/api/revert-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:f.hash})})).json();x.success?(n.success(x.message||"已成功撤销提交"),me(),b.fetchStatus(),_.getBranchStatus()):n.error(x.error||"撤销提交失败")}catch(o){o!=="cancel"&&(console.error("撤销提交出错:",o),n.error("撤销提交失败: "+(o.message||o)))}}async function Ie(f){if(f)try{await lt.confirm(`确定要将提交 ${f.hash.substring(0,7)} Cherry-Pick 到当前分支吗?`,"Cherry-Pick确认",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"});const x=await(await fetch("/api/cherry-pick-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hash:f.hash})})).json();x.success?(n.success(x.message||"已成功Cherry-Pick提交"),me(),b.fetchStatus(),_.getBranchStatus()):n.error(x.error||"Cherry-Pick提交失败")}catch(o){o!=="cancel"&&(console.error("Cherry-Pick提交出错:",o),n.error("Cherry-Pick提交失败: "+(o.message||o)))}}return(f,o)=>{var be;const x=rt,V=Tt,ce=It,ye=Mt;return d(),g(_e,null,[e("div",Fl,[Z.value?(d(),g("div",Il," 提交历史已刷新 ")):N("",!0),e("div",Nl,[o[12]||(o[12]=e("div",{class:"header-left"},[e("h2",null,"提交历史")],-1)),e("div",Hl,[P.value?N("",!0):(d(),le(l(Se),{key:0,type:C.value?"primary":"default",size:"small",onClick:o[0]||(o[0]=B=>C.value=!C.value)},{icon:a(()=>[t(x,null,{default:a(()=>[t(l(us))]),_:1})]),default:a(()=>[o[11]||(o[11]=h(" 筛选 ")),c.value.length!==D.value.length?(d(),le(l(cs),{key:0,value:c.value.length,class:"filter-badge"},null,8,["value"])):N("",!0)]),_:1},8,["type"])),t(l(Se),{type:"primary",size:"small",onClick:ge},{icon:a(()=>[t(x,null,{default:a(()=>[(d(),le(At(P.value?l(st):l(ds))))]),_:1})]),default:a(()=>[h(" "+$(P.value?"表格视图":"图表视图"),1)]),_:1}),t(l(Se),{type:"primary",size:"small",onClick:we,loading:ee.value},{icon:a(()=>[t(x,null,{default:a(()=>[(d(),le(At(j.value?l(ps):l(fs))))]),_:1})]),default:a(()=>[h(" "+$(j.value?"显示分页加载 (每页100条)":"显示所有提交"),1)]),_:1},8,["loading"]),t(l(Se),{circle:"",size:"small",onClick:o[1]||(o[1]=B=>me()),loading:ee.value,class:Ge({"refresh-button-animated":Z.value})},{default:a(()=>[t(x,null,{default:a(()=>[t(l(Vt))]),_:1})]),_:1},8,["loading","class"])])]),C.value&&!P.value?(d(),g("div",Wl,[e("div",Jl,[e("div",Yl,[o[13]||(o[13]=e("div",{class:"filter-label"},"作者:",-1)),t(l(nt),{modelValue:T.value,"onUpdate:modelValue":o[2]||(o[2]=B=>T.value=B),placeholder:"选择作者",multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{default:a(()=>[(d(!0),g(_e,null,ke(m.value,B=>(d(),le(l(ot),{key:B,label:B,value:B},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e("div",ql,[o[14]||(o[14]=e("div",{class:"filter-label"},"分支:",-1)),t(l(nt),{modelValue:y.value,"onUpdate:modelValue":o[3]||(o[3]=B=>y.value=B),placeholder:"选择分支",multiple:"",clearable:"",filterable:"",class:"filter-input",size:"small"},{default:a(()=>[(d(!0),g(_e,null,ke(W.value,B=>(d(),le(l(ot),{key:B,label:B,value:B},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e("div",Zl,[o[15]||(o[15]=e("div",{class:"filter-label"},"提交信息包含:",-1)),t(l(ut),{modelValue:K.value,"onUpdate:modelValue":o[4]||(o[4]=B=>K.value=B),placeholder:"关键词",clearable:"",class:"filter-input",size:"small"},null,8,["modelValue"])]),e("div",Xl,[o[16]||(o[16]=e("div",{class:"filter-label"},"日期范围:",-1)),t(l(vs),{modelValue:ue.value,"onUpdate:modelValue":o[5]||(o[5]=B=>ue.value=B),type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",class:"filter-input date-range",size:"small"},null,8,["modelValue"])]),e("div",Kl,[t(l(Se),{type:"primary",size:"small",onClick:ft},{default:a(()=>o[17]||(o[17]=[h("应用筛选")])),_:1}),t(l(Se),{type:"info",size:"small",onClick:pt},{default:a(()=>o[18]||(o[18]=[h("重置")])),_:1})])])])):N("",!0),e("div",{class:Ge(["content-area",{"with-filter":C.value&&!P.value}])},[z.value?(d(),g("div",Ql,$(z.value),1)):(d(),g("div",eo,[P.value?(d(),g("div",to,[l(i).length>0?(d(),g("div",so," 显示 "+$(l(i).length)+" 条提交记录 "+$(j.value?"(全部)":"(分页加载,每页100条)"),1)):N("",!0),e("div",ao,[e("div",lo,[t(l(Se),{type:"primary",circle:"",size:"small",onClick:je,disabled:q.value<=We},{default:a(()=>[t(x,null,{default:a(()=>[t(l(ms))]),_:1})]),_:1},8,["disabled"]),t(l(gs),{modelValue:q.value,"onUpdate:modelValue":o[6]||(o[6]=B=>q.value=B),min:We,max:tt,step:kt,onChange:Ve,class:"zoom-slider"},null,8,["modelValue"]),t(l(Se),{type:"primary",circle:"",size:"small",onClick:Le,disabled:q.value>=tt},{default:a(()=>[t(x,null,{default:a(()=>[t(l(ys))]),_:1})]),_:1},8,["disabled"]),t(l(Se),{type:"primary",size:"small",onClick:Ee},{default:a(()=>o[19]||(o[19]=[h(" 自适应大小 ")])),_:1})]),e("div",oo," 缩放: "+$(Math.round(q.value*100))+"% ",1)]),e("div",{ref_key:"graphContainer",ref:I,class:"graph-container"},null,512)])):(d(),g("div",no,[Je((d(),le(l(hs),{ref_key:"tableRef",ref:w,data:c.value,stripe:"",border:"",class:"log-table","empty-text":ee.value?"加载中...":"没有匹配的提交记录",height:"500",onRowContextmenu:mt},{default:a(()=>[t(l(He),{label:"提交哈希",width:"100",resizable:""},{default:a(B=>[e("span",{class:"commit-hash",onClick:Ue=>Pe(B.row)},$(B.row.hash.substring(0,7)),9,io)]),_:1}),t(l(He),{prop:"date",label:"日期",width:"120",resizable:""}),t(l(He),{label:"作者",width:"120",resizable:""},{default:a(B=>[t(V,{content:B.row.email,placement:"top","hide-after":1e3},{default:a(()=>[e("span",ro,$(B.row.author),1)]),_:2},1032,["content"])]),_:1}),t(l(He),{label:"分支",width:"180",resizable:""},{default:a(B=>[B.row.branch?(d(),g("div",co,[(d(!0),g(_e,null,ke(B.row.branch.split(","),(Ue,gt)=>(d(),le(l(Lt),{key:gt,size:"small",type:fe(Ue),class:"branch-tag"},{default:a(()=>[h($(pe(Ue)),1)]),_:2},1032,["type"]))),128))])):N("",!0)]),_:1}),t(l(He),{prop:"message",label:"提交信息","min-width":"250"})]),_:1},8,["data","empty-text"])),[[ye,ee.value]]),j.value?N("",!0):(d(),g("div",uo,[e("div",po,[e("span",null,"第 "+$(te.value)+" 页 "+$(E.value>0?`/ 共 ${Math.ceil(E.value/100)||1} 页`:"")+" (总计 "+$(E.value)+" 条记录)",1)]),O.value?(d(),g("div",fo,o[20]||(o[20]=[e("div",{class:"loading-spinner"},null,-1),e("span",null,"加载更多...",-1)]))):re.value?(d(),g("div",{key:1,class:"load-more-button",onClick:Ce},o[21]||(o[21]=[e("span",null,"加载更多",-1)]))):(d(),g("div",vo,[o[22]||(o[22]=e("span",null,"没有更多数据了",-1)),D.value.length>0?(d(),g("span",mo,"(已加载 "+$(D.value.length)+" 条记录)",1)):N("",!0)]))]))]))]))],2),t(l(ct),{modelValue:J.value,"onUpdate:modelValue":o[7]||(o[7]=B=>J.value=B),title:`提交详情: ${(be=G.value)!=null&&be.hash?G.value.hash.substring(0,7):"未知"}`,width:"80%","destroy-on-close":"",class:"commit-detail-dialog"},{default:a(()=>[Je((d(),g("div",go,[G.value?(d(),g("div",yo,[e("div",ho,[e("div",_o,[o[23]||(o[23]=e("span",{class:"item-label"},"哈希:",-1)),e("span",wo,$(G.value.hash),1)]),e("div",$o,[o[24]||(o[24]=e("span",{class:"item-label"},"作者:",-1)),e("span",bo,$(G.value.author)+" <"+$(G.value.email)+">",1)]),e("div",ko,[o[25]||(o[25]=e("span",{class:"item-label"},"日期:",-1)),e("span",Co,$(G.value.date),1)])]),e("div",So,[o[26]||(o[26]=e("div",{class:"message-label"},"提交信息:",-1)),e("div",{class:"message-content",innerHTML:L(G.value.message).replace(/\n/g,"<br>")},null,8,To)])])):N("",!0),e("div",Lo,[e("div",Vo,[o[27]||(o[27]=e("h3",null,"变更文件",-1)),ne.value.length===0?(d(),le(ce,{key:0,description:"没有找到变更文件"})):(d(),g("ul",xo,[(d(!0),g(_e,null,ke(ne.value,B=>(d(),g("li",{key:B,class:Ge({"active-file":B===Y.value}),onClick:Ue=>xe(G.value.hash,B)},$(B),11,Ro))),128))]))]),e("div",Bo,[Y.value?(d(),g("h3",zo,"文件差异: "+$(Y.value),1)):(d(),g("h3",Go,"文件差异")),!ie.value&&!se.value?(d(),le(ce,{key:2,description:"选择文件查看差异"})):ie.value?(d(),g("div",{key:3,innerHTML:Ae(ie.value),class:"diff-content"},null,8,Ao)):N("",!0)])])])),[[ye,se.value]])]),_:1},8,["modelValue","title"])]),o[33]||(o[33]=h()),Je(e("div",{class:"context-menu",style:St({top:ve.value+"px",left:de.value+"px"})},[e("div",{class:"context-menu-item",onClick:o[8]||(o[8]=B=>Pe(S.value))},o[28]||(o[28]=[e("i",{class:"el-icon-view"},null,-1),h(" 查看详情 ")])),o[31]||(o[31]=h()),e("div",{class:"context-menu-item",onClick:o[9]||(o[9]=B=>Fe(S.value))},o[29]||(o[29]=[e("i",{class:"el-icon-delete"},null,-1),h(" 撤销提交 (Revert) ")])),o[32]||(o[32]=h()),e("div",{class:"context-menu-item",onClick:o[10]||(o[10]=B=>Ie(S.value))},o[30]||(o[30]=[e("i",{class:"el-icon-edit"},null,-1),h(" Cherry-Pick 到当前分支 ")]))],4),[[_s,X.value]])],64)}}}),jo=dt(Do,[["__scopeId","data-v-b43b7b4e"]]),Eo="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",Po={class:"main-header"},Uo={class:"header-left"},Oo=["src"],Mo={class:"header-info"},Fo={key:0,id:"user-info"},Io={class:"user-name"},No={class:"user-email"},Ho={key:1,id:"user-info"},Wo={class:"main-container"},Jo={key:0,class:"loading-container"},Yo={class:"loading-spinner"},qo={key:1,class:"grid-layout"},Zo={class:"git-status-panel"},Xo={key:0,class:"commit-form-panel"},Ko={key:0,class:"card"},Qo={class:"tips"},en={key:1,class:"commit-form-panel"},tn={key:2,class:"log-list-panel"},sn={class:"dialog-footer"},an={class:"main-footer"},ln={key:0,class:"branch-info"},on={class:"branch-wrapper"},nn={class:"dialog-footer"},rn=it({__name:"App",setup(Q){const v=u(""),b=u(null),_=u(null),i=Oe(),D=u(!1),z=u("");async function oe(){try{const c=await(await fetch("/api/config/getConfig")).json();v.value=`默认提交信息: ${c.defaultCommitMessage}`}catch(S){console.error("加载配置失败:",S)}}async function ee(){try{const c=await(await fetch("/api/current_directory")).json();return z.value=c.directory||"未知目录",c}catch(S){return console.error("获取当前目录失败:",S),{directory:"未知目录",isGitRepo:!1}}}qe(async()=>{console.log("---------- 页面初始化开始 ----------");try{const[S,c]=await Promise.all([oe(),ee()]);i.isGitRepo=c.isGitRepo===!0,i.lastCheckedTime=Date.now(),i.isGitRepo?await Promise.all([i.getCurrentBranch(),i.getAllBranches(),i.getUserInfo()]):n.warning("当前目录不是Git仓库,部分功能将不可用")}catch(S){console.error("初始化失败:",S)}finally{D.value=!0,console.log("---------- 页面初始化完成 ----------"),setTimeout(()=>{ue()},100)}});const j=u(!1),E=u(""),P=u("");async function I(){await i.createBranch(E.value,P.value)&&(j.value=!1,E.value="",_.value&&_.value.refreshStatus(),b.value&&b.value.refreshLog())}function te(){P.value=i.currentBranch,j.value=!0}async function re(S){await i.changeBranch(S)&&(_.value&&_.value.refreshStatus(),b.value&&b.value.refreshLog())}const O=u(!1),H=u(""),J=u("");function G(){H.value=i.userName,J.value=i.userEmail,O.value=!0}async function ne(){if(!H.value||!J.value){n.warning("用户名和邮箱不能为空");return}await i.restoreUserConfig(H.value,J.value)&&(O.value=!1)}async function ie(){await i.clearUserConfig()&&(H.value="",J.value="")}let se=!1,Y=!1,q=0,Z=0,C="",T="";function K(){const S=document.querySelector(".grid-layout");if(!S)return;const c=getComputedStyle(S).gridTemplateColumns.split(" "),F=getComputedStyle(S).gridTemplateRows.split(" ");if(c.length>=3&&F.length>=3){const M=parseFloat(c[0]),ge=parseFloat(c[2]),we=M+ge,pe=M/we,fe=parseFloat(F[0]),w=parseFloat(F[2]),r=fe+w,A=fe/r;localStorage.setItem("zen-gitsync-layout-left-ratio",pe.toString()),localStorage.setItem("zen-gitsync-layout-top-ratio",A.toString()),console.log(`布局比例已保存 - 左侧: ${(pe*100).toFixed(0)}%, 上方: ${(A*100).toFixed(0)}%`)}}function ue(){const S=document.querySelector(".grid-layout");if(!S)return;const c=localStorage.getItem("zen-gitsync-layout-left-ratio"),F=localStorage.getItem("zen-gitsync-layout-top-ratio");if(c){const M=parseFloat(c),ge=1-M;S.style.gridTemplateColumns=`${M}fr 8px ${ge}fr`,console.log(`已恢复左侧比例: ${(M*100).toFixed(0)}%`)}else S.style.gridTemplateColumns="1fr 8px 3fr";if(F){const M=parseFloat(F),ge=1-M;S.style.gridTemplateRows=`${M}fr 8px ${ge}fr`,console.log(`已恢复上方比例: ${(M*100).toFixed(0)}%`)}}function m(S){var F;se=!0,q=S.clientX;const c=document.querySelector(".grid-layout");C=getComputedStyle(c).gridTemplateColumns,(F=document.getElementById("v-resizer"))==null||F.classList.add("active"),document.addEventListener("mousemove",y),document.addEventListener("mouseup",W),S.preventDefault()}function y(S){if(!se)return;const c=document.querySelector(".grid-layout"),F=S.clientX-q,M=C.split(" ");if(M.length>=3){const ge=parseFloat(M[0]),we=parseFloat(M[2]),pe=ge+we,fe=(ge+F/c.clientWidth*pe)/pe,w=1-fe,r=.1,A=.5;fe<r?c.style.gridTemplateColumns=`${r}fr 8px ${1-r}fr`:fe>A?c.style.gridTemplateColumns=`${A}fr 8px ${1-A}fr`:c.style.gridTemplateColumns=`${fe}fr 8px ${w}fr`}}function W(){var S;se=!1,(S=document.getElementById("v-resizer"))==null||S.classList.remove("active"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",W),K()}function X(S){var F;Y=!0,Z=S.clientY;const c=document.querySelector(".grid-layout");T=getComputedStyle(c).gridTemplateRows,(F=document.getElementById("h-resizer"))==null||F.classList.add("active"),document.addEventListener("mousemove",ve),document.addEventListener("mouseup",de),S.preventDefault()}function ve(S){if(!Y)return;const c=document.querySelector(".grid-layout"),F=S.clientY-Z,M=T.split(" ");if(M.length>=3){const ge=parseFloat(M[0]),we=parseFloat(M[2]),pe=ge+we,fe=(ge+F/c.clientHeight*pe)/pe,w=1-fe,r=.2,A=.8;fe<r?c.style.gridTemplateRows=`${r}fr 8px ${1-r}fr`:fe>A?c.style.gridTemplateRows=`${A}fr 8px ${1-A}fr`:c.style.gridTemplateRows=`${fe}fr 8px ${w}fr`}}function de(){var S;Y=!1,(S=document.getElementById("h-resizer"))==null||S.classList.remove("active"),document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",de),K()}return(S,c)=>{const F=rt,M=Se,ge=Nt,we=ut,pe=Ot,fe=ot,w=nt,r=Ut,A=ct,U=Ft;return d(),g(_e,null,[e("header",Po,[e("div",Uo,[e("img",{src:l(Eo),alt:"Zen GitSync Logo",class:"logo"},null,8,Oo),c[9]||(c[9]=e("h1",null,"Zen GitSync UI",-1))]),e("div",Mo,[l(i).userName&&l(i).userEmail?(d(),g("div",Fo,[c[10]||(c[10]=e("span",{class:"user-label"},"用户:",-1)),e("span",Io,$(l(i).userName),1),e("span",No,"<"+$(l(i).userEmail)+">",1),t(M,{type:"primary",size:"small",onClick:G,class:"user-settings-btn",circle:""},{default:a(()=>[t(F,null,{default:a(()=>[t(l(Ye))]),_:1})]),_:1})])):(d(),g("div",Ho,[c[11]||(c[11]=e("span",{class:"user-label"},"用户: ",-1)),c[12]||(c[12]=e("span",{class:"user-warning"},"未配置",-1)),t(M,{type:"primary",size:"small",onClick:G,class:"user-settings-btn",circle:""},{default:a(()=>[t(F,null,{default:a(()=>[t(l(Ye))]),_:1})]),_:1})]))])]),e("main",Wo,[D.value?(d(),g("div",qo,[e("div",Zo,[t(Aa,{ref_key:"gitStatusRef",ref:_,"initial-directory":z.value},null,8,["initial-directory"])]),e("div",{class:"vertical-resizer",id:"v-resizer",onMousedown:m},null,32),l(i).isGitRepo?(d(),g("div",Xo,[!l(i).userName||!l(i).userEmail?(d(),g("div",Ko,[c[18]||(c[18]=e("h2",null,"Git用户未配置",-1)),c[19]||(c[19]=e("p",null,"请先配置Git用户信息才能进行提交操作。",-1)),e("div",Qo,[c[16]||(c[16]=e("h3",null,"您可以通过以下方式配置:",-1)),c[17]||(c[17]=e("ol",null,[e("li",null,"点击右上角的设置按钮,配置用户名和邮箱"),e("li",null,"或者使用命令行配置:"),e("div",{class:"code-block"},[h(' git config --global user.name "您的用户名"'),e("br"),h(' git config --global user.email "您的邮箱" ')])],-1)),t(M,{type:"primary",onClick:G},{default:a(()=>c[15]||(c[15]=[h(" 立即配置 ")])),_:1})])])):(d(),le(Ml,{key:1}))])):(d(),g("div",en,c[20]||(c[20]=[e("div",{class:"card"},[e("h2",null,"Git仓库初始化"),e("p",null,"当前目录不是Git仓库,请先初始化Git仓库或切换到Git仓库目录。"),e("div",{class:"tips"},[e("h3",null,"可以使用以下命令初始化仓库:"),e("div",{class:"code-block"},"git init")])],-1)]))),e("div",{class:"horizontal-resizer",id:"h-resizer",onMousedown:X},null,32),l(i).isGitRepo?(d(),g("div",tn,[t(jo,{ref_key:"logListRef",ref:b},null,512)])):N("",!0),t(A,{modelValue:j.value,"onUpdate:modelValue":c[3]||(c[3]=k=>j.value=k),title:"创建新分支",width:"30%","destroy-on-close":""},{footer:a(()=>[e("span",sn,[t(M,{onClick:c[2]||(c[2]=k=>j.value=!1)},{default:a(()=>c[21]||(c[21]=[h("取消")])),_:1}),t(M,{type:"primary",onClick:I,loading:l(i).isCreatingBranch},{default:a(()=>c[22]||(c[22]=[h(" 创建 ")])),_:1},8,["loading"])])]),default:a(()=>[t(r,{model:{newBranchName:E.value,selectedBaseBranch:P.value}},{default:a(()=>[t(pe,{label:"新分支名称"},{default:a(()=>[t(we,{modelValue:E.value,"onUpdate:modelValue":c[0]||(c[0]=k=>E.value=k),placeholder:"请输入新分支名称"},null,8,["modelValue"])]),_:1}),t(pe,{label:"基于分支"},{default:a(()=>[t(w,{modelValue:P.value,"onUpdate:modelValue":c[1]||(c[1]=k=>P.value=k),placeholder:"选择基础分支",style:{width:"100%"}},{default:a(()=>[(d(!0),g(_e,null,ke(l(i).allBranches,k=>(d(),le(fe,{key:k,label:k,value:k},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])):(d(),g("div",Jo,[t(ge,{class:"loading-card"},{default:a(()=>[e("div",Yo,[t(F,{class:"is-loading"},{default:a(()=>c[13]||(c[13]=[e("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})],-1)])),_:1})]),c[14]||(c[14]=e("div",{class:"loading-text"},"加载中...",-1))]),_:1})]))]),e("footer",an,[l(i).currentBranch?(d(),g("div",ln,[e("div",on,[c[24]||(c[24]=e("span",{class:"branch-label"},"当前分支:",-1)),t(w,{modelValue:l(i).currentBranch,"onUpdate:modelValue":c[4]||(c[4]=k=>l(i).currentBranch=k),size:"small",onChange:re,loading:l(i).isChangingBranch,class:"branch-select"},{default:a(()=>[(d(!0),g(_e,null,ke(l(i).allBranches,k=>(d(),le(fe,{key:k,label:k,value:k},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"]),t(M,{type:"primary",size:"small",onClick:te,class:"create-branch-btn"},{default:a(()=>[t(F,null,{default:a(()=>[t(l($s))]),_:1}),c[23]||(c[23]=h(" 新建分支 "))]),_:1})])])):N("",!0),c[25]||(c[25]=e("div",{class:"footer-right"},null,-1))]),t(A,{modelValue:O.value,"onUpdate:modelValue":c[8]||(c[8]=k=>O.value=k),title:"Git用户设置",width:"30%","destroy-on-close":""},{footer:a(()=>[e("span",nn,[t(M,{type:"danger",onClick:ie},{default:a(()=>c[27]||(c[27]=[h(" 清除配置 ")])),_:1}),t(M,{onClick:c[7]||(c[7]=k=>O.value=!1)},{default:a(()=>c[28]||(c[28]=[h("取消")])),_:1}),t(M,{type:"primary",onClick:ne},{default:a(()=>c[29]||(c[29]=[h(" 保存 ")])),_:1})])]),default:a(()=>[t(r,null,{default:a(()=>[t(pe,{label:"用户名"},{default:a(()=>[t(we,{modelValue:H.value,"onUpdate:modelValue":c[5]||(c[5]=k=>H.value=k),placeholder:"请输入Git用户名"},null,8,["modelValue"])]),_:1}),t(pe,{label:"邮箱"},{default:a(()=>[t(we,{modelValue:J.value,"onUpdate:modelValue":c[6]||(c[6]=k=>J.value=k),placeholder:"请输入Git邮箱"},null,8,["modelValue"])]),_:1}),t(pe,null,{default:a(()=>[t(U,{type:"info",closable:!1,"show-icon":""},{default:a(()=>c[26]||(c[26]=[h(" 这些设置将影响全局Git配置,对所有Git仓库生效。 ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),cn=dt(rn,[["__scopeId","data-v-8ba54a98"]]),Ht=bs(cn);Ht.use(ks());Ht.mount("#app");
|