feat: frontend add boundary scan
This commit is contained in:
@@ -659,7 +659,7 @@ export class JtagClient {
|
||||
* @param port (optional) [TODO:parameter]
|
||||
* @return [TODO:return]
|
||||
*/
|
||||
boundaryScanLogicalPorts(address: string | undefined, port: number | undefined): Promise<boolean> {
|
||||
boundaryScanLogicalPorts(address: string | undefined, port: number | undefined): Promise<{ [key: string]: boolean; }> {
|
||||
let url_ = this.baseUrl + "/api/Jtag/BoundaryScanLogicalPorts?";
|
||||
if (address === null)
|
||||
throw new Error("The parameter 'address' cannot be null.");
|
||||
@@ -683,15 +683,23 @@ export class JtagClient {
|
||||
});
|
||||
}
|
||||
|
||||
protected processBoundaryScanLogicalPorts(response: Response): Promise<boolean> {
|
||||
protected processBoundaryScanLogicalPorts(response: Response): Promise<{ [key: string]: boolean; }> {
|
||||
const status = response.status;
|
||||
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
||||
if (status === 200) {
|
||||
return response.text().then((_responseText) => {
|
||||
let result200: any = null;
|
||||
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
||||
result200 = resultData200 !== undefined ? resultData200 : <any>null;
|
||||
|
||||
if (resultData200) {
|
||||
result200 = {} as any;
|
||||
for (let key in resultData200) {
|
||||
if (resultData200.hasOwnProperty(key))
|
||||
(<any>result200)![key] = resultData200[key] !== undefined ? resultData200[key] : <any>null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
result200 = <any>null;
|
||||
}
|
||||
return result200;
|
||||
});
|
||||
} else if (status === 400) {
|
||||
@@ -714,7 +722,7 @@ export class JtagClient {
|
||||
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
||||
});
|
||||
}
|
||||
return Promise.resolve<boolean>(null as any);
|
||||
return Promise.resolve<{ [key: string]: boolean; }>(null as any);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1818,4 +1826,4 @@ function throwException(message: string, status: number, response: string, heade
|
||||
throw result;
|
||||
else
|
||||
throw new ApiException(message, status, response, headers, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user