Change-Id: Ic7229b94bcfca46b33bc3e6184e4dccf34982c60
Issue-ID: HOLMES-154
Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
</tr>
<tr *ngFor="let rule of rules">
<td>
</tr>
<tr *ngFor="let rule of rules">
<td>
- <a routerLink="/ruleInfo/{{rule.ruleId}}&add">{{rule.rulename}}</a>
+ <a routerLink="/ruleInfo/{{rule.ruleId}}&add">{{rule.ruleName}}</a>
- <td [hidden]="rule.enabled === 1" style="text-align: center">
+ <td [hidden]="rule.enabled === 0">
- <img src="../../assets/thirdparty/images/round_off.png" alt="">
+ <i class="fas fa-power-off" style="color:#4ac9ff;"></i>
- <td [hidden]="rule.enabled === 0" style="text-align: center">
+ <td [hidden]="rule.enabled === 1">
- <img src="../../assets/thirdparty/images/round_on.png" alt="">
+ <i class="fas fa-power-off" style="color: #aaa;"></i>
</span>
</td>
<td>{{rule.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
</span>
</td>
<td>{{rule.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{rule.updateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>
<span (click)="updateRule(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
<td>{{rule.updateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>
<span (click)="updateRule(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
- <img src="../../assets/thirdparty/images/edit.png" alt="">
+ <i class="fas fa-pencil-alt" style="font-size: 14px;"></i>
- </span>
- <span [hidden]="rule.enabled===1" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
- <img src="../../assets/thirdparty/images/on.png" alt="">
</span>
<span [hidden]="rule.enabled===0" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
</span>
<span [hidden]="rule.enabled===0" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
- <img src="../../assets/thirdparty/images/off.png" alt="">
+ <i class="fas fa-toggle-on" style="font-size: 20px; color:#4ac9ff; vertical-align:-2px;"></i>
+ </span>
+ <span [hidden]="rule.enabled===1" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
+ <i class="fas fa-toggle-off" style="font-size: 20px; color:black; vertical-align:-2px;" title="Switch On"></i>
</span>
<span class="" id={{rule.ruleId}} (click)="delete(rule)" style="cursor: pointer;margin: 0 5px">
</span>
<span class="" id={{rule.ruleId}} (click)="delete(rule)" style="cursor: pointer;margin: 0 5px">
- <img src="../../assets/thirdparty/images/delete.png" alt="">
+ <i class="fas fa-times" style="color: rgba(255, 0, 0, 0.788);font-size:16px;vertical-align:-1px;"></i>
activeStatus = ["option_all", "common_enabled", "common_disabled"];
constructor(public _alarmRuleService: AlarmRuleService, private modalService: ModalService,
activeStatus = ["option_all", "common_enabled", "common_disabled"];
constructor(public _alarmRuleService: AlarmRuleService, private modalService: ModalService,
- private router: Router) { };
+ private router: Router) { }
switch(select: string): void {
console.log(select);
switch(select: string): void {
console.log(select);
this.ruleModel.enabled = null;
}
this.setActiveText();
this.ruleModel.enabled = null;
}
this.setActiveText();
setActiveText(): void {
if (this.ruleModel.enabled == 1) {
setActiveText(): void {
if (this.ruleModel.enabled == 1) {
this.activeText = "option_all";
this.ruleRequest.enabled = null;
}
this.activeText = "option_all";
this.ruleRequest.enabled = null;
}
getRules(): Promise<any> {
return this._alarmRuleService
.getRules()
.then(rules => {
this.rules = rules.correlationRules;
getRules(): Promise<any> {
return this._alarmRuleService
.getRules()
.then(rules => {
this.rules = rules.correlationRules;
- this.totalcount = rules.totalcount;
+ this.totalcount = rules.totalCount;
+ public searchRules(): void {
if (this.ruleModel.enabled == null) {
this.ruleRequest.enabled = null;
}
if (this.ruleModel.enabled == null) {
this.ruleRequest.enabled = null;
}
this.totalcount = rules.length;
});
}
this.totalcount = rules.length;
});
}
- updateRule(rule: RuleModel): void {
+ public updateRule(rule: RuleModel): void {
this.router.navigate(['ruleInfo/', rule.ruleId]);
}
this.router.navigate(['ruleInfo/', rule.ruleId]);
}
- delete(rule: RuleModel): void {
+ public delete(rule: RuleModel): void {
rule.enabled == 1 ? this.deleteActiveRule(rule) : this.deleteModel(rule.ruleId, this._alarmRuleService, this);
}
rule.enabled == 1 ? this.deleteActiveRule(rule) : this.deleteModel(rule.ruleId, this._alarmRuleService, this);
}
- on_off(rule: RuleModel) {
+ public on_off(rule: RuleModel) {
rule.enabled == 0 ? rule.enabled = 1 : rule.enabled = 0;
this._alarmRuleService
.updateRule(rule)
rule.enabled == 0 ? rule.enabled = 1 : rule.enabled = 0;
this._alarmRuleService
.updateRule(rule)
this.ruleModel.ruleName = null;
this.activeText = 'option_all';
this.ruleModel.enabled = null;
this.getRules();
}
this.ruleModel.ruleName = null;
this.activeText = 'option_all';
this.ruleModel.enabled = null;
this.getRules();
}
- deleteActiveRule(rule: RuleModel): void {
+ public deleteActiveRule(rule: RuleModel): void {
jQuery('#' + rule.ruleId).popModal({
html: jQuery('#deleteActiveRuleContent'),
placement: 'leftTop',
jQuery('#' + rule.ruleId).popModal({
html: jQuery('#deleteActiveRuleContent'),
placement: 'leftTop',
- deleteModel(ruleId: string, alarm: AlarmRuleService, obj: any): void {
+ public deleteModel(ruleId: string, alarm: AlarmRuleService, obj: any): void {
jQuery('#' + ruleId).popModal({
html: jQuery('#deleteTimingTaskContent'),
placement: 'leftTop',
jQuery('#' + ruleId).popModal({
html: jQuery('#deleteTimingTaskContent'),
placement: 'leftTop',
+ public ngOnInit(): void {
this.activeText = 'option_all';
this.ruleModel = {
ruleId: null,
this.activeText = 'option_all';
this.ruleModel = {
ruleId: null,
modifier: null,
enabled: 0,
loopControlName: ''
modifier: null,
enabled: 0,
loopControlName: ''
this.ruleRequest = {
ruleId: null,
ruleName: null,
this.ruleRequest = {
ruleId: null,
ruleName: null,
modifier: null,
enabled: null,
loopControlName: ''
modifier: null,
enabled: null,
loopControlName: ''
const url = `${this.ruleUrl}?queryrequest=${queryrequest}`;
return this.http.get(url, {headers:this.headers})
.toPromise()
const url = `${this.ruleUrl}?queryrequest=${queryrequest}`;
return this.http.get(url, {headers:this.headers})
.toPromise()
- .then(res => res.json().rules as RuleModel)
+ .then(res => res.json().correlationRules as RuleModel[])
.catch(this.handleError);
}
.catch(this.handleError);
}
const url = `${this.ruleUrl}?queryrequest=${JSON.stringify(data)}`
return this.http.get(url, { body: data, headers: this.headers })
.toPromise()
const url = `${this.ruleUrl}?queryrequest=${JSON.stringify(data)}`
return this.http.get(url, { body: data, headers: this.headers })
.toPromise()
- .then(res => res.json().correlatoinRules as RuleModel[])
+ .then(res => res.json().correlationRules as RuleModel[])
.catch(this.handleError);
}
.catch(this.handleError);
}
}
.customtable tbody tr:hover td{
}
.customtable tbody tr:hover td{
- background-color: #e6fbe0 !important;
+ background-color: #fafafa !important;
}
.customtable tbody tr:hover td{
}
.customtable tbody tr:hover td{
- background-color: #e6fbe0 !important;
+ background-color: #fafafa !important;
+ <base href="/iui/holmes-local/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
+ crossorigin="anonymous">
+
<script src="./assets/thirdparty/js/jquery_1.12.4.min.js"></script>
<script src="./assets/common/js/popModal.js"></script>
<script src="./assets/common/js/jQuery-File-Upload/js/jquery.ui.widget.js"></script>
<script src="./assets/thirdparty/js/jquery_1.12.4.min.js"></script>
<script src="./assets/common/js/popModal.js"></script>
<script src="./assets/common/js/jQuery-File-Upload/js/jquery.ui.widget.js"></script>
@Setter\r
public class RuleQueryCondition {\r
\r
@Setter\r
public class RuleQueryCondition {\r
\r
- @SerializedName(value = "ruleid")\r
+ @SerializedName(value = "ruleId")\r
- @SerializedName(value = "rulename")\r
+ @SerializedName(value = "ruleName")\r
private String name;\r
private int enabled;\r
private String creator;\r
private String name;\r
private int enabled;\r
private String creator;\r