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
42703107
Commit
42703107
authored
May 13, 2020
by
Kerwin_Cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接cmdb系统
parent
f5d1998e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
event_analysis/urls.py
event_analysis/urls.py
+1
-0
event_analysis/views.py
event_analysis/views.py
+27
-0
templates/event_analysis/event_edit.html
templates/event_analysis/event_edit.html
+10
-2
No files found.
event_analysis/urls.py
View file @
42703107
...
...
@@ -40,4 +40,5 @@ urlpatterns = [
url
(
r'^search_user_group/$'
,
search_user_group
),
url
(
r'^alarm_count_info/$'
,
alarm_count_info
),
url
(
r'^monitor_excel/$'
,
monitor_excel
),
url
(
r'^system_cmdb/$'
,
system_cmdb
),
]
event_analysis/views.py
View file @
42703107
...
...
@@ -2667,6 +2667,33 @@ def monitor_excel(request):
)
def
system_cmdb
(
request
):
try
:
sys_data
=
requests
.
get
(
'http://192.168.1.246:8001/webapi/moduleInstances/108?pageNum=1&pageSize=500'
)
sys_data
=
sys_data
.
text
sys_data
=
json
.
loads
(
sys_data
)
sys_data
=
sys_data
[
'data'
][
'list'
]
systemList
=
[]
for
i
in
sys_data
:
newdic
=
{}
newdic
[
'label'
]
=
i
[
u'名称'
]
newdic
[
'value'
]
=
i
[
u'名称'
]
systemList
.
append
(
newdic
)
return
render_json
({
"result"
:
True
,
"code"
:
0
,
"message"
:
u"搜索成功"
,
"data"
:
systemList
})
except
Exception
as
e
:
return
render_json
(
{
"result"
:
False
,
"code"
:
1
,
"message"
:
u"未知错误:
%
s"
%
e
,
"data"
:
{}
}
)
# 同步事件
def
sync
(
request
):
...
...
templates/event_analysis/event_edit.html
View file @
42703107
...
...
@@ -69,7 +69,7 @@
<div>
<el-form-item
label=
"故障系统"
label-width=
"97px"
class=
"normal"
style=
"display:inline-block;"
>
<el-select
v-model=
"formLine.failure_sys_name"
clearable
filterable
style=
"width:200px;"
:disabled=
"editStatus"
>
<el-option
v-for=
"item in systemList"
<el-option
v-for=
"item in systemList
Cmdb
"
:key=
"item.value"
:label=
"item.label"
:value=
"item.label"
>
...
...
@@ -81,7 +81,7 @@
style=
"display:inline-block;"
>
<el-select
v-model=
"formLine.influenced_sys_name"
multiple
filterable
style=
"width:210px;"
:disabled=
"editStatus"
>
<el-option
v-for=
"item in systemList"
<el-option
v-for=
"item in systemList
Cmdb
"
:key=
"item.value"
:label=
"item.label"
:value=
"item.label"
></el-option>
...
...
@@ -781,6 +781,7 @@ var unique= function (array) {
partAlarmList
:
[],
// 具体指标
preliminaryAnalysisOptions
:
[],
//事件初步原因列表
systemList
:
[],
systemListCmdb
:[],
labelList
:
[],
eventTypeOp
:
keyArray
.
eventType
,
urgency_degreeOp
:
keyArray
.
influenceLevel
,
...
...
@@ -930,6 +931,7 @@ var unique= function (array) {
this
.
getSystem
()
this
.
getAlarmTitle
()
this
.
getLabel
()
this
.
system_cmdb
()
},
computed
:
{
...
...
@@ -1158,6 +1160,12 @@ var unique= function (array) {
this
.
systemList
=
res
})
},
system_cmdb
(){
axios
.
get
(
'
${SITE_URL}system_cmdb/
'
).
then
(
res
=>
{
res
=
res
.
data
this
.
systemListCmdb
=
res
})
},
getAlarmInfo
()
{
let
vm
=
this
vm
.
alarmDisplay
=
[]
...
...
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