From 3f4af8fdd6df6204de40ba9a741985c5600f6852 Mon Sep 17 00:00:00 2001 From: MaxKey Date: Tue, 17 May 2022 17:15:15 +0800 Subject: [PATCH] custom --- .../src/app/layout/basic/basic.component.ts | 10 ++++- .../layout/passport/passport.component.html | 2 +- .../app/layout/passport/passport.component.ts | 1 + .../src/app/layout/basic/basic.component.ts | 37 +++++++++++++++++-- .../layout/passport/passport.component.html | 11 +++--- .../app/layout/passport/passport.component.ts | 19 +++++----- .../routes/passport/login/login.component.ts | 3 +- .../src/app/service/authn.service.ts | 18 +++++++-- .../src/app/shared/utils/knowhost.ts | 9 +++++ 9 files changed, 84 insertions(+), 26 deletions(-) create mode 100644 maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/utils/knowhost.ts diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/layout/basic/basic.component.ts b/maxkey-web-frontend/maxkey-web-app/src/app/layout/basic/basic.component.ts index 642d78554..224852132 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/layout/basic/basic.component.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/layout/basic/basic.component.ts @@ -37,13 +37,20 @@ import { LayoutDefaultOptions } from '../../theme/layout-default'; ], template: ` - + logo
MaxKey{{ 'mxk.title' | i18n }}
+ + + logo +
{{ inst.title }}
+
+
+ @@ -135,6 +142,7 @@ export class LayoutBasicComponent implements OnInit { ngOnInit(): void { this.inst = this.authnService.getInst(); if (this.inst == null) { + this.inst = { custom: false }; this.authnService.initInst().subscribe(res => { this.authnService.setInst(res.data, !knowHost()); this.inst = this.authnService.getInst(); diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.html b/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.html index 29b698813..10014c91d 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.html +++ b/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.html @@ -2,7 +2,7 @@
- +
diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.ts b/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.ts index 5c4a15356..62eb9284d 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/layout/passport/passport.component.ts @@ -51,6 +51,7 @@ export class LayoutPassportComponent implements OnInit { ngOnInit(): void { this.inst = this.authnService.getInst(); if (this.inst == null) { + this.inst = { custom: false }; this.authnService.initInst().subscribe(res => { this.authnService.setInst(res.data, !knowHost()); this.inst = this.authnService.getInst(); diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/layout/basic/basic.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/layout/basic/basic.component.ts index 7b7157985..f3b15df0a 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/layout/basic/basic.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/layout/basic/basic.component.ts @@ -14,11 +14,13 @@ * limitations under the License. */ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { SettingsService, User } from '@delon/theme'; import { environment } from '@env/environment'; +import { AuthnService } from 'src/app/service/authn.service'; import { CONSTS } from 'src/app/shared/consts'; +import { knowHost } from '../../shared/utils/knowhost'; import { LayoutDefaultOptions } from '../../theme/layout-default'; @Component({ @@ -33,7 +35,7 @@ import { LayoutDefaultOptions } from '../../theme/layout-default'; ], template: ` - + logo
+ + + logo +
+ {{ inst.title }} +
+
+