This commit is contained in:
sunny 2018-04-22 20:10:12 +09:00
parent e8cf16e8d8
commit cb22bd642a
6 changed files with 84 additions and 59 deletions

View File

@ -1,8 +1,11 @@
<li role="menuitem" *ngFor="let noti of notifications; let i = index" > <div class="ui-g-12 ui-bottom-border-1">
No tifications
</div>
<li role="menuitem" *ngFor="let noti of notifications; let i = index" class="ui-bottom-border-1 ui-app-noti">
<a *ngIf="i < 5" href="javascript:void(0)" class="topbar-message" (click)="onNotiClick(noti)" [ngStyle]="noti.confirmDate ? '' : {'background-color': 'lightblue'}"> <a *ngIf="i < 5" href="javascript:void(0)" class="topbar-message" (click)="onNotiClick(noti)" [ngStyle]="noti.confirmDate ? '' : {'background-color': 'lightblue'}">
<span>{{noti.title}}</span> <div class="ui-app-noti-title">{{noti.title}}</div>
<span>{{noti.message}}</span> <div class="ui-app-noti-content">{{noti.message}}</div>
<span>{{noti.createDate | date: 'short'}}</span> <div class="ui-app-noti-date">{{noti.createDate | date: 'short'}}</div>
</a> </a>
</li> </li>
<li role="menuitem"> <li role="menuitem">

View File

@ -128,7 +128,7 @@
</li> </li>
<li #messages [ngClass]="{'active-top-menu':app.activeTopbarItem === messages}"> <li #messages [ngClass]="{'active-top-menu':app.activeTopbarItem === messages}">
<a href="#" (click)="app.onTopbarItemClick($event,messages)"> <a href="#" (click)="app.onTopbarItemClick($event,messages)">
<i class="topbar-icon material-icons animated swing">message</i> <i class="topbar-icon material-icons animated swing">notifications</i>
<span class="topbar-badge animated rubberBand" *ngIf="notificationCount > 0"> <span class="topbar-badge animated rubberBand" *ngIf="notificationCount > 0">
{{notificationCount}} {{notificationCount}}
</span> </span>

View File

@ -3,14 +3,10 @@
<div class="ui-g-12"> <div class="ui-g-12">
<div class="card no-margin"> <div class="card no-margin">
<h1>Alert</h1> <h1>Alert</h1>
</div>
</div>
<div class="ui-g-12 ui-nopad">
<of-alert-list></of-alert-list> <of-alert-list></of-alert-list>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -1,49 +1,52 @@
<div class="ui-g form-group"> <div class="ui-g-12 ui-md-6">
<div class="ui-g-12 ui-md-2"> <div class="card ui-g">
<div class="ui-g"> <h3>Metric Alert</h3>
<div class="ui-g-6">All</div> <div class="ui-g-12 ui-xl-8 ui-xl-offset-4 ui-g-nopad">
<div class="ui-g-6">13</div> <div class="ui-g-3">
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>All : 13
</div> </div>
<div class="ui-g" [ngStyle]="{'background-color': bgMap.get('Down')}"> <div class="ui-g-3">
<div class="ui-g-6">Down</div> <i class="fa ui-icon-stop ui-status-icon ui-status-fatal"></i>Down : 3
<div class="ui-g-6">3</div>
</div> </div>
<div class="ui-g" [ngStyle]="{'background-color': bgMap.get('Warn')}"> <div class="ui-g-3">
<div class="ui-g-6">Warn</div> <i class="fa ui-icon-stop ui-status-icon ui-status-warn"></i>Warn : 5
<div class="ui-g-6">5</div>
</div> </div>
<div class="ui-g" [ngStyle]="{'background-color': bgMap.get('Error')}"> <div class="ui-g-3">
<div class="ui-g-6">Error</div> <i class="fa ui-icon-stop ui-status-icon ui-status-error"></i>Error : 5
<div class="ui-g-6">5</div>
</div> </div>
</div> </div>
</div>
<div class="ui-g form-group" [style]="{width: '700px'}"> <div class="ui-g-12 form-group">
<p-dataList [value]="metricAlerts" [paginator]="true" [rows]="5" styleClass="cars-datalist"> <p-dataList [value]="metricAlerts" [paginator]="true" [rows]="5">
<ng-template let-alert pTemplate="alert"> <ng-template let-alert pTemplate="alert">
<div [ngStyle]="{'border-bottom': '1px solid #bdbdbd','background-color': bgMap.get(alert.status)}" class="clearfix car-item"> <div [ngStyle]="{'padding':'5px', 'border-style':'solid', 'border-width':'0 0 1px 0', 'border-color': bgMap.get(alert.status)}" class="clearfix">
<div width="48" style="display:inline-block;margin:24px;vertical-align:middle">{{alert.created}}</div> <div class="ui-g-3">{{alert.created}}</div>
<div class="car-details" style="display:inline-block;vertical-align:middle"> <div class="ui-g-7">
{{alert.msg}} <i class="fa ui-icon-stop ui-status-icon ui-status-{{bgMap.get(alert.status)}}"></i>{{alert.msg}}
</div> </div>
<div width="48" style="display:inline-block;margin:24px;vertical-align:middle">{{alert.status}}</div> <div class="ui-g-2" [ngStyle]="{'font-color': bgMap.get(alert.status)}">{{alert.status}}</div>
</div> </div>
</ng-template> </ng-template>
</p-dataList> </p-dataList>
</div>
&nbsp; </div>
</div>
<p-dataList [value]="systemAlerts" [paginator]="true" [rows]="5" styleClass="cars-datalist"> <div class="ui-g-12 ui-md-6">
<div class="card ui-g">
<div class="ui-g-12">
<h3>System Alert</h3>
<p-dataList [value]="systemAlerts" [paginator]="true" [rows]="5">
<ng-template let-alert pTemplate="alert"> <ng-template let-alert pTemplate="alert">
<div style="border-bottom: 1px solid #bdbdbd" class="clearfix car-item"> <div style="border-bottom: 1px solid #bdbdbd; padding: 7px" class="clearfix">
<div width="48" style="display:inline-block;margin:24px;vertical-align:middle">{{alert.created}}</div> <div class="ui-g-3">{{alert.created}}</div>
<div class="car-details" style="display:inline-block;vertical-align:middle"> <div class="ui-g-7">
{{alert.msg}} {{alert.msg}}
</div> </div>
<div width="48" style="display:inline-block;margin:24px;vertical-align:middle">{{alert.status}}</div> <div class="ui-g-2">{{alert.status}}</div>
</div> </div>
</ng-template> </ng-template>
</p-dataList> </p-dataList>
</div>
</div>
</div> </div>

View File

@ -1,6 +1,6 @@
<h1>Notifications</h1> <h1>Notifications</h1>
<div> <div class="ui-g-12" dir="rtl">
<a href="javascript:void(0)" (click)="onMarkAllAsRead()">Mark all as read</a> <button type="button" label="Mark all as read" pButton class="ui-button-width-fit" (click)="onMarkAllAsRead()"></button>
</div> </div>
<p-table [value]="notifications" selectionMode="single" (onRowSelect)="onRowSelect($event)" [resizableColumns]="true"> <p-table [value]="notifications" selectionMode="single" (onRowSelect)="onRowSelect($event)" [resizableColumns]="true">

View File

@ -189,3 +189,26 @@ img.ui-img-profile-responsive {
.ui-bottom-border-1 { .ui-bottom-border-1 {
border-bottom: #bdbdbd 1px solid; border-bottom: #bdbdbd 1px solid;
} }
.ui-app-noti{
li{
padding: 10px !important;
line-height: 1.2em !important;
width: 100% !important;
a {
.ui-app-noti-title {
font-weight: bold !important;
float: left !important;
padding: 10px !important;
margin: 0 !important;
}
.ui-app-noti-date{
float: right !important;
font-size: 0.6em !important;
color: gray !important;
}
.ui-app-noti-content{
float: left !important;
}
}
}
}