Skip to content

Commit

Permalink
Merge pull request #3926 from pengpengshui/cherry_skinnable
Browse files Browse the repository at this point in the history
Modify skinnable json file and modify image path about #3909 #3879
  • Loading branch information
pengpengshui committed Jan 4, 2018
2 parents f37e840 + 42aa1bd commit 76f8882
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/ui_ng/src/app/account/sign-in/sign-in.component.css
Expand Up @@ -47,4 +47,5 @@
font-size: 14px !important;
position: relative;
top: -9px;
}
}
.bg{position: absolute;top: 60px; right: 0px;width: 100%; height: 100%; background-size: cover;}
3 changes: 2 additions & 1 deletion src/ui_ng/src/app/account/sign-in/sign-in.component.html
@@ -1,4 +1,5 @@
<div class="login-wrapper login-wrapper-override" [ngStyle]="{'background-image': 'url(' + customLoginBgImg + ')'}">
<div class="login-wrapper login-wrapper-override">
<div class="bg" *ngIf="customLoginBgImg" [ngStyle]="{'background-image': 'url(static/images/' + customLoginBgImg + ')'}"></div>
<form #signInForm="ngForm" class="login">
<label class="title"> {{customAppTitle? customAppTitle:(appTitle | translate)}}<span class="trademark tm-font">&#8482;</span>
</label>
Expand Down
Expand Up @@ -57,7 +57,7 @@ export class GlobalSearchComponent implements OnInit, OnDestroy {

ngOnInit(): void {
//custom skin
let customSkinObj = this.skinableConfig.getProjects();
let customSkinObj = this.skinableConfig.getProject();
if (customSkinObj && customSkinObj.projectName) {
this.translate.get('GLOBAL_SEARCH.PLACEHOLDER', {'param': customSkinObj.projectName}).subscribe(res => {
//Placeholder text
Expand Down
2 changes: 1 addition & 1 deletion src/ui_ng/src/app/base/navigator/navigator.component.html
Expand Up @@ -2,7 +2,7 @@
<div class="branding">
<a href="javascript:void(0)" class="nav-link" (click)="homeAction()">
<clr-icon shape="vm-bug" *ngIf="!customStyle?.headerLogo"></clr-icon>
<img [attr.src]="customStyle?.headerLogo" *ngIf="customStyle?.headerLogo" style="width: 36px;height: 36px; object-fit: fill;">
<img [attr.src]="'static/images/'+customStyle?.headerLogo" *ngIf="customStyle?.headerLogo" style="width: 36px;height: 36px; object-fit: fill;">
<span class="title">{{customProjectName?.projectName? customProjectName?.projectName:(appTitle | translate)}}</span>
</a>
</div>
Expand Down
Expand Up @@ -35,7 +35,7 @@ export class AboutDialogComponent implements OnInit{

ngOnInit(): void {
// custom skin
let customSkinObj = this.skinableConfig.getProjects();
let customSkinObj = this.skinableConfig.getProject();
if (customSkinObj) {
let selectedLang = this.translate.currentLang;
this.customName = customSkinObj;
Expand Down
6 changes: 3 additions & 3 deletions src/ui_ng/src/app/skinable-config.service.ts
Expand Up @@ -12,7 +12,7 @@ export class SkinableConfig {
constructor(private http: Http) {}

public getCustomFile(): Promise<any> {
return this.http.get('../setting.json')
return this.http.get('../static/setting.json')
.toPromise()
.then(response => { this.customSkinData = response.json(); return this.customSkinData; })
.catch(error => {
Expand All @@ -24,9 +24,9 @@ export class SkinableConfig {
return this.customSkinData;
}

public getProjects() {
public getProject() {
if (this.customSkinData) {
return this.customSkinData.projects;
return this.customSkinData.project;
}else {
return null;
}
Expand Down
10 changes: 5 additions & 5 deletions src/ui_ng/src/setting.json
@@ -1,11 +1,11 @@
{
"headerBgColor": "#004a70",
"headerBgColor": "",
"headerLogo": "",
"loginBgImg": "",
"appTitle": "VMware Harbor",
"projects": {
"companyName": "vmware",
"projectName": "Harbor",
"appTitle": "",
"project": {
"companyName": "",
"projectName": "",
"introduction": {
"zh-cn": "",
"es-es": "",
Expand Down

0 comments on commit 76f8882

Please sign in to comment.