diff --git a/src/portal/lib/src/config/registry-config.component.ts b/src/portal/lib/src/config/registry-config.component.ts index fcf6ed468..f7f8acd1b 100644 --- a/src/portal/lib/src/config/registry-config.component.ts +++ b/src/portal/lib/src/config/registry-config.component.ts @@ -13,7 +13,7 @@ import { clone } from '../utils'; import { ErrorHandler } from '../error-handler/index'; -import { SystemSettingsComponent, VulnerabilityConfigComponent } from './index'; +import { SystemSettingsComponent, VulnerabilityConfigComponent} from './index'; import { Configuration } from './config'; @Component({ diff --git a/src/portal/lib/src/config/system/system-settings.component.ts b/src/portal/lib/src/config/system/system-settings.component.ts index 29524fa09..4ec95e194 100644 --- a/src/portal/lib/src/config/system/system-settings.component.ts +++ b/src/portal/lib/src/config/system/system-settings.component.ts @@ -1,6 +1,5 @@ import { Component, Input, Output, EventEmitter, ViewChild, Inject } from '@angular/core'; import { NgForm } from '@angular/forms'; - import { Configuration } from '../config'; import { SERVICE_CONFIG, IServiceConfig } from '../../service.config'; diff --git a/src/portal/lib/tsconfig.lib.json b/src/portal/lib/tsconfig.lib.json index edaab721f..07f7260fc 100644 --- a/src/portal/lib/tsconfig.lib.json +++ b/src/portal/lib/tsconfig.lib.json @@ -11,7 +11,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, - "types": [], + "typeRoots": ["node_modules/@types"], "lib": [ "dom", "es2015" diff --git a/src/portal/package.json b/src/portal/package.json index bda59bcd5..7f2a88ea5 100644 --- a/src/portal/package.json +++ b/src/portal/package.json @@ -4,7 +4,7 @@ "description": "Harbor UI with Clarity", "angular-cli": {}, "scripts": { - "start": "ng serve --aot --ssl true --ssl-key ssl/server.key --ssl-cert ssl/server.crt --host 0.0.0.0 --proxy-config proxy.config.json", + "start": "ng serve --ssl true --ssl-key ssl/server.key --ssl-cert ssl/server.crt --host 0.0.0.0 --proxy-config proxy.config.json", "lint": "tslint \"src/**/*.ts\"", "lint:lib": "tslint \"lib/**/*.ts\" -e \"lib/dist/**/*\" ", "test": "ng test harbor-portal", diff --git a/src/portal/src/app/app.module.ts b/src/portal/src/app/app.module.ts index 7d7b0023b..1601dbb46 100644 --- a/src/portal/src/app/app.module.ts +++ b/src/portal/src/app/app.module.ts @@ -20,12 +20,21 @@ import { HarborRoutingModule } from './harbor-routing.module'; import { SharedModule } from './shared/shared.module'; import { AccountModule } from './account/account.module'; import { ConfigurationModule } from './config/config.module'; +import { registerLocaleData } from '@angular/common'; import { TranslateService } from "@ngx-translate/core"; import { AppConfigService } from './app-config.service'; -import {SkinableConfig} from "./skinable-config.service"; +import { SkinableConfig } from "./skinable-config.service"; import { ProjectConfigComponent } from './project/project-config/project-config.component'; +import zh from '@angular/common/locales/zh-Hans'; +import es from '@angular/common/locales/es'; +import localeFr from '@angular/common/locales/fr'; +registerLocaleData(zh, 'zh-cn'); +registerLocaleData(es, 'es-es'); +registerLocaleData(localeFr, 'fr-fr'); + + export function initConfig(configService: AppConfigService, skinableService: SkinableConfig) { return () => { skinableService.getCustomFile(); diff --git a/src/portal/src/app/config/config.component.html b/src/portal/src/app/config/config.component.html index 6bb025986..9d31b3738 100644 --- a/src/portal/src/app/config/config.component.html +++ b/src/portal/src/app/config/config.component.html @@ -18,6 +18,9 @@