Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
event-analysis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔义雄
event-analysis
Commits
39618130
Commit
39618130
authored
Jun 10, 2020
by
Kerwin_Cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
b9ca163b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
12 deletions
+42
-12
event_analysis/models.py
event_analysis/models.py
+2
-0
event_analysis/views.py
event_analysis/views.py
+16
-5
templates/event_analysis/alarm_edit.html
templates/event_analysis/alarm_edit.html
+24
-7
事件信息.xls
事件信息.xls
+0
-0
No files found.
event_analysis/models.py
View file @
39618130
...
...
@@ -290,6 +290,8 @@ class Error_alarm(models.Model):
user
=
models
.
CharField
(
null
=
True
,
max_length
=
100
,
verbose_name
=
"处理人"
)
cant_auto_info
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"不可自动化信息"
)
not_auto_yet
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"未自动化信息"
)
other_alarminfo
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"其他监控信息"
)
icube_alarminfo
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"一体化告警信息"
)
def
toDic
(
self
):
return
dict
([(
attr
,
getattr
(
self
,
attr
))
for
attr
in
[
f
.
name
for
f
in
self
.
_meta
.
fields
]])
...
...
event_analysis/views.py
View file @
39618130
...
...
@@ -2224,6 +2224,8 @@ def create_alarm(request):
monitor_name
=
data
[
'monitor_name'
]
if_icube
=
data
[
'if_icube'
]
not_auto_yet
=
data
[
'notautoyetinfo'
]
other_alarminfo
=
data
[
'other_alarminfo'
]
icube_alarminfo
=
''
if
alarm_time
and
recover_time
and
alarm_summary
and
alarm_type
and
alarm_system
:
pass
...
...
@@ -2296,7 +2298,9 @@ def create_alarm(request):
if_icube
=
if_icube
,
cant_auto_info
=
cant_auto_info
,
user
=
login_person
,
not_auto_yet
=
not_auto_yet
not_auto_yet
=
not_auto_yet
,
other_alarminfo
=
other_alarminfo
,
icube_alarminfo
=
icube_alarminfo
)
error_alarm
.
save
()
return
render_json
(
...
...
@@ -2352,7 +2356,9 @@ def edit_alarm_display(request):
'if_icube'
:
int
(
alarm
.
if_icube
)
if
alarm
.
if_icube
else
''
,
'show_src'
:
show_src
,
'cantautoinfo'
:
alarm
.
cant_auto_info
if
alarm
.
cant_auto_info
else
''
,
'notautoyetinfo'
:
alarm
.
not_auto_yet
if
alarm
.
not_auto_yet
else
''
'notautoyetinfo'
:
alarm
.
not_auto_yet
if
alarm
.
not_auto_yet
else
''
,
'icube_alarminfo'
:
alarm
.
icube_alarminfo
if
alarm
.
icube_alarminfo
else
''
,
'other_alarminfo'
:
alarm
.
other_alarminfo
if
alarm
.
other_alarminfo
else
''
}
return
render_json
(
{
...
...
@@ -2395,6 +2401,8 @@ def edit_alarm(request):
cant_auto_info
=
data
[
'cantautoinfo'
]
not_auto_yet
=
data
[
'notautoyetinfo'
]
if_icube
=
data
[
'if_icube'
]
other_alarminfo
=
data
[
'other_alarminfo'
]
icube_alarminfo
=
data
[
'icube_alarminfo'
]
alarm_time
=
alarm_time
.
replace
(
'T'
,
' '
)
# alarm_time = alarm_time[0:-5]
alarm_time
=
datetime
.
datetime
.
strptime
(
alarm_time
,
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
...
...
@@ -2422,6 +2430,8 @@ def edit_alarm(request):
alarm
.
if_icube
=
if_icube
alarm
.
cant_auto_info
=
cant_auto_info
alarm
.
not_auto_yet
=
not_auto_yet
alarm
.
icube_alarminfo
=
icube_alarminfo
alarm
.
other_alarminfo
=
other_alarminfo
alarm
.
save
()
return
render_json
(
{
"result"
:
True
,
...
...
@@ -2500,7 +2510,7 @@ def create_alarm_by_icube(request):
alarm_system
=
[
system
.
systemname
]
error_alarm
=
Error_alarm
.
objects
.
create
(
alarm_number
=
alarm_number
,
alarm_summary
=
i
[
'alarm_info'
]
,
alarm_summary
=
''
,
alarm_level
=
''
,
alarm_system
=
alarm_system
,
alarm_happen_time
=
alarm_time
,
...
...
@@ -2513,8 +2523,9 @@ def create_alarm_by_icube(request):
auto_name
=
''
,
other_autoname
=
''
,
monitor_name
=
''
,
if_icube
=
'8'
,
user
=
login_person
if_icube
=
'1'
,
user
=
login_person
,
icube_alarminfo
=
i
[
'alarm_info'
],
)
error_alarm
.
save
()
return
render_json
(
...
...
templates/event_analysis/alarm_edit.html
View file @
39618130
...
...
@@ -150,18 +150,18 @@
<el-form-item
label=
"监控类别:"
label-width=
"200px"
class=
"normal"
>
<el-select
v-model=
"formLine.monitor_name"
clearable
filterable
style=
"width:200px;"
:disabled=
"editStatus"
>
<el-option
v-for=
"item in
monitor_info
"
<el-option
v-for=
"item in
alarmType
"
:key=
"item.value"
:label=
"item.label"
:value=
"item.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"
告警是否来自一体化平台:"
class=
"normal"
label-width=
"200px
"
>
<el-
radio-group
style=
"margin-left: 5px;"
v-model=
"formLine.if_icube"
>
<el-radio
:label=
"8"
>
是
</el-radio
>
<el-radio
:label=
"9"
>
否
</el-radio
>
<
/el-radio-group
>
<el-form-item
label=
"
一体化平台告警信息"
label-width=
"140px"
class=
"normal"
v-if=
"icube_show
"
>
<el-
input
v-model=
"formLine.icube_alarminfo"
:disabled=
"flag"
></el-input
>
</el-form-item
>
<el-form-item
label=
"其他告警/监控信息"
label-width=
"140px"
class=
"normal"
v-if=
"other_show"
>
<
el-input
v-model=
"formLine.other_alarminfo"
></el-input
>
</el-form-item>
</el-form>
<el-row
style=
"margin-top: 10px"
>
...
...
@@ -196,12 +196,12 @@
{
label
:
'
中
'
,
value
:
'
2
'
},
{
label
:
'
高
'
,
value
:
'
3
'
}
],
//事件类型
eventType
:
[
{
label
:
'
严重
'
,
value
:
'
1
'
},
{
label
:
'
主要
'
,
value
:
'
2
'
},
{
label
:
'
次要
'
,
value
:
'
2
'
},
]
};
var
formatToId
=
function
(
item
,
itemArray
)
{
for
(
let
i
of
itemArray
)
{
...
...
@@ -231,7 +231,14 @@
options
:
[],
tabelshowData
:
[]
},
alarmType
:
[
{
label
:
'
基础监控
'
,
value
:
'
1
'
},
{
label
:
'
自定义监控
'
,
value
:
'
2
'
},
{
label
:
'
智能运维监控
'
,
value
:
'
3
'
},
],
systemListCmdb
:[],
icube_show
:
false
,
other_show
:
true
,
errorMachine
:
[],
machineBiz
:
""
,
machineListFlag
:
1
,
...
...
@@ -283,6 +290,7 @@
selectData
:
[],
gridData
:
[],
alarmDisplay
:
[],
flag
:
true
,
formLine
:
{
alarm_type
:
''
,
alarm_system
:[],
...
...
@@ -300,6 +308,8 @@
notautoyetinfo
:
''
,
monitor_name
:
''
,
if_icube
:
''
,
icube_alarminfo
:
''
,
other_alarminfo
:
''
},
editStatus
:
false
,
dealerStatus
:
true
,
...
...
@@ -321,6 +331,13 @@
}
else
{
this
.
showStatus
=
true
}
if
(
data
.
if_icube
==
1
)
{
this
.
icube_show
=
true
this
.
other_show
=
false
}
else
{
this
.
icube_show
=
false
this
.
other_show
=
true
}
//data.urgency_degree = formatToId(data.urgency_degree, keyArray.influenceLevel)
//data.priority = formatToId(data.priority, keyArray.priority)
//data.event_type = formatToId(data.event_type, keyArray.eventType)
...
...
事件信息.xls
View file @
39618130
No preview for this file type
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