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
bbdde67c
Commit
bbdde67c
authored
Nov 20, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0bf573b1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
26 deletions
+34
-26
app.component.ts
src/main/webapp/app/app.component.ts
+1
-1
app.constants.ts
src/main/webapp/app/app.constants.ts
+2
-2
home.component.html
src/main/webapp/app/home/home.component.html
+17
-11
home.component.ts
src/main/webapp/app/home/home.component.ts
+6
-6
warn-list.component.html
src/main/webapp/app/modal/warn-list/warn-list.component.html
+5
-5
warn-list.component.ts
src/main/webapp/app/modal/warn-list/warn-list.component.ts
+3
-1
No files found.
src/main/webapp/app/app.component.ts
View file @
bbdde67c
...
...
@@ -12,7 +12,7 @@ export class AppComponent {
constructor
(
private
router
:
Router
,
private
overAll
:
OverAllService
,
private
titleSer
:
Title
){
console
.
log
(
"monitor:v20191119"
);
console
.
log
(
"monitor:v20191119
1512
"
);
//火狐拖动图片会打开新tab
document
.
body
.
ondrop
=
(
event
)
=>
{
event
.
preventDefault
();
...
...
src/main/webapp/app/app.constants.ts
View file @
bbdde67c
export
const
VERSION
=
process
.
env
.
VERSION
;
export
const
DEBUG_INFO_ENABLED
:
boolean
=
!!
process
.
env
.
DEBUG_INFO_ENABLED
;
export
const
SERVER_API_URL_COMS
=
'/coms'
;
//
export const SERVER_API_URL = '/anke';
export
const
SERVER_API_URL
=
'/anke'
;
// export const SERVER_API_URL = '/zhouxi';
export
const
SERVER_API_URL
=
'/zabbixBox'
;
//
export const SERVER_API_URL = '/zabbixBox';
export
const
SERVER_API_URL_MONITOR
=
'/api'
;
export
const
BUILD_TIMESTAMP
=
process
.
env
.
BUILD_TIMESTAMP
;
export
const
pageSize
=
10
;
...
...
src/main/webapp/app/home/home.component.html
View file @
bbdde67c
...
...
@@ -27,7 +27,7 @@
</p>
<p>
<nz-tag
class=
"tag-yellow"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<span
class=
"margin-0-10"
>
告警 {{leftOneData.war
n
ing}}个,{{leftOneDataPre.warningPer}}%
</span>
<span
class=
"margin-0-10"
>
告警 {{leftOneData.waring}}个,{{leftOneDataPre.warningPer}}%
</span>
</p>
<p>
<nz-tag
class=
"tag-green"
[
nzColor
]="
color
.
green
"
></nz-tag>
...
...
@@ -50,7 +50,7 @@
</p>
<p>
<nz-tag
class=
"tag-yellow"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<span
class=
"margin-0-10"
>
告警 {{leftTwoData.war
n
ing}}个,{{leftTwoDataPre.warningPer}}%
</span>
<span
class=
"margin-0-10"
>
告警 {{leftTwoData.waring}}个,{{leftTwoDataPre.warningPer}}%
</span>
</p>
<p>
<nz-tag
class=
"tag-green"
[
nzColor
]="
color
.
green
"
></nz-tag>
...
...
@@ -91,23 +91,29 @@
<tr>
<th
nzShowSort
>
产生时间
</th>
<th>
级别
</th>
<th>
资源
名称
</th>
<th>
告警信息
</th>
<th>
持续时间
</th>
<th>
名称
</th>
<th
nzWidth=
"15%"
>
告警信息
</th>
<th>
状态
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of
nzTable.data
"
>
<tr
*
ngFor=
"let data of
warnList
"
>
<td>
{{data.c
lock | date:"yyyy-MM-dd HH:mm:ss"
}}
{{data.c
reateTime
}}
</td>
<td
class=
"round-tag tag-form"
>
<nz-tag
*
ngIf=
"data.priority == 4 || data.priority == 5"
class=
"tag-red"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"data.priority == 2 || data.priority == 3"
class=
"tag-yellow"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<nz-tag
class=
"tag-green"
*
ngIf=
"data.level == 0 "
[
nzColor
]="'#
58ca13
'"
></nz-tag>
<nz-tag
class=
"tag-red"
*
ngIf=
"data.level == 2 "
[
nzColor
]="'#
fc0d1b
'"
></nz-tag>
<nz-tag
class=
"tag-yellow"
*
ngIf=
"data.level == 1 "
[
nzColor
]="'#
fd9827
'"
></nz-tag>
</td>
<td
class=
"cursor main-color"
(
click
)="
goToDetail
(
data
)"
>
{{data.host
name}}
</td>
<td
>
{{data.
name}}
</td>
<td>
{{data.description}}
</td>
<td>
{{data.continuedTime}}
</td>
<td>
<ng-container
*
ngIf=
"data.r_clock"
><span
class=
"color-green"
><i
class=
"anticon anticon-check-square-o"
></i></span>
</ng-container>
<ng-container
*
ngIf=
"!data.r_clock"
><span
class=
"color-red"
>
<i
class=
"anticon anticon-warning"
></i></span>
</ng-container>
</td>
</tr>
</tbody>
</nz-table>
src/main/webapp/app/home/home.component.ts
View file @
bbdde67c
...
...
@@ -43,7 +43,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
leftOneData
=
{
serious
:
0
,
war
n
ing
:
0
,
waring
:
0
,
normal
:
0
,
disable
:
0
,
};
...
...
@@ -57,7 +57,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
leftOneTotal
=
0
;
leftTwoData
=
{
serious
:
0
,
war
n
ing
:
0
,
waring
:
0
,
normal
:
0
,
disable
:
0
,
};
...
...
@@ -151,8 +151,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
this
.
leftOneDataPre
.
seriousPer
=
a
.
toFixed
(
2
);
}
if
(
this
.
leftOneData
.
war
n
ing
>
0
){
let
b
:
any
=
(
(
this
.
leftOneData
.
war
n
ing
/
this
.
leftOneTotal
)
*
100
);
if
(
this
.
leftOneData
.
waring
>
0
){
let
b
:
any
=
(
(
this
.
leftOneData
.
waring
/
this
.
leftOneTotal
)
*
100
);
this
.
leftOneDataPre
.
warningPer
=
b
.
toFixed
(
2
);
}
...
...
@@ -238,8 +238,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
this
.
leftTwoDataPre
.
seriousPer
=
w
.
toFixed
(
2
);
}
if
(
this
.
leftTwoData
.
war
n
ing
>
0
){
let
x
:
any
=
(
(
this
.
leftTwoData
.
war
n
ing
/
this
.
leftTwoTotal
)
*
100
);
if
(
this
.
leftTwoData
.
waring
>
0
){
let
x
:
any
=
(
(
this
.
leftTwoData
.
waring
/
this
.
leftTwoTotal
)
*
100
);
this
.
leftTwoDataPre
.
warningPer
=
x
.
toFixed
(
2
);
}
...
...
src/main/webapp/app/modal/warn-list/warn-list.component.html
View file @
bbdde67c
...
...
@@ -13,13 +13,13 @@
</thead>
<tbody>
<tr
*
ngFor=
"let data of warnList"
>
<td
class=
"table-timeline"
>
<nz-timeline-item>
{{data.createTime | date:"yyyy-MM-dd HH:mm:ss"}}
</nz-timeline-item>
<td>
{{data.createTime}}
</td>
<td
class=
"round-tag tag-form"
>
<nz-tag
*
ngIf=
"data.level == 0 "
[
nzColor
]="'#
58ca13
'"
></nz-tag>
<nz-tag
*
ngIf=
"data.level == 2 "
[
nzColor
]="'#
fc0d1b
'"
></nz-tag>
<nz-tag
*
ngIf=
"data.level == 1 "
[
nzColor
]="'#
fd9827
'"
></nz-tag>
<nz-tag
class=
"tag-green"
*
ngIf=
"data.level == 0 "
[
nzColor
]="'#
58ca13
'"
></nz-tag>
<nz-tag
class=
"tag-red"
*
ngIf=
"data.level == 2 "
[
nzColor
]="'#
fc0d1b
'"
></nz-tag>
<nz-tag
class=
"tag-yellow"
*
ngIf=
"data.level == 1 "
[
nzColor
]="'#
fd9827
'"
></nz-tag>
</td>
<td>
{{data.name}}
</td>
<td>
{{data.description}}
</td>
...
...
src/main/webapp/app/modal/warn-list/warn-list.component.ts
View file @
bbdde67c
...
...
@@ -55,7 +55,9 @@ export class WarnListComponent implements OnInit {
if
(
res
.
data
)
{
res
.
data
.
data
.
forEach
(
e
=>
{
if
(
e
.
endTime
&&
e
.
createTime
)
{
const
continuedTime
=
(
new
Date
(
e
.
endTime
).
getTime
()
-
new
Date
(
e
.
createTime
).
getTime
());
const
endTime
=
e
.
endTime
.
replace
(
/-/g
,
'/'
);
const
createTime
=
e
.
createTime
.
replace
(
/-/g
,
'/'
);
const
continuedTime
=
(
new
Date
(
endTime
).
getTime
())
-
(
new
Date
(
createTime
).
getTime
());
e
.
continuedTime
=
this
.
commonSer
.
unitTime
(
continuedTime
);
}
});
...
...
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