mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 17:47:46 +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) {
|
||||
return Promise.reject('Invalid endpoint.');
|
||||
}
|
||||
let requestUrl: string = `${this._endpointUrl}/ping`;
|
||||
let requestUrl: string ;
|
||||
if(endpoint.id) {
|
||||
requestUrl = `${this._endpointUrl}/${endpoint.id}/ping`;
|
||||
return this.http
|
||||
.post(requestUrl, {})
|
||||
.toPromise()
|
||||
.then(response=>response.status)
|
||||
.catch(error=>Promise.reject(error));
|
||||
} else {
|
||||
requestUrl = `${this._endpointUrl}/ping`;
|
||||
return this.http
|
||||
.post(requestUrl, endpoint)
|
||||
.toPromise()
|
||||
|
Loading…
Reference in New Issue
Block a user