aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYILI <li.yi101@zte.com.cn>2017-04-01 10:12:49 +0800
committer6092002077 <li.yi101@zte.com.cn>2017-04-01 10:12:49 +0800
commit0d55c2e3df210da06c3f4c8856d71ec590721810 (patch)
tree617ce41228243a4d3cff383504496cf66b655ac9
parentf2ead9f64ae1e9816c948793d676e73b3af8e9ed (diff)
Modify i18n file and other bugs
modify i18n configuration in app.component.ts file and modify other bugs Issue-ID:CLIENT-164 Change-Id: I7d3b1db9fd3f8d8e58ff0ddc84965e457afa3c6b Signed-off-by: YILI <li.yi101@zte.com.cn>
-rw-r--r--alarm-analysis/src/main/webapp/alarm/app/app.component.ts2
-rw-r--r--alarm-analysis/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts43
-rw-r--r--alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html16
-rw-r--r--alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts23
-rw-r--r--alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts8
-rw-r--r--alarm-analysis/src/main/webapp/alarm/app/pages/remote.component.html2
-rw-r--r--alarm-analysis/src/main/webapp/alarm/index.html12
7 files changed, 51 insertions, 55 deletions
diff --git a/alarm-analysis/src/main/webapp/alarm/app/app.component.ts b/alarm-analysis/src/main/webapp/alarm/app/app.component.ts
index d6ad1c0e..cc8fdc7e 100644
--- a/alarm-analysis/src/main/webapp/alarm/app/app.component.ts
+++ b/alarm-analysis/src/main/webapp/alarm/app/app.component.ts
@@ -33,7 +33,7 @@ export class AppComponent implements OnInit{
}
ngOnInit():void {
- this.translate.addLangs(["en", "zh"]);
+ this.translate.addLangs(["en-US", "zh-CN"]);
this.translate.setDefaultLang('zh');
let language = this.getLanguage();
this.translate.use(language);
diff --git a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts
index 8bcbad5b..26c28b82 100644
--- a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts
+++ b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts
@@ -41,18 +41,16 @@ export class RuleInfo implements OnInit {
this.alarmRuleService.checkContent(this.queryRule.content)
.then(res => {
- if (res.status == 200) {
+ if (res._body == 'true') {
this.alarmRuleService.updateRule(this.queryRule)
.then(res => {
- if (res.status == 200) {
+ let resp: string = res._body;
+ if (resp.includes("ruleid")) {
let msg = { title: "modalTitleUpdate", message: "message_update_rule_success" };
this.modalService.getmodalObservable.next(msg);
this.router.navigate(['alarmRule']);
- } else if (res.status == 499) {
- let msg = { title: "modalTitleUpdate", message: "message_exception_rule_fail" };
- this.modalService.getmodalObservable.next(msg);
} else {
- let msg = { title: "modalTitleUpdate", message: "message_other_exception_rule_fail" };
+ let msg = { title: "modalTitleUpdate", message: res._body };
this.modalService.getmodalObservable.next(msg);
}
}).catch(
@@ -62,14 +60,9 @@ export class RuleInfo implements OnInit {
}
);
- } else if (res.status == 499) {
- let msg = { "title": "modalTitleCheck", message: "message_rule_content_repeat_error" };
- this.modalService.getmodalObservable.next(msg);
- return false;
} else {
- let msg = { "title": "modalTitleCheck", message: "message_other_exception_rule_fail" };
+ let msg = { title: "modalTitleUpdate", message: res._body };
this.modalService.getmodalObservable.next(msg);
- return false;
}
})
}
@@ -85,17 +78,15 @@ export class RuleInfo implements OnInit {
this.modalService.getmodalObservable.next(msg);
} else {
this.alarmRuleService.checkContent(this.queryRule.content).then(res => {
- if (res.status == 200) {
+ if (res._body == 'true') {
this.alarmRuleService.save(this.queryRule).then(res => {
- if (res.status == 200) {
+ let resp: string = res._body;
+ if (resp.includes("ruleid")) {
let msg = { title: "modalTitleDefault", message: "message_add_rule_success" };
this.modalService.getmodalObservable.next(msg);
this.router.navigate(['alarmRule']);
- } else if (res.status == 499) {
- let msg = { title: "modalTitleDefault", message: "message_rule_name_repeat_error" };
- this.modalService.getmodalObservable.next(msg);
} else {
- let msg = { "title": "modalTitleCheck", message: "message_other_exception_rule_fail" };
+ let msg = { "title": "modalTitleCheck", message: res._body };
this.modalService.getmodalObservable.next(msg);
}
@@ -103,15 +94,9 @@ export class RuleInfo implements OnInit {
let msg = { title: "modalTitleDefault", message: "message_rule_name_repeat_error" };
this.modalService.getmodalObservable.next(msg);
});
- return true;
- } else if (res.status == 499) {
- let msg = { "title": "modalTitleCheck", message: "message_rule_content_repeat_error" };
- this.modalService.getmodalObservable.next(msg);
- return false;
} else {
- let msg = { "title": "modalTitleCheck", message: "message_other_exception_rule_fail" };
+ let msg = { "title": "modalTitleCheck", message: res._body };
this.modalService.getmodalObservable.next(msg);
- return false;
}
})
}
@@ -132,15 +117,11 @@ export class RuleInfo implements OnInit {
} else {
this.alarmRuleService.checkContent(this.queryRule.content)
.then(res => {
- if (res.status == 200) {
+ if (res._body == 'true') {
let msg = { "title": "modalTitleCheck", message: "message_checkContent_rule_success" };
this.modalService.getmodalObservable.next(msg);
- } else if (res.status == 499) {
- let msg = { "title": "modalTitleCheck", message: "message_rule_content_repeat_error" };
- this.modalService.getmodalObservable.next(msg);
- return false;
} else {
- let msg = { "title": "modalTitleCheck", message: "message_other_exception_rule_fail" };
+ let msg = { "title": "modalTitleCheck", message: res._body };
this.modalService.getmodalObservable.next(msg);
return false;
}
diff --git a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html
index 3a259fda..ead93003 100644
--- a/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html
+++ b/alarm-analysis/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html
@@ -78,27 +78,27 @@
<tbody>
<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="../../../public/thirdparty/images/round_off.png" alt=""></span></td>
- <td [hidden]="rule.enabled === 0" style="text-align: center"><span value=0><img src="../../../public/thirdparty/images/round_on.png" alt=""></span></td>
+ <td [hidden]="rule.enabled === 1" style="text-align: center"><span value=1><img src="public/thirdparty/images/round_off.png" alt=""></span></td>
+ <td [hidden]="rule.enabled === 0" style="text-align: center"><span value=0><img src="public/thirdparty/images/round_on.png" alt=""></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="../../../public/thirdparty/images/edit.png" alt="">
+ <img src="public/thirdparty/images/edit.png" alt="">
</span>
<span>
</span>
- <span [hidden]="rule.enabled===1" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
- <img src="../../../public/thirdparty/images/on.png" alt="">
+ <span [hidden]="rule.enabled===0" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
+ <img src="public/thirdparty/images/on.png" alt="">
</span>
- <span [hidden]="rule.enabled===0" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
- <img src="../../../public/thirdparty/images/off.png" alt="">
+ <span [hidden]="rule.enabled===1" class="" (click)="on_off(rule); $event.stopPropagation()" style="cursor: pointer;margin: 0 5px">
+ <img src="public/thirdparty/images/off.png" alt="">
</span>
<span class="" id={{rule.ruleid}} (click)="delete(rule)" style="cursor: pointer;margin: 0 5px">
- <img src="../../../public/thirdparty/images/delete.png" alt="">
+ <img src="public/thirdparty/images/delete.png" alt="">
</span>
</td>
</tr>
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<any> {
- const url = "/api/correlation-engine/v1/rule";
+ checkContent(ruleContent: string): Promise<any> {//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.
-->
-<div class="tabzone">
-</div>
<sif-modal></sif-modal>
<router-outlet></router-outlet> \ 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 @@
<base href="/holmes/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <!--<script src="../public/thirdparty/js/jquery_1.12.4.min.js"></script>
- <script src="../public/common/js/popModal.js"></script>
- <script src="../public/common/js/jQuery-File-Upload/js/jquery.ui.widget.js"></script>
- <script src="../public/common/js/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
- <script src="../public/common/js/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
- <script src="../public/common/js/jQuery-File-Upload/js/jquery.fileupload.js"></script>-->
+ <!--<script src="public/thirdparty/js/jquery_1.12.4.min.js"></script>
+ <script src="public/common/js/popModal.js"></script>
+ <script src="public/common/js/jQuery-File-Upload/js/jquery.ui.widget.js"></script>
+ <script src="public/common/js/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
+ <script src="public/common/js/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
+ <script src="public/common/js/jQuery-File-Upload/js/jquery.fileupload.js"></script>-->
<script src="./public/js/jquery_1.12.4.min.js"></script>
<script src="./public/js/popModal.js"></script>