diff --git a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts
index 7fec7a8c..f46ece06 100644
--- a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts
+++ b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts
@@ -104,11 +104,28 @@ export class AlarmRule implements OnInit {
}
on_off(rule: RuleModel) {
- rule.enabled == 0 ? rule.enabled = 1 : rule.enabled = 0;
+
+ let ru: RuleModel = rule;
+ if (ru.enabled == 0) {
+ ru.enabled = 1;
+ } else {
+ ru.enabled = 0;
+ }
this._alarmRuleService
- .updateRule(rule)
+ .updateRule(ru)
.then(res => {
- rule = res;
+ let resp: string = res._body;
+ if (resp.includes("ruleid")) {
+ if (rule.enabled == 0) {
+ rule.enabled = 1;
+ } else {
+ rule.enabled = 0;
+ }
+ } else {
+ let msg = { title: "modalTitleUpdate", message: resp };
+ this.modalService.getmodalObservable.next(msg);
+ }
+
});
}
diff --git a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts
index a76319f1..5f84a5ba 100644
--- a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts
+++ b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts
@@ -23,8 +23,8 @@ import { Router } from '@angular/router';
import { ModalService } from '../correlation-modal/modal.service';
@Injectable()
-export class AlarmRuleService {
- private ruleUrl = "/api/correlation-mgt/v1/rule";
+export class AlarmRuleService {//api/holmes-rule-mgmt/v1 /api/correlation-mgt/v1/rul
+ private ruleUrl = "/api/holmes-rule-mgmt/v1/rule";
private headers = new Headers({ 'Content-Type': 'application/json' });
constructor(private http: Http, private modalService: ModalService, private router: Router) { }
@@ -73,8 +73,8 @@ export class AlarmRuleService {
.catch(this.handleError);
}
- checkContent(ruleContent: string): Promise {
- const url = "/api/correlation-engine/v1/rule";
+ checkContent(ruleContent: string): Promise {//api/holmes-engine-mgmt/v1 api/correlation-engine/v1
+ const url = "/api/holmes-engine-mgmt/v1/rule";
let data = { content: ruleContent };
return this.http
.post(url, JSON.stringify(data), { headers: this.headers })
diff --git a/alarm-analysis/src/main/webapp/alarm/app/pages/remote.component.html b/alarm-analysis/src/main/webapp/alarm/app/pages/remote.component.html
index 398159a3..3d8c4838 100644
--- a/alarm-analysis/src/main/webapp/alarm/app/pages/remote.component.html
+++ b/alarm-analysis/src/main/webapp/alarm/app/pages/remote.component.html
@@ -13,7 +13,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
\ No newline at end of file
diff --git a/alarm-analysis/src/main/webapp/alarm/index.html b/alarm-analysis/src/main/webapp/alarm/index.html
index 094e972f..234d7160 100644
--- a/alarm-analysis/src/main/webapp/alarm/index.html
+++ b/alarm-analysis/src/main/webapp/alarm/index.html
@@ -20,12 +20,12 @@
-
+