From 101e5e37f4ece60af8d08020c7e4bd8f473adce7 Mon Sep 17 00:00:00 2001 From: zhangab Date: Thu, 18 Oct 2018 12:36:05 +0800 Subject: Update usecase-ui version for R3 Change-Id: I6d9b3e71f69d17d34dc5f5074a6f2d7025516e58 Issue-ID: USECASEUI-153 Signed-off-by: zhangab --- .../src/main/webapp/alarm/app/app.component.ts | 41 --- .../src/main/webapp/alarm/app/app.module.ts | 46 ---- .../src/main/webapp/alarm/app/app.routing.ts | 40 --- .../app/correlation-modal/modal.component.html | 31 --- .../alarm/app/correlation-modal/modal.component.ts | 44 --- .../alarm/app/correlation-modal/modal.service.ts | 24 -- .../main/webapp/alarm/app/correlation-modal/msg.ts | 20 -- .../correlation-ruleInfo/ruleInfo.component.html | 150 ----------- .../app/correlation-ruleInfo/ruleInfo.component.ts | 295 --------------------- .../correlation-ruleList/alarmRule.component.html | 135 ---------- .../correlation-ruleList/alarmRule.component.ts | 170 ------------ .../app/correlation-ruleList/alarmRule.service.ts | 123 --------- .../alarm/app/correlation-ruleList/alarmRule.ts | 26 -- .../alarm/app/correlation-ruleList/ruleRequest.ts | 22 -- usecaseui-holmes/src/main/webapp/alarm/app/main.ts | 19 -- .../webapp/alarm/app/pages/remote.component.html | 19 -- usecaseui-holmes/src/main/webapp/alarm/index.html | 41 --- .../src/main/webapp/alarm/main.browser.ts | 20 -- usecaseui-holmes/src/main/webapp/alarm/main.ts | 21 -- .../src/main/webapp/alarm/polyfills.browser.ts | 43 --- .../src/main/webapp/alarm/polyfills.ts | 22 -- usecaseui-holmes/src/main/webapp/alarm/vendor.ts | 44 --- 22 files changed, 1396 deletions(-) delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/app.component.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/app.module.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/app.routing.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.html delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.service.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/msg.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.html delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/ruleRequest.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/main.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/app/pages/remote.component.html delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/index.html delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/main.browser.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/main.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/polyfills.browser.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/polyfills.ts delete mode 100644 usecaseui-holmes/src/main/webapp/alarm/vendor.ts (limited to 'usecaseui-holmes/src/main/webapp/alarm') diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/app.component.ts b/usecaseui-holmes/src/main/webapp/alarm/app/app.component.ts deleted file mode 100644 index cc69df2a..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/app.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { Component,OnInit } from '@angular/core'; -import {TranslateService} from 'ng2-translate'; -@Component({ - selector: 'remote-config', - templateUrl: './pages/remote.component.html', -}) -export class AppComponent implements OnInit{ - constructor(private translate:TranslateService){} - getLanguage():string{ - let rtnLanguage = localStorage.getItem("language-option"); - if( rtnLanguage == "null" || rtnLanguage == null ){ - rtnLanguage =window.navigator.language; - } - if( rtnLanguage.startsWith('en') ){ - return "en-US"; - } - return rtnLanguage; - } - - ngOnInit():void { - this.translate.addLangs(["en", "zh"]); - this.translate.setDefaultLang('zh'); - let language = this.getLanguage(); - this.translate.use(language); - } -} \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/app.module.ts b/usecaseui-holmes/src/main/webapp/alarm/app/app.module.ts deleted file mode 100644 index 72c60aa5..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/app.module.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { FormsModule } from '@angular/forms'; -import {routing} from "./app.routing"; -import {AppComponent} from "./app.component"; -import {AlarmRule} from "./correlation-ruleList/alarmRule.component"; -import {RuleInfo} from "./correlation-ruleInfo/ruleInfo.component"; -import {ModalService} from "./correlation-modal/modal.service"; -import {HttpModule,Jsonp} from '@angular/http'; -import {AlarmRuleService} from './correlation-ruleList/alarmRule.service'; -import {TranslateModule} from "ng2-translate"; -import {SifModalComponent} from './correlation-modal/modal.component' -@NgModule({ - imports: [ - BrowserModule, - FormsModule, - HttpModule, - routing, - TranslateModule.forRoot() - - ], - declarations: [ - AppComponent, - AlarmRule, - RuleInfo, - SifModalComponent - ], - providers:[ModalService,AlarmRuleService,Jsonp], - bootstrap: [AppComponent] -}) -export class AppModule { } \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/app.routing.ts b/usecaseui-holmes/src/main/webapp/alarm/app/app.routing.ts deleted file mode 100644 index 35021677..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/app.routing.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -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' -const appRoutes: Routes = [ - { - path: 'alarmRule', - component:AlarmRule - }, - { - path: 'ruleInfo', - component: RuleInfo - }, - { - path: 'ruleInfo/:id', - component: RuleInfo - }, - { - path:'', - redirectTo:'alarmRule', - pathMatch: 'full' - }, - -]; -export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes,{ useHash: true }); diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.html b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.html deleted file mode 100644 index 16f61e81..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.html +++ /dev/null @@ -1,31 +0,0 @@ - - \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.ts deleted file mode 100644 index 6c9f432c..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.component.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { Component, Input, OnInit } from '@angular/core'; -import { ModalService } from './modal.service'; -import { Msg } from './msg'; -declare var $: any; -@Component({ - - selector: 'sif-modal', - templateUrl: './modal.component.html', - -}) -export class SifModalComponent implements OnInit { - constructor(private modalServer: ModalService) { }; - modalTitle: string = "modalTitleDefault"; - modalBodyMessage: string = "modalBodyMessageDefault"; - closeBtnTitle: string = "closeBtnTitleDefault"; - - ngOnInit(): void { - console.log('init'); - this.modalServer.getmodalObservable.subscribe((msg: Msg) => { - console.log('receive ' + msg); - this.modalTitle = msg.title || this.modalTitle; - this.modalBodyMessage = msg.message || this.modalBodyMessage; - this.closeBtnTitle = msg.btn || this.closeBtnTitle; - $('#myModal').modal('show'); - }); - } - - -} diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.service.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.service.ts deleted file mode 100644 index 1d41bfd0..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/modal.service.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { Subject } from 'rxjs/Subject'; -import { Injectable } from '@angular/core'; -@Injectable() -export class ModalService { - private modalObservable = new Subject(); - get getmodalObservable() { - return this.modalObservable; - } -} diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/msg.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/msg.ts deleted file mode 100644 index 8608dc1c..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-modal/msg.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -export interface Msg { - title?: string; - message: string; - btn?: string; -} \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.html b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.html deleted file mode 100644 index b77f5479..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.html +++ /dev/null @@ -1,150 +0,0 @@ - -
-
-
- -
- -
- -
-
- -
- -
- -
-
- -
- - -
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - - -
- -
- -
- -
-
- - -
- -
-
-
- {{"file_import"|translate}} -
-
-
- -
-
task2.zip
- - - {{"common_browse"|translate}} - - - - - -
- - -
-
-
-
-
- -
- -
-
- - -
-
-
- -
-
- - - - -
-
-
- -
\ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts deleted file mode 100644 index 8222735c..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleInfo/ruleInfo.component.ts +++ /dev/null @@ -1,295 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { Component, OnInit, Input } from '@angular/core'; -import { RuleModel } from '../correlation-ruleList/alarmRule'; -import { ActivatedRoute, Params, Router } from '@angular/router'; -import { AlarmRuleService } from '../correlation-ruleList/alarmRule.service'; -import { Http, Response, Headers } from '@angular/http'; -import { ModalService } from '../correlation-modal/modal.service'; -import { NgModel } from '@angular/forms'; -declare var $: any; -@Component({ - selector: 'RuleInfo', - templateUrl: './ruleInfo.component.html' -}) -export class RuleInfo implements OnInit { - formModel: RuleModel; - queryRule: RuleModel; - id: number; - addBottonStatus: boolean; - constructor(private modalService: ModalService, private route: ActivatedRoute, private router: Router, private alarmRuleService: AlarmRuleService, http: Http) { }; - - update() { - this.queryRule.enabled = $('input:radio:checked').val(); - if (!this.queryRule.content.startsWith("package ")) { - let msg = { title: "exception_content_error", message: "exception_package_error" }; - this.modalService.getmodalObservable.next(msg); - } else { - - this.alarmRuleService.checkContent(this.queryRule.content) - .then(res => { - if (res.status == 200) { - this.alarmRuleService.updateRule(this.queryRule) - .then(res => { - if (res.status == 200) { - 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" }; - this.modalService.getmodalObservable.next(msg); - } - }).catch( - res => { - let msg = { title: "modalTitleUpdate", message: "message_other_exception_rule_fail" }; - 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" }; - this.modalService.getmodalObservable.next(msg); - return false; - } - }) - } - } - - onSubmit(obj: NgModel) { - this.save(); - } - - save() { - if (!this.queryRule.content.startsWith("package ")) { - let msg = { title: "exception_content_error", message: "exception_package_error" }; - this.modalService.getmodalObservable.next(msg); - } else { - this.alarmRuleService.checkContent(this.queryRule.content).then(res => { - if (res.status == 200) { - this.alarmRuleService.save(this.queryRule).then(res => { - if (res.status == 200) { - 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" }; - this.modalService.getmodalObservable.next(msg); - } - - }).catch(error => { - 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" }; - this.modalService.getmodalObservable.next(msg); - return false; - } - }) - } - } - - getRuleInfo(id: string): void { - this.route.params.switchMap((params: Params) => this.alarmRuleService.search(id)) - .subscribe(rule => { - rule[0].enabled = "" + rule[0].enabled; - this.queryRule = rule[0] - }) - } - - checkContent(judge: string): void { - if (!this.queryRule.content.startsWith("package ")) { - let msg = { title: "exception_content_error", message: "exception_package_error" }; - this.modalService.getmodalObservable.next(msg); - } else { - this.alarmRuleService.checkContent(this.queryRule.content) - .then(res => { - if (res.status == 200) { - 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" }; - this.modalService.getmodalObservable.next(msg); - return false; - } - }); - } - } - switch(): void { - // alert(this.queryRule.enabled); - this.queryRule.enabled == '0' ? this.queryRule.enabled = '1' : this.queryRule.enabled = '0'; - } - - - initUpload(queryRule: RuleModel): void { - $("#fileName").text(""); - $("#importFailTip").addClass("hide_panel"); - $("#fileupload").fileupload({ - - dropZone: $('#dropzone'), - maxNumberOfFiles: 1, - maxChunkSize: 20000000, - autoUpload: false, - add: function (e, data) { - var fileName = data.files[0].name; - - $("#importFailTip").addClass("hide_panel"); - let suffix = fileName.substring(fileName.lastIndexOf("."), fileName.length) - - if (suffix != ".txt") { - $("#importFailTip").removeClass("hide_panel"); - return suffix; - } - - $("#bar").css('width', '0%'); - $("#persent").text('0%'); - $("#fileName").text(fileName); - $("#fileremove").attr("disabled", false); - $("#filesubmit").attr("disabled", false); - $("#filesubmit").click(function () { - this.file = data.files[0] - var reader = new FileReader(); - reader.readAsText(this.file); - reader.onload = function (data) { - queryRule.content = this.result; - } - $("#fileremove").click(); - $("#importDiv").hide(); - e.stopPropagation(); - }); - - $("#fileremove").click(function () { - $("#bar").css('width', '0%'); - $("#persent").text("0%"); - $("#fileName").text(""); - $("#filesubmit").attr("disabled", true); - $("#fileremove").attr("disabled", true); - }); - }, - done: function (e, data) { - - }, - fail: function (e, resp) { - }, - always: function (e, data) { - $(".progress").removeClass("active"); - $("#bar").css('width', '100%'); - $("#persent").text('100%'); - }, - progressall: function (e, data) { - } - }); - } - - initImportDiv(queryRule: RuleModel): void { - this.initUpload(queryRule); - var importDiv = $("#importDiv"); - $(function (arg) { - $("#importBtn").click(function (e) { - e.preventDefault(); - $("[data-toggle='tooltip']").tooltip(); - $("#importFailTip").addClass("hide_panel"); - showDiv(); - $(document).one("click", function (e) { - $(importDiv).hide(); - }); - e.stopPropagation(); - }); - $(importDiv).click(function (e) { - e.stopPropagation(); - }); - $("#filesubmit").attr("disabled", true); - $("#fileremove").attr("disabled", true); - }); - function showDiv() { - $("#bar").css('width', '0%'); - $("#persent").text('0%'); - $(importDiv).fadeIn(); - } - } - ngOnInit() { - this.formModel = { - ruleid: null, - rulename: null, - description: null, - content: null, - createtime: null, - creator: null, - updatetime: null, - modifier: null, - enabled: null, - } - this.queryRule = { - ruleid: null, - rulename: null, - description: null, - content: null, - createtime: null, - creator: null, - updatetime: null, - modifier: null, - enabled: 0, - } - - this.route.params.subscribe((params) => { - - let id = params['id']; - if (typeof (id) == "string") { - if (id.indexOf('&') == -1) { - $("#ruleNameInput").attr("disabled", true); - $("#saveLabel").hide(); - } else { - this.addBottonStatus = false; - $("#saveLabel").hide(); - $("#checkLabel").hide(); - $("#updateLabel").hide(); - } - - let str = id.split("&"); - this.getRuleInfo(str[0]); - } else if (typeof (id) != "undefined") { - this.getRuleInfo(id); - } else { - $("#updateLabel").hide(); - } - if (typeof (this.queryRule.enabled) === "number") { - this.queryRule.enabled = "" + this.queryRule.enabled; - } - }) - - this.initImportDiv(this.queryRule); - } - -} \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html deleted file mode 100644 index a5ac3443..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.html +++ /dev/null @@ -1,135 +0,0 @@ - -
-
-
-
-
- - -
- -
- - -
- -
-
- - -
-
-
- -
-
-
- -
-
-
-
- -
-
-
{{"common_total1"|translate}}{{totalcount}}{{"common_total2"|translate}}
- - - - - - - - - - - - - - - - - - - - - - -
{{"field_rule_name_Add_Page"|translate}}{{"common_status"|translate}}{{"field_create_time"|translate}}{{"field_creator"|translate}}{{"field_update_time"|translate}}{{"common_operator"|translate}}
{{rule.rulename}}{{rule.createtime | date:'yyyy-MM-dd HH:mm:ss'}}{{rule.creator}}{{rule.updatetime | date:'yyyy-MM-dd HH:mm:ss'}} - - - - - - - - - - - - - - - - -
-
- - - \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts deleted file mode 100644 index af33eec7..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.component.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; -import { ModalService } from '../correlation-modal/modal.service'; -import { RuleModel } from './alarmRule'; -import { RuleRequest } from './ruleRequest'; -import { Router } from '@angular/router'; -import { Http, Response, Jsonp, Headers, RequestOptions } from '@angular/http'; -import { AlarmRuleService } from './alarmRule.service'; -declare var jQuery: any; - -@Component({ - selector: 'alarmRule', - templateUrl: './alarmRule.component.html', - -}) -export class AlarmRule implements OnInit { - ruleModel: RuleModel; - rules: RuleModel[]; - queryRule: RuleModel; - activeText: string; - ruleName: string; - enable_on = "enabled"; - enable_off = "disabled" - totalcount: number; - model: any; - ruleRequest: RuleRequest; - solution = 'ANGULAR'; - selection = 'A' - activeStatus = ["option_all", "common_enabled", "common_disabled"]; - - constructor(public _alarmRuleService: AlarmRuleService, private modalService: ModalService, - private router: Router) { }; - - switch(select: string): void { - console.log(select); - if (select == "common_enabled") { - this.ruleModel.enabled = 1; - } else if (select == "common_disabled") { - this.ruleModel.enabled = 0; - } else { - - this.ruleModel.enabled = null; - } - this.setActiveText(); - }; - - setActiveText(): void { - if (this.ruleModel.enabled == 1) { - this.activeText = "common_enabled"; - this.ruleRequest.enabled = 1; - } - else if (this.ruleModel.enabled == 0) { - this.activeText = "common_disabled"; - this.ruleRequest.enabled = 0; - } else { - this.activeText = "option_all"; - this.ruleRequest.enabled = null; - } - }; - - getRules(): Promise { - return this._alarmRuleService - .getRules() - .then(rules => { - this.rules = rules.rules; - this.totalcount = rules.totalcount; - }); - } - - searchRules(): void { - if (this.ruleModel.enabled == null) { - this.ruleRequest.enabled = null; - } - this.ruleRequest.rulename = this.ruleModel.rulename; - console.log(this.ruleRequest.enabled, this.ruleRequest.rulename); - - this._alarmRuleService - .searchrules(this.ruleRequest) - .then(rules => { - this.rules = rules; - this.totalcount = rules.length; - }); - } - updateRule(rule: RuleModel): void { - this.router.navigate(['ruleInfo/', rule.ruleid]); - } - - delete(rule: RuleModel): void { - rule.enabled == 1 ? this.deleteActiveRule(rule) : this.deleteModel(rule.ruleid, this._alarmRuleService, this); - } - - on_off(rule: RuleModel) { - rule.enabled == 0 ? rule.enabled = 1 : rule.enabled = 0; - this._alarmRuleService - .updateRule(rule) - .then(res => { - rule = res; - }); - } - - reset(): void { - this.ruleModel.rulename = null; - this.activeText = "option_all"; - this.ruleModel.enabled = null; - this.getRules(); - } - - deleteActiveRule(rule: RuleModel): void { - jQuery("#" + rule.ruleid).popModal({ - html: jQuery('#deleteActiveRuleContent'), - placement: 'leftTop', - showCloseBut: false, - onDocumentClickClose: true, - onOkBut: function () { - }, - }); - } - deleteModel(ruleid: string, alarm: AlarmRuleService, obj: any): void { - jQuery("#" + ruleid).popModal({ - html: jQuery('#deleteTimingTaskContent'), - placement: 'leftTop', - showCloseBut: false, - onDocumentClickClose: true, - onOkBut: function () { - jQuery("#deleteTimingTaskDlg").append(jQuery('#deleteTimingTaskContent')); - alarm.delete(ruleid); - obj.getRules(); - }, - onCancelBut: function () { - } - }); - } - - ngOnInit(): void { - this.activeText = "option_all"; - this.ruleModel = { - ruleid: null, - rulename: null, - description: "", - content: null, - createtime: null, - creator: null, - updatetime: null, - modifier: null, - enabled: 0, - } - this.ruleRequest = { - ruleid: null, - rulename: null, - creator: null, - modifier: null, - enabled: null, - } - this.getRules(); - } -} diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts deleted file mode 100644 index c0ca2ad2..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.service.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { Injectable } from '@angular/core'; -import { Http, Response, Headers } from '@angular/http'; -import 'rxjs/add/operator/toPromise'; -import 'rxjs/add/operator/map'; -import { RuleModel } from './alarmRule'; -import { RuleRequest } from './ruleRequest' -import { Router } from '@angular/router'; -import { ModalService } from '../correlation-modal/modal.service'; - -@Injectable() -export class AlarmRuleService { - 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) { } - - getRules(): Promise { - return this.http.get(this.ruleUrl) - .toPromise() - .then(res => res.json()) - .catch(this.handleError); - } - - private handleError(error: any): Promise { - console.error('An error occurred', error); - return Promise.reject(error._body || error); - } - - search(ruleid: string): Promise { - if (typeof (ruleid) == "string") { - let rule = [{ - ruleid: null, - rulename: null, - description: null, - content: null, - createtime: null, - creator: null, - updatetime: null, - modifier: null, - enabled: 0, - }] - } - let data = { 'ruleid': ruleid }; - var queryrequest = JSON.stringify(data); - const url = `${this.ruleUrl}?queryrequest=${queryrequest}`; - return this.http.get(url, {headers:this.headers}) - .toPromise() - .then(res => res.json().rules as RuleModel) - .catch(this.handleError); - } - - searchrules(rule: RuleRequest): Promise { - let data = { rulename: rule.rulename, enabled: rule.enabled } - console.log(JSON.stringify(data)); - 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[]) - .catch(this.handleError); - } - - checkContent(ruleContent: string): Promise { - const url = "/api/holmes-engine-mgmt/v1/rule"; - let data = { content: ruleContent }; - return this.http - .post(url, JSON.stringify(data), { headers: this.headers }) - .toPromise() - .then(res => res) - .catch(error => error); - } - - updateRule(rule: RuleModel): Promise { - let rules = { - "ruleid": rule.ruleid, - "description": rule.description, - "content": rule.content, - "enabled": rule.enabled - } - const url = `${this.ruleUrl}` - return this.http - .post(url, JSON.stringify(rules), { headers: this.headers }) - .toPromise() - .then(res => res) - .catch(error => error) - } - - save(rule: RuleModel): Promise { - let ruledata = { - "description": rule.description, - "content": rule.content, - "enabled": rule.enabled, - "rulename": rule.rulename - } - return this.http.put(this.ruleUrl, JSON.stringify(ruledata), { headers: this.headers }) - .toPromise() - .then(res => res) - .catch(error => error); - } - - public delete(ruleid: string): Promise { - const url = `${this.ruleUrl}` + '/' + ruleid; - return this.http.delete(url, { headers: this.headers }) - .toPromise() - .then(res => { - - }) - .catch(this.handleError); - } -} \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.ts deleted file mode 100644 index 69c5b224..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/alarmRule.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -export class RuleModel { - ruleid: string; - rulename: string; - description: string; - content: string; - createtime: Date; - creator: number; - updatetime: Date; - modifier: string; - enabled?; -} \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/ruleRequest.ts b/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/ruleRequest.ts deleted file mode 100644 index fbbe1c94..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/correlation-ruleList/ruleRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -export class RuleRequest { - ruleid: string; - rulename: string; - creator: number; - modifier: string; - enabled: number; -} \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/main.ts b/usecaseui-holmes/src/main/webapp/alarm/app/main.ts deleted file mode 100644 index b961c671..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/main.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - Copyright 2017 ZTE Corporation. - - 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 - - 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. - See the License for the specific language governing permissions and - limitations under the License. -*/ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppModule } from './app.module'; -const platform = platformBrowserDynamic(); -platform.bootstrapModule(AppModule); \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/app/pages/remote.component.html b/usecaseui-holmes/src/main/webapp/alarm/app/pages/remote.component.html deleted file mode 100644 index 2b5c8c33..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/app/pages/remote.component.html +++ /dev/null @@ -1,19 +0,0 @@ - -
-
- - \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/index.html b/usecaseui-holmes/src/main/webapp/alarm/index.html deleted file mode 100644 index bd82c49d..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/index.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - Loading... - - - \ No newline at end of file diff --git a/usecaseui-holmes/src/main/webapp/alarm/main.browser.ts b/usecaseui-holmes/src/main/webapp/alarm/main.browser.ts deleted file mode 100644 index b3c471bb..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/main.browser.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 2017 ZTE Corporation. - * - *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 - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - -import { AppModule } from './app/app.module'; -const platform = platformBrowserDynamic(); - -platform.bootstrapModule(AppModule); diff --git a/usecaseui-holmes/src/main/webapp/alarm/main.ts b/usecaseui-holmes/src/main/webapp/alarm/main.ts deleted file mode 100644 index 049fe756..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2017 ZTE Corporation. - * - *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 - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { enableProdMode } from '@angular/core'; -import {AppModule } from './app/app.module'; -if (process.env.ENV === 'production') { - enableProdMode(); -} -platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/usecaseui-holmes/src/main/webapp/alarm/polyfills.browser.ts b/usecaseui-holmes/src/main/webapp/alarm/polyfills.browser.ts deleted file mode 100644 index ba7e54e5..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/polyfills.browser.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2017 ZTE Corporation. - * - *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 - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'ie-shim'; // Internet Explorer 9 support - -// import 'core-js/es6'; -// Added parts of es6 which are necessary for your project or your browser support requirements. - -import 'core-js/es6/symbol'; -import 'core-js/es6/object'; -import 'core-js/es6/function'; -import 'core-js/es6/parse-int'; -import 'core-js/es6/parse-float'; -import 'core-js/es6/number'; -import 'core-js/es6/math'; -import 'core-js/es6/string'; -import 'core-js/es6/date'; -import 'core-js/es6/array'; -import 'core-js/es6/regexp'; -import 'core-js/es6/map'; -import 'core-js/es6/set'; -import 'core-js/es6/weak-map'; -import 'core-js/es6/weak-set'; -import 'core-js/es6/typed'; -import 'core-js/es6/reflect'; -// see issue https://github.com/AngularClass/angular2-webpack-starter/issues/709 -// import 'core-js/es6/promise'; - -import 'core-js/es7/reflect'; -import 'zone.js/dist/zone'; -import 'zone.js/dist/long-stack-trace-zone'; diff --git a/usecaseui-holmes/src/main/webapp/alarm/polyfills.ts b/usecaseui-holmes/src/main/webapp/alarm/polyfills.ts deleted file mode 100644 index 840f0a6f..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/polyfills.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2017 ZTE Corporation. - * - *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 - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import 'core-js/es6'; -import 'core-js/es7/reflect'; -require('zone.js/dist/zone'); -if (process.env.ENV === 'production') { -} else { - Error['stackTraceLimit'] = Infinity; - require('zone.js/dist/long-stack-trace-zone'); -} diff --git a/usecaseui-holmes/src/main/webapp/alarm/vendor.ts b/usecaseui-holmes/src/main/webapp/alarm/vendor.ts deleted file mode 100644 index d130e9d9..00000000 --- a/usecaseui-holmes/src/main/webapp/alarm/vendor.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright 2017 ZTE Corporation. - * - *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 - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import '@angular/platform-browser'; -import '@angular/platform-browser-dynamic'; -import '@angular/core'; -import '@angular/common'; -import '@angular/http'; -import '@angular/router'; -import 'angular-in-memory-web-api'; -import 'rxjs'; - -import '../public/thirdparty/js/jquery_1.12.4.min.js'; -import '../public/thirdparty/css/bootstrap.min.css'; -import '../public/thirdparty/css/magic-check.css'; -import '../public/thirdparty/css/zTreeStyle.css'; -import '../public/framework/browser/css/open-ostyle.css'; -import '../public/thirdparty/css/alarm-rule.css' - -import '../public/thirdparty/js/bootstrap.min.js'; -import '../public/thirdparty/js/bootstrap-table.min.js'; -import '../public/thirdparty/js/bootstrap-table-filter-control.min.js'; -import '../public/thirdparty/js/jquery.ztree.core-3.5.js'; - -import '../public/thirdparty/js/mustache.js'; - - -import '../public/common/css/popModal.css'; -import '../public/common/css/fileupload.css'; -import '../public/common/js/jQuery-File-Upload/css/jquery.fileupload.css'; - -import '../public/common/js/jQuery-File-Upload/js/jquery.fileupload.js'; -import '../public/common/js/popModal.js'; -- cgit 1.2.3-korg