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
6ebceaa7
Commit
6ebceaa7
authored
Nov 03, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
告警模块
parent
3a805664
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
52 deletions
+92
-52
app.module.ts
src/main/webapp/app/app.module.ts
+2
-0
app.route.ts
src/main/webapp/app/app.route.ts
+14
-14
basi-check.component.html
...ain/webapp/app/modal/basi-check/basi-check.component.html
+0
-0
basi-check.component.ts
src/main/webapp/app/modal/basi-check/basi-check.component.ts
+70
-30
basic.component.ts
src/main/webapp/app/overAll/basic/basic.component.ts
+1
-5
loginGuard.ts
src/main/webapp/app/shared/common/loginGuard.ts
+1
-0
login.component.ts
src/main/webapp/app/shared/login/login.component.ts
+4
-3
No files found.
src/main/webapp/app/app.module.ts
View file @
6ebceaa7
...
...
@@ -48,6 +48,7 @@ import {BasicComponent} from './overAll/basic/basic.component';
import
{
NewTypeComponent
}
from
'./modal/new-type/new-type.component'
;
import
{
BasicDetailComponent
}
from
'./overAll/basic/basic-detail/basic-detail.component'
;
import
{
BasicKeyComponent
}
from
'./modal/basic-key/basic-key.component'
;
import
{
BasicEditComponent
}
from
'./modal/basic-edit/basic-edit.component'
;
@
NgModule
({
imports
:
[
...
...
@@ -82,6 +83,7 @@ import {BasicKeyComponent} from './modal/basic-key/basic-key.component';
BasicDetailComponent
,
BasiCheckComponent
,
BasicKeyComponent
,
BasicEditComponent
,
CreateGroupComponent
,
NewTypeComponent
,
AppComponent
...
...
src/main/webapp/app/app.route.ts
View file @
6ebceaa7
...
...
@@ -27,20 +27,20 @@ export const route: Routes = [
{
path
:
'main'
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
],
children
:
[
{
path
:
'basic'
,
component
:
BasicComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'basic-detail'
,
component
:
BasicDetailComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'monitor'
,
component
:
MonitorComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'security'
,
component
:
SecurityComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'audit'
,
component
:
AuditComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'examine'
,
component
:
ExamineComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'group'
,
component
:
GroupComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'power'
,
component
:
PowerComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'alarmList'
,
component
:
AlarmListComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'alarmLog'
,
component
:
AlarmLogComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'alarmManage'
,
component
:
AlarmManageComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'alarmSet'
,
component
:
AlarmSetComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'nowAlarm'
,
component
:
NowAlarmComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'sendSet'
,
component
:
SendSetComponent
,
canActivate
:[
LoginGuard
]
},
{
path
:
'basic'
,
component
:
BasicComponent
},
{
path
:
'basic-detail'
,
component
:
BasicDetailComponent
},
{
path
:
'monitor'
,
component
:
MonitorComponent
},
{
path
:
'security'
,
component
:
SecurityComponent
},
{
path
:
'audit'
,
component
:
AuditComponent
},
{
path
:
'examine'
,
component
:
ExamineComponent
},
{
path
:
'group'
,
component
:
GroupComponent
},
{
path
:
'power'
,
component
:
PowerComponent
},
{
path
:
'alarmList'
,
component
:
AlarmListComponent
},
{
path
:
'alarmLog'
,
component
:
AlarmLogComponent
},
{
path
:
'alarmManage'
,
component
:
AlarmManageComponent
},
{
path
:
'alarmSet'
,
component
:
AlarmSetComponent
},
{
path
:
'nowAlarm'
,
component
:
NowAlarmComponent
},
{
path
:
'sendSet'
,
component
:
SendSetComponent
},
]
},
]
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.html
View file @
6ebceaa7
This diff is collapsed.
Click to expand it.
src/main/webapp/app/modal/basi-check/basi-check.component.ts
View file @
6ebceaa7
...
...
@@ -12,7 +12,16 @@ import {NewTypeComponent} from '../new-type/new-type.component';
@
Component
({
selector
:
'smart-basi-check'
,
templateUrl
:
'./basi-check.component.html'
,
styles
:
[]
styles
:
[
`.tag-button[disabled],
.tag-button {
width: 80%;
height: 30px;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
border-color: #d9d9d9;
}`
]
})
export
class
BasiCheckComponent
implements
OnInit
{
@
ViewChild
(
'basicKey'
)
basicKey
:
BasicKeyComponent
;
...
...
@@ -23,18 +32,19 @@ export class BasiCheckComponent implements OnInit {
validateForm
;
checkList
;
//监测点分类
interval
;
//间隔时长
conditionType
=
'commonly'
;
faultConditionList
=
[
{
code
:
'1'
,
equal
:
'
>
='
,
value
:
'
400
'
,
equal
:
'='
,
value
:
''
,
}
];
//危险阀值list
conditionList
=
[
{
code
:
'1'
,
equal
:
'
>
='
,
value
:
'
400
'
,
equal
:
'='
,
value
:
''
,
}
];
//故障list
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
...
...
@@ -43,24 +53,24 @@ export class BasiCheckComponent implements OnInit {
ngOnInit
()
{
this
.
validateForm
=
{
itemExtend
:
{
datatype
:
null
,
itemtype
:
null
,
multiple
:
null
,
storagevalue
:
null
,
},
hostid
:
this
.
hostId
,
name
:
null
,
interfaceid
:
null
,
key_
:
null
,
value_type
:
null
,
type
:
null
,
data_type
:
null
,
units
:
null
,
history
:
null
,
trends
:
null
,
valuemapid
:
null
,
interval1
:
null
,
delay
:
null
,
condition_commonly
:
null
,
//故障
condition_high
:
null
,
//故障
faultCondition_commonly
:
null
,
//危险
faultCondition_high
:
null
,
//危险
delta
:
null
,
formula
:
null
};
}
...
...
@@ -69,24 +79,25 @@ export class BasiCheckComponent implements OnInit {
this
.
isCheck
=
true
;
this
.
hostId
=
hostId
;
this
.
validateForm
=
{
itemExtend
:
{
datatype
:
null
,
itemtype
:
null
,
multiple
:
null
,
storagevalue
:
null
,
},
hostid
:
this
.
hostId
,
name
:
null
,
interfaceid
:
null
,
key_
:
null
,
value_type
:
null
,
type
:
null
,
data_type
:
null
,
units
:
null
,
history
:
null
,
trends
:
null
,
valuemapid
:
null
,
interval1
:
null
,
delay
:
null
,
condition_commonly
:
null
,
//故障
condition_high
:
null
,
//故障
faultCondition_commonly
:
null
,
//危险
faultCondition_high
:
null
,
//危险
delta
:
null
,
formula
:
null
,
applicationids
:
null
};
//主机接口
...
...
@@ -102,9 +113,8 @@ export class BasiCheckComponent implements OnInit {
getItemType
()
{
//监测点分类
const
data
=
{
'hostids'
:
[]
'hostids'
:
[
this
.
hostId
]
};
data
.
hostids
.
push
(
this
.
hostId
);
this
.
overAllSer
.
findItemType
(
data
).
subscribe
(
(
res
)
=>
{
this
.
checkList
=
res
.
data
;
...
...
@@ -114,8 +124,41 @@ export class BasiCheckComponent implements OnInit {
//添加
handleCheckOk
():
void
{
console
.
log
(
this
.
validateForm
);
this
.
overAllSer
.
create
(
this
.
validateForm
).
subscribe
(
const
data
=
{
hostid
:
this
.
hostId
,
name
:
this
.
validateForm
.
name
,
interfaceid
:
this
.
validateForm
.
interfaceid
,
key_
:
this
.
validateForm
.
key_
,
value_type
:
Number
(
this
.
validateForm
.
value_type
),
type
:
Number
(
this
.
validateForm
.
type
),
data_type
:
Number
(
this
.
validateForm
.
data_type
),
units
:
this
.
validateForm
.
units
,
history
:
this
.
validateForm
.
history
+
'd'
,
trends
:
this
.
validateForm
.
trends
+
'd'
,
valuemapid
:
this
.
validateForm
.
valuemapid
,
delay
:
this
.
validateForm
.
delay
,
condition
:
''
,
//故障
faultCondition
:
''
,
//危险
delta
:
Number
(
this
.
validateForm
.
delta
),
formula
:
this
.
validateForm
.
formula
,
applicationids
:
[
this
.
validateForm
.
applicationids
]
};
if
(
this
.
conditionType
==
'commonly'
)
{
//常规
this
.
conditionList
.
forEach
(
res
=>
{
data
.
condition
+=
'{'
+
this
.
validateForm
.
name
+
':'
+
this
.
validateForm
.
key_
+
'.last}'
+
res
.
equal
+
''
+
res
.
value
;
});
this
.
faultConditionList
.
forEach
(
res
=>
{
data
.
faultCondition
+=
'{'
+
this
.
validateForm
.
name
+
':'
+
this
.
validateForm
.
key_
+
'.last}'
+
res
.
equal
+
''
+
res
.
value
;
});
}
else
{
//高级
data
.
condition
=
this
.
validateForm
.
condition_high
;
data
.
faultCondition
=
this
.
validateForm
.
faultCondition_high
;
}
console
.
log
(
this
.
conditionList
);
console
.
log
(
this
.
faultConditionList
);
console
.
log
(
data
);
this
.
overAllSer
.
create
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
==
10000
)
{
this
.
isCheck
=
false
;
...
...
@@ -144,7 +187,6 @@ export class BasiCheckComponent implements OnInit {
//添加分类
addItemType
(
data
)
{
console
.
log
(
data
);
const
obj
=
{
hostid
:
this
.
hostId
,
name
:
data
...
...
@@ -166,8 +208,8 @@ export class BasiCheckComponent implements OnInit {
const
demo
=
{
and
:
'&'
,
code
:
'1'
,
equal
:
'
>
='
,
value
:
'
400
'
,
equal
:
'='
,
value
:
''
,
};
this
.
faultConditionList
.
push
(
demo
);
}
...
...
@@ -177,8 +219,8 @@ export class BasiCheckComponent implements OnInit {
const
demo
=
{
and
:
'&'
,
code
:
'1'
,
equal
:
'
>
='
,
value
:
'
400
'
,
equal
:
'='
,
value
:
''
,
};
this
.
conditionList
.
push
(
demo
);
}
...
...
@@ -196,6 +238,4 @@ export class BasiCheckComponent implements OnInit {
getKey
(
keyValue
):
void
{
this
.
validateForm
.
key_
=
keyValue
;
}
}
src/main/webapp/app/overAll/basic/basic.component.ts
View file @
6ebceaa7
...
...
@@ -278,15 +278,11 @@ export class BasicComponent implements OnInit {
//查看详情
goDetail
(
item
){
let
type
;
let
type
=
0
;
if
(
item
.
hostExtend
){
if
(
item
.
hostExtend
.
equipmentType
==
'交换机'
){
type
=
1
;
}
else
{
type
=
0
;
}
}
else
{
type
=
0
;
}
this
.
router
.
navigate
([
'app/main/basic-detail'
],{
queryParams
:{
...
...
src/main/webapp/app/shared/common/loginGuard.ts
View file @
6ebceaa7
...
...
@@ -9,6 +9,7 @@ export class LoginGuard implements CanActivate {
}
canActivate
(
route
:
ActivatedRouteSnapshot
,
state
:
RouterStateSnapshot
):
boolean
{
console
.
log
(
'canActivite'
);
let
isLogin
:
boolean
;
// 判断用户是否登入
const
user
=
this
.
localStorage
.
retrieve
(
'accessToken'
);
...
...
src/main/webapp/app/shared/login/login.component.ts
View file @
6ebceaa7
...
...
@@ -86,9 +86,10 @@ export class JhiLoginModalComponent implements AfterViewInit,OnInit {
password
:
this
.
password
,
rememberMe
:
true
}).
then
(()
=>
{
console
.
log
(
'login success'
);
this
.
authenticationError
=
false
;
this
.
activeModal
.
dismiss
(
'login success'
);
this
.
isSpinning
=
false
;
this
.
router
.
navigate
([
'app/main/basic'
]);
// this.authenticationError = false;
// this.activeModal.dismiss('login success');
// if (this.router.url === '/register' || (/^\/activate\//.test(this.router.url)) ||
// (/^\/reset\//.test(this.router.url))) {
// this.router.navigate(['app/main/basic']);
...
...
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