功能: 右键新增属性弹窗与获取特定版本(FE-019),服务端新增 /api/items/info

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
fenghp
2026-06-11 12:58:11 +08:00
co-authored by Cursor
parent 0c2324b1db
commit 23062e8333
12 changed files with 606 additions and 7 deletions
+8
View File
@@ -13,6 +13,7 @@ import type {
FolderDiffItem,
GetLatestResult,
HistoryEntry,
ItemInfo,
MappingInfo,
OperationLogEntry,
PendingChange,
@@ -173,6 +174,13 @@ export function checkin(body: { paths?: string[]; comment: string }) {
return apiClient.post<{ checkin: CheckinResult }>("/api/checkin", { body })
}
/**
* 读取服务端对象(文件或目录)的属性信息,供属性弹窗展示。
*/
export function getItemInfo(params: { serverPath: string }) {
return apiClient.get<{ item: ItemInfo }>("/api/items/info", { query: params })
}
/**
* 读取服务器内容(latest 或指定 changeset),或读取本地映射文件内容。
*/
+1
View File
@@ -15,6 +15,7 @@ export type {
FolderDiffItem,
GetLatestResult,
HistoryEntry,
ItemInfo,
MappingConfig,
MappingInfo,
OperationLogEntry,
+14
View File
@@ -159,6 +159,20 @@ export interface HistoryEntry {
comment: string
}
// 服务端对象属性信息,对应 core TfsItemInfo(属性弹窗用)。
export interface ItemInfo {
serverPath: string
folder: boolean
changeset: number
checkinDate: number | null
author: string
comment: string
/** 文件大小(字节),目录为 null。 */
size: number | null
/** 文件编码名称,目录为 null。 */
encoding: string | null
}
// 文件内容,对应 core TfsFileContent,binary / tooLarge 时 content 为空串。
export interface FileContent {
serverPath: string