Add rule manager common component
authorYILI <li.yi101@zte.com.cn>
Fri, 24 Feb 2017 08:33:35 +0000 (16:33 +0800)
committer6092002077 <li.yi101@zte.com.cn>
Fri, 24 Feb 2017 08:33:35 +0000 (16:33 +0800)
read rule manager common component include main,routing,module and other content

Issue-ID:CLIENT-164

Change-Id: I1cc0a218cf97a379a53d2faaacec37977b56a92c
Signed-off-by: YILI <li.yi101@zte.com.cn>
alarm-analysis/src/main/webapp/alarm/app/app.component.ts [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/app/app.module.ts [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/app/app.routing.ts [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/app/main.ts [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/app/pages/remote.component.html [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/index.html [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/main.ts [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/polyfills.ts [new file with mode: 0644]
alarm-analysis/src/main/webapp/alarm/vendor.ts [new file with mode: 0644]

diff --git a/alarm-analysis/src/main/webapp/alarm/app/app.component.ts b/alarm-analysis/src/main/webapp/alarm/app/app.component.ts
new file mode 100644 (file)
index 0000000..d6ad1c0
--- /dev/null
@@ -0,0 +1,41 @@
+/*\r
+ Copyright 2017 ZTE Corporation.\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+     http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+import { Component,OnInit } from '@angular/core';\r
+import {TranslateService} from 'ng2-translate';\r
+@Component({\r
+    selector: 'remote-config',\r
+    templateUrl: './pages/remote.component.html',\r
+})\r
+export class AppComponent implements OnInit{\r
+     constructor(private translate:TranslateService){}\r
+     getLanguage():string{\r
+        let rtnLanguage = localStorage.getItem("language-option");\r
+        if( rtnLanguage == "null" || rtnLanguage == null ){\r
+            rtnLanguage =window.navigator.language;\r
+        }\r
+        if( rtnLanguage.startsWith('en') ){\r
+            return "en-US";\r
+        }\r
+        return rtnLanguage;\r
+    }\r
+\r
+    ngOnInit():void {\r
+        this.translate.addLangs(["en", "zh"]);\r
+        this.translate.setDefaultLang('zh');\r
+        let language = this.getLanguage();\r
+        this.translate.use(language);\r
+    }\r
+}
\ No newline at end of file
diff --git a/alarm-analysis/src/main/webapp/alarm/app/app.module.ts b/alarm-analysis/src/main/webapp/alarm/app/app.module.ts
new file mode 100644 (file)
index 0000000..5c1d653
--- /dev/null
@@ -0,0 +1,50 @@
+/*\r
+ Copyright 2017 ZTE Corporation.\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+     http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+import { NgModule }      from '@angular/core';\r
+import { BrowserModule } from '@angular/platform-browser';\r
+import { FormsModule }   from '@angular/forms';\r
+import {routing} from "./app.routing";\r
+import {AppComponent} from "./app.component";\r
+import {AlarmRule} from "./correlation-ruleList/alarmRule.component";\r
+import {RuleInfo} from "./correlation-ruleInfo/ruleInfo.component";\r
+import {ModalService} from "./correlation-modal/modal.service";\r
+import {HttpModule,Jsonp}   from  '@angular/http';\r
+import {AlarmRuleService} from './correlation-ruleList/alarmRule.service';\r
+import {TranslateModule} from "ng2-translate";\r
+import {SifModalComponent} from './correlation-modal/modal.component'\r
+import {TestBed,ComponentFixture} from '@angular/core/testing';\r
+@NgModule({\r
+    imports: [\r
+        BrowserModule,\r
+        FormsModule,\r
+        HttpModule,\r
+        routing,\r
+        TranslateModule.forRoot()\r
+\r
+    ],\r
+    declarations: [\r
+        AppComponent,\r
+        AlarmRule,\r
+        RuleInfo,\r
+        SifModalComponent,\r
+        TestBed,\r
+        ComponentFixture\r
+    ],\r
+    providers:[ModalService,AlarmRuleService,Jsonp],\r
+    bootstrap: [AppComponent]\r
+})\r
+export class AppModule { }\r
+\r
diff --git a/alarm-analysis/src/main/webapp/alarm/app/app.routing.ts b/alarm-analysis/src/main/webapp/alarm/app/app.routing.ts
new file mode 100644 (file)
index 0000000..173d533
--- /dev/null
@@ -0,0 +1,40 @@
+/*\r
+ Copyright 2017 ZTE Corporation.\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+     http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+import { ModuleWithProviders }  from '@angular/core';\r
+import { Routes, RouterModule } from '@angular/router';\r
+import {AlarmRule} from './correlation-ruleList/alarmRule.component';\r
+import {RuleInfo} from './correlation-ruleInfo/ruleInfo.component'\r
+const appRoutes: Routes = [\r
+    {\r
+        path: 'alarmRule',\r
+        component:AlarmRule\r
+    },\r
+    {\r
+        path: 'ruleInfo',\r
+        component: RuleInfo\r
+    },\r
+    {\r
+        path: 'ruleInfo/:id',\r
+        component: RuleInfo\r
+    },\r
+    {\r
+        path:'',\r
+        redirectTo:'alarmRule',\r
+        pathMatch: 'full'\r
+    },\r
+\r
+];\r
+export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);\r
diff --git a/alarm-analysis/src/main/webapp/alarm/app/main.ts b/alarm-analysis/src/main/webapp/alarm/app/main.ts
new file mode 100644 (file)
index 0000000..2ab522c
--- /dev/null
@@ -0,0 +1,19 @@
+/*\r
+ Copyright 2017 ZTE Corporation.\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+     http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r
+import { AppModule } from './app.module';\r
+const platform = platformBrowserDynamic();\r
+platform.bootstrapModule(AppModule);
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..398159a
--- /dev/null
@@ -0,0 +1,19 @@
+<!--\r
+ Copyright 2017 ZTE Corporation.\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+     http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+-->\r
+<div class="tabzone">\r
+</div>\r
+<sif-modal></sif-modal>\r
+<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
new file mode 100644 (file)
index 0000000..423e4ca
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <base href="/iui/LY-Correlation/">\r
+    <meta charset="UTF-8">\r
+    <meta name="viewport" content="width=device-width, initial-scale=1">\r
+    <script src="public/component/thirdparty/jquery/jquery-1.10.2.min.js"></script>\r
+    <script src="public/common/js/popModal.js"></script>\r
+    <script src="public/common/js/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>\r
+    <script src="public/common/js/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>\r
+    <script src="public/common/js/jQuery-File-Upload/js/jquery.fileupload.js"></script>\r
+<body style="overflow: auto">\r
+<remote-config>Loading...</remote-config>\r
+\r
+</body>\r
+</html>\r
diff --git a/alarm-analysis/src/main/webapp/alarm/main.ts b/alarm-analysis/src/main/webapp/alarm/main.ts
new file mode 100644 (file)
index 0000000..3229737
--- /dev/null
@@ -0,0 +1,7 @@
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r
+import { enableProdMode } from '@angular/core';\r
+import { AppModule } from './app/app.module';\r
+if (process.env.ENV === 'production') {\r
+    enableProdMode();\r
+}\r
+platformBrowserDynamic().bootstrapModule(AppModule);\r
diff --git a/alarm-analysis/src/main/webapp/alarm/polyfills.ts b/alarm-analysis/src/main/webapp/alarm/polyfills.ts
new file mode 100644 (file)
index 0000000..20d968e
--- /dev/null
@@ -0,0 +1,8 @@
+import 'core-js/es6';\r
+import 'core-js/es7/reflect';\r
+require('zone.js/dist/zone');\r
+if (process.env.ENV === 'production') {\r
+} else {\r
+    Error['stackTraceLimit'] = Infinity;\r
+    require('zone.js/dist/long-stack-trace-zone');\r
+}\r
diff --git a/alarm-analysis/src/main/webapp/alarm/vendor.ts b/alarm-analysis/src/main/webapp/alarm/vendor.ts
new file mode 100644 (file)
index 0000000..1d7ce27
--- /dev/null
@@ -0,0 +1,30 @@
+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/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/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/jquery_1.12.4.min.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';