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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
322 additions
and
274 deletions
+322
-274
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
+139
-120
basic-edit.component.ts
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
+165
-154
No files found.
src/main/webapp/app/alarm/alarm-list/alarm-list.component.html
View file @
96ff4459
...
@@ -24,4 +24,21 @@
...
@@ -24,4 +24,21 @@
<span>
当前告警数:120
</span>
<span>
当前告警数:120
</span>
</div>
</div>
</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>
<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-tabset
[
nzSelectedIndex
]="
tabNum
"
style=
"padding-bottom: 25px;min-height: 500px"
>
<nz-tab
nzTitle=
"资源信息"
>
<nz-tab
nzTitle=
"资源信息"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<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-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>
<nz-option
nzValue=
"交换机"
nzLabel=
"交换机"
></nz-option>
<nz-option
nzValue=
"服务器"
nzLabel=
"服务器"
></nz-option>
<nz-option
nzValue=
"服务器"
nzLabel=
"服务器"
></nz-option>
...
@@ -26,7 +29,8 @@
...
@@ -26,7 +29,8 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"os"
>
操作系统
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"os"
>
操作系统
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<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-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -34,31 +38,34 @@
...
@@ -34,31 +38,34 @@
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<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-control
[
nzSpan
]="
14
"
>
</nz-form-label>
<nz-select
name=
"secondLevelType"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择二级类型"
[(
ngModel
)]="
validateForm
.
hostExtend
.
secondLevelType
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-option
nzValue=
"存储"
nzLabel=
"存储"
></nz-option>
<nz-select
name=
"secondLevelType"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择二级类型"
<nz-option
nzValue=
"交换机"
nzLabel=
"交换机"
></nz-option>
[(
ngModel
)]="
validateForm
.
hostExtend
.
secondLevelType
"
>
<nz-option
nzValue=
"服务器"
nzLabel=
"服务器"
></nz-option>
<nz-option
nzValue=
"存储"
nzLabel=
"存储"
></nz-option>
<nz-option
nzValue=
"数据库"
nzLabel=
"数据库"
></nz-option>
<nz-option
nzValue=
"交换机"
nzLabel=
"交换机"
></nz-option>
<nz-option
nzValue=
"网络"
nzLabel=
"网络"
></nz-option>
<nz-option
nzValue=
"服务器"
nzLabel=
"服务器"
></nz-option>
<nz-option
nzValue=
"中间件"
nzLabel=
"中间件"
></nz-option>
<nz-option
nzValue=
"数据库"
nzLabel=
"数据库"
></nz-option>
<nz-option
nzValue=
"虚拟化"
nzLabel=
"虚拟化"
></nz-option>
<nz-option
nzValue=
"网络"
nzLabel=
"网络"
></nz-option>
<nz-option
nzValue=
"应用服务"
nzLabel=
"应用服务"
></nz-option>
<nz-option
nzValue=
"中间件"
nzLabel=
"中间件"
></nz-option>
</nz-select>
<nz-option
nzValue=
"虚拟化"
nzLabel=
"虚拟化"
></nz-option>
</nz-form-control>
<nz-option
nzValue=
"应用服务"
nzLabel=
"应用服务"
></nz-option>
</nz-form-item>
</nz-select>
</div>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"name"
>
厂商
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"name"
>
厂商
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<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"
</nz-form-control>
[(
ngModel
)]="
validateForm
.
inventory
.
name
"
>
</nz-form-item>
</nz-form-control>
</div>
</nz-form-item>
</div>
</div>
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
...
@@ -75,7 +82,8 @@
...
@@ -75,7 +82,8 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialno_a"
>
产品序列号
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"serialno_a"
>
产品序列号
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<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-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -96,21 +104,23 @@
...
@@ -96,21 +104,23 @@
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
关联业务
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
关联业务
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<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-option
nzValue=
""
nzLabel=
"无"
></nz-option>
</nz-select>
</nz-select>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
添加接口
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
>
添加接口
</nz-form-label>
<nz-form-control
[
nzSpan
]="
20
"
>
<nz-form-control
[
nzSpan
]="
20
"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<ng-container
*
ngFor=
"let item of interfaceslist;let i = index;"
>
<ng-container
*
ngFor=
"let item of interfaceslist;let i = index;"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<nz-select
name=
"main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
item
.
main
"
>
<nz-select
name=
"main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
item
.
main
"
(
ngModelChange
)="
changeMain
(
i
)"
>
<nz-option
nzValue=
"1"
nzLabel=
"默认"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"默认"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"不默认"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"不默认"
></nz-option>
</nz-select>
</nz-select>
...
@@ -121,8 +131,9 @@
...
@@ -121,8 +131,9 @@
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<input
type=
"text"
placeholder=
"DNS名称"
nz-input
name=
"dns"
[(
ngModel
)]="
item
.
dns
"
>
<input
type=
"text"
placeholder=
"DNS名称"
nz-input
name=
"dns"
[(
ngModel
)]="
item
.
dns
"
>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<nz-select
name=
"type"
nzPlaceHolder=
"连接类型"
[(
ngModel
)]="
item
.
type
"
(
ngModelChange
)="
changePort
(
i
)"
>
<nz-select
name=
"type"
nzPlaceHolder=
"连接类型"
[(
ngModel
)]="
item
.
type
"
(
ngModelChange
)="
changePort
(
i
)"
>
<nz-option
nzValue=
"1"
nzLabel=
"agent代理程序接口"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"agent代理程序接口"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"SNMP接口"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"SNMP接口"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"JMX接口"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"JMX接口"
></nz-option>
...
@@ -130,34 +141,36 @@
...
@@ -130,34 +141,36 @@
</nz-select>
</nz-select>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<input
type=
"text"
placeholder=
"端口"
nz-input
name=
"port"
[(
ngModel
)]="
item
.
port
"
>
<input
type=
"text"
placeholder=
"端口"
nz-input
name=
"port"
[(
ngModel
)]="
item
.
port
"
>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
*
ngIf=
"item.type == 2
"
>
<label
nz-checkbox
[(
ngModel
)]="
checked
"
>
使用大量请求
</label>
<label
nz-checkbox
[(
ngModel
)]="
item
.
bulk
"
>
使用大量请求
</label>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<span
class=
"cursor"
(
click
)="
deleteInterfaces
(
i
)"
>
X
</span>
<span
class=
"cursor"
(
click
)="
deleteInterfaces
(
i
)"
>
X
</span>
</nz-form-control>
</nz-form-control>
</
ng-container
>
</
div
>
</
div
>
</
ng-container
>
<button
nz-button
(
click
)="
addInterfaces
()"
nzType=
"default"
>
添加
</button>
<button
nz-button
(
click
)="
addInterfaces
()"
nzType=
"default"
>
添加
</button>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"test3"
>
由agent代理程序检测
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"test3"
>
由agent代理程序检测
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"test3"
name=
"test3"
nzPlaceHolder=
"无agen代理程序"
>
<nz-select
name=
"test3"
name=
"test3"
nzPlaceHolder=
"无agen代理程序"
>
<nz-option
nzValue=
""
nzLabel=
"无agen代理程序"
></nz-option>
<nz-option
nzValue=
""
nzLabel=
"无agen代理程序"
></nz-option>
</nz-select>
</nz-select>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"templates"
>
监控策略
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"templates"
>
监控策略
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"templates"
style=
"width: 100%"
[(
ngModel
)]="
validateForm
.
templates
"
[
nzSize
]="
nzSize
"
nzMode=
"tags"
nzPlaceHolder=
"选择监控策略"
>
<nz-select
name=
"templates"
style=
"width: 100%"
[(
ngModel
)]="
validateForm
.
templates
"
<nz-option
*
ngFor=
"let option of tempList"
[
nzLabel
]="
option
.
name
"
[
nzValue
]="
option
.
templateid
"
></nz-option>
[
nzSize
]="
nzSize
"
nzMode=
"tags"
nzPlaceHolder=
"选择监控策略"
>
<nz-option
*
ngFor=
"let option of tempList"
[
nzLabel
]="
option
.
name
"
[
nzValue
]="
option
.
templateid
"
></nz-option>
</nz-select>
</nz-select>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
...
@@ -171,14 +184,16 @@
...
@@ -171,14 +184,16 @@
<nz-tab
nzTitle=
"配置信息"
>
<nz-tab
nzTitle=
"配置信息"
>
<nz-collapse>
<nz-collapse>
<nz-collapse-panel
[
nzHeader
]="
panel1
.
name
"
[
nzActive
]="
panel1
.
active
"
>
<nz-collapse-panel
[
nzHeader
]="
panel1
.
name
"
[
nzActive
]="
panel1
.
active
"
>
<form
nz-form
class=
"ant-advanced-search-form"
>
<form
nz-form
class=
"ant-advanced-search-form"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<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-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=
"-1"
nzLabel=
"默认"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"无"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"无"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"MD2"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"MD2"
></nz-option>
...
@@ -195,7 +210,8 @@
...
@@ -195,7 +210,8 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"ipmi_username"
>
用户名称
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"ipmi_username"
>
用户名称
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<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-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -204,9 +220,11 @@
...
@@ -204,9 +220,11 @@
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<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-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=
"1"
nzLabel=
"回调"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"用户"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"用户"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"操作者"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"操作者"
></nz-option>
...
@@ -221,7 +239,8 @@
...
@@ -221,7 +239,8 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"ipmi_password"
>
密码
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"ipmi_password"
>
密码
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<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-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -230,8 +249,8 @@
...
@@ -230,8 +249,8 @@
</nz-collapse-panel>
</nz-collapse-panel>
</nz-collapse>
</nz-collapse>
<nz-collapse>
<nz-collapse>
<nz-collapse-panel
[
nzHeader
]="
panel2
.
name
"
[
nzActive
]="
panel2
.
active
"
>
<nz-collapse-panel
[
nzHeader
]="
panel2
.
name
"
[
nzActive
]="
panel2
.
active
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
...
@@ -243,7 +262,7 @@
...
@@ -243,7 +262,7 @@
</nz-form-item>
</nz-form-item>
</div>
</div>
</div>
</div>
<div
*
ngIf=
"macroTYpe == 'macro'"
>
<div
*
ngIf=
"macroTYpe == 'macro'"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
<div
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
宏
宏
...
@@ -255,13 +274,13 @@
...
@@ -255,13 +274,13 @@
<div
nz-row
*
ngFor=
"let item of macroList;let i = index;"
[
nzGutter
]="
24
"
>
<div
nz-row
*
ngFor=
"let item of macroList;let i = index;"
[
nzGutter
]="
24
"
>
<nz-form-control
[
nzOffset
]="
2
"
nz-col
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzOffset
]="
2
"
nz-col
[
nzSpan
]="
6
"
>
<input
nz-input
placeholder=
"{$SNMP_COMMUNITY}"
value=
"{{item.macro}}"
>
<input
nz-input
placeholder=
"{$SNMP_COMMUNITY}"
value=
"{{item.macro}}"
>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
1
"
>
<nz-form-control
nz-col
[
nzSpan
]="
1
"
>
=>
=>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<input
nz-input
placeholder=
"public"
value=
"{{item.value}}"
>
<input
nz-input
placeholder=
"public"
value=
"{{item.value}}"
>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<span
(
click
)="
deleteMacro
(
i
)"
>
移除
</span>
<span
(
click
)="
deleteMacro
(
i
)"
>
移除
</span>
...
@@ -269,8 +288,8 @@
...
@@ -269,8 +288,8 @@
</div>
</div>
<button
nz-button
(
click
)="
addMacro
()"
nzType=
"default"
>
添加
</button>
<button
nz-button
(
click
)="
addMacro
()"
nzType=
"default"
>
添加
</button>
</div>
</div>
<div
*
ngIf=
"macroTYpe == 'macroExpand'"
>
<div
*
ngIf=
"macroTYpe == 'macroExpand'"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
<div
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
宏
宏
</div>
</div>
...
@@ -290,13 +309,13 @@
...
@@ -290,13 +309,13 @@
</div>
</div>
<div
nz-row
[
nzGutter
]="
12
"
*
ngFor=
"let item of macroList"
>
<div
nz-row
[
nzGutter
]="
12
"
*
ngFor=
"let item of macroList"
>
<nz-form-control
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
<nz-form-control
nz-col
[
nzOffset
]="
2
"
[
nzSpan
]="
6
"
>
<input
nz-input
placeholder=
"{$SNMP_COMMUNITY}"
value=
"{{item.macro}}"
>
<input
nz-input
placeholder=
"{$SNMP_COMMUNITY}"
value=
"{{item.macro}}"
>
</nz-form-control>
</nz-form-control>
<div
nz-col
[
nzSpan
]="
1
"
>
<div
nz-col
[
nzSpan
]="
1
"
>
=>
=>
</div>
</div>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<input
nz-input
placeholder=
"public"
value=
"{{item.value}}"
>
<input
nz-input
placeholder=
"public"
value=
"{{item.value}}"
>
</nz-form-control>
</nz-form-control>
<div
nz-col
[
nzSpan
]="
3
"
>
<div
nz-col
[
nzSpan
]="
3
"
>
<button
nz-button
nzType=
"default"
>
更改
</button>
<button
nz-button
nzType=
"default"
>
更改
</button>
...
@@ -325,65 +344,65 @@
...
@@ -325,65 +344,65 @@
</nz-tab>
</nz-tab>
<!--<nz-tab nzTitle="加密">-->
<!--<nz-tab nzTitle="加密">-->
<!--<form nz-form class="ant-advanced-search-form">-->
<!--<form nz-form class="ant-advanced-search-form">-->
<!--<nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="host">连接主机</nz-form-label>-->
<!--<nz-form-label [nzSpan]="6" nzFor="host">连接主机</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-radio-group [(ngModel)] ="mainHost" name="mainHost">-->
<!--<nz-radio-group [(ngModel)] ="mainHost" name="mainHost">-->
<!--<label nz-radio-button nzValue="hostType1"><span>非加密</span></label>-->
<!--<label nz-radio-button nzValue="hostType1"><span>非加密</span></label>-->
<!--<label nz-radio-button nzValue="hostType2"><span>共享密钥(PSK)</span></label>-->
<!--<label nz-radio-button nzValue="hostType2"><span>共享密钥(PSK)</span></label>-->
<!--<label nz-radio-button nzValue="hostType3"><span>证书</span></label>-->
<!--<label nz-radio-button nzValue="hostType3"><span>证书</span></label>-->
<!--</nz-radio-group>-->
<!--</nz-radio-group>-->
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="host">从主机连接</nz-form-label>-->
<!--<nz-form-label [nzSpan]="6" nzFor="host">从主机连接</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-radio-group [(ngModel)]="otherHost" name="otherHost">-->
<!--<nz-radio-group [(ngModel)]="otherHost" name="otherHost">-->
<!--<label nz-radio [ngStyle]="style" nzValue="A">非加密</label>-->
<!--<label nz-radio [ngStyle]="style" nzValue="A">非加密</label>-->
<!--<label nz-radio [ngStyle]="style" nzValue="B">共享密钥(PSK)</label>-->
<!--<label nz-radio [ngStyle]="style" nzValue="B">共享密钥(PSK)</label>-->
<!--<label nz-radio [ngStyle]="style" nzValue="C">证书</label>-->
<!--<label nz-radio [ngStyle]="style" nzValue="C">证书</label>-->
<!--</nz-radio-group>-->
<!--</nz-radio-group>-->
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
<!--<ng-container *ngIf="mainHost == 'hostType2'">-->
<!--<ng-container *ngIf="mainHost == 'hostType2'">-->
<!--<nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_psk_identity">共享密钥一致性</nz-form-label>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_psk_identity">共享密钥一致性</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input type="text" name="tls_psk_identity" nz-input [(ngModel)]="tls_psk_identity">-->
<!--<input type="text" name="tls_psk_identity" nz-input [(ngModel)]="tls_psk_identity">-->
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_psk">共享密钥(PSK)</nz-form-label>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_psk">共享密钥(PSK)</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input type="text" nz-input name="tls_psk" [(ngModel)]="tls_psk">-->
<!--<input type="text" nz-input name="tls_psk" [(ngModel)]="tls_psk">-->
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
<!--</ng-container>-->
<!--</ng-container>-->
<!--<ng-container *ngIf="mainHost == 'hostType3'">-->
<!--<ng-container *ngIf="mainHost == 'hostType3'">-->
<!--<nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_issuer">发行者</nz-form-label>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_issuer">发行者</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input type="text" name="tls_issuer" nz-input [(ngModel)]="tls_issuer">-->
<!--<input type="text" name="tls_issuer" nz-input [(ngModel)]="tls_issuer">-->
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_subject">主体</nz-form-label>-->
<!--<nz-form-label [nzSpan]="6" nzFor="tls_subject">主体</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input type="text" name="tls_subject" nz-input [(ngModel)]="tls_subject">-->
<!--<input type="text" name="tls_subject" nz-input [(ngModel)]="tls_subject">-->
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
<!--</ng-container>-->
<!--</ng-container>-->
<!--</form>-->
<!--</form>-->
<!--<div class="modal-footer-btn">-->
<!--<div class="modal-footer-btn">-->
<!--<button nz-button (click)="handleEditCancel()" nzType="primary">取消</button>-->
<!--<button nz-button (click)="handleEditCancel()" nzType="primary">取消</button>-->
<!--<button nz-button (click)="tabsChange(1)" nzType="primary">上一步</button>-->
<!--<button nz-button (click)="tabsChange(1)" nzType="primary">上一步</button>-->
<!--<button nz-button (click)="handEditleOk()" nzType="primary">完成</button>-->
<!--<button nz-button (click)="handEditleOk()" nzType="primary">完成</button>-->
<!--</div>-->
<!--</div>-->
<!--</nz-tab>-->
<!--</nz-tab>-->
</nz-tabset>
</nz-tabset>
</nz-modal>
</nz-modal>
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
View file @
96ff4459
...
@@ -4,13 +4,13 @@ import {
...
@@ -4,13 +4,13 @@ import {
FormGroup
,
FormGroup
,
Validators
Validators
}
from
'@angular/forms'
;
}
from
'@angular/forms'
;
import
{
OverAllService
}
from
"../../overAll/overAll.service"
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
NzMessageService
}
from
"ng-zorro-antd"
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
@
Component
({
selector
:
'smart-basic-edit'
,
selector
:
'smart-basic-edit'
,
templateUrl
:
'./basic-edit.component.html'
,
templateUrl
:
'./basic-edit.component.html'
,
styles
:
[]
styles
:
[]
})
})
export
class
BasicEditComponent
implements
OnInit
{
export
class
BasicEditComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
string
>
();
@
Output
()
done
=
new
EventEmitter
<
string
>
();
...
@@ -18,8 +18,8 @@ export class BasicEditComponent implements OnInit {
...
@@ -18,8 +18,8 @@ export class BasicEditComponent implements OnInit {
nzSize
=
'large'
;
nzSize
=
'large'
;
hostId
;
//主机ID
hostId
;
//主机ID
style
=
{
style
=
{
display
:
'block'
,
display
:
'block'
,
height
:
'30px'
,
height
:
'30px'
,
lineHeight
:
'30px'
lineHeight
:
'30px'
};
};
radioValue
;
radioValue
;
...
@@ -30,139 +30,141 @@ export class BasicEditComponent implements OnInit {
...
@@ -30,139 +30,141 @@ export class BasicEditComponent implements OnInit {
groupList
=
[];
groupList
=
[];
//折叠面板
//折叠面板
panel1
=
{
name
:
'配置IPMI'
,
active
:
true
};
panel1
=
{
name
:
'配置IPMI'
,
active
:
true
};
panel2
=
{
name
:
'配置宏'
,
active
:
true
};
panel2
=
{
name
:
'配置宏'
,
active
:
true
};
//加密
//加密
otherHost
;
otherHost
;
isBasicEdit
=
false
;
isBasicEdit
=
false
;
tabNum
:
number
;
//tabs面板的序列号
tabNum
:
number
;
//tabs面板的序列号
macroList
=
[
//配置宏数组
macroList
=
[
//配置宏数组
{
{
macro
:
'{$SNMP_COMMUNITY}'
,
macro
:
'{$SNMP_COMMUNITY}'
,
value
:
'public'
,
value
:
'public'
,
}
}
];
];
interfaceslist
=
[
interfaceslist
=
[
{
{
main
:
'1'
,
main
:
'1'
,
ip
:
''
,
ip
:
''
,
dns
:
''
,
dns
:
''
,
type
:
'1'
,
type
:
'1'
,
port
:
'10050'
,
port
:
'10050'
,
useip
:
1
,
useip
:
1
,
bulk
:
0
,
}
}
];
//接口数组
];
//接口数组
macroTYpe
=
'macro'
;
//宏tabs
macroTYpe
=
'macro'
;
//宏tabs
mainHost
=
'hostType1'
;
//主机tabs
mainHost
=
'hostType1'
;
//主机tabs
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
private
message
:
NzMessageService
)
{
}
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
tabNum
=
0
;
this
.
tabNum
=
0
;
// this.isBasicEdit = true;
// this.isBasicEdit = true;
this
.
validateForm
=
{
this
.
validateForm
=
{
groups
:
[],
groups
:
[],
hostExtend
:
{
hostExtend
:
{
equipmentType
:
null
,
equipmentType
:
null
,
secondLevelType
:
null
,
secondLevelType
:
null
,
serviceid
:
""
serviceid
:
''
},
},
macros
:
this
.
macroList
,
macros
:
this
.
macroList
,
interfaces
:
this
.
interfaceslist
,
//接口
interfaces
:
this
.
interfaceslist
,
//接口
inventory
:
{
inventory
:
{
os
:
null
,
os
:
null
,
name
:
null
,
name
:
null
,
serialno_a
:
null
serialno_a
:
null
},
},
templates
:
[],
templates
:
[],
name
:
null
,
name
:
null
,
host
:
null
,
host
:
null
,
ipmi_authtype
:
null
,
ipmi_authtype
:
null
,
ipmi_username
:
null
,
ipmi_username
:
null
,
ipmi_privilege
:
null
,
ipmi_privilege
:
null
,
ipmi_password
:
null
,
ipmi_password
:
null
,
tls_psk_identity
:
null
,
tls_psk_identity
:
null
,
tls_issuer
:
null
,
tls_issuer
:
null
,
tls_subject
:
null
,
tls_subject
:
null
,
tls_psk
:
null
,
tls_psk
:
null
,
}
};
}
}
//新增
//新增
showModal
(
hostId
,
name
,
gId
):
void
{
showModal
(
hostId
,
name
,
gId
):
void
{
this
.
groupList
=
[];
this
.
groupList
=
[];
if
(
gId
)
{
if
(
gId
)
{
const
gObj
=
{
const
gObj
=
{
label
:
name
,
value
:
gId
,
checked
:
true
label
:
name
,
value
:
gId
,
checked
:
true
};
};
this
.
groupList
.
push
(
gObj
);
this
.
groupList
.
push
(
gObj
);
}
else
{
}
else
{
this
.
overAllSer
.
getgroups
({}).
subscribe
(
this
.
overAllSer
.
getgroups
({}).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
const
gObj
=
{
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
.
groupList
.
push
(
gObj
);
}
}
}
}
)
);
}
}
this
.
modalTitle
=
'添加资源'
;
this
.
modalTitle
=
'添加资源'
;
this
.
hostId
=
hostId
;
this
.
hostId
=
hostId
;
this
.
tabNum
=
0
;
this
.
tabNum
=
0
;
this
.
isBasicEdit
=
true
;
this
.
isBasicEdit
=
true
;
this
.
getTemplate
();
this
.
getTemplate
();
this
.
validateForm
=
{
this
.
validateForm
=
{
groups
:
[],
groups
:
[],
hostExtend
:{
hostExtend
:
{
equipmentType
:
null
,
equipmentType
:
null
,
secondLevelType
:
null
,
secondLevelType
:
null
,
serviceid
:
""
serviceid
:
''
},
},
macros
:
this
.
macroList
,
macros
:
this
.
macroList
,
interfaces
:
this
.
interfaceslist
,
//接口
interfaces
:
this
.
interfaceslist
,
//接口
inventory
:{
inventory
:
{
os
:
null
,
os
:
null
,
name
:
null
,
name
:
null
,
serialno_a
:
null
serialno_a
:
null
},
},
templates
:[],
templates
:
[],
name
:
null
,
name
:
null
,
host
:
null
,
host
:
null
,
ipmi_authtype
:
null
,
ipmi_authtype
:
null
,
ipmi_username
:
null
,
ipmi_username
:
null
,
ipmi_privilege
:
null
,
ipmi_privilege
:
null
,
ipmi_password
:
null
,
ipmi_password
:
null
,
tls_psk_identity
:
null
,
tls_psk_identity
:
null
,
tls_issuer
:
null
,
tls_issuer
:
null
,
tls_subject
:
null
,
tls_subject
:
null
,
tls_psk
:
null
,
tls_psk
:
null
,
}
}
;
}
}
//编辑
//编辑
editModal
(
hostId
,
name
,
gId
):
void
{
editModal
(
hostId
,
name
,
gId
):
void
{
this
.
groupList
=
[];
this
.
groupList
=
[];
if
(
gId
)
{
if
(
gId
)
{
const
gObj
=
{
const
gObj
=
{
label
:
name
,
value
:
gId
,
checked
:
true
label
:
name
,
value
:
gId
,
checked
:
true
};
};
this
.
groupList
.
push
(
gObj
);
this
.
groupList
.
push
(
gObj
);
}
else
{
}
else
{
this
.
overAllSer
.
getgroups
({}).
subscribe
(
this
.
overAllSer
.
getgroups
({}).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
const
gObj
=
{
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
.
groupList
.
push
(
gObj
);
}
}
}
}
)
)
;
}
}
this
.
hostId
=
hostId
;
this
.
hostId
=
hostId
;
...
@@ -171,39 +173,39 @@ export class BasicEditComponent implements OnInit {
...
@@ -171,39 +173,39 @@ export class BasicEditComponent implements OnInit {
this
.
isBasicEdit
=
true
;
this
.
isBasicEdit
=
true
;
this
.
getTemplate
();
this
.
getTemplate
();
this
.
overAllSer
.
findDetailed
(
this
.
hostId
).
subscribe
(
this
.
overAllSer
.
findDetailed
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
validateForm
=
res
.
data
[
0
];
this
.
validateForm
=
res
.
data
[
0
];
this
.
validateForm
.
ipmi_authtype
=
res
.
data
[
0
].
ipmi_authtype
+
""
;
this
.
validateForm
.
ipmi_authtype
=
res
.
data
[
0
].
ipmi_authtype
+
''
;
this
.
validateForm
.
ipmi_privilege
=
res
.
data
[
0
].
ipmi_privilege
+
""
;
this
.
validateForm
.
ipmi_privilege
=
res
.
data
[
0
].
ipmi_privilege
+
''
;
this
.
interfaceslist
=
res
.
data
[
0
].
interfaces
;
this
.
interfaceslist
=
res
.
data
[
0
].
interfaces
;
// console.log(this.validateForm);
// console.log(this.validateForm);
// this.message.info(res.errMsg);
// this.message.info(res.errMsg);
}
}
)
);
}
}
handEditleOk
():
void
{
handEditleOk
():
void
{
//获取分组id
//获取分组id
le
t
groupArr
=
[];
cons
t
groupArr
=
[];
for
(
let
i
=
0
;
i
<
this
.
groupList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
groupList
.
length
;
i
++
)
{
if
(
this
.
groupList
[
i
].
checked
==
true
)
{
if
(
this
.
groupList
[
i
].
checked
==
true
)
{
const
groupid
=
{
"groupid"
:
this
.
groupList
[
i
].
value
}
const
groupid
=
{
'groupid'
:
this
.
groupList
[
i
].
value
};
groupArr
.
push
(
groupid
);
groupArr
.
push
(
groupid
);
}
}
}
}
this
.
validateForm
.
groups
=
groupArr
;
this
.
validateForm
.
groups
=
groupArr
;
this
.
overAllSer
.
createHost
(
this
.
validateForm
).
subscribe
(
this
.
overAllSer
.
createHost
(
this
.
validateForm
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
isBasicEdit
=
false
;
this
.
isBasicEdit
=
false
;
}
}
this
.
done
.
emit
();
this
.
done
.
emit
();
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
info
(
res
.
errMsg
);
},
},
(
err
)
=>
{
(
err
)
=>
{
this
.
message
.
info
(
"系统错误"
);
this
.
message
.
info
(
'系统错误'
);
}
}
)
)
;
}
}
handleEditCancel
():
void
{
handleEditCancel
():
void
{
...
@@ -211,61 +213,70 @@ export class BasicEditComponent implements OnInit {
...
@@ -211,61 +213,70 @@ export class BasicEditComponent implements OnInit {
}
}
//tabs切换
//tabs切换
tabsChange
(
num
){
tabsChange
(
num
)
{
console
.
log
(
'tabs:'
+
num
);
console
.
log
(
'tabs:'
+
num
);
this
.
tabNum
=
num
;
this
.
tabNum
=
num
;
}
}
//获取模版
//获取模版
getTemplate
(){
getTemplate
()
{
this
.
overAllSer
.
templates
().
subscribe
(
this
.
overAllSer
.
templates
().
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
tempList
=
res
.
apiResponse
.
data
;
this
.
tempList
=
res
.
apiResponse
.
data
;
}
}
)
);
}
}
//接口add
//接口add
addInterfaces
(){
addInterfaces
()
{
const
demo
=
{
const
demo
=
{
main
:
'1'
,
main
:
'0'
,
ip
:
''
,
ip
:
''
,
dns
:
''
,
dns
:
''
,
type
:
'1'
,
type
:
'1'
,
port
:
'10050'
,
port
:
'10050'
,
useip
:
1
,
useip
:
1
,
bulk
:
0
,
};
};
this
.
interfaceslist
.
push
(
demo
);
this
.
interfaceslist
.
push
(
demo
);
}
}
deleteInterfaces
(
index
){
deleteInterfaces
(
index
)
{
this
.
interfaceslist
.
splice
(
index
,
1
);
this
.
interfaceslist
.
splice
(
index
,
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'
:
{
this
.
interfaceslist
[
index
].
port
=
'161'
;
this
.
interfaceslist
[
index
].
bulk
=
1
;
break
;
}
case
'3'
:
{
this
.
interfaceslist
[
index
].
port
=
'12345'
;
break
;
}
case
'4'
:
{
this
.
interfaceslist
[
index
].
port
=
'623'
;
break
;
}
}
console
.
log
(
this
.
interfaceslist
);
}
}
// agent:10050
//只能一个默认
// SNMP:161
changeMain
(
index
){
// JMX:12345
this
.
interfaceslist
.
forEach
(
res
=>
{
// IPMI:623
res
.
main
=
'0'
;
changePort
(
index
){
});
console
.
log
(
this
.
interfaceslist
);
this
.
interfaceslist
[
index
].
main
=
'1'
;
switch
(
this
.
interfaceslist
[
index
].
type
){
console
.
log
(
this
.
interfaceslist
);
case
'1'
:{
this
.
interfaceslist
[
index
].
port
=
'10050'
;
break
;
}
case
'2'
:{
this
.
interfaceslist
[
index
].
port
=
'161'
;
break
;
}
case
'3'
:{
this
.
interfaceslist
[
index
].
port
=
'12345'
;
break
;
}
case
'4'
:{
this
.
interfaceslist
[
index
].
port
=
'623'
;
break
;
}
}
}
}
}
}
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