This commit is contained in:
crusader 2018-05-31 17:27:00 +09:00
parent e8ad7b6716
commit b525f40063
5 changed files with 28 additions and 1 deletions

View File

@ -47,7 +47,11 @@
<b>HostID:</b> {{rowData.descriptions.host.hostID}}
</div>
<div class="ui-g-12">
<b>Connected:</b> {{rowData.connectDate | date: 'dd/MM/yyyy'}} ({{rowData.connectAddress}})
<b>Connected:</b>
<ng-container [ngSwitch]="rowData.connectDate">
<ng-container *ngSwitchCase="undefined"> Not Connected</ng-container>
<ng-container *ngSwitchDefault> {{rowData.connectDate | date: 'dd/MM/yyyy'}} ({{rowData.connectAddress}})</ng-container>
</ng-container>
</div>
</div>

View File

@ -29,6 +29,7 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
private store: Store<any>,
private noAuthProbeService: NoAuthProbeService,
) {
this.noauthProbes = [];
}
ngOnInit() {

View File

@ -0,0 +1,5 @@
import { UPTimePipe } from './uptime.pipe';
export const PIPES = [
UPTimePipe,
];

View File

@ -0,0 +1,14 @@
import { Pipe, PipeTransform } from '@angular/core';
import { DatePipe } from '@angular/common';
@Pipe({
name: 'ofUPTime'
})
export class UPTimePipe extends DatePipe implements PipeTransform {
transform(value: any, nullString: string, format = 'mediumDate', timezone?: string, locale?: string): string | null {
if (value == null || value === '' || value !== value) {
return nullString;
}
return super.transform(value, format, timezone, locale);
}
}

View File

@ -4,6 +4,7 @@ import { PRIME_NG_MODULES } from './ui-prime-ng.module';
import { COMPONENTS } from './component';
import { DIRECTIVES } from './directive';
import { PIPES } from './pipe';
@NgModule({
imports: [
@ -14,10 +15,12 @@ import { DIRECTIVES } from './directive';
PRIME_NG_MODULES,
COMPONENTS,
DIRECTIVES,
PIPES,
],
declarations: [
COMPONENTS,
DIRECTIVES,
PIPES,
],
})
export class UIModule { }