Commit 07477837 authored by wangqinghua's avatar wangqinghua

message update

parent ef1b6872
......@@ -69,9 +69,13 @@ export class DatabaseComponent implements OnInit {
findDatabase() {
this.overAllSer.findAllDatabaseByHost(this.hostId).subscribe(
(res) => {
if(res.errCode == 10000){
this.databaseList = res.data;
this.databaseType = this.databaseList[0].type;
this.findTarget();
}else{
this.message.error(res.errMsg);
}
}
);
}
......
......@@ -79,7 +79,11 @@ export class ServerComponent implements OnInit {
};
this.overAllSer.findDetailed(this.hostId).subscribe(
(res) => {
if(res.errCode == 10000){
this.server = res.data[0];
}else{
this.message.error(res.errMsg);
}
}
);
//内存使用率
......
......@@ -95,11 +95,16 @@ export class SwitchComponent implements OnInit {
//内存使用率
this.overAllSer.used(data).subscribe(
(res) => {
if(res.errCode == 10000){
if (res.data) {
this.hostObj.used = res.data.used;
} else {
this.hostObj.used = 0;
}
}else{
this.message.error(res.errMsg);
}
}
);
//cpu使用率
......
......@@ -12,16 +12,16 @@ import {AlarmModalComponent} from '../../modal/alarm-modal/alarm-modal.component
templateUrl: './network-check.component.html',
styles: [
`
:host ::ng-deep .table-dropdown a{
:host ::ng-deep .table-dropdown a {
font-weight: 300;
}
`
]
})
export class NetworkCheckComponent implements OnInit {
@ViewChild('smartWebsite') smartWebsite:WebsiteComponent;
@ViewChild('smartPause') smartPause:PauseComponent;
@ViewChild('smartAlarmModal') smartAlarmModal:AlarmModalComponent;
@ViewChild('smartWebsite') smartWebsite: WebsiteComponent;
@ViewChild('smartPause') smartPause: PauseComponent;
@ViewChild('smartAlarmModal') smartAlarmModal: AlarmModalComponent;
color = color;
dataSet;
......@@ -35,19 +35,19 @@ export class NetworkCheckComponent implements OnInit {
totalNum;
checkStatus = {
type:{
seriousNum:null,
notNum:null,
warnNum:null,
normalNum:null
type: {
seriousNum: null,
notNum: null,
warnNum: null,
normalNum: null
},
total:null
total: null
};
batchSelectList = [];
constructor(private overAllSer: OverAllService,private router:Router,
private modalService:NzModalService,private message:NzMessageService) {
constructor(private overAllSer: OverAllService, private router: Router,
private modalService: NzModalService, private message: NzMessageService) {
}
ngOnInit() {
......@@ -59,86 +59,84 @@ export class NetworkCheckComponent implements OnInit {
getwebList() {
this.loading = true;
const data = {
name:this.name,
eventPage:this.pageIndex,
pageRecords:this.pageSize
name: this.name,
eventPage: this.pageIndex,
pageRecords: this.pageSize
};
this.overAllSer.findWebscenario(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.dataSet = res.data.data;
this.totalNum = res.data.totalNum;
}
this.loading = false;
}
);
}
//详情
goDetail(item){
this.router.navigate(['app/main/network-detail'],{
queryParams:{
httptestid:item.httptestid,
name:item.name
goDetail(item) {
this.router.navigate(['app/main/network-detail'], {
queryParams: {
httptestid: item.httptestid,
name: item.name
}
})
});
}
//监测状态
getCheckStatus() {
this.overAllSer.countStatus().subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.checkStatus = res.data;
}else{
this.message.info(res.errMsg);
} else {
this.message.error(res.errMsg);
}
}
)
);
}
//选中
selectChecked(event,item){
if(event){
selectChecked(event, item) {
if (event) {
this.batchSelectList.push(item.httptestid);
}else{
} else {
const index = this.batchSelectList.indexOf(item.hostid);
this.batchSelectList.splice(index,1);
this.batchSelectList.splice(index, 1);
}
}
//单个开启关闭
operationHost(item,status,operation){
operationHost(item, status, operation) {
this.batchSelectList.push(item.httptestid);
this.openBatchHost(status,operation);
this.openBatchHost(status, operation);
}
//添加网站
showAddmodal(){
showAddmodal() {
this.smartWebsite.showAddModal();
}
//编辑网站
editBasicModal(item){
this.smartWebsite.showEditModal(item.httptestid)
editBasicModal(item) {
this.smartWebsite.showEditModal(item.httptestid);
}
//批量开启or关闭
openBatchHost(status,operation){
if(this.batchSelectList.length == 0){
this.message.info('请选择需要'+ operation +'的网站监测');
openBatchHost(status, operation) {
if (this.batchSelectList.length == 0) {
this.message.info('请选择需要' + operation + '的网站监测');
return false;
}
this.modalService.confirm({
nzTitle: '监控',
nzContent: '确定'+operation+'网站监测?',
nzContent: '确定' + operation + '网站监测?',
nzOkText: '确定',
nzCancelText: '取消',
nzOnOk: () => {
const data = {
status:status,
ids:this.batchSelectList
}
status: status,
ids: this.batchSelectList
};
this.overAllSer.statusBatch(data).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -156,8 +154,8 @@ export class NetworkCheckComponent implements OnInit {
}
//批量删除
batchDeleteConfirm(){
if(this.batchSelectList.length == 0){
batchDeleteConfirm() {
if (this.batchSelectList.length == 0) {
this.message.info('请选择需要删除的网站监测');
return false;
}
......@@ -168,8 +166,8 @@ export class NetworkCheckComponent implements OnInit {
nzOkType: 'danger',
nzOnOk: () => {
const data = {
ids:this.batchSelectList
}
ids: this.batchSelectList
};
this.overAllSer.deleteBatch(data).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -188,7 +186,7 @@ export class NetworkCheckComponent implements OnInit {
}
//单个删除
showDeleteConfirm(item){
showDeleteConfirm(item) {
this.modalService.confirm({
nzTitle: '删除',
nzContent: '<b style="color: red;">确认要删除该网站监测吗?</b>',
......@@ -198,8 +196,8 @@ export class NetworkCheckComponent implements OnInit {
let arr = [];
arr.push(item.httptestid);
const data = {
ids:arr
}
ids: arr
};
this.overAllSer.deleteBatch(data).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -218,12 +216,12 @@ export class NetworkCheckComponent implements OnInit {
}
//临时暂停
showTempStop(item){
this.smartPause.showModal(item.httptestid,'网站监测');
showTempStop(item) {
this.smartPause.showModal(item.httptestid, '网站监测');
}
//添加告警
showAlarm() {
this.smartAlarmModal.showAddModal('添加告警',null);
this.smartAlarmModal.showAddModal('添加告警', null);
}
}
......@@ -27,7 +27,7 @@ import {CommonService} from '../../../shared/common/common.service';
`
]
})
export class NetworkDetailComponent implements OnInit, OnChanges {
export class NetworkDetailComponent implements OnInit {
@ViewChild('chartSpeedLeft') chartSpeedLeft: ElementRef;
@ViewChild('chartTimeLeft') chartTimeLeft: ElementRef;
@ViewChild('smartWebsite') smartWebsite: WebsiteComponent;
......@@ -73,9 +73,6 @@ export class NetworkDetailComponent implements OnInit, OnChanges {
this.getNowStatus();
}
ngOnChanges() {
}
//历史告警
findAlertList() {
const data = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment