Merge pull request #3910 from pengpengshui/skinable

Modify skinnable json file and modify images path about #3909 #3879
This commit is contained in:
pengpengshui 2018-01-04 16:12:59 +08:00 committed by GitHub
commit a75f347fd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 13 deletions

View File

@ -47,4 +47,5 @@
font-size: 14px !important; font-size: 14px !important;
position: relative; position: relative;
top: -9px; top: -9px;
} }
.bg{position: absolute;top: 60px; right: 0px;width: 100%; height: 100%; background-size: cover;}

View File

@ -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"> <form #signInForm="ngForm" class="login">
<label class="title"> {{customAppTitle? customAppTitle:(appTitle | translate)}}<span class="trademark tm-font">&#8482;</span> <label class="title"> {{customAppTitle? customAppTitle:(appTitle | translate)}}<span class="trademark tm-font">&#8482;</span>
</label> </label>

View File

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

View File

@ -2,7 +2,7 @@
<div class="branding"> <div class="branding">
<a href="javascript:void(0)" class="nav-link" (click)="homeAction()"> <a href="javascript:void(0)" class="nav-link" (click)="homeAction()">
<clr-icon shape="vm-bug" *ngIf="!customStyle?.headerLogo"></clr-icon> <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> <span class="title">{{customProjectName?.projectName? customProjectName?.projectName:(appTitle | translate)}}</span>
</a> </a>
</div> </div>

View File

@ -35,7 +35,7 @@ export class AboutDialogComponent implements OnInit{
ngOnInit(): void { ngOnInit(): void {
// custom skin // custom skin
let customSkinObj = this.skinableConfig.getProjects(); let customSkinObj = this.skinableConfig.getProject();
if (customSkinObj) { if (customSkinObj) {
let selectedLang = this.translate.currentLang; let selectedLang = this.translate.currentLang;
this.customName = customSkinObj; this.customName = customSkinObj;

View File

@ -12,7 +12,7 @@ export class SkinableConfig {
constructor(private http: Http) {} constructor(private http: Http) {}
public getCustomFile(): Promise<any> { public getCustomFile(): Promise<any> {
return this.http.get('../setting.json') return this.http.get('../static/setting.json')
.toPromise() .toPromise()
.then(response => { this.customSkinData = response.json(); return this.customSkinData; }) .then(response => { this.customSkinData = response.json(); return this.customSkinData; })
.catch(error => { .catch(error => {
@ -24,9 +24,9 @@ export class SkinableConfig {
return this.customSkinData; return this.customSkinData;
} }
public getProjects() { public getProject() {
if (this.customSkinData) { if (this.customSkinData) {
return this.customSkinData.projects; return this.customSkinData.project;
}else { }else {
return null; return null;
} }

View File

@ -1,11 +1,11 @@
{ {
"headerBgColor": "#004a70", "headerBgColor": "",
"headerLogo": "", "headerLogo": "",
"loginBgImg": "", "loginBgImg": "",
"appTitle": "VMware Harbor", "appTitle": "",
"projects": { "project": {
"companyName": "vmware", "companyName": "",
"projectName": "Harbor", "projectName": "",
"introduction": { "introduction": {
"zh-cn": "", "zh-cn": "",
"es-es": "", "es-es": "",