diff options
30 files changed, 354 insertions, 304 deletions
diff --git a/rulemgt-frontend/assembly.xml b/rulemgt-frontend/assembly.xml index bf9a73e..9a4a65d 100644 --- a/rulemgt-frontend/assembly.xml +++ b/rulemgt-frontend/assembly.xml @@ -11,6 +11,13 @@ <directory>dist</directory> <outputDirectory>/iui/holmes</outputDirectory> </fileSet> + <fileSet> + <directory>src</directory> + <outputDirectory>/iui/holmes</outputDirectory> + <includes> + <include>default.html</include> + </includes> + </fileSet> </fileSets> </assembly> diff --git a/rulemgt-frontend/karma.conf.js b/rulemgt-frontend/karma.conf.js index 37c5952..9f3bb5e 100644 --- a/rulemgt-frontend/karma.conf.js +++ b/rulemgt-frontend/karma.conf.js @@ -1,4 +1,4 @@ -/* Copyright 2017 ZTE Corporation. +/* Copyright 2018 ZTE Corporation. * *Licensed under the Apache License, Version 2.0 (the "License"); *you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/package-lock.json b/rulemgt-frontend/package-lock.json index 1c29b4d..ac2cffe 100644 --- a/rulemgt-frontend/package-lock.json +++ b/rulemgt-frontend/package-lock.json @@ -1,5 +1,5 @@ { - "name": "alarm-analysis", + "name": "holmes", "version": "1.0.0", "lockfileVersion": 1, "requires": true, diff --git a/rulemgt-frontend/src/app/app.component.ts b/rulemgt-frontend/src/app/app.component.ts index aa1b236..29bf86b 100644 --- a/rulemgt-frontend/src/app/app.component.ts +++ b/rulemgt-frontend/src/app/app.component.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'remote-config', - templateUrl: './pages/remote.component.html', + templateUrl: './pages/remote.component.html' }) export class AppComponent implements OnInit { constructor(private translate: TranslateService) { } diff --git a/rulemgt-frontend/src/app/app.module.ts b/rulemgt-frontend/src/app/app.module.ts index 670c9b3..47977e6 100644 --- a/rulemgt-frontend/src/app/app.module.ts +++ b/rulemgt-frontend/src/app/app.module.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/app.routing.ts b/rulemgt-frontend/src/app/app.routing.ts index 3502167..649053b 100644 --- a/rulemgt-frontend/src/app/app.routing.ts +++ b/rulemgt-frontend/src/app/app.routing.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,14 +13,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ModuleWithProviders } from '@angular/core'; +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import {AlarmRule} from './correlation-ruleList/alarmRule.component'; -import {RuleInfo} from './correlation-ruleInfo/ruleInfo.component' +import { AlarmRule } from './correlation-ruleList/alarmRule.component'; +import { RuleInfo } from './correlation-ruleInfo/ruleInfo.component'; const appRoutes: Routes = [ { path: 'alarmRule', - component:AlarmRule + component: AlarmRule }, { path: 'ruleInfo', @@ -31,10 +31,10 @@ const appRoutes: Routes = [ component: RuleInfo }, { - path:'', - redirectTo:'alarmRule', + path: '', + redirectTo: 'alarmRule', pathMatch: 'full' }, ]; -export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes,{ useHash: true }); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true }); diff --git a/rulemgt-frontend/src/app/correlation-modal/modal.component.html b/rulemgt-frontend/src/app/correlation-modal/modal.component.html index 16f61e8..cc1cb2c 100644 --- a/rulemgt-frontend/src/app/correlation-modal/modal.component.html +++ b/rulemgt-frontend/src/app/correlation-modal/modal.component.html @@ -1,5 +1,5 @@ <!-- - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/correlation-modal/modal.component.ts b/rulemgt-frontend/src/app/correlation-modal/modal.component.ts index 8fff7cd..cafb8e5 100644 --- a/rulemgt-frontend/src/app/correlation-modal/modal.component.ts +++ b/rulemgt-frontend/src/app/correlation-modal/modal.component.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/correlation-modal/modal.service.ts b/rulemgt-frontend/src/app/correlation-modal/modal.service.ts index d851d52..11b4378 100644 --- a/rulemgt-frontend/src/app/correlation-modal/modal.service.ts +++ b/rulemgt-frontend/src/app/correlation-modal/modal.service.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/correlation-modal/msg.ts b/rulemgt-frontend/src/app/correlation-modal/msg.ts index 8608dc1..55151a4 100644 --- a/rulemgt-frontend/src/app/correlation-modal/msg.ts +++ b/rulemgt-frontend/src/app/correlation-modal/msg.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.html b/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.html index 6378429..61535fc 100644 --- a/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.html +++ b/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.html @@ -1,5 +1,5 @@ <!-- - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,137 +13,138 @@ See the License for the specific language governing permissions and limitations under the License. --> -<div class="container" style="margin-top: 20px"> +<div class="container-fluid" style="padding: 40px 55px 0 55px"> <form #ruleForm="ngForm" class="form-group row" (submit)="onSubmit(ruleName)"> <div class="form-body"> - <div class="row form-group col-xs-12 "> - <label for="userName" class="col-xs-2 col-form-label labelstyle"> - <span>{{"field_rule_name_Add_Page"|translate}}</span> - <span style="color: red">*</span> - </label> - <div class="col-xs-6" style="margin-left: -100px"> - <input class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required" style="width: 60%" type="text" name="rulename" - [(ngModel)]="queryRule.ruleName" id="ruleNameInput" readonly="{{addBottonStatus}}" #ruleName="ngModel" - required> + <div class="row form-group"> + <label for="userName" class="col-xs-2 col-sm-1 col-form-label labelstyle"> + <span>{{"field_rule_name_Add_Page"|translate}}</span> + <span style="color: red">*</span> + </label> + <div class="col-xs-5 col-sm-6"> + <input class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required" type="text" name="rulename" [(ngModel)]="queryRule.ruleName" + id="ruleNameInput" readonly="{{addBottonStatus}}" #ruleName="ngModel" required> </div> </div> - <div class="row form-group col-xs-12"> - <label for="userName" class="col-xs-2 col-form-label labelstyle"> - <span>{{"field_description"|translate}}</span> - </label> - <div class="col-xs-6" style="margin-left: -100px"> - <input class="form-control ng-untouched ng-pristine ng-valid" readonly="{{addBottonStatus}}" style="width: 60%" type="text" - [(ngModel)]="queryRule.loopControlName" name="description"> + <div class="row form-group"> + <label for="controlLoopName" class="col-xs-2 col-sm-1 col-form-label labelstyle"> + <span>{{"field_controlLoopName"|translate}}</span> + <span style="color: red">*</span> + </label> + <div class="col-xs-5 col-sm-6"> + <input class="form-control ng-untouched ng-pristine ng-valid" readonly="{{addBottonStatus}}" type="text" [(ngModel)]="queryRule.loopControlName" + name="controlLoopName" id="controlLoopName" required> </div> </div> - <div class="row form-group col-xs-12"> - <label for="userName" class="col-xs-2 col-form-label labelstyle"> - <span>{{"field_description"|translate}}</span> - </label> - <div class="col-xs-6" style="margin-left: -100px"> - <input class="form-control ng-untouched ng-pristine ng-valid" readonly="{{addBottonStatus}}" style="width: 60%" type="text" - [(ngModel)]="queryRule.description" name="description"> + <div class="row form-group"> + <label for="userName" class="col-xs-2 col-sm-1 col-form-label labelstyle"> + <span>{{"field_description"|translate}}</span> + </label> + <div class="col-xs-5 col-sm-6"> + <input class="form-control ng-untouched ng-pristine ng-valid" readonly="{{addBottonStatus}}" type="text" [(ngModel)]="queryRule.description" + name="description"> </div> </div> - <div id="state" class="row form-group col-xs-12"> - <label class="col-xs-2 col-form-label labelstyle"> - <span>{{"common_status"|translate}}</span> - </label> + <div id="state" class="row form-group"> + <label class="col-xs-2 col-sm-1 col-form-label labelstyle"> + <span>{{"common_status"|translate}}</span> + </label> - <div class="col-xs-6" style="margin-left: -113px"> - <div *ngIf="queryRule.enabled == 0"> - <div class="col-xs-3" > - <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='0'> - <label for="radio1" >{{"common_off"|translate}}</label> + <div class="col-xs-10 col-sm-11"> + <div class="row"> + <div *ngIf="queryRule.enabled == 0"> + <div class="col-xs-4 col-sm-2 col-md-1"> + <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='0'> + <label for="radio1">{{"common_off"|translate}}</label> + </div> + <div class="col-xs-4 col-sm-2 col-md-1"> + <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='1'> + <label for="radio1" (click)="switch()">{{"common_on"|translate}}</label> + </div> </div> - <div class="col-xs-3" > - <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='1'> - <label for="radio1" (click)="switch()">{{"common_on"|translate}}</label> + <div *ngIf="queryRule.enabled == 1"> + <div class="col-xs-4 col-sm-2 col-md-1"> + <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='0'> + <label for="radio1" (click)="switch()">{{"common_off"|translate}}</label> + </div> + <div class="col-xs-4 col-sm-2 col-md-1"> + <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='1'> + <label for="radio1">{{"common_on"|translate}}</label> + </div> </div> </div> - <div *ngIf="queryRule.enabled == 1"> - <div class="col-xs-3" > - <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='0'> - <label for="radio1" (click)="switch()">{{"common_off"|translate}}</label> - </div> - <div class="col-xs-3" > - <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='1'> - <label for="radio1" >{{"common_on"|translate}}</label> - </div> - </div> </div> </div> - <div class="row form-group col-xs-12"> - <label for="" class="col-xs-2 col-form-label labelstyle"> - <span>{{"common_file"|translate}}</span> - </label> - <div class="col-xs-6" style="margin-left: -100px"> + <div class="row form-group"> + <label for="" class="col-xs-2 col-sm-1 col-form-label labelstyle"> + <span>{{"common_file"|translate}}</span> + </label> + <div class="col-xs-6 col-sm-7"> <div class="btn-group btn-group-circle"> <span class="importDivArea mmlBatchBtnBar"> <button class="btn btn-info" id="importBtn" disabled="{{addBottonStatus}}"> <span class="ict-import"></span> - <span>{{"import"|translate}}</span> - </button> - <div id="importDiv" class="container upload"> - <form id="fileupload" #fileForm="ngForm" role="form" enctype="multipart/form-data"> - <div class="file-preview"> - <div id="dropzone" class="file-drop-zone"> - <div class="file-drop-zone-title"> - <span>{{"file_import"|translate}}</span> + <span>{{"import"|translate}}</span> + </button> + <div id="importDiv" class="container upload"> + <form id="fileupload" #fileForm="ngForm" role="form" enctype="multipart/form-data"> + <div class="file-preview"> + <div id="dropzone" class="file-drop-zone"> + <div class="file-drop-zone-title"> + <span>{{"file_import"|translate}}</span> + </div> </div> </div> - </div> - <div class="input-group fileupload-btn"> - <div id="fileName" class="form-control file-caption">task2.zip</div> - <span class="input-group-btn" id="btnGroup"> + <div class="input-group fileupload-btn"> + <div id="fileName" class="form-control file-caption">task2.zip</div> + <span class="input-group-btn" id="btnGroup"> <span class="btn btn-primary fileinput-button white radius_s blue1-active" id="browse" data-placement="bottom" data-toggle="tooltip"> <span class="importBtnFontSize">{{"common_browse"|translate}}</span> - <input type="file" name="file" title=" " accept=".txt" multiple=""> - </span> - <button id="fileremove" class="btn btn-default" type="button"> + <input type="file" name="file" title=" " accept=".txt" multiple=""> + </span> + <button id="fileremove" class="btn btn-default" type="button"> <span class="importBtnFontSize">{{"common_remove"|translate}}</span> </button> - <button id="filesubmit" class="btn btn-default" type="button">{{"common_confirm"|translate}}</button> - </span> - </div> + <button id="filesubmit" class="btn btn-default" type="button">{{"common_confirm"|translate}}</button> + </span> + </div> - </form> - </div> + </form> + </div> </span> </div> </div> </div> - <div class="row form-group col-xs-12"> - <label for="" class="col-xs-2 col-form-label labelstyle"> - <span>{{"message_rule_content"|translate}}</span> - <span style="color: red">*</span> - </label> - <div class="col-xs-8" style="margin-left: -100px"> + <div class="row form-group"> + <label for="" class="col-xs-2 col-sm-1 col-form-label labelstyle"> + <span>{{"message_rule_content"|translate}}</span> + <span style="color: red">*</span> + </label> + <div class="col-xs-9 col-sm-10"> <div class="form-group"> <textarea id="cmds" class="form-control" readonly="{{addBottonStatus}}" [(ngModel)]="queryRule.content" name="content" rows="12" cols="80" required placeholder="package example;"> </textarea> - </div> </div> </div> - <div class="row form-group col-xs-12 " style="margin-left: 73px"> - <div class="col-xs-8 "> + <div class="row form-group"> + <div class="col-xs-8 col-xs-offset-2 col-sm-offset-1"> <label class="myclass" id="checkLabel"> <button type="button" (click)="checkContent('check')" disabled="{{addBottonStatus}}" class="btn btn-info">{{"common_check"|translate}}</button> </label> <label class="myclass" id="updateLabel"> - <button type="button" disabled="{{addBottonStatus}}" class="btn btn-info" (click)="update()">{{"common_update"|translate}}</button> + <button type="button" disabled="{{addBottonStatus}}" class="btn btn-info" (click)="update()">{{"common_update"|translate}}</button> </label> <label class="myclass" id="saveLabel"> - <button type="submit" disabled="{{addBottonStatus}}" class="btn btn-info">{{"common_save"|translate}}</button> + <button type="submit" disabled="{{addBottonStatus}}" class="btn btn-info">{{"common_save"|translate}}</button> </label> <label class="myclass" id="cancelLabel"> <button type="button" routerLink='/alarmRule' class="btn btn-info">{{"common_cancel"|translate}}</button> diff --git a/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts b/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts index 36d721c..56376df 100644 --- a/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts +++ b/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.html b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.html index 6e03db3..99966a8 100644 --- a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.html +++ b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.html @@ -1,5 +1,5 @@ <!-- - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,30 +13,38 @@ See the License for the specific language governing permissions and limitations under the License. --> -<div class="container" style="margin-top: 20px"> +<div class="container-fluid" style="padding: 40px 40px 0 40px"> <form class="form-inline"> <div class="form-body"> <div class="row form-group col-xs-12"> <div class="col-xs-4"> - <label class="col-xs-3 control-label" style="padding-top: 8px"> - {{"common_status"|translate}} - </label> - <select #selection class="form-control" style="width: 60%" id="status" (change)="switch(selection.value)" [(ngModel)]="activeText" - name="activestatus"> - <option *ngFor="let a of activeStatus" [value]="a">{{a|translate}}</option> - </select> + <div class="row"> + <label class="col-xs-3 col-md-2 control-label" style="padding-top: 8px"> + {{"common_status"|translate}} + </label> + <div class="col-xs-7"> + <select #selection class="form-control" id="status" (change)="switch(selection.value)" [(ngModel)]="activeText" name="activestatus" + style="width:100%"> + <option *ngFor="let a of activeStatus" [value]="a">{{a|translate}}</option> + </select> + </div> + </div> </div> <div class="col-xs-4"> - <label for="userName" class="col-xs-3 control-label" style="padding-top: 8px"> - <span>{{"common_keyword"|translate}}</span> - </label> - <input class="form-control ng-untouched ng-pristine ng-valid" style="width: 60%" placeholder='{{"field_rule_name_Add_Page"|translate}}' - type="text" [(ngModel)]="ruleModel.ruleName" name="name"> + <div class="row"> + <label for="userName" class="col-xs-3 control-label" style="padding-top: 8px"> + <span>{{"common_keyword"|translate}}</span> + </label> + <div class="col-xs-7"> + <input class="form-control ng-untouched ng-pristine ng-valid" placeholder='{{"field_rule_name_Add_Page"|translate}}' type="text" + [(ngModel)]="ruleModel.ruleName" name="name" style="width:100%"> + </div> + </div> </div> - <div class="fmrule_btn_group display_table"> - <div class="inline"> + <div class="fmrule_btn_group display_table col-xs-4"> + <div class="inline row"> <button id="batchDeleteButton" class="btn btn-primary" (click)="searchRules()"> <span class="glyphicon glyphicon-search" style="padding-top: 2px"></span> <span>{{"common_query"|translate}}</span> @@ -49,14 +57,12 @@ </div> </div> - <div class="row form-group col-xs-12" style="margin-top: 10px"> - <div class=""> - <div class="inline"> - <button type="button" routerLink='/ruleInfo' class="btn btn-info"> - <span class="glyphicon glyphicon-plus"></span> - <span>{{"common_add"|translate}}</span> + <div class="row form-group" style="margin-top: 10px"> + <div class="inline col-xs-12"> + <button type="button" routerLink='/ruleInfo' class="btn btn-info"> + <span class="glyphicon glyphicon-plus"></span> + <span>{{"common_add"|translate}}</span> </button> - </div> </div> </div> </div> @@ -76,30 +82,43 @@ </tr> </thead> <tbody> + <tr *ngIf="rules == null || rules.length === 0"> + <td colspan="6" style="text-align: center; background-color: white;">{{"nodata"|translate}}</td> + </tr> <tr *ngFor="let rule of rules"> - <td><a routerLink="/ruleInfo/{{rule.ruleId}}&add">{{rule.rulename}}</a></td> - <td [hidden]="rule.enabled === 1" style="text-align: center"><span value=1><img src="../../assets/thirdparty/images/round_off.png" alt=""></span></td> - <td [hidden]="rule.enabled === 0" style="text-align: center"><span value=0><img src="../../assets/thirdparty/images/round_on.png" alt=""></span></td> + <td> + <a routerLink="/ruleInfo/{{rule.ruleId}}&add">{{rule.ruleName}}</a> + </td> + <td [hidden]="rule.enabled === 0"> + <span value=1> + <i class="fas fa-power-off" style="color:#4ac9ff;"></i> + </span> + </td> + <td [hidden]="rule.enabled === 1"> + <span value=0> + <i class="fas fa-power-off" style="color: #aaa;"></i> + </span> + </td> <td>{{rule.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td> <td>{{rule.creator}}</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"> - <img src="../../assets/thirdparty/images/edit.png" alt=""> - </span> + <i class="fas fa-pencil-alt" style="font-size: 14px;"></i> + </span> <span> - - </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> <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=""> - </span> + <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"> - <img src="../../assets/thirdparty/images/delete.png" alt=""> - </span> + <i class="fas fa-times" style="color: rgba(255, 0, 0, 0.788);font-size:16px;vertical-align:-1px;"></i> + </span> </td> </tr> </tbody> @@ -114,7 +133,7 @@ <button class="btn btnDefault btnmrg" data-popmodal-but="ok"> <span>{{"common_confirm"|translate}}</span> </button> - <button class="btn btnDefault btnmrg" type="button" data-popmodal-but="cancel"> + <button class="btn btnDefault btnmrg" type="button" data-popmodal-but="cancel"> <span>{{"common_cancel"|translate}}</span> </button> </div> diff --git a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.ts b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.ts index 65a5296..6e2c997 100644 --- a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.ts +++ b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.component.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ declare var jQuery: any; @Component({ selector: 'alarmRule', - templateUrl: './alarmRule.component.html', - + templateUrl: './alarmRule.component.html' }) + export class AlarmRule implements OnInit { ruleModel: RuleModel; rules: RuleModel[]; @@ -35,15 +35,15 @@ export class AlarmRule implements OnInit { ruleName: string; enable_on = "enabled"; enable_off = "disabled" - totalcount: number; + totalcount: number = 0; model: any; ruleRequest: RuleRequest; solution = 'ANGULAR'; - selection = 'A' + selection = 'A'; 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); @@ -56,7 +56,7 @@ export class AlarmRule implements OnInit { this.ruleModel.enabled = null; } this.setActiveText(); - }; + } setActiveText(): void { if (this.ruleModel.enabled == 1) { @@ -70,18 +70,18 @@ export class AlarmRule implements OnInit { this.activeText = "option_all"; this.ruleRequest.enabled = null; } - }; + } getRules(): Promise<any> { return this._alarmRuleService .getRules() .then(rules => { - this.rules = rules.rules; - this.totalcount = rules.totalcount; + this.rules = rules.correlationRules; + this.totalcount = rules.totalCount; }); } - searchRules(): void { + public searchRules(): void { if (this.ruleModel.enabled == null) { this.ruleRequest.enabled = null; } @@ -95,15 +95,15 @@ export class AlarmRule implements OnInit { this.totalcount = rules.length; }); } - updateRule(rule: RuleModel): void { + public updateRule(rule: RuleModel): void { 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); } - on_off(rule: RuleModel) { + public on_off(rule: RuleModel) { rule.enabled == 0 ? rule.enabled = 1 : rule.enabled = 0; this._alarmRuleService .updateRule(rule) @@ -112,14 +112,14 @@ export class AlarmRule implements OnInit { }); } - reset(): void { + public reset(): void { 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', @@ -129,7 +129,7 @@ export class AlarmRule implements OnInit { }, }); } - 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', @@ -145,7 +145,7 @@ export class AlarmRule implements OnInit { }); } - ngOnInit(): void { + public ngOnInit(): void { this.activeText = 'option_all'; this.ruleModel = { ruleId: null, @@ -158,7 +158,7 @@ export class AlarmRule implements OnInit { modifier: null, enabled: 0, loopControlName: '' - } + }; this.ruleRequest = { ruleId: null, ruleName: null, @@ -166,7 +166,7 @@ export class AlarmRule implements OnInit { modifier: null, enabled: null, loopControlName: '' - } + }; this.getRules(); } } diff --git a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.service.ts b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.service.ts index 33ea713..1f0ee3e 100644 --- a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.service.ts +++ b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.service.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ export class AlarmRuleService { 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); } @@ -69,7 +69,7 @@ export class AlarmRuleService { const url = `${this.ruleUrl}?queryrequest=${JSON.stringify(data)}` return this.http.get(url, { body: data, headers: this.headers }) .toPromise() - .then(res => res.json().rules as RuleModel[]) + .then(res => res.json().correlationRules as RuleModel[]) .catch(this.handleError); } @@ -88,7 +88,8 @@ export class AlarmRuleService { "ruleId": rule.ruleId, "description": rule.description, "content": rule.content, - "enabled": rule.enabled + "enabled": rule.enabled, + "loopControlName": rule.loopControlName } const url = `${this.ruleUrl}` return this.http @@ -103,7 +104,8 @@ export class AlarmRuleService { "description": rule.description, "content": rule.content, "enabled": rule.enabled, - "ruleName": rule.ruleName + "ruleName": rule.ruleName, + "loopControlName": rule.loopControlName } return this.http.put(this.ruleUrl, JSON.stringify(ruledata), { headers: this.headers }) .toPromise() diff --git a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.ts b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.ts index 9c36d30..92c45b5 100644 --- a/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.ts +++ b/rulemgt-frontend/src/app/correlation-ruleList/alarmRule.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/correlation-ruleList/ruleRequest.ts b/rulemgt-frontend/src/app/correlation-ruleList/ruleRequest.ts index 2719a90..065fe50 100644 --- a/rulemgt-frontend/src/app/correlation-ruleList/ruleRequest.ts +++ b/rulemgt-frontend/src/app/correlation-ruleList/ruleRequest.ts @@ -1,5 +1,5 @@ /* - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/app/pages/remote.component.html b/rulemgt-frontend/src/app/pages/remote.component.html index 2b5c8c3..a3f64c8 100644 --- a/rulemgt-frontend/src/app/pages/remote.component.html +++ b/rulemgt-frontend/src/app/pages/remote.component.html @@ -1,5 +1,5 @@ <!-- - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and limitations under the License. --> -<div class="tabzone"> -</div> +<div class="tabzone"></div> <sif-modal></sif-modal> <router-outlet></router-outlet>
\ No newline at end of file diff --git a/rulemgt-frontend/src/assets/framework/browser/css/open-ostyle.css b/rulemgt-frontend/src/assets/framework/browser/css/open-ostyle.css index 763797a..720dc60 100644 --- a/rulemgt-frontend/src/assets/framework/browser/css/open-ostyle.css +++ b/rulemgt-frontend/src/assets/framework/browser/css/open-ostyle.css @@ -909,7 +909,7 @@ a:hover { } .customtable tbody tr:hover td{ - background-color: #e6fbe0 !important; + background-color: #fafafa !important; } .shortnote{ @@ -927,7 +927,7 @@ a:hover { .labelstyle{ text-align:left; - font-size:12px; + font-size:14px; font-family: "Microsoft Yahei",Arial,Tahoma,Verdana,SimSun; } diff --git a/rulemgt-frontend/src/assets/framework/css/open-ostyle.css b/rulemgt-frontend/src/assets/framework/css/open-ostyle.css index 73ec064..200d91f 100644 --- a/rulemgt-frontend/src/assets/framework/css/open-ostyle.css +++ b/rulemgt-frontend/src/assets/framework/css/open-ostyle.css @@ -924,7 +924,7 @@ tr{ } .customtable tbody tr:hover td{ - background-color: #e6fbe0 !important; + background-color: #fafafa !important; } .shortnote{ diff --git a/rulemgt-frontend/src/assets/i18n/en.json b/rulemgt-frontend/src/assets/i18n/en.json index a755c4a..d74c4bb 100644 --- a/rulemgt-frontend/src/assets/i18n/en.json +++ b/rulemgt-frontend/src/assets/i18n/en.json @@ -1,50 +1,52 @@ { - "common_status":"Status", - "common_keyword":"Keyword", - "field_rule_name":"Rule Name", - "common_query":"Query", - "common_reset":"Reset", - "common_add":"Add", - "common_total1":"Total ", - "common_total2":" Rules", - "field_create_time":"Creation Time", - "field_creator":"Creator", - "field_update_time":"Update Time", - "common_operator":"Operations", - "common_update":"Update", - "common_off":"OFF", - "common_on":"ON", - "common_delete":"Delete", - "message_is_delete":"Are you sure to delete the rule?", - "common_cancel":"Cancel", - "common_confirm":"Confirm", - "option_all":"All", - "common_enabled":"Enabled", - "common_disabled":"Disabled", - "field_description":"Description", - "common_check":"Check", - "common_save":"Save", - "common_file":"File", - "import":"Import", - "file_import":"Drag & drop files here ...", - "common_browse":"Browse", - "common_remove":"Remove", - "modalTitleDefault":"Add a Rule", - "closeBtnTitleDefault":"Close", - "modalBodyMessageDefault":"Message Contents", - "message_add_rule_success":"The rule is saved successfully.", - "exception_content_error":"The contents of the rule are invalid.", - "exception_package_error":"The contents of the rule must start with \"package\".", + "common_status": "Status", + "common_keyword": "Keyword", + "field_rule_name": "Rule Name", + "common_query": "Query", + "common_reset": "Reset", + "common_add": "Add", + "common_total1": "Total ", + "common_total2": " Rules", + "field_create_time": "Creation Time", + "field_creator": "Creator", + "field_update_time": "Update Time", + "common_operator": "Operations", + "common_update": "Update", + "common_off": "OFF", + "common_on": "ON", + "common_delete": "Delete", + "message_is_delete": "Are you sure to delete the rule?", + "common_cancel": "Cancel", + "common_confirm": "Confirm", + "option_all": "All", + "common_enabled": "Enabled", + "common_disabled": "Disabled", + "field_description": "Description", + "common_check": "Check", + "common_save": "Save", + "common_file": "File", + "import": "Import", + "file_import": "Drag & drop files here ...", + "common_browse": "Browse", + "common_remove": "Remove", + "modalTitleDefault": "Add a Rule", + "closeBtnTitleDefault": "Close", + "modalBodyMessageDefault": "Message Contents", + "message_add_rule_success": "The rule is saved successfully.", + "exception_content_error": "The contents of the rule are invalid.", + "exception_package_error": "The contents of the rule must start with \"package\".", "warn_delete_info": "Only the disabled rules can be deleted.", - "message_update_rule_success":"The rule is updated successfully.", - "message_engine_error_rule_fail":"Failed to call the interface of the engine management module.", - "modalTitleUpdate":"Rule Update", - "message_other_exception_rule_fail":"Unknown error. Please contact the administrator.", - "message_checkContent_rule_success":"The contents of the rule are valid.", - "modalTitleCheck":"Verification", - "message_rule_name_repeat_error":"A rule with the same name already exists.", - "message_rule_content_repeat_error":"A rule with the same contents already exists.", - "message_rule_content":"Rule Contents", - "message_rule_update_error":"The rule has not corresponding entity in the engine. Please contact the administrator to remove the rule manually from the database.", - "field_rule_name_Add_Page":"Rule Name" + "message_update_rule_success": "The rule is updated successfully.", + "message_engine_error_rule_fail": "Failed to call the interface of the engine management module.", + "modalTitleUpdate": "Rule Update", + "message_other_exception_rule_fail": "Unknown error. Please contact the administrator.", + "message_checkContent_rule_success": "The contents of the rule are valid.", + "modalTitleCheck": "Verification", + "message_rule_name_repeat_error": "A rule with the same name already exists.", + "message_rule_content_repeat_error": "A rule with the same contents already exists.", + "message_rule_content": "Rule Contents", + "message_rule_update_error": "The rule has not corresponding entity in the engine. Please contact the administrator to remove the rule manually from the database.", + "field_rule_name_Add_Page": "Rule Name", + "field_controlLoopName": "Control Loop", + "nodata": "No data" }
\ No newline at end of file diff --git a/rulemgt-frontend/src/assets/i18n/zh.json b/rulemgt-frontend/src/assets/i18n/zh.json index 565c457..0dc1912 100644 --- a/rulemgt-frontend/src/assets/i18n/zh.json +++ b/rulemgt-frontend/src/assets/i18n/zh.json @@ -1,50 +1,52 @@ { - "common_status":"状态", - "common_keyword":"关键字", - "field_rule_name":"规则名称", - "common_query":"查询 ", - "common_reset":"重置", - "common_add":"添加", - "common_total1":"共 ", - "common_total2":" 条记录", - "field_create_time":"创建时间", - "field_creator":"创建者", - "field_update_time":"修改时间", - "common_operator":"操作", - "common_update":"修改", - "common_off":"禁用", - "common_on":"启用", - "common_delete":"删除", - "message_is_delete":"是否删除", - "common_cancel":"取消", - "common_confirm":"确认", - "option_all":"全部", - "common_enabled":"已启用", - "common_disabled":"已禁用", - "field_description":"描述", - "common_check":"校验", - "common_save":"保存", - "common_file":"文件", - "import":"导入", - "file_import":"拖放文件到这里 ...", - "common_browse":"浏览", - "common_remove":"移除", - "modalTitleDefault":"规则添加", - "closeBtnTitleDefault":"关闭", - "modalBodyMessageDefault":"消息体", - "message_add_rule_success":"添加成功", - "exception_content_error":"规则内容错误", - "exception_package_error":"规则必须以package开头", - "warn_delete_info":"只能删除处于已停止状态的规则", - "message_update_rule_success":"修改成功", - "message_exception_rule_fail":"从引擎调用删除规则接口失败", - "modalTitleUpdate":"规则修改", - "message_other_exception_rule_fail":"发生其他错误", - "message_checkContent_rule_success":"规则内容正确", - "modalTitleCheck":"验证规则", - "message_rule_name_repeat_error":"规则名字重复", - "message_rule_content_repeat_error":"规则内容重复", - "message_rule_content":"规则内容", - "message_rule_update_error":"规则的引擎内容被删了,请联系管理员删除这条规则", - "field_rule_name_Add_Page":"规则名称" + "common_status": "状态", + "common_keyword": "关键字", + "field_rule_name": "规则名称", + "common_query": "查询 ", + "common_reset": "重置", + "common_add": "添加", + "common_total1": "共 ", + "common_total2": " 条记录", + "field_create_time": "创建时间", + "field_creator": "创建者", + "field_update_time": "修改时间", + "common_operator": "操作", + "common_update": "修改", + "common_off": "禁用", + "common_on": "启用", + "common_delete": "删除", + "message_is_delete": "是否删除", + "common_cancel": "取消", + "common_confirm": "确认", + "option_all": "全部", + "common_enabled": "已启用", + "common_disabled": "已禁用", + "field_description": "描述", + "common_check": "校验", + "common_save": "保存", + "common_file": "文件", + "import": "导入", + "file_import": "拖放文件到这里 ...", + "common_browse": "浏览", + "common_remove": "移除", + "modalTitleDefault": "规则添加", + "closeBtnTitleDefault": "关闭", + "modalBodyMessageDefault": "消息体", + "message_add_rule_success": "添加成功", + "exception_content_error": "规则内容错误", + "exception_package_error": "规则必须以package开头", + "warn_delete_info": "只能删除处于已停止状态的规则", + "message_update_rule_success": "修改成功", + "message_exception_rule_fail": "从引擎调用删除规则接口失败", + "modalTitleUpdate": "规则修改", + "message_other_exception_rule_fail": "发生其他错误", + "message_checkContent_rule_success": "规则内容正确", + "modalTitleCheck": "验证规则", + "message_rule_name_repeat_error": "规则名字重复", + "message_rule_content_repeat_error": "规则内容重复", + "message_rule_content": "规则内容", + "message_rule_update_error": "规则的引擎内容被删了,请联系管理员删除这条规则", + "field_rule_name_Add_Page": "规则名称", + "field_controlLoopName": "控制环", + "nodata": "无数据" }
\ No newline at end of file diff --git a/rulemgt-frontend/src/assets/images/logo.png b/rulemgt-frontend/src/assets/images/logo.png Binary files differnew file mode 100644 index 0000000..1f47ed0 --- /dev/null +++ b/rulemgt-frontend/src/assets/images/logo.png diff --git a/rulemgt-frontend/src/default.html b/rulemgt-frontend/src/default.html index beab509..33280b7 100644 --- a/rulemgt-frontend/src/default.html +++ b/rulemgt-frontend/src/default.html @@ -17,10 +17,12 @@ <html> <head> - <!-- <base href=""> --> + <base href="/iui/holmes/"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="./assets/thirdparty/js/jquery_1.12.4.min.js"></script> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" + crossorigin="anonymous"> <style type="text/css"> .header { @@ -59,21 +61,20 @@ .body { min-height: 500px; - height: 500px; padding: 0; } body { margin: 0; - overflow: auto; } iframe { margin: 0; + border: none; } .menu-item { - height: 135px; + height: 120px; color: #aaa; text-align: center; } @@ -84,22 +85,22 @@ } .menu-item-title { - height: 50px; - line-height: 50px; + height: 45px; + line-height: 25px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; } .menu-icon { - height: 85px; - line-height: 85px; + height: 75px; + line-height: 90px; + font-size: 35px; } .active { color: #FFF; background-color: #424e57; } - </style> </head> @@ -114,31 +115,41 @@ </div> <div class="body"> <div class="sidebar fl"> - <div class="menu-item active"> + <div class="menu-item active" id="rule-mgmt"> <div class="menu-icon"> - icon + <i class="fas fa-file-alt"></i> </div> <div class="menu-item-title">Rules</div> </div> </div> <div class="main fl"> - <iframe src="/iui/holmes/index.html"></iframe> + <iframe src="/iui/holmes/#/alarmRule"></iframe> </div> </div> <script type="text/javascript"> + + var menus = { + "rule-mgmt": "/iui/holmes/#/alarmRule" + } + function adjustSizes() { - var height = $(window).height() - $(".header").height(); - $(".sidebar").height(height); - $("iframe").height(height); - $("iframe").width($(window).width() - $(".sidebar").width()); + var height = $(window).height() - $(".header").outerHeight() - 4; + $(".sidebar").height(height); + $("iframe").height(height); + $(".main").height(height); + $("iframe").width($(window).width() - $(".sidebar").width()); } - $(function(){ - $(window).on("resize", function(){ + $(function () { + $(window).on("resize", function () { adjustSizes(); }); adjustSizes(); + + $(".menu-item").on("click", function () { + $("iframe")[0].src = menus[$(this).attr("id")]; + }) }); </script> </body> diff --git a/rulemgt-frontend/src/index.html b/rulemgt-frontend/src/index.html index c8da64f..8a8252a 100644 --- a/rulemgt-frontend/src/index.html +++ b/rulemgt-frontend/src/index.html @@ -1,5 +1,5 @@ <!-- - Copyright 2017 ZTE Corporation. + Copyright 2018 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,10 +17,13 @@ <html> <head> - <base href="/"> + <base href="/iui/holmes-local/"> <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> @@ -30,5 +33,4 @@ <body style="overflow: auto"> <remote-config>Loading...</remote-config> </body> - </html> diff --git a/rulemgt-frontend/src/main.ts b/rulemgt-frontend/src/main.ts index ac36dfe..028eb6d 100644 --- a/rulemgt-frontend/src/main.ts +++ b/rulemgt-frontend/src/main.ts @@ -1,4 +1,4 @@ -/* Copyright 2017 ZTE Corporation. +/* Copyright 2018 ZTE Corporation. * *Licensed under the Apache License, Version 2.0 (the "License"); *you may not use this file except in compliance with the License. diff --git a/rulemgt-frontend/src/polyfills.ts b/rulemgt-frontend/src/polyfills.ts index ed349af..d8d80f8 100644 --- a/rulemgt-frontend/src/polyfills.ts +++ b/rulemgt-frontend/src/polyfills.ts @@ -1,4 +1,4 @@ -/* Copyright 2017 ZTE Corporation. +/* Copyright 2018 ZTE Corporation. * *Licensed under the Apache License, Version 2.0 (the "License"); *you may not use this file except in compliance with the License. diff --git a/rulemgt-standalone/src/main/assembly/Dockerfile b/rulemgt-standalone/src/main/assembly/Dockerfile index 03265a6..46c79c8 100644 --- a/rulemgt-standalone/src/main/assembly/Dockerfile +++ b/rulemgt-standalone/src/main/assembly/Dockerfile @@ -33,7 +33,7 @@ RUN set -x \ RUN apk upgrade \ && apk update \ && apk add --no-cache curl \ - && apk add --no-cache postgresql-client=10.4-r0 + && apk add --no-cache postgresql-client=10.5-r0 #add the frontend pacakge to the docker images RUN rm /etc/nginx/conf.d/default.conf diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java index daebff3..5d577cc 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java @@ -1,12 +1,12 @@ /** - * Copyright 2017 ZTE Corporation. - * + * Copyright 2017-2018 ZTE Corporation. + * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,6 +17,7 @@ package org.onap.holmes.rulemgt; import io.dropwizard.setup.Environment; + import java.util.EnumSet; import java.util.HashSet; import java.util.Set; @@ -24,6 +25,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.servlet.DispatcherType; + import lombok.extern.slf4j.Slf4j; import org.onap.holmes.common.config.MicroServiceConfig; import org.onap.holmes.common.dropwizard.ioc.bundle.IOCApplication; @@ -59,12 +61,15 @@ public class RuleActiveApp extends IOCApplication<RuleAppConfig> { log.warn(e.getMessage(), e); } - ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); - service.scheduleAtFixedRate( - new DcaeConfigurationPolling(MicroServiceConfig.getEnv(MicroServiceConfig.HOSTNAME)), 0, - DcaeConfigurationPolling.POLLING_PERIOD, TimeUnit.MILLISECONDS); - environment.servlets().addFilter("customFilter",new TransactionIdFilter()).addMappingForUrlPatterns(EnumSet - .allOf(DispatcherType.class),true,"/*"); + if (!System.getenv("TESTING").equals("1")) { + ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); + service.scheduleAtFixedRate( + new DcaeConfigurationPolling(MicroServiceConfig.getEnv(MicroServiceConfig.HOSTNAME)), 0, + DcaeConfigurationPolling.POLLING_PERIOD, TimeUnit.MILLISECONDS); + } + + environment.servlets().addFilter("customFilter", new TransactionIdFilter()).addMappingForUrlPatterns(EnumSet + .allOf(DispatcherType.class), true, "/*"); new MsbQuery().startTimer(); } diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java index c6ba4b7..f4978ab 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java @@ -23,9 +23,9 @@ import lombok.Setter; @Setter
public class RuleQueryCondition {
- @SerializedName(value = "ruleid")
+ @SerializedName(value = "ruleId")
private String rid;
- @SerializedName(value = "rulename")
+ @SerializedName(value = "ruleName")
private String name;
private int enabled;
private String creator;
|