feat: 新增冲突处理、提交搜索、批量操作功能\n\n冲突处理:\n- 检测合并状态并显示冲突提示栏\n- 冲突文件列表展示和内容编辑器\n- 支持保存冲突文件、标记已解决、中止合并、完成合并\n\n提交搜索:\n- 支持按提交信息关键字和作者搜索\n- 搜索结果与完整历史切换显示\n\n批量操作:\n- 侧边栏新增批量操作入口\n- 展示所有项目概览(分支/变更/未推送状态)\n- 支持批量 Pull/Push 并显示执行结果"
This commit is contained in:
@@ -22,6 +22,15 @@ import * as config$0 from "../../config/models.js";
|
||||
// @ts-ignore: Unused imports
|
||||
import * as $models from "./models.js";
|
||||
|
||||
/**
|
||||
* AbortMerge 中止合并
|
||||
* @param {string} path
|
||||
* @returns {$CancellablePromise<void>}
|
||||
*/
|
||||
export function AbortMerge(path) {
|
||||
return $Call.ByID(3035150106, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* AddPlatform 添加新平台
|
||||
* @param {string} name
|
||||
@@ -55,6 +64,28 @@ export function AddUser(platform, username, token) {
|
||||
return $Call.ByID(2264426704, platform, username, token);
|
||||
}
|
||||
|
||||
/**
|
||||
* BatchPull 批量拉取指定项目
|
||||
* @param {string[]} paths
|
||||
* @returns {$CancellablePromise<$models.BatchPullResult[]>}
|
||||
*/
|
||||
export function BatchPull(paths) {
|
||||
return $Call.ByID(758996647, paths).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType1($result);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* BatchPush 批量推送指定项目
|
||||
* @param {string[]} paths
|
||||
* @returns {$CancellablePromise<$models.BatchPullResult[]>}
|
||||
*/
|
||||
export function BatchPush(paths) {
|
||||
return $Call.ByID(794082076, paths).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType1($result);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* CheckoutRemoteBranch 检出远程分支到本地
|
||||
* @param {string} path
|
||||
@@ -159,13 +190,23 @@ export function FetchProject(path) {
|
||||
return $Call.ByID(3541106829, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetAllProjectOverview 获取所有项目的概览状态
|
||||
* @returns {$CancellablePromise<$models.ProjectOverview[]>}
|
||||
*/
|
||||
export function GetAllProjectOverview() {
|
||||
return $Call.ByID(2453130151).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType3($result);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* GetAppSettings 获取应用设置
|
||||
* @returns {$CancellablePromise<config$0.Settings | null>}
|
||||
*/
|
||||
export function GetAppSettings() {
|
||||
return $Call.ByID(428589026).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType1($result);
|
||||
return $$createType5($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -176,7 +217,7 @@ export function GetAppSettings() {
|
||||
*/
|
||||
export function GetBranches(path) {
|
||||
return $Call.ByID(1686190192, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType3($result);
|
||||
return $$createType7($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -209,7 +250,7 @@ export function GetCommitFileDiff(path, hash, filePath) {
|
||||
*/
|
||||
export function GetCommitFiles(path, hash) {
|
||||
return $Call.ByID(2420707876, path, hash).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType5($result);
|
||||
return $$createType9($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -221,7 +262,28 @@ export function GetCommitFiles(path, hash) {
|
||||
*/
|
||||
export function GetCommitLog(path, count) {
|
||||
return $Call.ByID(1281870789, path, count).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType7($result);
|
||||
return $$createType11($result);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* GetConflictFileContent 获取冲突文件内容(包含冲突标记)
|
||||
* @param {string} projectPath
|
||||
* @param {string} filePath
|
||||
* @returns {$CancellablePromise<string>}
|
||||
*/
|
||||
export function GetConflictFileContent(projectPath, filePath) {
|
||||
return $Call.ByID(298498517, projectPath, filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetConflictFiles 获取冲突文件列表
|
||||
* @param {string} path
|
||||
* @returns {$CancellablePromise<$models.ConflictFileInfo[]>}
|
||||
*/
|
||||
export function GetConflictFiles(path) {
|
||||
return $Call.ByID(2446806137, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType13($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -261,7 +323,7 @@ export function GetFileDiffStaged(projectPath, filePath) {
|
||||
*/
|
||||
export function GetGitGlobalConfig() {
|
||||
return $Call.ByID(154811497).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType9($result);
|
||||
return $$createType15($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -272,7 +334,7 @@ export function GetGitGlobalConfig() {
|
||||
*/
|
||||
export function GetPlatformInfo(name) {
|
||||
return $Call.ByID(2668095547, name).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType11($result);
|
||||
return $$createType17($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -283,7 +345,7 @@ export function GetPlatformInfo(name) {
|
||||
*/
|
||||
export function GetProjectChangedFiles(path) {
|
||||
return $Call.ByID(2302591462, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType13($result);
|
||||
return $$createType19($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -294,7 +356,7 @@ export function GetProjectChangedFiles(path) {
|
||||
*/
|
||||
export function GetProjectStatus(path) {
|
||||
return $Call.ByID(3451089027, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType15($result);
|
||||
return $$createType21($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -304,7 +366,7 @@ export function GetProjectStatus(path) {
|
||||
*/
|
||||
export function GetProjectTree() {
|
||||
return $Call.ByID(651189689).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType17($result);
|
||||
return $$createType23($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -315,7 +377,7 @@ export function GetProjectTree() {
|
||||
*/
|
||||
export function GetRemoteBranches(path) {
|
||||
return $Call.ByID(994796370, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType3($result);
|
||||
return $$createType7($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -326,7 +388,7 @@ export function GetRemoteBranches(path) {
|
||||
*/
|
||||
export function GetStashList(path) {
|
||||
return $Call.ByID(1948257945, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType19($result);
|
||||
return $$createType25($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -337,7 +399,7 @@ export function GetStashList(path) {
|
||||
*/
|
||||
export function GetTags(path) {
|
||||
return $Call.ByID(3979169621, path).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType21($result);
|
||||
return $$createType27($result);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -349,10 +411,19 @@ export function GetTags(path) {
|
||||
*/
|
||||
export function GetUserInfo(platform, username) {
|
||||
return $Call.ByID(2674655707, platform, username).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType23($result);
|
||||
return $$createType29($result);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* IsMerging 检查是否处于合并状态
|
||||
* @param {string} path
|
||||
* @returns {$CancellablePromise<boolean>}
|
||||
*/
|
||||
export function IsMerging(path) {
|
||||
return $Call.ByID(693809703, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* MergeBranch 合并指定分支到当前分支
|
||||
* @param {string} path
|
||||
@@ -433,6 +504,16 @@ export function ResetProject(path, hash, mode) {
|
||||
return $Call.ByID(2061148684, path, hash, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* ResolveConflictFile 将冲突文件标记为已解决
|
||||
* @param {string} path
|
||||
* @param {string[]} files
|
||||
* @returns {$CancellablePromise<void>}
|
||||
*/
|
||||
export function ResolveConflictFile(path, files) {
|
||||
return $Call.ByID(1893119072, path, files);
|
||||
}
|
||||
|
||||
/**
|
||||
* RevertCommit 撤回指定提交(生成一个反向提交)
|
||||
* @param {string} path
|
||||
@@ -443,6 +524,31 @@ export function RevertCommit(path, hash) {
|
||||
return $Call.ByID(1334788539, path, hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* SaveConflictFile 保存冲突文件内容(手动解决冲突后保存)
|
||||
* @param {string} projectPath
|
||||
* @param {string} filePath
|
||||
* @param {string} content
|
||||
* @returns {$CancellablePromise<void>}
|
||||
*/
|
||||
export function SaveConflictFile(projectPath, filePath, content) {
|
||||
return $Call.ByID(3340289161, projectPath, filePath, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* SearchCommitLog 搜索提交历史
|
||||
* @param {string} path
|
||||
* @param {string} keyword
|
||||
* @param {string} author
|
||||
* @param {number} maxCount
|
||||
* @returns {$CancellablePromise<$models.CommitLog[]>}
|
||||
*/
|
||||
export function SearchCommitLog(path, keyword, author, maxCount) {
|
||||
return $Call.ByID(2874450917, path, keyword, author, maxCount).then(/** @type {($result: any) => any} */(($result) => {
|
||||
return $$createType11($result);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* SelectDirectory 打开系统文件夹选择器,返回选中的路径
|
||||
* @returns {$CancellablePromise<string>}
|
||||
@@ -589,27 +695,33 @@ export function UpdateUser(platform, oldUsername, newUsername, token) {
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = config$0.Settings.createFrom;
|
||||
const $$createType1 = $Create.Nullable($$createType0);
|
||||
const $$createType2 = $models.BranchInfo.createFrom;
|
||||
const $$createType0 = $models.BatchPullResult.createFrom;
|
||||
const $$createType1 = $Create.Array($$createType0);
|
||||
const $$createType2 = $models.ProjectOverview.createFrom;
|
||||
const $$createType3 = $Create.Array($$createType2);
|
||||
const $$createType4 = $models.CommitFileInfo.createFrom;
|
||||
const $$createType5 = $Create.Array($$createType4);
|
||||
const $$createType6 = $models.CommitLog.createFrom;
|
||||
const $$createType4 = config$0.Settings.createFrom;
|
||||
const $$createType5 = $Create.Nullable($$createType4);
|
||||
const $$createType6 = $models.BranchInfo.createFrom;
|
||||
const $$createType7 = $Create.Array($$createType6);
|
||||
const $$createType8 = $models.GitConfig.createFrom;
|
||||
const $$createType9 = $Create.Nullable($$createType8);
|
||||
const $$createType10 = $models.PlatformInfo.createFrom;
|
||||
const $$createType11 = $Create.Nullable($$createType10);
|
||||
const $$createType12 = $models.FileInfo.createFrom;
|
||||
const $$createType8 = $models.CommitFileInfo.createFrom;
|
||||
const $$createType9 = $Create.Array($$createType8);
|
||||
const $$createType10 = $models.CommitLog.createFrom;
|
||||
const $$createType11 = $Create.Array($$createType10);
|
||||
const $$createType12 = $models.ConflictFileInfo.createFrom;
|
||||
const $$createType13 = $Create.Array($$createType12);
|
||||
const $$createType14 = $models.ProjectStatus.createFrom;
|
||||
const $$createType14 = $models.GitConfig.createFrom;
|
||||
const $$createType15 = $Create.Nullable($$createType14);
|
||||
const $$createType16 = $models.TreeNode.createFrom;
|
||||
const $$createType17 = $Create.Array($$createType16);
|
||||
const $$createType18 = $models.StashInfo.createFrom;
|
||||
const $$createType16 = $models.PlatformInfo.createFrom;
|
||||
const $$createType17 = $Create.Nullable($$createType16);
|
||||
const $$createType18 = $models.FileInfo.createFrom;
|
||||
const $$createType19 = $Create.Array($$createType18);
|
||||
const $$createType20 = $models.TagInfo.createFrom;
|
||||
const $$createType21 = $Create.Array($$createType20);
|
||||
const $$createType22 = $models.UserInfo.createFrom;
|
||||
const $$createType23 = $Create.Nullable($$createType22);
|
||||
const $$createType20 = $models.ProjectStatus.createFrom;
|
||||
const $$createType21 = $Create.Nullable($$createType20);
|
||||
const $$createType22 = $models.TreeNode.createFrom;
|
||||
const $$createType23 = $Create.Array($$createType22);
|
||||
const $$createType24 = $models.StashInfo.createFrom;
|
||||
const $$createType25 = $Create.Array($$createType24);
|
||||
const $$createType26 = $models.TagInfo.createFrom;
|
||||
const $$createType27 = $Create.Array($$createType26);
|
||||
const $$createType28 = $models.UserInfo.createFrom;
|
||||
const $$createType29 = $Create.Nullable($$createType28);
|
||||
|
||||
@@ -8,12 +8,15 @@ export {
|
||||
};
|
||||
|
||||
export {
|
||||
BatchPullResult,
|
||||
BranchInfo,
|
||||
CommitFileInfo,
|
||||
CommitLog,
|
||||
ConflictFileInfo,
|
||||
FileInfo,
|
||||
GitConfig,
|
||||
PlatformInfo,
|
||||
ProjectOverview,
|
||||
ProjectStatus,
|
||||
StashInfo,
|
||||
TagInfo,
|
||||
|
||||
@@ -6,6 +6,58 @@
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* BatchPullResult 批量 pull 结果
|
||||
*/
|
||||
export class BatchPullResult {
|
||||
/**
|
||||
* Creates a new BatchPullResult instance.
|
||||
* @param {Partial<BatchPullResult>} [$$source = {}] - The source object to create the BatchPullResult.
|
||||
*/
|
||||
constructor($$source = {}) {
|
||||
if (!("name" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("path" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["path"] = "";
|
||||
}
|
||||
if (!("success" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {boolean}
|
||||
*/
|
||||
this["success"] = false;
|
||||
}
|
||||
if (!("message" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["message"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new BatchPullResult instance from a string or object.
|
||||
* @param {any} [$$source = {}]
|
||||
* @returns {BatchPullResult}
|
||||
*/
|
||||
static createFrom($$source = {}) {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new BatchPullResult(/** @type {Partial<BatchPullResult>} */($$parsedSource));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* BranchInfo 分支信息
|
||||
*/
|
||||
@@ -155,6 +207,37 @@ export class CommitLog {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ConflictFileInfo 冲突文件信息
|
||||
*/
|
||||
export class ConflictFileInfo {
|
||||
/**
|
||||
* Creates a new ConflictFileInfo instance.
|
||||
* @param {Partial<ConflictFileInfo>} [$$source = {}] - The source object to create the ConflictFileInfo.
|
||||
*/
|
||||
constructor($$source = {}) {
|
||||
if (!("filePath" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["filePath"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ConflictFileInfo instance from a string or object.
|
||||
* @param {any} [$$source = {}]
|
||||
* @returns {ConflictFileInfo}
|
||||
*/
|
||||
static createFrom($$source = {}) {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new ConflictFileInfo(/** @type {Partial<ConflictFileInfo>} */($$parsedSource));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* FileInfo 文件信息
|
||||
*/
|
||||
@@ -283,6 +366,79 @@ export class PlatformInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ProjectOverview 项目概览信息(轻量级)
|
||||
*/
|
||||
export class ProjectOverview {
|
||||
/**
|
||||
* Creates a new ProjectOverview instance.
|
||||
* @param {Partial<ProjectOverview>} [$$source = {}] - The source object to create the ProjectOverview.
|
||||
*/
|
||||
constructor($$source = {}) {
|
||||
if (!("key" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["key"] = "";
|
||||
}
|
||||
if (!("name" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("path" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["path"] = "";
|
||||
}
|
||||
if (!("branch" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["branch"] = "";
|
||||
}
|
||||
if (!("hasChanges" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {boolean}
|
||||
*/
|
||||
this["hasChanges"] = false;
|
||||
}
|
||||
if (!("unpushed" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["unpushed"] = 0;
|
||||
}
|
||||
if (/** @type {any} */(false)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string | undefined}
|
||||
*/
|
||||
this["error"] = undefined;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ProjectOverview instance from a string or object.
|
||||
* @param {any} [$$source = {}]
|
||||
* @returns {ProjectOverview}
|
||||
*/
|
||||
static createFrom($$source = {}) {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new ProjectOverview(/** @type {Partial<ProjectOverview>} */($$parsedSource));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ProjectStatus 项目状态信息
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user