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
33ab7b9a
Commit
33ab7b9a
authored
Jan 11, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
template
parent
2da51acc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
34 deletions
+45
-34
discovery.component.ts
src/main/webapp/app/modal/discovery/discovery.component.ts
+2
-7
flow-trend.component.ts
...webapp/app/netTopology/flow-trend/flow-trend.component.ts
+0
-0
line.component.ts
src/main/webapp/app/netTopology/model/line/line.component.ts
+7
-7
topology.service.ts
src/main/webapp/app/netTopology/topology.service.ts
+5
-0
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+3
-3
discovery-list.component.html
...All/template/discovery-list/discovery-list.component.html
+6
-6
discovery-list.component.ts
...erAll/template/discovery-list/discovery-list.component.ts
+22
-11
No files found.
src/main/webapp/app/modal/discovery/discovery.component.ts
View file @
33ab7b9a
...
@@ -50,7 +50,7 @@ export class DiscoveryComponent implements OnInit {
...
@@ -50,7 +50,7 @@ export class DiscoveryComponent implements OnInit {
interfaceid
:
[
null
,],
interfaceid
:
[
null
,],
delay
:
[
null
,
[
Validators
.
required
]],
delay
:
[
null
,
[
Validators
.
required
]],
description
:
[
null
],
description
:
[
null
],
lifetime
:
[
null
],
lifetime
:
[
'3600'
],
status
:
[
null
],
status
:
[
null
],
});
});
}
}
...
@@ -80,11 +80,6 @@ export class DiscoveryComponent implements OnInit {
...
@@ -80,11 +80,6 @@ export class DiscoveryComponent implements OnInit {
data
.
type
+=
''
;
data
.
type
+=
''
;
data
.
interfaceid
+=
''
;
data
.
interfaceid
+=
''
;
data
.
value_type
+=
''
;
data
.
value_type
+=
''
;
if
(
data
.
applications
){
data
.
applications
=
data
.
applications
.
map
(
e
=>
{
return
e
.
applicationid
;
});
}
this
.
validateForm
.
patchValue
(
data
);
this
.
validateForm
.
patchValue
(
data
);
}
}
);
);
...
@@ -107,7 +102,7 @@ export class DiscoveryComponent implements OnInit {
...
@@ -107,7 +102,7 @@ export class DiscoveryComponent implements OnInit {
this
.
message
.
error
(
'请输入必填信息'
);
this
.
message
.
error
(
'请输入必填信息'
);
return
false
;
return
false
;
}
}
this
.
validateForm
.
value
.
applications
=
[
this
.
validateForm
.
value
.
applications
]
;
this
.
validateForm
.
value
.
status
=
this
.
validateForm
.
value
.
status
?
1
:
0
;
this
.
validateForm
.
value
.
hostid
=
this
.
hostId
;
this
.
validateForm
.
value
.
hostid
=
this
.
hostId
;
if
(
this
.
title
==
'添加自动发现'
)
{
if
(
this
.
title
==
'添加自动发现'
)
{
this
.
create
();
this
.
create
();
...
...
src/main/webapp/app/netTopology/flow-trend/flow-trend.component.ts
View file @
33ab7b9a
This diff is collapsed.
Click to expand it.
src/main/webapp/app/netTopology/model/line/line.component.ts
View file @
33ab7b9a
...
@@ -48,7 +48,8 @@ export class LineComponent implements OnInit {
...
@@ -48,7 +48,8 @@ export class LineComponent implements OnInit {
}
}
changePageIn
(
e
){
changePageIn
(
e
){
this
.
inPageNum
=
e
;
this
.
getInList
();
}
}
//out
//out
...
@@ -70,7 +71,8 @@ export class LineComponent implements OnInit {
...
@@ -70,7 +71,8 @@ export class LineComponent implements OnInit {
}
}
changePageOut
(
e
){
changePageOut
(
e
){
this
.
outPageNum
=
e
;
this
.
getOutList
();
}
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -78,7 +80,7 @@ export class LineComponent implements OnInit {
...
@@ -78,7 +80,7 @@ export class LineComponent implements OnInit {
}
}
showModal
(
hostIds
)
{
showModal
(
hostIds
)
{
this
.
hostIds
=
hostIds
;
this
.
hostIds
=
hostIds
.
split
(
','
)
;
this
.
isLine
=
true
;
this
.
isLine
=
true
;
this
.
getOutList
();
this
.
getOutList
();
this
.
getInList
();
this
.
getInList
();
...
@@ -86,7 +88,7 @@ export class LineComponent implements OnInit {
...
@@ -86,7 +88,7 @@ export class LineComponent implements OnInit {
getInList
(){
getInList
(){
const
data
=
{
const
data
=
{
hostIds
:
[
this
.
hostIds
]
,
hostIds
:
this
.
hostIds
,
search
:
""
,
search
:
""
,
type
:
"in"
,
type
:
"in"
,
pageNum
:
this
.
inPageNum
,
pageNum
:
this
.
inPageNum
,
...
@@ -103,7 +105,7 @@ export class LineComponent implements OnInit {
...
@@ -103,7 +105,7 @@ export class LineComponent implements OnInit {
getOutList
(){
getOutList
(){
const
data
=
{
const
data
=
{
hostIds
:
[
this
.
hostIds
]
,
hostIds
:
this
.
hostIds
,
search
:
""
,
search
:
""
,
type
:
"out"
,
type
:
"out"
,
pageNum
:
this
.
outPageNum
,
pageNum
:
this
.
outPageNum
,
...
@@ -130,8 +132,6 @@ export class LineComponent implements OnInit {
...
@@ -130,8 +132,6 @@ export class LineComponent implements OnInit {
this
.
inList
=
[];
this
.
inList
=
[];
this
.
outList
=
[];
this
.
outList
=
[];
this
.
isLine
=
false
;
this
.
isLine
=
false
;
console
.
log
(
this
.
inSelect
);
console
.
log
(
this
.
outSelect
);
editor
.
utils
.
setLink
(
this
.
inSelect
,
this
.
outSelect
);
editor
.
utils
.
setLink
(
this
.
inSelect
,
this
.
outSelect
);
localStorage
.
setItem
(
"line"
,
'false'
);
localStorage
.
setItem
(
"line"
,
'false'
);
}
}
...
...
src/main/webapp/app/netTopology/topology.service.ts
View file @
33ab7b9a
...
@@ -89,6 +89,11 @@ export class TopologyService {
...
@@ -89,6 +89,11 @@ export class TopologyService {
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trend/findTrendData'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trend/findTrendData'
,
data
);
}
}
//实时流量数据获取
findByTime
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/trend/findByTime/'
+
params
);
}
// 接受/发送流量列表
// 接受/发送流量列表
findTrend
(
data
):
Observable
<
any
>
{
findTrend
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trend/findTrend'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trend/findTrend'
,
data
);
...
...
src/main/webapp/app/overAll/overAll.service.ts
View file @
33ab7b9a
...
@@ -344,17 +344,17 @@ export class OverAllService {
...
@@ -344,17 +344,17 @@ export class OverAllService {
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/create'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/create'
,
data
);
}
}
//
添加
主机自动发现
//
修改
主机自动发现
updateLldrule
(
data
):
Observable
<
any
>
{
updateLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/update'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/update'
,
data
);
}
}
//
添加主机自动发现
//
主机自动发现列表
findPageLldrule
(
data
):
Observable
<
any
>
{
findPageLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/findPage'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/findPage'
,
data
);
}
}
//
添加
主机自动发现
//
删除
主机自动发现
deleteLldrule
(
data
):
Observable
<
any
>
{
deleteLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/delete'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/delete'
,
data
);
}
}
...
...
src/main/webapp/app/overAll/template/discovery-list/discovery-list.component.html
View file @
33ab7b9a
...
@@ -22,13 +22,13 @@
...
@@ -22,13 +22,13 @@
</div>
</div>
<div
nz-row
[
nzGutter
]="
4
"
class=
"search-form"
>
<div
nz-row
[
nzGutter
]="
4
"
class=
"search-form"
>
<div
nz-col
nzSpan=
"3"
>
<div
nz-col
nzSpan=
"3"
>
<button
(
click
)="
showAddModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus-circle-o"
></i>
添加
资产
</button>
<button
(
click
)="
showAddModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus-circle-o"
></i>
添加
自动发现
</button>
</div>
</div>
<div
nz-col
nzSpan=
"18"
></div>
<div
nz-col
nzSpan=
"18"
></div>
<div
nz-col
nzSpan=
"3"
></div>
<div
nz-col
nzSpan=
"3"
></div>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
children
List
"
>
<nz-table
#
nzTable
[
nzData
]="
discovery
List
"
>
<thead>
<thead>
<tr>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
...
@@ -42,11 +42,11 @@
...
@@ -42,11 +42,11 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*
ngFor=
"let data of
children
List"
>
<tr
*
ngFor=
"let data of
discovery
List"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
class=
"round-tag tag-form"
>
{{data.
inventoryNo
}}
</td>
<td
class=
"round-tag tag-form"
>
{{data.
name
}}
</td>
<td>
{{data.
name
}}
</td>
<td>
{{data.
itemsCount
}}
</td>
<td>
{{data.
inventoryc
ount}}
</td>
<td>
{{data.
triggersC
ount}}
</td>
<td>
{{data.stock}}
</td>
<td>
{{data.stock}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
{{data.lendcount}}
</td>
<td>
{{data.lendcount}}
</td>
...
...
src/main/webapp/app/overAll/template/discovery-list/discovery-list.component.ts
View file @
33ab7b9a
...
@@ -4,9 +4,10 @@ import {CommonService} from '../../../shared/common/common.service';
...
@@ -4,9 +4,10 @@ import {CommonService} from '../../../shared/common/common.service';
import
{
WorkService
}
from
'../../../work/work.service'
;
import
{
WorkService
}
from
'../../../work/work.service'
;
import
{
SystemService
}
from
'../../../system/system.service'
;
import
{
SystemService
}
from
'../../../system/system.service'
;
import
{
AssetsComponent
}
from
'../../../work/modal/assets/assets.component'
;
import
{
AssetsComponent
}
from
'../../../work/modal/assets/assets.component'
;
import
{
SERVER_API_URL
}
from
'../../../app.constants'
;
import
{
pageSize
,
SERVER_API_URL
}
from
'../../../app.constants'
;
import
{
UploadComponent
}
from
'../../../work/modal/upload/upload.component'
;
import
{
UploadComponent
}
from
'../../../work/modal/upload/upload.component'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
OverAllService
}
from
'../../overAll.service'
;
@
Component
({
@
Component
({
selector
:
'smart-discovery-list'
,
selector
:
'smart-discovery-list'
,
...
@@ -19,15 +20,19 @@ export class DiscoveryListComponent implements OnInit {
...
@@ -19,15 +20,19 @@ export class DiscoveryListComponent implements OnInit {
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
hostId
;
hostId
;
children
List
;
discovery
List
;
tempName
;
tempName
;
pageNum
=
1
;
pageCount
=
pageSize
;
totalNum
;
allChecked
=
false
;
allChecked
=
false
;
selectList
=
[];
selectList
=
[];
disabledButton
=
true
;
disabledButton
=
true
;
indeterminate
=
false
;
indeterminate
=
false
;
constructor
(
private
workSer
:
Work
Service
,
private
routerInfo
:
ActivatedRoute
,
private
router
:
Router
,
constructor
(
private
overAllSer
:
OverAll
Service
,
private
routerInfo
:
ActivatedRoute
,
private
router
:
Router
,
private
message
:
NzMessageService
,
private
systemSer
:
SystemService
,
private
message
:
NzMessageService
,
private
systemSer
:
SystemService
,
private
commonSer
:
CommonService
)
{
private
commonSer
:
CommonService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
this
.
routerInfo
.
queryParams
.
subscribe
(
...
@@ -39,12 +44,12 @@ export class DiscoveryListComponent implements OnInit {
...
@@ -39,12 +44,12 @@ export class DiscoveryListComponent implements OnInit {
}
}
checkAll
(
value
:
boolean
):
void
{
checkAll
(
value
:
boolean
):
void
{
this
.
children
List
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
discovery
List
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
refreshStatus
();
this
.
refreshStatus
();
}
}
currentPageDataChange
(
$event
:
Array
<
{
checked
:
boolean
}
>
):
void
{
currentPageDataChange
(
$event
:
Array
<
{
checked
:
boolean
}
>
):
void
{
this
.
children
List
=
$event
;
this
.
discovery
List
=
$event
;
}
}
selectItem
(
item
,
e
)
{
selectItem
(
item
,
e
)
{
...
@@ -61,8 +66,8 @@ export class DiscoveryListComponent implements OnInit {
...
@@ -61,8 +66,8 @@ export class DiscoveryListComponent implements OnInit {
}
}
refreshStatus
():
void
{
refreshStatus
():
void
{
const
allChecked
=
this
.
children
List
.
every
(
value
=>
value
.
checked
===
true
);
const
allChecked
=
this
.
discovery
List
.
every
(
value
=>
value
.
checked
===
true
);
const
allUnChecked
=
this
.
children
List
.
every
(
value
=>
!
value
.
checked
);
const
allUnChecked
=
this
.
discovery
List
.
every
(
value
=>
!
value
.
checked
);
this
.
allChecked
=
allChecked
;
this
.
allChecked
=
allChecked
;
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
}
}
...
@@ -72,9 +77,15 @@ export class DiscoveryListComponent implements OnInit {
...
@@ -72,9 +77,15 @@ export class DiscoveryListComponent implements OnInit {
}
}
getList
()
{
getList
()
{
this
.
workSer
.
findInventory
(
this
.
hostId
).
subscribe
(
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
hostIds
:[
this
.
hostId
]
};
this
.
overAllSer
.
findPageLldrule
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
childrenList
=
res
.
data
;
this
.
discoveryList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
}
}
);
);
}
}
...
@@ -86,7 +97,7 @@ export class DiscoveryListComponent implements OnInit {
...
@@ -86,7 +97,7 @@ export class DiscoveryListComponent implements OnInit {
};
};
data
.
inventoryIds
.
push
(
item
.
id
);
data
.
inventoryIds
.
push
(
item
.
id
);
this
.
commonSer
.
confirmThing
(
"删除"
,
"确定删除该资产?"
,()
=>
{
this
.
commonSer
.
confirmThing
(
"删除"
,
"确定删除该资产?"
,()
=>
{
this
.
workSer
.
deleteInventory
(
data
).
subscribe
(
this
.
overAllSer
.
deleteLldrule
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
if
(
res
.
errCode
==
10000
){
this
.
getList
();
this
.
getList
();
...
@@ -111,7 +122,7 @@ export class DiscoveryListComponent implements OnInit {
...
@@ -111,7 +122,7 @@ export class DiscoveryListComponent implements OnInit {
})
})
};
};
this
.
commonSer
.
confirmThing
(
"批量删除"
,
"确定删除选择的资产?"
,()
=>
{
this
.
commonSer
.
confirmThing
(
"批量删除"
,
"确定删除选择的资产?"
,()
=>
{
this
.
workSer
.
deleteInventory
(
data
).
subscribe
(
this
.
overAllSer
.
deleteLldrule
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
if
(
res
.
errCode
==
10000
){
this
.
getList
();
this
.
getList
();
...
...
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