mirror of
https://github.com/goharbor/harbor
synced 2024-09-21 15:30:50 +00:00
Fix: helmchart api change caused problems
Adapter ui to new backend API Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
parent
399c9c44d8
commit
2a583fccfe
|
@ -113,26 +113,6 @@ export class HelmChartDefaultService extends HelmChartService {
|
||||||
return res.json() || [];
|
return res.json() || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private extractHelmItems(res: Response) {
|
|
||||||
if (res.text() === "") {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
let charts = res.json();
|
|
||||||
if (charts) {
|
|
||||||
return charts.map( chart => {
|
|
||||||
return {
|
|
||||||
name: chart.Name,
|
|
||||||
total_versions: chart.total_versions,
|
|
||||||
latest_version: chart.latest_version,
|
|
||||||
created: chart.Created,
|
|
||||||
icon: chart.Icon,
|
|
||||||
home: chart.Home};
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private handleErrorObservable(error: HttpErrorResponse) {
|
private handleErrorObservable(error: HttpErrorResponse) {
|
||||||
return observableThrowError(error.message || error);
|
return observableThrowError(error.message || error);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +127,7 @@ export class HelmChartDefaultService extends HelmChartService {
|
||||||
return this.http
|
return this.http
|
||||||
.get(`${this.config.helmChartEndpoint}/${projectName}/charts`, HTTP_GET_OPTIONS)
|
.get(`${this.config.helmChartEndpoint}/${projectName}/charts`, HTTP_GET_OPTIONS)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(response => this.extractHelmItems(response),
|
map(response => this.extractData(response),
|
||||||
catchError(error => this.handleErrorObservable(error))
|
catchError(error => this.handleErrorObservable(error))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,12 +306,13 @@ export interface HelmChartItem {
|
||||||
total_versions: number;
|
total_versions: number;
|
||||||
latest_version: string;
|
latest_version: string;
|
||||||
created: string;
|
created: string;
|
||||||
|
updated: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
home: string;
|
home: string;
|
||||||
|
deprecated?: boolean;
|
||||||
status?: string;
|
status?: string;
|
||||||
pulls?: number;
|
pulls?: number;
|
||||||
maintainer?: string;
|
maintainer?: string;
|
||||||
deprecated?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HelmChartVersion {
|
export interface HelmChartVersion {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user