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
96ff4459
Commit
96ff4459
authored
Nov 06, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
告警模块
parent
ac4ade89
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
185 additions
and
137 deletions
+185
-137
alarm-list.component.html
...ain/webapp/app/alarm/alarm-list/alarm-list.component.html
+18
-0
basic-edit.component.html
...ain/webapp/app/modal/basic-edit/basic-edit.component.html
+47
-28
basic-edit.component.ts
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
+120
-109
No files found.
src/main/webapp/app/alarm/alarm-list/alarm-list.component.html
View file @
96ff4459
...
...
@@ -24,4 +24,21 @@
<span>
当前告警数:120
</span>
</div>
</div>
<div>
<nz-select
style=
"width: 200px;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择级别"
[(
ngModel
)]="
selectedValue
"
(
ngModelChange
)="
select
()"
>
<nz-option
nzLabel=
"按设备类型展开"
nzValue=
"type"
></nz-option>
<nz-option
nzLabel=
"按资源分组展开"
nzValue=
"group"
></nz-option>
</nz-select>
<nz-select
style=
"width: 200px;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择分组"
[(
ngModel
)]="
selectedValue
"
(
ngModelChange
)="
select
()"
>
<nz-option
nzLabel=
"按设备类型展开"
nzValue=
"type"
></nz-option>
<nz-option
nzLabel=
"按资源分组展开"
nzValue=
"group"
></nz-option>
</nz-select>
<nz-select
style=
"width: 200px;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择资源类型"
[(
ngModel
)]="
selectedValue
"
(
ngModelChange
)="
select
()"
>
<nz-option
nzLabel=
"按设备类型展开"
nzValue=
"type"
></nz-option>
<nz-option
nzLabel=
"按资源分组展开"
nzValue=
"group"
></nz-option>
</nz-select>
<nz-radio-group
[(
ngModel
)]="
itemTypeValue
"
[
nzButtonStyle
]="'
solid
'"
>
<label
*
ngFor=
"let item of itemTypeList"
(
click
)="
changeType
(
item
.
applicationid
)"
nz-radio-button
nzValue=
"{{item.applicationid}}"
>
{{item.name}}
</label>
</nz-radio-group>
</div>
<smart-warn-list
#
warnList
></smart-warn-list>
\ No newline at end of file
src/main/webapp/app/modal/basic-edit/basic-edit.component.html
View file @
96ff4459
<!--添加资源-->
<nz-modal
[
nzWidth
]="
980
"
[
nzFooter
]="
null
"
[(
nzVisible
)]="
isBasicEdit
"
nzTitle=
"{{modalTitle}}"
(
nzOnCancel
)="
handleEditCancel
()"
(
nzOnOk
)="
handEditleOk
()"
>
<nz-modal
[
nzWidth
]="
1080
"
[
nzFooter
]="
null
"
[(
nzVisible
)]="
isBasicEdit
"
nzTitle=
"{{modalTitle}}"
(
nzOnCancel
)="
handleEditCancel
()"
(
nzOnOk
)="
handEditleOk
()"
>
<nz-tabset
[
nzSelectedIndex
]="
tabNum
"
style=
"padding-bottom: 25px;min-height: 500px"
>
<nz-tab
nzTitle=
"资源信息"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"equipmentType"
>
设备类型
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"equipmentType"
>
设备类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"equipmentType"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择设备类型"
[(
ngModel
)]="
validateForm
.
hostExtend
.
equipmentType
"
>
<nz-select
name=
"equipmentType"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择设备类型"
[(
ngModel
)]="
validateForm
.
hostExtend
.
equipmentType
"
>
<nz-option
nzValue=
"存储"
nzLabel=
"存储"
></nz-option>
<nz-option
nzValue=
"交换机"
nzLabel=
"交换机"
></nz-option>
<nz-option
nzValue=
"服务器"
nzLabel=
"服务器"
></nz-option>
...
...
@@ -26,7 +29,8 @@
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"os"
>
操作系统
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"os"
nz-input
placeholder=
"操作系统"
name=
"inventory_os"
[(
ngModel
)]="
validateForm
.
inventory
.
os
"
>
<input
id=
"os"
nz-input
placeholder=
"操作系统"
name=
"inventory_os"
[(
ngModel
)]="
validateForm
.
inventory
.
os
"
>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -35,9 +39,11 @@
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
二级类型
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
二级类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"secondLevelType"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择二级类型"
[(
ngModel
)]="
validateForm
.
hostExtend
.
secondLevelType
"
>
<nz-select
name=
"secondLevelType"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择二级类型"
[(
ngModel
)]="
validateForm
.
hostExtend
.
secondLevelType
"
>
<nz-option
nzValue=
"存储"
nzLabel=
"存储"
></nz-option>
<nz-option
nzValue=
"交换机"
nzLabel=
"交换机"
></nz-option>
<nz-option
nzValue=
"服务器"
nzLabel=
"服务器"
></nz-option>
...
...
@@ -55,7 +61,8 @@
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"name"
>
厂商
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"inventory_name"
nz-input
placeholder=
"厂商"
name=
"inventory_name"
[(
ngModel
)]="
validateForm
.
inventory
.
name
"
>
<input
id=
"inventory_name"
nz-input
placeholder=
"厂商"
name=
"inventory_name"
[(
ngModel
)]="
validateForm
.
inventory
.
name
"
>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -75,7 +82,8 @@
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialno_a"
>
产品序列号
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"serialno_a"
nz-input
placeholder=
"产品序列号"
name=
"inventory_serialno_a"
[(
ngModel
)]="
validateForm
.
inventory
.
serialno_a
"
>
<input
id=
"serialno_a"
nz-input
placeholder=
"产品序列号"
name=
"inventory_serialno_a"
[(
ngModel
)]="
validateForm
.
inventory
.
serialno_a
"
>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -98,19 +106,21 @@
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
关联业务
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"serviceid"
[(
ngModel
)]="
validateForm
.
hostExtend
.
serviceid
"
nzPlaceHolder=
"无关联业务"
>
<nz-select
name=
"serviceid"
[(
ngModel
)]="
validateForm
.
hostExtend
.
serviceid
"
nzPlaceHolder=
"无关联业务"
>
<nz-option
nzValue=
""
nzLabel=
"无"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
添加接口
</nz-form-label>
<nz-form-control
[
nzSpan
]="
20
"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<ng-container
*
ngFor=
"let item of interfaceslist;let i = index;"
>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<nz-select
name=
"main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
item
.
main
"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<nz-select
name=
"main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
item
.
main
"
(
ngModelChange
)="
changeMain
(
i
)"
>
<nz-option
nzValue=
"1"
nzLabel=
"默认"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"不默认"
></nz-option>
</nz-select>
...
...
@@ -121,8 +131,9 @@
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<input
type=
"text"
placeholder=
"DNS名称"
nz-input
name=
"dns"
[(
ngModel
)]="
item
.
dns
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-select
name=
"type"
nzPlaceHolder=
"连接类型"
[(
ngModel
)]="
item
.
type
"
(
ngModelChange
)="
changePort
(
i
)"
>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<nz-select
name=
"type"
nzPlaceHolder=
"连接类型"
[(
ngModel
)]="
item
.
type
"
(
ngModelChange
)="
changePort
(
i
)"
>
<nz-option
nzValue=
"1"
nzLabel=
"agent代理程序接口"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"SNMP接口"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"JMX接口"
></nz-option>
...
...
@@ -132,14 +143,14 @@
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<input
type=
"text"
placeholder=
"端口"
nz-input
name=
"port"
[(
ngModel
)]="
item
.
port
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<label
nz-checkbox
[(
ngModel
)]="
checked
"
>
使用大量请求
</label>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
*
ngIf=
"item.type == 2
"
>
<label
nz-checkbox
[(
ngModel
)]="
item
.
bulk
"
>
使用大量请求
</label>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<span
class=
"cursor"
(
click
)="
deleteInterfaces
(
i
)"
>
X
</span>
</nz-form-control>
</ng-container>
</div>
</ng-container>
<button
nz-button
(
click
)="
addInterfaces
()"
nzType=
"default"
>
添加
</button>
</nz-form-control>
</nz-form-item>
...
...
@@ -156,8 +167,10 @@
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"templates"
>
监控策略
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"templates"
style=
"width: 100%"
[(
ngModel
)]="
validateForm
.
templates
"
[
nzSize
]="
nzSize
"
nzMode=
"tags"
nzPlaceHolder=
"选择监控策略"
>
<nz-option
*
ngFor=
"let option of tempList"
[
nzLabel
]="
option
.
name
"
[
nzValue
]="
option
.
templateid
"
></nz-option>
<nz-select
name=
"templates"
style=
"width: 100%"
[(
ngModel
)]="
validateForm
.
templates
"
[
nzSize
]="
nzSize
"
nzMode=
"tags"
nzPlaceHolder=
"选择监控策略"
>
<nz-option
*
ngFor=
"let option of tempList"
[
nzLabel
]="
option
.
name
"
[
nzValue
]="
option
.
templateid
"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
...
...
@@ -176,9 +189,11 @@
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzFor=
"ipmi_authtype"
>
认证算法
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzFor=
"ipmi_authtype"
>
认证算法
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
style=
"width: 200px;"
name=
"ipmi_authtype"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择设备类型"
[(
ngModel
)]="
validateForm
.
ipmi_authtype
"
>
<nz-select
style=
"width: 200px;"
name=
"ipmi_authtype"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择设备类型"
[(
ngModel
)]="
validateForm
.
ipmi_authtype
"
>
<nz-option
nzValue=
"-1"
nzLabel=
"默认"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"无"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"MD2"
></nz-option>
...
...
@@ -195,7 +210,8 @@
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"ipmi_username"
>
用户名称
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"ipmi_username"
name=
"ipmi_username"
nz-input
placeholder=
"用户名称"
[(
ngModel
)]="
validateForm
.
ipmi_username
"
>
<input
id=
"ipmi_username"
name=
"ipmi_username"
nz-input
placeholder=
"用户名称"
[(
ngModel
)]="
validateForm
.
ipmi_username
"
>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -204,9 +220,11 @@
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzFor=
"ipmi_privilege"
>
优先权层级
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzFor=
"ipmi_privilege"
>
优先权层级
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"ipmi_privilege"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择设备类型"
[(
ngModel
)]="
validateForm
.
ipmi_privilege
"
>
<nz-select
name=
"ipmi_privilege"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择设备类型"
[(
ngModel
)]="
validateForm
.
ipmi_privilege
"
>
<nz-option
nzValue=
"1"
nzLabel=
"回调"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"用户"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"操作者"
></nz-option>
...
...
@@ -221,7 +239,8 @@
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"ipmi_password"
>
密码
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"ipmi_password"
name=
"ipmi_password"
nz-input
placeholder=
"密码"
[(
ngModel
)]="
validateForm
.
ipmi_password
"
>
<input
id=
"ipmi_password"
name=
"ipmi_password"
nz-input
placeholder=
"密码"
[(
ngModel
)]="
validateForm
.
ipmi_password
"
>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -231,7 +250,7 @@
</nz-collapse>
<nz-collapse>
<nz-collapse-panel
[
nzHeader
]="
panel2
.
name
"
[
nzActive
]="
panel2
.
active
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
...
...
@@ -270,7 +289,7 @@
<button
nz-button
(
click
)="
addMacro
()"
nzType=
"default"
>
添加
</button>
</div>
<div
*
ngIf=
"macroTYpe == 'macroExpand'"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
宏
</div>
...
...
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
View file @
96ff4459
...
...
@@ -4,8 +4,8 @@ import {
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
OverAllService
}
from
"../../overAll/overAll.service"
;
import
{
NzMessageService
}
from
"ng-zorro-antd"
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-basic-edit'
,
...
...
@@ -18,8 +18,8 @@ export class BasicEditComponent implements OnInit {
nzSize
=
'large'
;
hostId
;
//主机ID
style
=
{
display
:
'block'
,
height
:
'30px'
,
display
:
'block'
,
height
:
'30px'
,
lineHeight
:
'30px'
};
radioValue
;
...
...
@@ -30,85 +30,87 @@ export class BasicEditComponent implements OnInit {
groupList
=
[];
//折叠面板
panel1
=
{
name
:
'配置IPMI'
,
active
:
true
};
panel2
=
{
name
:
'配置宏'
,
active
:
true
};
panel1
=
{
name
:
'配置IPMI'
,
active
:
true
};
panel2
=
{
name
:
'配置宏'
,
active
:
true
};
//加密
otherHost
;
isBasicEdit
=
false
;
tabNum
:
number
;
//tabs面板的序列号
tabNum
:
number
;
//tabs面板的序列号
macroList
=
[
//配置宏数组
{
macro
:
'{$SNMP_COMMUNITY}'
,
value
:
'public'
,
macro
:
'{$SNMP_COMMUNITY}'
,
value
:
'public'
,
}
];
interfaceslist
=
[
{
main
:
'1'
,
ip
:
''
,
dns
:
''
,
type
:
'1'
,
port
:
'10050'
,
useip
:
1
,
main
:
'1'
,
ip
:
''
,
dns
:
''
,
type
:
'1'
,
port
:
'10050'
,
useip
:
1
,
bulk
:
0
,
}
];
//接口数组
macroTYpe
=
'macro'
;
//宏tabs
mainHost
=
'hostType1'
;
//主机tabs
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
private
message
:
NzMessageService
)
{
}
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
this
.
tabNum
=
0
;
// this.isBasicEdit = true;
this
.
validateForm
=
{
this
.
validateForm
=
{
groups
:
[],
hostExtend
:
{
hostExtend
:
{
equipmentType
:
null
,
secondLevelType
:
null
,
serviceid
:
""
serviceid
:
''
},
macros
:
this
.
macroList
,
interfaces
:
this
.
interfaceslist
,
//接口
inventory
:
{
os
:
null
,
name
:
null
,
serialno_a
:
null
macros
:
this
.
macroList
,
interfaces
:
this
.
interfaceslist
,
//接口
inventory
:
{
os
:
null
,
name
:
null
,
serialno_a
:
null
},
templates
:
[],
templates
:
[],
name
:
null
,
host
:
null
,
ipmi_authtype
:
null
,
ipmi_username
:
null
,
ipmi_privilege
:
null
,
ipmi_password
:
null
,
tls_psk_identity
:
null
,
tls_issuer
:
null
,
tls_subject
:
null
,
tls_psk
:
null
,
}
ipmi_authtype
:
null
,
ipmi_username
:
null
,
ipmi_privilege
:
null
,
ipmi_password
:
null
,
tls_psk_identity
:
null
,
tls_issuer
:
null
,
tls_subject
:
null
,
tls_psk
:
null
,
};
}
//新增
showModal
(
hostId
,
name
,
gId
):
void
{
showModal
(
hostId
,
name
,
gId
):
void
{
this
.
groupList
=
[];
if
(
gId
)
{
if
(
gId
)
{
const
gObj
=
{
label
:
name
,
value
:
gId
,
checked
:
true
label
:
name
,
value
:
gId
,
checked
:
true
};
this
.
groupList
.
push
(
gObj
);
}
else
{
}
else
{
this
.
overAllSer
.
getgroups
({}).
subscribe
(
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
const
gObj
=
{
label
:
res
.
data
[
i
].
name
,
value
:
res
.
data
[
i
].
groupid
,
checked
:
false
label
:
res
.
data
[
i
].
name
,
value
:
res
.
data
[
i
].
groupid
,
checked
:
false
};
this
.
groupList
.
push
(
gObj
);
}
}
)
);
}
this
.
modalTitle
=
'添加资源'
;
...
...
@@ -116,53 +118,53 @@ export class BasicEditComponent implements OnInit {
this
.
tabNum
=
0
;
this
.
isBasicEdit
=
true
;
this
.
getTemplate
();
this
.
validateForm
=
{
this
.
validateForm
=
{
groups
:
[],
hostExtend
:{
hostExtend
:
{
equipmentType
:
null
,
secondLevelType
:
null
,
serviceid
:
""
serviceid
:
''
},
macros
:
this
.
macroList
,
interfaces
:
this
.
interfaceslist
,
//接口
inventory
:{
os
:
null
,
name
:
null
,
serialno_a
:
null
macros
:
this
.
macroList
,
interfaces
:
this
.
interfaceslist
,
//接口
inventory
:
{
os
:
null
,
name
:
null
,
serialno_a
:
null
},
templates
:[],
templates
:
[],
name
:
null
,
host
:
null
,
ipmi_authtype
:
null
,
ipmi_username
:
null
,
ipmi_privilege
:
null
,
ipmi_password
:
null
,
tls_psk_identity
:
null
,
tls_issuer
:
null
,
tls_subject
:
null
,
tls_psk
:
null
,
}
ipmi_authtype
:
null
,
ipmi_username
:
null
,
ipmi_privilege
:
null
,
ipmi_password
:
null
,
tls_psk_identity
:
null
,
tls_issuer
:
null
,
tls_subject
:
null
,
tls_psk
:
null
,
}
;
}
//编辑
editModal
(
hostId
,
name
,
gId
):
void
{
editModal
(
hostId
,
name
,
gId
):
void
{
this
.
groupList
=
[];
if
(
gId
)
{
if
(
gId
)
{
const
gObj
=
{
label
:
name
,
value
:
gId
,
checked
:
true
label
:
name
,
value
:
gId
,
checked
:
true
};
this
.
groupList
.
push
(
gObj
);
}
else
{
}
else
{
this
.
overAllSer
.
getgroups
({}).
subscribe
(
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
const
gObj
=
{
label
:
res
.
data
[
i
].
name
,
value
:
res
.
data
[
i
].
groupid
,
checked
:
false
label
:
res
.
data
[
i
].
name
,
value
:
res
.
data
[
i
].
groupid
,
checked
:
false
};
this
.
groupList
.
push
(
gObj
);
}
}
)
)
;
}
this
.
hostId
=
hostId
;
...
...
@@ -171,39 +173,39 @@ export class BasicEditComponent implements OnInit {
this
.
isBasicEdit
=
true
;
this
.
getTemplate
();
this
.
overAllSer
.
findDetailed
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
validateForm
=
res
.
data
[
0
];
this
.
validateForm
.
ipmi_authtype
=
res
.
data
[
0
].
ipmi_authtype
+
""
;
this
.
validateForm
.
ipmi_privilege
=
res
.
data
[
0
].
ipmi_privilege
+
""
;
this
.
validateForm
.
ipmi_authtype
=
res
.
data
[
0
].
ipmi_authtype
+
''
;
this
.
validateForm
.
ipmi_privilege
=
res
.
data
[
0
].
ipmi_privilege
+
''
;
this
.
interfaceslist
=
res
.
data
[
0
].
interfaces
;
// console.log(this.validateForm);
// this.message.info(res.errMsg);
}
)
);
}
handEditleOk
():
void
{
//获取分组id
le
t
groupArr
=
[];
for
(
let
i
=
0
;
i
<
this
.
groupList
.
length
;
i
++
)
{
if
(
this
.
groupList
[
i
].
checked
==
true
)
{
const
groupid
=
{
"groupid"
:
this
.
groupList
[
i
].
value
}
cons
t
groupArr
=
[];
for
(
let
i
=
0
;
i
<
this
.
groupList
.
length
;
i
++
)
{
if
(
this
.
groupList
[
i
].
checked
==
true
)
{
const
groupid
=
{
'groupid'
:
this
.
groupList
[
i
].
value
};
groupArr
.
push
(
groupid
);
}
}
this
.
validateForm
.
groups
=
groupArr
;
this
.
overAllSer
.
createHost
(
this
.
validateForm
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isBasicEdit
=
false
;
}
this
.
done
.
emit
();
this
.
message
.
info
(
res
.
errMsg
);
},
(
err
)
=>
{
this
.
message
.
info
(
"系统错误"
);
(
err
)
=>
{
this
.
message
.
info
(
'系统错误'
);
}
)
)
;
}
handleEditCancel
():
void
{
...
...
@@ -211,61 +213,70 @@ export class BasicEditComponent implements OnInit {
}
//tabs切换
tabsChange
(
num
){
console
.
log
(
'tabs:'
+
num
);
tabsChange
(
num
)
{
console
.
log
(
'tabs:'
+
num
);
this
.
tabNum
=
num
;
}
//获取模版
getTemplate
(){
getTemplate
()
{
this
.
overAllSer
.
templates
().
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
tempList
=
res
.
apiResponse
.
data
;
}
)
);
}
//接口add
addInterfaces
(){
addInterfaces
()
{
const
demo
=
{
main
:
'1'
,
ip
:
''
,
dns
:
''
,
type
:
'1'
,
port
:
'10050'
,
useip
:
1
,
main
:
'0'
,
ip
:
''
,
dns
:
''
,
type
:
'1'
,
port
:
'10050'
,
useip
:
1
,
bulk
:
0
,
};
this
.
interfaceslist
.
push
(
demo
);
}
deleteInterfaces
(
index
){
this
.
interfaceslist
.
splice
(
index
,
1
);
deleteInterfaces
(
index
)
{
this
.
interfaceslist
.
splice
(
index
,
1
);
}
// agent:10050
// SNMP:161
// JMX:12345
// IPMI:623
changePort
(
index
){
console
.
log
(
this
.
interfaceslist
);
switch
(
this
.
interfaceslist
[
index
].
type
){
case
'1'
:{
// agent:10050 SNMP:161 JMX:12345 IPMI:623
changePort
(
index
)
{
switch
(
this
.
interfaceslist
[
index
].
type
)
{
case
'1'
:
{
this
.
interfaceslist
[
index
].
port
=
'10050'
;
break
;
}
case
'2'
:
{
case
'2'
:
{
this
.
interfaceslist
[
index
].
port
=
'161'
;
this
.
interfaceslist
[
index
].
bulk
=
1
;
break
;
}
case
'3'
:
{
case
'3'
:
{
this
.
interfaceslist
[
index
].
port
=
'12345'
;
break
;
}
case
'4'
:
{
case
'4'
:
{
this
.
interfaceslist
[
index
].
port
=
'623'
;
break
;
}
}
console
.
log
(
this
.
interfaceslist
);
}
//只能一个默认
changeMain
(
index
){
this
.
interfaceslist
.
forEach
(
res
=>
{
res
.
main
=
'0'
;
});
this
.
interfaceslist
[
index
].
main
=
'1'
;
console
.
log
(
this
.
interfaceslist
);
}
}
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