hostname or uri
This commit is contained in:
parent
fae4530564
commit
8cf3a6b0f0
|
@ -6,12 +6,15 @@ import { LoginUri } from '../domain/loginUri';
|
|||
|
||||
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
||||
|
||||
import { UtilsService } from '../../services/utils.service';
|
||||
|
||||
export class LoginUriView implements View {
|
||||
match: UriMatchType = null;
|
||||
|
||||
// tslint:disable
|
||||
private _uri: string;
|
||||
private _domain: string;
|
||||
private _hostname: string;
|
||||
// tslint:enable
|
||||
|
||||
constructor(u?: LoginUri) {
|
||||
|
@ -47,8 +50,19 @@ export class LoginUriView implements View {
|
|||
return this._domain;
|
||||
}
|
||||
|
||||
get domainOrUri(): string {
|
||||
return this.domain != null ? this.domain : this.uri;
|
||||
get hostname(): string {
|
||||
if (this._hostname == null && this.uri != null) {
|
||||
this._hostname = UtilsService.getHostname(this.uri);
|
||||
if (this._hostname === '') {
|
||||
this._hostname = null;
|
||||
}
|
||||
}
|
||||
|
||||
return this._hostname;
|
||||
}
|
||||
|
||||
get hostnameOrUri(): string {
|
||||
return this.hostname != null ? this.hostname : this.uri;
|
||||
}
|
||||
|
||||
get isWebsite(): boolean {
|
||||
|
|
Loading…
Reference in New Issue