Fix setting.json bug

Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
Yogi_Wang 2019-10-08 17:31:54 +08:00
parent ec559b0585
commit 4347d2e06d
8 changed files with 14 additions and 16 deletions

View File

@ -10,11 +10,10 @@ Open the `setting.json` file, you'll see the default content as shown below:
"headerBgColor": "#004a70",
"headerLogo": "",
"loginBgImg": "",
"appTitle": "",
"product": {
"title": "Harbor",
"company": "goharbor",
"name": "Harbor",
"introductions": {
"introduction": {
"zh-cn": "",
"es-es": "",
"en-us": ""

View File

@ -58,8 +58,8 @@ export class GlobalSearchComponent implements OnInit, OnDestroy {
ngOnInit(): void {
// custom skin
let customSkinObj = this.skinableConfig.getProject();
if (customSkinObj && customSkinObj.projectName) {
this.translate.get('GLOBAL_SEARCH.PLACEHOLDER', {'param': customSkinObj.projectName}).subscribe(res => {
if (customSkinObj && customSkinObj.name) {
this.translate.get('GLOBAL_SEARCH.PLACEHOLDER', {'param': customSkinObj.name}).subscribe(res => {
// Placeholder text
this.placeholderText = res;
});

View File

@ -2,9 +2,9 @@
<div class="branding">
<a href="javascript:void(0)" class="nav-link" (click)="homeAction()">
<!-- <clr-icon shape="vm-bug" *ngIf="!customStyle?.headerLogo"></clr-icon> -->
<img [src]="'images/harbor-logo.svg'" class="harbor-logo" />
<img [attr.src]="'static/images/'+customStyle?.headerLogo" *ngIf="customStyle?.headerLogo" class="headerLogo">
<span class="title">{{customProjectName?.projectName? customProjectName?.projectName:(appTitle | translate)}}</span>
<img [attr.src]="'images/'+customStyle?.headerLogo" *ngIf="customStyle?.headerLogo;else elseBlock" class="headerLogo">
<ng-template #elseBlock><img [src]="'images/harbor-logo.svg'" class="harbor-logo" /></ng-template>
<span class="title">{{customProjectName?.name? customProjectName?.name:(appTitle | translate)}}</span>
</a>
</div>
<div class="header-nav">

View File

@ -61,8 +61,8 @@ export class NavigatorComponent implements OnInit {
// custom skin
let customSkinObj = this.skinableConfig.getSkinConfig();
if (customSkinObj) {
if (customSkinObj.projects) {
this.customProjectName = customSkinObj.projects;
if (customSkinObj.product) {
this.customProjectName = customSkinObj.product;
}
this.customStyle = customSkinObj;
}

View File

@ -4,7 +4,7 @@
<img [src]="'images/harbor-logo.svg'" class="harbor-icon">
</div>
<div class="content">
<div>{{customName?.projectName? customName?.projectName : ('APP_TITLE.HARBOR' | translate)}}</div>
<div>{{customName?.name? customName?.name : ('APP_TITLE.HARBOR' | translate)}}</div>
<div>
<span class="p5 about-version">{{'ABOUT.VERSION' | translate}} {{version}}</span>
</div>

View File

@ -2,7 +2,7 @@
<global-message [isAppLevel]="true"></global-message>
<navigator></navigator>
<search-result></search-result>
<div class="login-wrapper" [ngStyle]="{'background-image': customLoginBgImg? 'url(static/images/' + customLoginBgImg + ')': ''}">
<div class="login-wrapper" [ngStyle]="{'background-image': customLoginBgImg? 'url(/images/' + customLoginBgImg + ')': ''}">
<form #signInForm="ngForm" class="login">
<label class="title"> {{customAppTitle? customAppTitle:(appTitle | translate)}}
</label>

View File

@ -23,7 +23,7 @@ export class SkinableConfig {
public getProject() {
if (this.customSkinData) {
return this.customSkinData.project;
return this.customSkinData.product;
} else {
return null;
}

View File

@ -3,9 +3,8 @@
"headerLogo": "",
"loginBgImg": "",
"appTitle": "",
"project": {
"companyName": "",
"projectName": "",
"product": {
"name": "",
"introduction": {
"zh-cn": "",
"es-es": "",