Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
smart
Commits
4c6d4711
Commit
4c6d4711
authored
Feb 20, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
download
parent
a075be7e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
14 deletions
+110
-14
alarm-list.component.html
...ain/webapp/app/alarm/alarm-list/alarm-list.component.html
+8
-2
alarm-list.component.ts
src/main/webapp/app/alarm/alarm-list/alarm-list.component.ts
+24
-5
alarm-log.component.html
src/main/webapp/app/alarm/alarm-log/alarm-log.component.html
+3
-2
alarm-log.component.ts
src/main/webapp/app/alarm/alarm-log/alarm-log.component.ts
+32
-1
alarm.service.ts
src/main/webapp/app/alarm/alarm.service.ts
+11
-2
now-alarm.component.html
src/main/webapp/app/alarm/now-alarm/now-alarm.component.html
+3
-0
now-alarm.component.ts
src/main/webapp/app/alarm/now-alarm/now-alarm.component.ts
+29
-2
No files found.
src/main/webapp/app/alarm/alarm-list/alarm-list.component.html
View file @
4c6d4711
...
...
@@ -59,8 +59,13 @@
</div>
</div>
<div
nz-row
class=
"search-form"
style=
"border-top: none;padding: 0 0 15px 0;"
>
<input
style=
"width: 15%;"
[(
ngModel
)]="
obj
.
name
"
nz-input
placeholder=
"告警信息"
>
<button
(
click
)="
searchValue
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
></i>
搜索
</button>
<div
nz-col
nzSpan=
"16"
>
<input
style=
"width: 15%;"
[(
ngModel
)]="
obj
.
name
"
nz-input
placeholder=
"告警信息"
>
<button
(
click
)="
searchValue
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
></i>
搜索
</button>
</div>
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
<button
[
nzLoading
]="
isDownload
"
(
click
)="
downLoadExcel
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-download"
></i>
下载
</button>
</div>
</div>
<smart-warn-list
#
warnList
></smart-warn-list>
\ No newline at end of file
src/main/webapp/app/alarm/alarm-list/alarm-list.component.ts
View file @
4c6d4711
...
...
@@ -5,6 +5,8 @@ import {WarnListComponent} from '../../modal/warn-list/warn-list.component';
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
DatePipe
}
from
'@angular/common'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
import
{
WorkService
}
from
'../../work/work.service'
;
@
Component
({
selector
:
'smart-alarm-list'
,
...
...
@@ -50,9 +52,10 @@ export class AlarmListComponent implements OnInit {
dateBegin
=
null
;
dateEnd
=
null
;
isDownload
;
constructor
(
public
alarmSer
:
AlarmService
,
public
overAllSer
:
OverAllService
,
public
message
:
NzMessageService
,
public
datePipe
:
DatePipe
)
{
public
datePipe
:
DatePipe
,
private
commonSer
:
CommonService
,
private
workSer
:
WorkService
)
{
this
.
changeType
();
}
...
...
@@ -62,10 +65,6 @@ export class AlarmListComponent implements OnInit {
this
.
searchValue
();
}
// ngAfterViewInit(){
// this.searchValue();
// }
//获取分组
getWarnGroup
()
{
this
.
overAllSer
.
findGroup
().
subscribe
(
...
...
@@ -134,4 +133,24 @@ export class AlarmListComponent implements OnInit {
}
this
.
warnList
.
getList
(
this
.
obj
);
}
//导出文件
downLoadExcel
(){
this
.
isDownload
=
true
;
this
.
alarmSer
.
getExportUrlEvent
(
this
.
obj
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
workSer
.
downloadTemplate
(
'alarm'
,
res
.
data
).
subscribe
(
(
data
)
=>
{
this
.
isDownload
=
false
;
this
.
commonSer
.
downloadFile
(
'告警记录.xlsx'
,
data
)
}
)
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isDownload
=
false
;
}
)
}
}
src/main/webapp/app/alarm/alarm-log/alarm-log.component.html
View file @
4c6d4711
...
...
@@ -42,7 +42,7 @@
<label
nz-radio-button
nzValue=
"5"
>
自定义
</label>
</nz-radio-group>
</div>
<div
nz-col
nzSpan=
"
8
"
>
<div
nz-col
nzSpan=
"
7
"
>
<ng-container
*
ngIf=
"timeType == '5'"
>
<nz-date-picker
nzFormat=
"yyyy-MM-dd"
...
...
@@ -56,7 +56,8 @@
></nz-date-picker>
</ng-container>
</div>
<div
nz-col
nzSpan=
"3"
class=
"text-right"
>
<div
nz-col
nzSpan=
"4"
class=
"text-right"
>
<button
[
nzLoading
]="
isDownload
"
(
click
)="
downLoadExcel
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-download"
></i>
下载
</button>
<button
(
click
)="
search
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
style=
"color: #6097b7"
></i>
搜索
</button>
</div>
</div>
...
...
src/main/webapp/app/alarm/alarm-log/alarm-log.component.ts
View file @
4c6d4711
...
...
@@ -6,6 +6,8 @@ import {AlarmService} from '../alarm.service';
import
{
pageSize
}
from
'../../app.constants'
;
import
{
NzMessageService
,
NzModalService
}
from
'ng-zorro-antd'
;
import
{
AlarmTargetComponent
}
from
'../modal/alarm-target/alarm-target.component'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
import
{
WorkService
}
from
'../../work/work.service'
;
@
Component
({
selector
:
'smart-alarm-log'
,
...
...
@@ -60,8 +62,10 @@ export class AlarmLogComponent implements OnInit {
title
;
content
;
loading
=
false
;
isDownload
;
constructor
(
public
alarmSer
:
AlarmService
,
public
overAllSer
:
OverAllService
,
public
message
:
NzMessageService
,
public
datePipe
:
DatePipe
,
public
modalSer
:
NzModalService
)
{
public
datePipe
:
DatePipe
,
public
modalSer
:
NzModalService
,
private
commonSer
:
CommonService
,
private
workSer
:
WorkService
)
{
const
today
=
new
Date
();
this
.
obj
.
time_from
=
this
.
datePipe
.
transform
(
today
,
"yyyy-MM-dd"
)
+
" 00:00:00"
;
this
.
obj
.
time_till
=
this
.
datePipe
.
transform
(
today
,
"yyyy-MM-dd"
)
+
" 23:59:59"
;
...
...
@@ -222,4 +226,31 @@ export class AlarmLogComponent implements OnInit {
this
.
smartAlarmTarget
.
showModal
();
}
//导出文件
downLoadExcel
(){
this
.
isDownload
=
true
;
const
data
=
{
"alertGroupId"
:
this
.
obj
.
alertGroupId
,
"time_from"
:
new
Date
(
this
.
obj
.
time_from
).
getTime
(),
"time_till"
:
new
Date
(
this
.
obj
.
time_till
).
getTime
(),
"mediatypeids"
:[
this
.
obj
.
mediatypeids
],
"hostids"
:[
this
.
obj
.
hostids
]
};
this
.
alarmSer
.
getExportUrlAlert
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
workSer
.
downloadTemplate
(
'alert'
,
res
.
data
).
subscribe
(
(
data
)
=>
{
this
.
isDownload
=
false
;
this
.
commonSer
.
downloadFile
(
'告警推送日志.xlsx'
,
data
);
}
)
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isDownload
=
false
;
}
)
}
}
src/main/webapp/app/alarm/alarm.service.ts
View file @
4c6d4711
...
...
@@ -123,4 +123,14 @@ export class AlarmService {
findAlertTarget
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/action/findAlertTarget'
);
}
}
\ No newline at end of file
//导出当前告警列表
getExportUrlEvent
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/event/getExportUrl'
,
data
);
}
//告警推送日志导出
getExportUrlAlert
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/alert/getExportUrl'
,
data
);
}
}
src/main/webapp/app/alarm/now-alarm/now-alarm.component.html
View file @
4c6d4711
...
...
@@ -25,6 +25,9 @@
style=
"font-size: 15px;"
></i>
{{alarmTotal}}
</span>
</div>
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
<button
[
nzLoading
]="
isDownload
"
(
click
)="
downLoadExcel
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-download"
></i>
下载
</button>
</div>
</div>
<div
class=
"tag-warn tag-form handle"
>
<ng-container
*
ngFor=
"let item of warnCountList"
>
...
...
src/main/webapp/app/alarm/now-alarm/now-alarm.component.ts
View file @
4c6d4711
...
...
@@ -5,6 +5,8 @@ import {SendLogComponent} from '../modal/send-log/send-log.component';
import
{
color
,
pageSize
}
from
'../../app.constants'
;
import
{
WarnListComponent
}
from
'../../modal/warn-list/warn-list.component'
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
import
{
WorkService
}
from
'../../work/work.service'
;
@
Component
({
selector
:
'smart-now-alarm'
,
...
...
@@ -48,9 +50,10 @@ export class NowAlarmComponent implements OnInit, OnDestroy {
time_
;
selectHostId
;
isDownload
;
constructor
(
public
alarmSer
:
AlarmService
,
public
message
:
NzMessageService
,
public
overAllSer
:
OverAllService
)
{
constructor
(
public
alarmSer
:
AlarmService
,
public
message
:
NzMessageService
,
private
workSer
:
WorkService
,
public
overAllSer
:
OverAllService
,
private
commonSer
:
CommonService
)
{
}
ngOnInit
()
{
...
...
@@ -98,4 +101,28 @@ export class NowAlarmComponent implements OnInit, OnDestroy {
getTotal
(
num
){
this
.
alarmTotal
=
num
;
}
//导出文件
downLoadExcel
(){
this
.
isDownload
=
true
;
const
data
=
{
isWaring
:
'yes'
,
hostid
:
this
.
selectHostId
,
};
this
.
alarmSer
.
getExportUrlEvent
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
workSer
.
downloadTemplate
(
'alarm'
,
res
.
data
).
subscribe
(
(
data
)
=>
{
this
.
isDownload
=
false
;
this
.
commonSer
.
downloadFile
(
'当前告警.xlsx'
,
data
);
}
)
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isDownload
=
false
;
}
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment