feat: 添加下载进度条

This commit is contained in:
2025-08-04 19:59:59 +08:00
parent e0ac21d141
commit aff9da2a60
20 changed files with 1073 additions and 361 deletions

View File

@@ -3331,9 +3331,9 @@ export class JtagClient {
* @param address (optional) JTAG 设备地址
* @param port (optional) JTAG 设备端口
* @param bitstreamId (optional) 比特流ID
* @return 下载结果
* @return 进度跟踪TaskID
*/
downloadBitstream(address: string | undefined, port: number | undefined, bitstreamId: number | undefined, cancelToken?: CancelToken): Promise<boolean> {
downloadBitstream(address: string | undefined, port: number | undefined, bitstreamId: number | undefined, cancelToken?: CancelToken): Promise<string> {
let url_ = this.baseUrl + "/api/Jtag/DownloadBitstream?";
if (address === null)
throw new Error("The parameter 'address' cannot be null.");
@@ -3369,7 +3369,7 @@ export class JtagClient {
});
}
protected processDownloadBitstream(response: AxiosResponse): Promise<boolean> {
protected processDownloadBitstream(response: AxiosResponse): Promise<string> {
const status = response.status;
let _headers: any = {};
if (response.headers && typeof response.headers === "object") {
@@ -3385,7 +3385,7 @@ export class JtagClient {
let resultData200 = _responseText;
result200 = resultData200 !== undefined ? resultData200 : <any>null;
return Promise.resolve<boolean>(result200);
return Promise.resolve<string>(result200);
} else if (status === 400) {
const _responseText = response.data;
@@ -3413,7 +3413,7 @@ export class JtagClient {
const _responseText = response.data;
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
}
return Promise.resolve<boolean>(null as any);
return Promise.resolve<string>(null as any);
}
/**