mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-25 01:58:35 +01:00
fix #2775 about create-rule modal connect test issue
This commit is contained in:
parent
a9a79736b4
commit
8236e0358e
@ -185,14 +185,16 @@ export class EndpointDefaultService extends EndpointService {
|
|||||||
if(!endpoint) {
|
if(!endpoint) {
|
||||||
return Promise.reject('Invalid endpoint.');
|
return Promise.reject('Invalid endpoint.');
|
||||||
}
|
}
|
||||||
let requestUrl: string = `${this._endpointUrl}/ping`;
|
let requestUrl: string ;
|
||||||
if(endpoint.id) {
|
if(endpoint.id) {
|
||||||
|
requestUrl = `${this._endpointUrl}/${endpoint.id}/ping`;
|
||||||
return this.http
|
return this.http
|
||||||
.post(requestUrl, {})
|
.post(requestUrl, {})
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(response=>response.status)
|
.then(response=>response.status)
|
||||||
.catch(error=>Promise.reject(error));
|
.catch(error=>Promise.reject(error));
|
||||||
} else {
|
} else {
|
||||||
|
requestUrl = `${this._endpointUrl}/ping`;
|
||||||
return this.http
|
return this.http
|
||||||
.post(requestUrl, endpoint)
|
.post(requestUrl, endpoint)
|
||||||
.toPromise()
|
.toPromise()
|
||||||
|
Loading…
Reference in New Issue
Block a user