summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-11-08 12:37:25 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-11-08 12:38:00 +0800
commita85d5280af7c04207bfb725e4bae037ba0eac3bf (patch)
tree9f6bf2f6d2810f5334c73ce0e77ad1559919dee9
parent5068ef4e733342d03d30ad895e5dcbeb4b6390b1 (diff)
Fix VNF Alarm Query Bugs
Change-Id: I8cc18d8f7bf02002d062e30aa5b5abd13743d6dd Issue-ID: USECASEUI-165 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
-rw-r--r--usecaseui-portal/src/app/alarm/alarm.component.html14
-rw-r--r--usecaseui-portal/src/app/alarm/alarm.component.ts73
-rw-r--r--usecaseui-portal/src/app/components/details/details.component.ts31
3 files changed, 53 insertions, 65 deletions
diff --git a/usecaseui-portal/src/app/alarm/alarm.component.html b/usecaseui-portal/src/app/alarm/alarm.component.html
index b1f49949..894cdf5b 100644
--- a/usecaseui-portal/src/app/alarm/alarm.component.html
+++ b/usecaseui-portal/src/app/alarm/alarm.component.html
@@ -88,12 +88,12 @@
<thead (nzSortChange)="sort($event)" nzSingleSort>
<tr>
<th nzWidth="5%">NO</th>
- <th nzWidth="20%">Source Name</th>
+ <th nzWidth="10%">Source Name</th>
<th nzWidth="10%">Priority</th>
- <th nzWidth="20%">SpecificProblem</th>
- <th nzWidth="20%">Report Time</th>
- <th nzWidth="20%">Report Time</th>
- <th nzWidth="15%">Status</th>
+ <th nzWidth="15%">SpecificProblem</th>
+ <th nzWidth="15%">Report Time</th>
+ <th nzWidth="15%">Clear Time</th>
+ <th nzWidth="10%">Status</th>
<th nzWidth="10%">Action</th>
</tr>
</thead>
@@ -103,8 +103,8 @@
<td>{{item.sourceName}}</td>
<td>{{item.priority}}</td>
<td>{{item.specificProblem}}</td>
- <td>{{item.startEpochMicrosec}}</td>
- <td>{{item.startEpochMicrosecCleared}}</td>
+ <td>{{item.startEpochMicrosec | date:'yyyy-MM-dd HH:mm:ss'}}</td>
+ <td>{{item.startEpochMicrosecCleared | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.status}}</td>
<td class="action"><a (click)="detailShow(item)"><i class="details"></i></a></td>
</tr>
diff --git a/usecaseui-portal/src/app/alarm/alarm.component.ts b/usecaseui-portal/src/app/alarm/alarm.component.ts
index e9f7cbdd..9fe870bb 100644
--- a/usecaseui-portal/src/app/alarm/alarm.component.ts
+++ b/usecaseui-portal/src/app/alarm/alarm.component.ts
@@ -33,8 +33,8 @@ export class AlarmComponent implements OnInit {
public pageSize: number = 10;
public sourceName: string = '';
public priority: string = '';
- public startTime: string = '';
- public endTime: string = '';
+ public startTime: string = this.myhttp.dateformater(Date.now() - 30 * 24 * 60 * 60 * 1000);
+ public endTime: string = this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss');
public vfStatus: string = '';
public sourceNameList: Array<any> = ['---auto---'];
list: any;
@@ -94,31 +94,29 @@ export class AlarmComponent implements OnInit {
// Date screening
dateRange = [(new Date(), -30), new Date()];
-
onChange(result: Date): void {
- this.startTime = this.datePipe.transform(result[0], 'yyyy-MM-dd-HH:mm:ss');
- this.endTime = this.datePipe.transform(result[1], 'yyyy-MM-dd-HH:mm:ss');
+ this.startTime = this.datePipe.transform(result[0], 'yyyy-MM-dd HH:mm:ss');
+ this.endTime = this.datePipe.transform(result[1], 'yyyy-MM-dd HH:mm:ss');
}
-
- sort(e) {
+ sort(e){
}
// total
alarmList = {
- all: 200,
+ all: 0,
closed: 0,
activeNum: 0
}
// total data
- // getstatuscount(){
- // this.myhttp.getstatuscount().subscribe((data)=>{
- // this.alarmList.activeNum = data[0];
- // this.alarmList.closed = data[1];
+ getstatuscount() {
+ this.myhttp.getstatuscount().subscribe((data) => {
+ this.alarmList.activeNum = data[0];
+ this.alarmList.closed = data[1];
+ this.alarmList.all = (data[0] - 0) + (data[1] - 0);
- // })
- // }
+ })
+ }
getAlarmFormData() {
-
this.myhttp.getAlarmFormData(this.currentPage, this.pageSize, this.sourceName, this.priority, this.startTime, this.endTime, this.vfStatus).subscribe((data) => {
this.list = data.alarms;
})
@@ -126,15 +124,16 @@ export class AlarmComponent implements OnInit {
}
getAlarmChartData(event) {
let paramsObj = {
- alarmSourceName: this.sourceName,
+ sourceName: this.sourceName,
startTime: this.startTime,
- endTime: this.endTime
+ endTime: this.endTime,
+ format: 'day'
}
this.myhttp.getHomeAlarmChartData(paramsObj)
.subscribe((data) => {
this.alarmChartData = {
- xAxis:{
- data:data.dataList
+ xAxis: {
+ data: data.dateList
},
series: [
{ data: data.allList },
@@ -149,14 +148,16 @@ export class AlarmComponent implements OnInit {
// day alarmchartdata
day() {
let paramsObj = {
- alarmSourceName: this.sourceName,
- day: "day"
+ sourceName: this.sourceName,
+ startTime: this.startTime,
+ endTime: this.endTime,
+ format: "day"
}
this.myhttp.getHomeAlarmChartData(paramsObj)
.subscribe((data) => {
this.alarmChartData = {
- xAxis:{
- data:data.dataList
+ xAxis: {
+ data: data.dateList
},
series: [
{ data: data.allList },
@@ -170,14 +171,16 @@ export class AlarmComponent implements OnInit {
}
month() {
let paramsObj = {
- alarmSourceName: this.sourceName,
- day: "month"
+ sourceName: this.sourceName,
+ startTime: this.startTime,
+ endTime: this.endTime,
+ format: "month"
}
this.myhttp.getHomeAlarmChartData(paramsObj)
.subscribe((data) => {
this.alarmChartData = {
- xAxis:{
- data:data.dataList
+ xAxis: {
+ data: data.dateList
},
series: [
{ data: data.allList },
@@ -211,10 +214,8 @@ export class AlarmComponent implements OnInit {
end: 40
}
],
- xAxis:{
- data:["2018-09-10 ","2018-09-11","2018-09-12","2018-09-13","2018-09-14",
- "2018-09-15","2018-09-16","2018-09-17","2018-09-18","2018-09-19",
- "2018-09-20","2018-09-21","2018-09-22","2018-09-10 ","2018-09-11","2018-09-12","2018-09-13"]
+ xAxis: {
+ data: []
},
series: [
{
@@ -226,7 +227,7 @@ export class AlarmComponent implements OnInit {
opacity: 0.8
},
//timeframe_one
- data: [40, 45, 38, 52, 64, 58, 69, 87, 76, 33, 64, 87, 45, 76, 88, 56, 33, 76, 45, 65, 38, 52, 64, 58, 69, 87, 76, 33, 64, 87, 40, 45, 38, 52, 64, 58, 69, 87, 76, 40, 45, 38, 52, 64, 58, 69, 87, 76],
+ data: [],
itemStyle: {
color: "#526b75"
},
@@ -244,7 +245,7 @@ export class AlarmComponent implements OnInit {
opacity: 0.8
},
//timeframe_two
- data: [32, 43, 23, 45, 63, 24, 54, 22, 32, 42, 42, 22, 23, 43, 32, 34, 42, 33, 42, 12, 32, 43, 23, 45, 63, 24, 54, 22, 32, 42, 42, 22, 23, 43, 32, 34, 42, 33, 42, 12, 32, 43, 23, 45, 63, 24, 54, 22],
+ data: [],
itemStyle: {
color: "#fb6e6e"
},
@@ -280,18 +281,16 @@ export class AlarmComponent implements OnInit {
// Show hidden animation
state = "show";
state2 = "hide";
- detailId: number;
+ detailId: string;
detailShow(item) {
this.state = 'hide';
this.state2 = 'show';
this.detailshow = true;
- // console.log(item);
- this.detailId = item.eventId;
+ this.detailId = item.id;
}
detailHide() {
this.state = 'show';
this.state2 = 'hide';
this.detailshow = false;
}
-
}
diff --git a/usecaseui-portal/src/app/components/details/details.component.ts b/usecaseui-portal/src/app/components/details/details.component.ts
index 4965ed70..19da9e66 100644
--- a/usecaseui-portal/src/app/components/details/details.component.ts
+++ b/usecaseui-portal/src/app/components/details/details.component.ts
@@ -1,18 +1,3 @@
-/*
- Copyright (C) 2018 CMCC, Inc. and others. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
import { Component, OnInit, Input } from '@angular/core';
import { slideUpDown } from '../../animates';
import { MyhttpService } from '../../myhttp.service';
@@ -34,14 +19,18 @@ export class DetailsComponent implements OnInit {
this.getAlarmDetailData(this.detailId);
}
- datailheaderdata: any = {};
+ datailheaderdata: any = {
+
+ };
dataillistdata: any = [];
getAlarmDetailData(id){
- this.myhttp.getAlarmDetailData(id).subscribe((data)=>{
- // console.log(data)
- this.datailheaderdata = data.alarmsHeader;
- this.dataillistdata = data.list;
- })
+ if(id){
+ this.myhttp.getAlarmDetailData(id).subscribe((data)=>{
+ this.datailheaderdata = data.alarmsHeader;
+ this.dataillistdata = data.list;
+ })
+ }
+
}
// 详情显示
moredetailShow = false;
tin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */