mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-26 02:28:06 +01:00
Merge pull request #6628 from zhoumeina/add_swagger_title
add harbor swagger title for api explorer
This commit is contained in:
commit
1456d1d326
@ -2,19 +2,37 @@ import { AfterViewInit, Component, ElementRef, OnInit } from '@angular/core';
|
|||||||
import { Http } from '@angular/http';
|
import { Http } from '@angular/http';
|
||||||
import { throwError as observableThrowError, Observable } from 'rxjs';
|
import { throwError as observableThrowError, Observable } from 'rxjs';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
|
||||||
const SwaggerUI = require('swagger-ui');
|
const SwaggerUI = require('swagger-ui');
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dev-center',
|
selector: 'dev-center',
|
||||||
templateUrl: 'dev-center.component.html',
|
templateUrl: 'dev-center.component.html',
|
||||||
|
viewProviders: [Title],
|
||||||
styleUrls: ['dev-center.component.scss']
|
styleUrls: ['dev-center.component.scss']
|
||||||
})
|
})
|
||||||
export class DevCenterComponent implements AfterViewInit {
|
export class DevCenterComponent implements AfterViewInit, OnInit {
|
||||||
private ui: any;
|
private ui: any;
|
||||||
private host: any;
|
private host: any;
|
||||||
private json: any;
|
private json: any;
|
||||||
constructor(private el: ElementRef, private http: Http) {
|
constructor(
|
||||||
|
private el: ElementRef,
|
||||||
|
private http: Http,
|
||||||
|
private translate: TranslateService,
|
||||||
|
private titleService: Title) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.setTitle("APP_TITLE.HARBOR_SWAGGER");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public setTitle( key: string) {
|
||||||
|
this.translate.get(key).subscribe((res: string) => {
|
||||||
|
this.titleService.setTitle(res);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"HARBOR": "Harbor",
|
"HARBOR": "Harbor",
|
||||||
"VIC": "vSphere Integrated Containers",
|
"VIC": "vSphere Integrated Containers",
|
||||||
"MGMT": "Management",
|
"MGMT": "Management",
|
||||||
"REG": "Registry"
|
"REG": "Registry",
|
||||||
|
"HARBOR_SWAGGER": "Harbor Swagger"
|
||||||
},
|
},
|
||||||
"SIGN_IN": {
|
"SIGN_IN": {
|
||||||
"REMEMBER": "Remember me",
|
"REMEMBER": "Remember me",
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"HARBOR": "Harbor",
|
"HARBOR": "Harbor",
|
||||||
"VIC": "Contenedores Integrados vSphere",
|
"VIC": "Contenedores Integrados vSphere",
|
||||||
"MGMT": "Administración",
|
"MGMT": "Administración",
|
||||||
"REG": "Registro"
|
"REG": "Registro",
|
||||||
|
"HARBOR_SWAGGER": "Harbor Swagger"
|
||||||
},
|
},
|
||||||
"SIGN_IN": {
|
"SIGN_IN": {
|
||||||
"REMEMBER": "Recordarme",
|
"REMEMBER": "Recordarme",
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"HARBOR": "Harbor",
|
"HARBOR": "Harbor",
|
||||||
"VIC": "vSphere Integrated Containers",
|
"VIC": "vSphere Integrated Containers",
|
||||||
"MGMT": "Management",
|
"MGMT": "Management",
|
||||||
"REG": "Registre"
|
"REG": "Registre",
|
||||||
|
"HARBOR_SWAGGER": "Harbor Swagger"
|
||||||
},
|
},
|
||||||
"SIGN_IN": {
|
"SIGN_IN": {
|
||||||
"REMEMBER": "Se souvenir de moi",
|
"REMEMBER": "Se souvenir de moi",
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"HARBOR": "Harbor",
|
"HARBOR": "Harbor",
|
||||||
"VIC": "vSphere Integrated Containers",
|
"VIC": "vSphere Integrated Containers",
|
||||||
"MGMT": "Gerência",
|
"MGMT": "Gerência",
|
||||||
"REG": "Registro"
|
"REG": "Registro",
|
||||||
|
"HARBOR_SWAGGER": "Harbor Swagger"
|
||||||
},
|
},
|
||||||
"SIGN_IN": {
|
"SIGN_IN": {
|
||||||
"REMEMBER": "Lembrar-se de mim",
|
"REMEMBER": "Lembrar-se de mim",
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"HARBOR": "Harbor",
|
"HARBOR": "Harbor",
|
||||||
"VIC": "vSphere Integrated Containers",
|
"VIC": "vSphere Integrated Containers",
|
||||||
"MGMT": "Management",
|
"MGMT": "Management",
|
||||||
"REG": "Registry"
|
"REG": "Registry",
|
||||||
|
"HARBOR_SWAGGER": "Harbor Swagger"
|
||||||
},
|
},
|
||||||
"SIGN_IN": {
|
"SIGN_IN": {
|
||||||
"REMEMBER": "记住我",
|
"REMEMBER": "记住我",
|
||||||
|
Loading…
Reference in New Issue
Block a user