Commit 8ed9b8ac authored by wangqinghua's avatar wangqinghua

delete log

parent de8f8c7d
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AnalysisService {
constructor() { }
}
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<nz-form-control [nzOffset]="4" [nzSpan]="14"> <nz-form-control [nzOffset]="4" [nzSpan]="14">
<nz-radio-group [(ngModel)]="macroTYpe"> <nz-radio-group [(ngModel)]="macroTYpe">
<label nz-radio-button nzValue="macro"><span>主机宏</span></label> <label nz-radio-button nzValue="macro"><span>主机宏</span></label>
<label nz-radio-button nzValue="macroExpand"><span>继承以及主机宏</span></label> <!--<label nz-radio-button nzValue="macroExpand"><span>继承以及主机宏</span></label>-->
</nz-radio-group> </nz-radio-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
...@@ -271,13 +271,13 @@ ...@@ -271,13 +271,13 @@
<div nz-row *ngFor="let item of macroList1;let i = index;" [nzGutter]="24"> <div nz-row *ngFor="let item of macroList1;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 [(ngModel)]="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 [(ngModel)]="item.value">
</nz-form-control> </nz-form-control>
<nz-form-control nz-col [nzSpan]="3"> <nz-form-control nz-col [nzSpan]="3">
<span (click)="deleteMacro1(i)">移除</span> <span (click)="deleteMacro1(i)">移除</span>
......
...@@ -49,34 +49,8 @@ export class BasicEditComponent implements OnInit { ...@@ -49,34 +49,8 @@ export class BasicEditComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.tabNum = 0; this.tabNum = 0;
this.initForm();
this.getTemplate(); this.getTemplate();
this.validateForm = {
groups: [],
hostExtend: {
equipmentType: null,
secondLevelType: null,
serviceid: ''
},
macros: this.macroList1,
interfaces: this.interfaceslist, //接口
inventory: {
os: null,
name: null,
serialno_a: null
},
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,
};
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++) {
...@@ -103,19 +77,39 @@ export class BasicEditComponent implements OnInit { ...@@ -103,19 +77,39 @@ export class BasicEditComponent implements OnInit {
this.modalTitle = '编辑资源'; this.modalTitle = '编辑资源';
this.overAllSer.findDetailed(this.hostId).subscribe( this.overAllSer.findDetailed(this.hostId).subscribe(
(res) => { (res) => {
this.validateForm = res.data[0]; const data = res.data[0];
this.validateForm.ipmi_authtype = res.data[0].ipmi_authtype + ''; this.validateForm.name = data.name;
this.validateForm.ipmi_privilege = res.data[0].ipmi_privilege + ''; this.validateForm.host = data.host;
this.validateForm.groups = res.data[0].groups; this.validateForm.ipmi_authtype = data.ipmi_authtype + '';
this.interfaceslist = res.data[0].interfaces; this.validateForm.ipmi_username = data.ipmi_username + '';
if (res.data[0].macros) { this.validateForm.ipmi_privilege = data.ipmi_privilege + '';
this.validateForm.macros = res.data([0]).macros; this.validateForm.ipmi_password = data.ipmi_password + '';
} this.validateForm.tls_psk_identity = data.tls_psk_identity + '';
this.validateForm.tls_issuer = data.tls_issuer + '';
this.validateForm.tls_subject = data.tls_subject + '';
this.validateForm.tls_psk = data.tls_psk + '';
this.validateForm.inventory.os = data.inventory.os;
this.validateForm.inventory.name = data.inventory.name;
this.validateForm.inventory.serialno_a = data.inventory.serialno_a;
this.validateForm.hostExtend.equipmentType = data.hostExtend.equipmentType +'';
this.validateForm.hostExtend.secondLevelType = data.hostExtend.secondLevelType +'';
this.validateForm.hostExtend.serviceid = data.hostExtend.serviceid +'';
this.validateForm.groups = data.groups;
const tempArr = data.parentTemplates.map(res=>{
return res.templateid;
});
this.validateForm.templates = tempArr;
this.interfaceslist = data.interfaces;
this.interfaceslist.forEach(res => { this.interfaceslist.forEach(res => {
res.main = res.main + ''; res.main = res.main + '';
res.type = res.type + ''; res.type = res.type + '';
}); });
if (data.macros) {
this.macroList1 = data.macros;
}
for (let i = 0; i < this.validateForm.groups.length; i++) { for (let i = 0; i < this.validateForm.groups.length; i++) {
for (let j = 0; j < this.groupList.length; j++) { for (let j = 0; j < this.groupList.length; j++) {
if (this.validateForm.groups[i].groupid == this.groupList[j].value) { if (this.validateForm.groups[i].groupid == this.groupList[j].value) {
...@@ -169,14 +163,17 @@ export class BasicEditComponent implements OnInit { ...@@ -169,14 +163,17 @@ export class BasicEditComponent implements OnInit {
if (this.macroTYpe == 'macroExpand') { if (this.macroTYpe == 'macroExpand') {
this.validateForm.macros = this.macroList2; this.validateForm.macros = this.macroList2;
} }
this.validateForm.hostid = this.hostId;
this.validateForm.interfaces = this.interfaceslist;
this.validateForm.macros = this.macroList1;
this.overAllSer.updateHost(this.validateForm).subscribe( this.overAllSer.updateHost(this.validateForm).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.isBasicEdit = false; this.isBasicEdit = false;
this.done.emit();
this.initForm();
} }
this.done.emit();
this.message.info(res.errMsg); this.message.info(res.errMsg);
this.initForm();
}, },
(err) => { (err) => {
this.message.info('系统错误'); this.message.info('系统错误');
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {OverAllService} from '../../overAll/overAll.service'; import {OverAllService} from '../../overAll/overAll.service';
import { DatePipe } from '@angular/common'; import { DatePipe } from '@angular/common';
import {NzMessageService} from 'ng-zorro-antd';
@Component({ @Component({
selector: 'smart-pause', selector: 'smart-pause',
...@@ -16,7 +17,8 @@ export class PauseComponent implements OnInit { ...@@ -16,7 +17,8 @@ export class PauseComponent implements OnInit {
time: '' time: ''
}; };
hostId; //主机id hostId; //主机id
constructor(public overAllSer: OverAllService,public datePipe:DatePipe) { constructor(public overAllSer: OverAllService,public datePipe:DatePipe,
public message:NzMessageService) {
} }
ngOnInit() { ngOnInit() {
...@@ -39,8 +41,10 @@ export class PauseComponent implements OnInit { ...@@ -39,8 +41,10 @@ export class PauseComponent implements OnInit {
}; };
this.overAllSer.tempStop(data).subscribe( this.overAllSer.tempStop(data).subscribe(
(res) => { (res) => {
// this.isShow = false; if(res.errCode == 10000){
this.isShow = false;
}
this.message.info(res.errMsg);
} }
); );
......
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class OperationService {
constructor() { }
}
...@@ -181,7 +181,7 @@ export class OverAllService { ...@@ -181,7 +181,7 @@ export class OverAllService {
//临时暂停 //临时暂停
tempStop(data): Observable<any>{ tempStop(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/temp-stop', data); return this.http.post(SERVER_API_URL + '/host/tempStop', data);
} }
//查询报警主机 和报警数量 以及最高报警级别 //查询报警主机 和报警数量 以及最高报警级别
......
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SmartService {
constructor() { }
}
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class WorkService {
constructor() { }
}
...@@ -94,4 +94,8 @@ ...@@ -94,4 +94,8 @@
right: 24px; right: 24px;
left: auto; left: auto;
height: 220%; height: 220%;
}
.ant-checkbox-group label:first-child{
margin-left: 8px;
} }
\ No newline at end of file
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