feat: 工作目录支持页面内目录浏览器
This commit is contained in:
@@ -21,6 +21,9 @@ export type VenvProbeResponse = components['schemas']['VenvProbeResponse']
|
||||
export type VenvProbeStatus = components['schemas']['VenvProbeStatus']
|
||||
export type VenvSource = components['schemas']['VenvSource']
|
||||
export type InterpreterKind = components['schemas']['InterpreterKind']
|
||||
export type DirectoryEntry = components['schemas']['DirectoryEntry']
|
||||
export type DirectoryListingResponse =
|
||||
components['schemas']['DirectoryListingResponse']
|
||||
|
||||
export interface TaskFilters {
|
||||
q?: string
|
||||
@@ -248,3 +251,17 @@ export function probePythonVenv(
|
||||
signal,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出目录下的子文件夹;不传 path 时返回盘符列表。
|
||||
* 用于页面内的目录浏览器,选中后把绝对路径回填到表单。
|
||||
*/
|
||||
export function listDirectories(
|
||||
path?: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<DirectoryListingResponse> {
|
||||
return requestJson<DirectoryListingResponse>(
|
||||
withQuery('/api/v1/system/directories', { path }),
|
||||
{ signal },
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user