├── src ├── common │ ├── schema.edit.component.ts │ ├── common.component.ts │ ├── consume.time.pipe.ts │ ├── selectedtab │ │ ├── basic-selected-tab-manager-component.ts │ │ ├── table.base.component.ts │ │ └── table.transformer.component.ts │ ├── base.component.ts │ ├── application.ts │ ├── skeleton-loader.component.ts │ ├── safe.pipe.ts │ ├── terminal.component.ts │ ├── breadcrumb.component.ts │ ├── freshman.readme.component.ts │ ├── loading-state.component.ts │ ├── msg.component.ts │ ├── date.format.pipe.ts │ ├── init.system.component.ts │ ├── snapshot.link.ts │ ├── multi-selected │ │ └── basic.tuples.view.component.ts │ ├── MultiViewDAG.ts │ ├── control.panel.component.ts │ └── operation.log.component.ts ├── favicon.ico ├── images │ ├── weixin-xms.jpeg │ ├── weixin_talk.png │ ├── weixin_talk_group.jpg │ └── icon │ │ ├── nestable.svg │ │ ├── union.svg │ │ ├── tis-log.svg │ │ ├── table.svg │ │ └── cog.svg ├── runtime │ ├── incr.build.step2.component.ts │ ├── membership.component.ts │ ├── app.component.ts │ ├── monitor.component.ts │ ├── css │ │ └── prettify.css │ ├── pojo.component.ts │ ├── snapshot.change.log.ts │ ├── incr.build.step3.component.ts │ ├── incr.build.step0.component.ts │ └── line.chart.component.ts ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── base │ ├── addapp.directive.ts │ ├── base.manage.index.component.ts │ ├── error.detail.component.ts │ ├── datax.add.base.ts │ ├── global.update.param.ts │ ├── common │ │ └── datax.common.ts │ ├── global.add.param.ts │ ├── error.list.component.ts │ └── base.manage.module.ts ├── user │ ├── user.index.component.ts │ ├── user.module.ts │ ├── user-routing.module.ts │ ├── user.add.component.ts │ └── user.list.component.ts ├── main.ts ├── offline │ ├── workflow.offline.engine.select.component.ts │ ├── offline.index.component.ts │ ├── table.add.step.ts │ ├── db.add.component.ts │ ├── table.cols.meta.component.ts │ ├── offline.module.ts │ └── workflow.add.union.component.ts ├── index.html ├── service │ ├── script.store.ts │ ├── basic.service.ts │ ├── script.service.ts │ └── tis.service.ts.orig ├── index │ └── application.module.ts ├── test.ts ├── styles.css ├── datax │ ├── datax.config.component.ts │ └── datax.module.ts └── polyfills.ts ├── start.sh ├── assemble_node_module.sh ├── readme.txt ├── bs-config.json ├── .gitignore ├── .idea ├── sbt.xml ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── vcs.xml ├── misc.xml ├── modules.xml ├── $CACHE_FILE$ ├── checkstyle-idea.xml └── $PRODUCT_WORKSPACE_FILE$ ├── proxy.conf.json ├── .claude └── settings.local.json ├── .editorconfig ├── tsconfig.app.json ├── .prettierignore ├── tis-console.iml ├── .prettierrc ├── README.md ├── tsconfig-aot.json ├── .github └── workflows │ └── main.yml ├── .eslintrc.json ├── rollup-config.js_bak ├── web.xml ├── tsconfig.json ├── pom.xml ├── pom.xml.4.2.0 ├── tslint.json ├── CLAUDE.md ├── OPTIMIZATION_GUIDE.md └── package.json /src/common/schema.edit.component.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qlangtech/ng-tis/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | export NODE_OPTIONS=--openssl-legacy-provider 2 | npm run ng:serve-jit 3 | -------------------------------------------------------------------------------- /assemble_node_module.sh: -------------------------------------------------------------------------------- 1 | tar czvf tis-console-ng-node-modules.tar.gz ./node_modules 2 | -------------------------------------------------------------------------------- /src/images/weixin-xms.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qlangtech/ng-tis/HEAD/src/images/weixin-xms.jpeg -------------------------------------------------------------------------------- /src/images/weixin_talk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qlangtech/ng-tis/HEAD/src/images/weixin_talk.png -------------------------------------------------------------------------------- /src/images/weixin_talk_group.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qlangtech/ng-tis/HEAD/src/images/weixin_talk_group.jpg -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | // npm install --save angular-tree-component@3.2.3 2 | angular的脚手架工具 https://github.com/angular/angular-cli 3 | 4 | -------------------------------------------------------------------------------- /bs-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": { 3 | "baseDir": "src", 4 | "routes": { 5 | "/node_modules": "node_modules" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /aot 3 | *.js 4 | *.map 5 | *.ngsummary.json 6 | *.metadata.json 7 | !rollup-config.js_bak 8 | /dist 9 | .idea/* 10 | .angular/* 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/sbt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/tjs": { 3 | "target": "http://localhost:8080", 4 | "secure": false, 5 | "ws": true 6 | }, 7 | "/tis-assemble": { 8 | "target": "http://localhost:8083", 9 | "secure": false, 10 | "ws": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.claude/settings.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "allow": [ 4 | "WebSearch", 5 | "Bash(find:*)", 6 | "Bash(npm install:*)", 7 | "Bash(npx ng build:*)", 8 | "Bash(cat:*)" 9 | ], 10 | "deny": [], 11 | "ask": [] 12 | } 13 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | 12 | [*.md] 13 | max_line_length = 0 14 | trim_trailing_whitespace = false 15 | 16 | # Indentation override 17 | #[lib/**.js] 18 | #[{package.json,.travis.yml}] 19 | #[**/**.js] 20 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [], 6 | "noImplicitAny": false 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.ts" 14 | ], 15 | "exclude": [ 16 | "src/test.ts", 17 | "src/**/*.spec.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | node_modules/ 3 | 4 | # Build outputs 5 | dist/ 6 | build/ 7 | 8 | # Environment files 9 | .env 10 | .env.local 11 | .env.production 12 | 13 | # IDE files 14 | .vscode/ 15 | .idea/ 16 | 17 | # OS generated files 18 | .DS_Store 19 | Thumbs.db 20 | 21 | # Logs 22 | *.log 23 | 24 | # Coverage directory used by tools like istanbul 25 | coverage/ 26 | 27 | # Compiled JavaScript files 28 | *.js.map 29 | 30 | # Lock files 31 | package-lock.json 32 | yarn.lock -------------------------------------------------------------------------------- /.idea/$CACHE_FILE$: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Angular 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tis-console.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "es5", 4 | "singleQuote": true, 5 | "printWidth": 100, 6 | "tabWidth": 2, 7 | "useTabs": false, 8 | "bracketSpacing": true, 9 | "arrowParens": "avoid", 10 | "endOfLine": "lf", 11 | "overrides": [ 12 | { 13 | "files": "*.html", 14 | "options": { 15 | "parser": "angular" 16 | } 17 | }, 18 | { 19 | "files": "*.component.html", 20 | "options": { 21 | "parser": "angular" 22 | } 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ng-tis 介绍 2 | ![](https://tokei.rs/b1/github/qlangtech/ng-tis) 3 | ## 介绍 4 | TIS UI前端部分主要依赖于 angular9 [https://angular.cn/](https://angular.cn/),和 ng-zorro [https://ng-zorro.gitee.io/docs/introduce/zh](https://ng-zorro.gitee.io/docs/introduce/zh)构建而成。 5 | 6 | Drag And Drop 参考使用 git@github.com:retejs/rete.git 7 | ## 构建方法 8 | 9 | ### 生产环境打包 10 | 11 | > 为避免npm install 耗费大量时间,可以先将事先打包好的node_modules包下载到本地中,以便加快打包时间 [https://tis-release.oss-cn-beijing.aliyuncs.com/tis-console-ng-node-modules.tar](https://tis-release.oss-cn-beijing.aliyuncs.com/tis-console-ng-node-modules.tar) 12 | 13 | ``` shell 14 | npm run ng:serve-aot 15 | ``` 16 | 17 | ### 开发环境运行 18 | 19 | ``` shell 20 | npm run ng:serve-jti 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/images/icon/nestable.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tsconfig-aot.json: -------------------------------------------------------------------------------- 1 | { // https://github.com/angular/angular-cli 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "target": "es5", 5 | "module": "es2015", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "lib": [ "es2015", "dom" ], 11 | "noImplicitAny": true, 12 | "suppressImplicitAnyIndexErrors": true, 13 | "typeRoots": [ 14 | "../node_modules/@types/" 15 | ] 16 | }, 17 | "files": [ 18 | "src/offline/offline.module.ts", 19 | "src/user/user.module.ts", 20 | "src/runtime/app.module.ts", 21 | "src/main.ts" 22 | ], 23 | "angularCompilerOptions": { 24 | "fullTemplateTypeCheck": true, 25 | "strictMetadataEmit" : true, 26 | "trace": true, 27 | "genDir": "aot" 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/common/common.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | AfterContentChecked, 3 | AfterContentInit, 4 | AfterViewInit, 5 | Component, 6 | ContentChildren, 7 | Input, 8 | OnInit, QueryList, TemplateRef, ViewChild, ViewContainerRef 9 | } from "@angular/core"; 10 | import {ItemPropVal} from "./tis.plugin"; 11 | import {NzInputDirective} from "ng-zorro-antd/input"; 12 | import {NzSelectComponent} from "ng-zorro-antd/select"; 13 | import {TisInputProp} from "./form.component"; 14 | 15 | @Component({ 16 | selector: 'blibli', 17 | template: ` 18 | 19 | 20 | ` 21 | }) 22 | export class BliBliComponent { 23 | 24 | @Input() 25 | videoId:string; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/runtime/incr.build.step2.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | -------------------------------------------------------------------------------- /src/images/icon/union.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | export module Tis { 20 | export const environment = { 21 | production: true 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: aot-build 4 | 5 | # Controls when the action will run. Triggers the workflow on push or pull request 6 | # events but only for the master branch 7 | on: 8 | push: 9 | branches: [ master ] 10 | 11 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 12 | jobs: 13 | # This workflow contains a single job called "build" 14 | build: 15 | # The type of runner that the job will run on 16 | runs-on: ubuntu-latest 17 | 18 | # Steps represent a sequence of tasks that will be executed as part of the job 19 | steps: 20 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 21 | - uses: actions/checkout@v2 22 | - uses: actions/setup-node@v1 23 | 24 | 25 | # Runs a single command using the runners shell 26 | - name: install dependencies 27 | run: npm install 28 | 29 | - name: run build 30 | #run: npm run ng:serve-aot 31 | run: ng --version 32 | 33 | -------------------------------------------------------------------------------- /src/base/addapp.directive.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import { Directive, ViewContainerRef } from '@angular/core'; 20 | 21 | @Directive({ 22 | selector : '[tis-index-add-flow]' 23 | }) 24 | export class AddAppFlowDirective { 25 | constructor(public viewContainerRef: ViewContainerRef) { } 26 | } 27 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": [ 4 | "projects/**/*" 5 | ], 6 | "overrides": [ 7 | { 8 | "files": [ 9 | "*.ts" 10 | ], 11 | "parserOptions": { 12 | "project": [ 13 | "tsconfig.json" 14 | ], 15 | "createDefaultProgram": true 16 | }, 17 | "extends": [ 18 | "@typescript-eslint/recommended", 19 | "@typescript-eslint/recommended-requiring-type-checking" 20 | ], 21 | "rules": { 22 | "@typescript-eslint/no-unused-vars": "error", 23 | "@typescript-eslint/no-explicit-any": "warn", 24 | "@typescript-eslint/prefer-const": "error", 25 | "@typescript-eslint/no-empty-function": "warn", 26 | "max-len": ["error", { "code": 120, "ignoreComments": true }], 27 | "no-console": ["warn", { "allow": ["warn", "error"] }], 28 | "prefer-arrow-callback": "error", 29 | "arrow-spacing": "error" 30 | } 31 | }, 32 | { 33 | "files": [ 34 | "*.html" 35 | ], 36 | "extends": [ 37 | "@angular-eslint/template/recommended" 38 | ], 39 | "rules": {} 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /src/user/user.index.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {TISService} from '../common/tis.service'; 20 | import {Component} from '@angular/core'; 21 | 22 | @Component({ 23 | template: '' 24 | }) 25 | export class UserIndexComponent { 26 | constructor(private tisService: TISService) { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/images/icon/tis-log.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 20 | import {AppModule} from "./runtime/app.module-jit"; 21 | import {enableProdMode} from '@angular/core'; 22 | 23 | import {Tis} from './environments/environment'; 24 | // 25 | if (Tis.environment.production) { 26 | enableProdMode(); 27 | } 28 | 29 | platformBrowserDynamic().bootstrapModule(AppModule); 30 | -------------------------------------------------------------------------------- /src/offline/workflow.offline.engine.select.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from "@angular/core"; 2 | import {BasicWFComponent} from "./workflow.component"; 3 | import {TISService} from "../common/tis.service"; 4 | import {NzModalService} from "ng-zorro-antd/modal"; 5 | import {ActivatedRoute, Router} from "@angular/router"; 6 | import {NzNotificationService} from "ng-zorro-antd/notification"; 7 | 8 | 9 | @Component({ 10 | // templateUrl: '/offline/workflowList.htm' 11 | template: ` 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

21 | Offline Engine 22 |

23 | 24 | ` 25 | }) 26 | // 工作流 27 | export class WorkflowOfflineEngineSelectComponent extends BasicWFComponent implements OnInit { 28 | constructor(tisService: TISService, modalService: NzModalService, router: Router, route: ActivatedRoute, notification: NzNotificationService) { 29 | super(tisService, modalService, router, route, notification); 30 | } 31 | 32 | ngOnInit(): void { 33 | } 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | TIS 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/common/consume.time.pipe.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Created by baisui on 2017/4/18 0018. 21 | */ 22 | import {Pipe, PipeTransform} from '@angular/core'; 23 | 24 | @Pipe({name: 'consuming'}) 25 | export class ConsumeTimePipe implements PipeTransform { 26 | 27 | transform(value: number, args?: string[]): any { 28 | let t = new Date(); 29 | t.setTime(value); 30 | return t.getHours() + ':' + t.getMinutes() + ':' + t.getSeconds(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/common/selectedtab/basic-selected-tab-manager-component.ts: -------------------------------------------------------------------------------- 1 | import {EventEmitter, Injectable, Input, Output} from "@angular/core"; 2 | import {BasicFormComponent} from "../basic.form.component"; 3 | import {StepType} from "../steps.component"; 4 | import {HeteroList, PluginSaveResponse, PluginType, SavePluginEvent} from "../tis.plugin"; 5 | import {TISService} from "../tis.service"; 6 | import {NzDrawerRef} from "ng-zorro-antd/drawer"; 7 | import {SelectedTabDTO} from "./plugin-sub-form.component"; 8 | 9 | @Injectable() 10 | export abstract class BasicSelectedTabManagerComponent extends BasicFormComponent { 11 | 12 | savePlugin = new EventEmitter(); 13 | // @Input() hetero: HeteroList[] = []; 14 | 15 | // @Input() pluginMeta: PluginType[] = []; 16 | 17 | @Output() 18 | public nextStep = new EventEmitter(); 19 | @Output() 20 | protected preStep = new EventEmitter(); 21 | @Input() 22 | public dto: SelectedTabDTO; 23 | 24 | constructor(tisService: TISService, public drawer: NzDrawerRef<{ hetero: HeteroList }>) { 25 | super(tisService); 26 | } 27 | abstract verifyPluginConfig(e: PluginSaveResponse); 28 | // verifyPluginConfig(e: PluginSaveResponse) { 29 | // if (e.saveSuccess && e.verify) { 30 | // this.drawer.close({hetero: this.hetero[0]}); 31 | // } 32 | // } 33 | } 34 | -------------------------------------------------------------------------------- /src/service/script.store.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | interface Scripts { 20 | name: string; 21 | src: string; 22 | } 23 | // 24 | // 25 | 26 | export const ScriptStore: Scripts[] = [ 27 | {name: 'codeMirror', src: '/runtime/js/codemirror/codemirror.js'}, 28 | {name: 'codeMirrorXml', src: '/runtime/js/codemirror/xml.js'}, 29 | {name: 'codeMirrorCLike', src: '/runtime/js/codemirror/clike.js'} 30 | ]; 31 | -------------------------------------------------------------------------------- /src/offline/offline.index.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {TISService} from '../common/tis.service'; 20 | import {Component} from '@angular/core'; 21 | 22 | // import 'ng-zorro-antd/../ng-zorro-antd.min.css'; 23 | 24 | @Component({ 25 | template: ` 26 | 27 |
28 | 29 |
30 | `, 31 | styles: [ 32 | ` 33 | ` 34 | ] 35 | }) 36 | export class OffileIndexComponent { 37 | constructor(private tisService: TISService) { 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/runtime/membership.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component} from "@angular/core"; 20 | import {TISService} from "../common/tis.service"; 21 | import {BasicFormComponent} from "../common/basic.form.component"; 22 | 23 | import {NzModalService} from "ng-zorro-antd/modal"; 24 | 25 | // 会员权限管理 26 | @Component({ 27 | template: ` 28 |

Membership

29 | ` 30 | }) 31 | export class MembershipComponent extends BasicFormComponent { 32 | constructor(tisService: TISService, modalService: NzModalService) { 33 | super(tisService, modalService); 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/common/base.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Injectable, OnDestroy} from '@angular/core'; 20 | import { Subject } from 'rxjs'; 21 | 22 | /** 23 | * 基础组件类,提供统一的订阅管理和内存泄露防护 24 | * 所有需要处理订阅的组件都应该继承此类 25 | */ 26 | @Injectable() 27 | export abstract class BaseComponent implements OnDestroy { 28 | /** 29 | * 用于管理组件订阅的Subject 30 | * 组件销毁时会自动取消所有订阅 31 | */ 32 | protected readonly destroy$ = new Subject(); 33 | 34 | /** 35 | * 组件销毁时的清理逻辑 36 | * 自动取消所有通过takeUntil(this.destroy$)管理的订阅 37 | */ 38 | ngOnDestroy(): void { 39 | this.destroy$.next(); 40 | this.destroy$.complete(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/common/application.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {PluginManipulateMeta} from "./tis.plugin"; 20 | 21 | /** 22 | * Created by baisui on 2017/3/29 0029. 23 | */ 24 | export class Application { 25 | 26 | appId: number; 27 | appType: AppType; 28 | createTime: number; 29 | dptId: number; 30 | dptName: string; 31 | projectName: string; 32 | recept: string; 33 | updateTime: number; 34 | incrRunning: boolean = false; 35 | incrConsumeNum: number; 36 | 37 | manipulateMetas: Array =[]; 38 | } 39 | 40 | export enum AppType { 41 | DataX = 2, 42 | Solr = 1 43 | } 44 | 45 | export class Crontab { 46 | } 47 | -------------------------------------------------------------------------------- /src/service/basic.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Created by baisui on 2017/3/29 0029. 21 | */ 22 | // import {Http} from '@angular/http'; 23 | import 'rxjs/add/operator/catch'; 24 | import 'rxjs/add/operator/map'; 25 | import {TISService} from '../common/tis.service'; 26 | import {HttpClient} from "@angular/common/http"; 27 | 28 | export class BasicService { 29 | 30 | constructor(protected http: HttpClient, protected tisService: TISService) { 31 | 32 | } 33 | 34 | protected handleError(error: any): Promise { 35 | console.error('An error occurred', error); 36 | return Promise.reject(error.message || error); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/runtime/app.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, OnInit} from "@angular/core"; 20 | import {LocalStorageService} from "../common/local-storage.service"; 21 | import {TISService} from "../common/tis.service"; 22 | import {BaseComponent} from "../common/base.component"; 23 | 24 | // 这个类专门负责router 25 | @Component({ 26 | selector: 'app-root', 27 | template: ` 28 | 29 | `, 30 | }) 31 | export class AppComponent extends BaseComponent implements OnInit { 32 | 33 | constructor( private _localStorageService: LocalStorageService, private tisService: TISService) { 34 | super(); 35 | } 36 | 37 | ngOnInit(): void { 38 | 39 | 40 | 41 | } 42 | 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/index/application.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // /** 20 | // * Created by baisui on 2017/3/29 0029. 21 | // */ 22 | // import {NgModule} from '@angular/core'; 23 | // import {BrowserModule} from '@angular/platform-browser'; 24 | // import {FormsModule} from '@angular/forms'; 25 | // 26 | // // import {AddAppFormComponent} from '../base/addapp-form.component'; 27 | // // import {AppComponent} from '../runtime/app.component'; 28 | // 29 | // @NgModule({ 30 | // imports: [ 31 | // BrowserModule, 32 | // FormsModule 33 | // ], 34 | // declarations: [ 35 | // // AppComponent, 36 | // // AddAppFormComponent 37 | // ], 38 | // // bootstrap: [AddAppFormComponent] 39 | // }) 40 | // export class ApplicationModule { 41 | // } 42 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 20 | 21 | import 'zone.js/dist/zone-testing'; 22 | import { getTestBed } from '@angular/core/testing'; 23 | import { 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting 26 | } from '@angular/platform-browser-dynamic/testing'; 27 | 28 | declare const require: any; 29 | 30 | // First, initialize the Angular testing environment. 31 | getTestBed().initTestEnvironment( 32 | BrowserDynamicTestingModule, 33 | platformBrowserDynamicTesting() 34 | ); 35 | // Then we find all the tests. 36 | const context = require.context('./', true, /\.spec\.ts$/); 37 | // And load the modules. 38 | context.keys().map(context); 39 | -------------------------------------------------------------------------------- /src/user/user.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {NgModule} from '@angular/core'; 20 | import {FormsModule} from '@angular/forms'; 21 | import {UserRoutingModule} from './user-routing.module'; 22 | import {UserListComponent} from './user.list.component'; 23 | 24 | import {UserAddComponent} from './user.add.component'; 25 | import {UserIndexComponent} from './user.index.component'; 26 | import {CommonModule} from '@angular/common'; 27 | import {TisCommonModule} from '../common/common.module'; 28 | 29 | 30 | 31 | @NgModule({ 32 | id: 'usermanage', 33 | imports: [CommonModule, FormsModule, UserRoutingModule, TisCommonModule], 34 | declarations: [UserIndexComponent, UserListComponent, UserAddComponent 35 | ] 36 | }) 37 | export class UserModule { 38 | } 39 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // This file can be replaced during build by using the `fileReplacements` array. 20 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 21 | // The list of file replacements can be found in `angular.json`. 22 | export module Tis { 23 | export const environment = { 24 | production: false 25 | }; 26 | } 27 | 28 | /* 29 | * For easier debugging in development mode, you can import the following file 30 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 31 | * 32 | * This import should be commented out in production mode because it will have a negative impact 33 | * on performance if an error is thrown. 34 | */ 35 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 36 | -------------------------------------------------------------------------------- /rollup-config.js_bak: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 QingLang, Inc. 3 | *

4 | * This program is free software: you can use, redistribute, and/or modify 5 | * it under the terms of the GNU Affero General Public License, version 3 6 | * or later ("AGPL"), as published by the Free Software Foundation. 7 | *

8 | * This program is distributed in the hope that it will be useful, but WITHOUT 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | * FITNESS FOR A PARTICULAR PURPOSE. 11 | *

12 | * You should have received a copy of the GNU Affero General Public License 13 | * along with this program. If not, see . 14 | */ 15 | 16 | import rollup from 'rollup' 17 | import nodeResolve from 'rollup-plugin-node-resolve' 18 | import commonjs from 'rollup-plugin-commonjs'; 19 | import uglify from 'rollup-plugin-uglify' 20 | 21 | export default { 22 | entry: 'src/main.js', 23 | dest: 'src/build.js', // output a single application bundle 24 | sourceMap: false, 25 | format: 'iife', 26 | onwarn: function(warning) { 27 | // Skip certain warnings 28 | 29 | // should intercept ... but doesn't in some rollup versions 30 | if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; } 31 | // intercepts in some rollup versions 32 | if ( warning.indexOf("The 'this' keyword is equivalent to 'undefined'") > -1 ) { return; } 33 | 34 | // console.warn everything else 35 | console.warn( warning.message ); 36 | }, 37 | plugins: [ 38 | nodeResolve({jsnext: true, module: true}), 39 | commonjs({ 40 | include: 'node_modules/rxjs/**', 41 | }), 42 | uglify() 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /src/common/skeleton-loader.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import { Component, Input } from '@angular/core'; 20 | 21 | @Component({ 22 | selector: 'tis-skeleton-loader', 23 | template: ` 24 |

25 | 30 | 31 |
32 |
33 | 34 |
35 | `, 36 | styles: [` 37 | .skeleton-loader { 38 | padding: 20px; 39 | background: #fff; 40 | border-radius: 6px; 41 | margin-bottom: 16px; 42 | } 43 | `] 44 | }) 45 | export class SkeletonLoaderComponent { 46 | @Input() loading = false; 47 | @Input() showAvatar = false; 48 | @Input() showTitle = true; 49 | @Input() rows = 3; 50 | } -------------------------------------------------------------------------------- /web.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 25 | 26 | 27 | logback/context-name 28 | java.lang.String 29 | ng 30 | 31 | 32 | 33 | angularfilter 34 | com.qlangtech.tis.manage.servlet.AngluarFilter 35 | 36 | 37 | angularfilter 38 | /* 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/user/user-routing.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {NgModule} from '@angular/core'; 20 | import {UserIndexComponent} from './user.index.component'; 21 | 22 | import {RouterModule, Routes} from '@angular/router'; 23 | import {UserListComponent} from './user.list.component'; 24 | 25 | 26 | const userRoutes: Routes = [ 27 | { 28 | path: '', component: UserIndexComponent, 29 | children: [ 30 | { 31 | path: '', 32 | children: [ 33 | { 34 | path: 'users', 35 | component: UserListComponent 36 | } 37 | , 38 | { 39 | path: '', 40 | component: UserListComponent 41 | } 42 | ] 43 | } 44 | ] 45 | }, 46 | 47 | ]; 48 | 49 | @NgModule({ 50 | imports: [ 51 | RouterModule.forChild(userRoutes) 52 | ], 53 | declarations: [ 54 | ], exports: [ 55 | RouterModule 56 | ] 57 | }) 58 | export class UserRoutingModule { 59 | } 60 | -------------------------------------------------------------------------------- /src/runtime/monitor.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component} from "@angular/core"; 20 | import {TISService} from "../common/tis.service"; 21 | import {BasicFormComponent} from "../common/basic.form.component"; 22 | 23 | import {NzModalService} from "ng-zorro-antd/modal"; 24 | 25 | 26 | @Component({ 27 | template: ` 28 |
29 |
30 | 31 |
32 |
33 | 34 |
35 |
36 | `, 37 | styles: [ 38 | ` 39 | .line-chart-block { 40 | } 41 | ` 42 | ] 43 | }) 44 | export class MonitorComponent extends BasicFormComponent { 45 | constructor(tisService: TISService, modalService: NzModalService) { 46 | super(tisService, modalService); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "paths": { 6 | "@zeppelin/*": [ 7 | "./src/zeppelin_app/*", 8 | "./src/environments/*" 9 | ], 10 | "@zeppelin/helium": [ 11 | "./dist/zeppelin-helium" 12 | ], 13 | "@zeppelin/helium/*": [ 14 | "./dist/zeppelin-helium/*" 15 | ], 16 | "@zeppelin/visualization": [ 17 | "dist/zeppelin-visualization" 18 | ], 19 | "@zeppelin/visualization/*": [ 20 | "dist/zeppelin-visualization/*" 21 | ], 22 | "@zeppelin/sdk": [ 23 | "dist/zeppelin-sdk" 24 | ], 25 | "@zeppelin/sdk/*": [ 26 | "dist/zeppelin-sdk/*" 27 | ], 28 | "zeppelin-sdk": [ 29 | "dist/zeppelin-sdk/zeppelin-sdk", 30 | "dist/zeppelin-sdk" 31 | ], 32 | "zeppelin-visualization": [ 33 | "dist/zeppelin-visualization/zeppelin-visualization", 34 | "dist/zeppelin-visualization" 35 | ] 36 | }, 37 | "outDir": "./dist/out-tsc", 38 | "forceConsistentCasingInFileNames": true, 39 | "skipLibCheck": true, 40 | "strict": false, 41 | "noImplicitOverride": false, 42 | "noPropertyAccessFromIndexSignature": false, 43 | "noImplicitReturns": false, 44 | "noFallthroughCasesInSwitch": false, 45 | "sourceMap": true, 46 | "declaration": false, 47 | "downlevelIteration": true, 48 | "experimentalDecorators": true, 49 | "moduleResolution": "node", 50 | "importHelpers": true, 51 | "target": "ES2022", 52 | "module": "ES2022", 53 | "useDefineForClassFields": false, 54 | "lib": [ 55 | "ES2022", 56 | "dom" 57 | ] 58 | }, 59 | "angularCompilerOptions": { 60 | "enableI18nLegacyMessageIdFormat": false, 61 | "strictInjectionParameters": true, 62 | "strictInputAccessModifiers": true, 63 | "strictTemplates": false 64 | } 65 | } -------------------------------------------------------------------------------- /.idea/$PRODUCT_WORKSPACE_FILE$: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 1.8 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 1.8 42 | 43 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 23 | 4.0.0 24 | 25 | 26 | com.qlangtech.tis 27 | tis-parent 28 | 1.1.0 29 | 30 | 31 | com.qlangtech.tis 32 | ng-tis 33 | 34 | 35 | pom 36 | tis 37 | http://maven.apache.org 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /pom.xml.4.2.0: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 23 | 4.0.0 24 | 25 | 26 | com.qlangtech.tis 27 | tis-parent 28 | 1.1.0 29 | 30 | 31 | com.qlangtech.tis 32 | ng-tis 33 | 34 | 35 | pom 36 | tis 37 | http://maven.apache.org 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/images/icon/table.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/offline/table.add.step.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {EventEmitter, Inject, Injectable, Input, Output} from '@angular/core'; 20 | import {TISService} from '../common/tis.service'; 21 | import {BasicFormComponent} from '../common/basic.form.component'; 22 | import {Router} from '@angular/router'; 23 | import {Location} from '@angular/common'; 24 | import {IntendDirect} from "../common/MultiViewDAG"; 25 | 26 | 27 | @Injectable() 28 | export class TableAddStep extends BasicFormComponent { 29 | // @Input() isShow: boolean; 30 | @Output() previousStep: EventEmitter = new EventEmitter(); 31 | @Output() nextStep = new EventEmitter(); 32 | 33 | constructor(protected tisService: TISService, protected router: Router 34 | , protected localtion: Location) { 35 | super(tisService); 36 | } 37 | 38 | // 执行下一步 39 | public createPreviousStep(form: any): void { 40 | this.previousStep.emit(form); 41 | } 42 | 43 | // 执行下一步 44 | public createNextStep(form: any): void { 45 | this.nextStep.emit(form); 46 | } 47 | 48 | // protected goHomePage(tableId: number): void { 49 | // // this.router.navigate(['/t/offline'], {queryParams: {tableId: tableId}}); 50 | // } 51 | 52 | protected goBack(): void { 53 | this.localtion.back(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/common/safe.pipe.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Pipe, PipeTransform} from '@angular/core'; 20 | import {DomSanitizer} from '@angular/platform-browser'; 21 | import {HeteroList, PluginType} from "./tis.plugin"; 22 | 23 | @Pipe({name: 'safe'}) 24 | export class SafePipe implements PipeTransform { 25 | constructor(private sanitizer: DomSanitizer) { 26 | } 27 | 28 | public transform(url: string): any { 29 | return this.sanitizer.bypassSecurityTrustResourceUrl(url); 30 | } 31 | } 32 | 33 | @Pipe({ 34 | name: 'pluginDescCallback', 35 | pure: false 36 | }) 37 | export class PluginDescCallbackPipe implements PipeTransform { 38 | transform(items: any[], h: HeteroList, pluginMetas: PluginType[], callback: (h: HeteroList, pluginMetas: PluginType[], item: any) => boolean): any { 39 | if (!items || !callback) { 40 | return items; 41 | } 42 | return items.filter(item => callback(h, pluginMetas, item)); 43 | } 44 | } 45 | 46 | // @Pipe({ 47 | // name: 'itemFilter', 48 | // pure: false 49 | // }) 50 | // export class PluginItemFilterCallbackPipe implements PipeTransform { 51 | // transform(items: Item[], callback: (item: Item) => boolean): any { 52 | // if (!items || !callback) { 53 | // return items; 54 | // } 55 | // return items.filter(item => callback(item)); 56 | // } 57 | // } 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/common/terminal.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {AfterContentInit, Component, OnDestroy, OnInit, ViewChild} from "@angular/core"; 20 | import {Subject, Unsubscribable} from "rxjs"; 21 | import {NgTerminal} from "ng-terminal"; 22 | import {WSMessage} from "./basic.form.component"; 23 | 24 | @Component({ 25 | template: ` 26 | 27 | `, 28 | styles: [ 29 | ` 30 | ` 31 | ] 32 | }) 33 | export class TerminalComponent implements AfterContentInit, OnInit, OnDestroy { 34 | 35 | logSubject: Subject; 36 | @ViewChild('term', {static: true}) terminal: NgTerminal; 37 | 38 | // subscription: Unsubscribable; 39 | 40 | ngAfterContentInit(): void { 41 | } 42 | 43 | ngOnDestroy(): void { 44 | // if (this.subscription) { 45 | // this.subscription.unsubscribe(); 46 | // } 47 | // this.logSubject.next(new WSMessage("full", "unsubscribe")); 48 | } 49 | 50 | ngOnInit(): void { 51 | if (!this.logSubject) { 52 | throw new Error("logSubject can not be null"); 53 | } 54 | if (!this.terminal) { 55 | throw new Error("terminal can not be null"); 56 | } 57 | this.logSubject.subscribe((msg) => { 58 | if (msg && msg.logtype === 'full') { 59 | this.terminal.write(msg.data.msg + "\r\n"); 60 | } 61 | }); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* You can add global styles to this file, and also import other style files */ 20 | 21 | .tis-markdown code { 22 | color: #e30000; 23 | } 24 | 25 | .tis-markdown table { 26 | border: 1px solid #989898; 27 | } 28 | .tis-markdown th { 29 | padding: 4px; 30 | border: 1px solid #989898; 31 | } 32 | .tis-markdown td { 33 | padding: 4px; 34 | border: 1px solid #989898; 35 | } 36 | 37 | .get-gen-cfg-file .ant-drawer-body { 38 | overflow: hidden; 39 | padding: 2px; 40 | } 41 | 42 | .item-block { 43 | border: 1px solid #d8d8d8; 44 | margin-bottom: 10px; 45 | padding: 10px; 46 | } 47 | 48 | button { 49 | margin-left: 8px; 50 | } 51 | 52 | .tool-bar { 53 | background-color: #ffffff; 54 | padding: 8px; 55 | } 56 | 57 | .alter-notice { 58 | margin: 12px; 59 | } 60 | 61 | 62 | .body_content { 63 | margin: 0 30px 0 30px; 64 | } 65 | 66 | .list-ul-msg { 67 | margin: 0px; 68 | padding: 0px; 69 | list-style: none; 70 | } 71 | 72 | html, body { 73 | width: 100%; 74 | height: 100%; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | nz-select, nz-cascader { 80 | width: 100%; 81 | } 82 | 83 | .tis-link-btn { 84 | display: inline-block; 85 | margin: 5px 10px 5px 10px 86 | } 87 | 88 | .combine-input { 89 | border: 1px dashed #cccccc; 90 | padding: 4px; 91 | } 92 | 93 | .combine-input input, nz-switch, nz-select { 94 | margin: 3px 0 3px 0; 95 | } 96 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [ 5 | true, 6 | "check-space" 7 | ], 8 | "curly": true, 9 | "eofline": true, 10 | "forin": false, 11 | "indent": [ 12 | true, 13 | "spaces" 14 | ], 15 | "label-position": true, 16 | "label-undefined": true, 17 | "max-line-length": [ 18 | true, 19 | 500 20 | ], 21 | "member-access": false, 22 | "member-ordering": [ 23 | true, 24 | "static-before-instance", 25 | "variables-before-functions" 26 | ], 27 | "no-arg": true, 28 | "no-bitwise": true, 29 | "no-console": [ 30 | true, 31 | "debug", 32 | "info", 33 | "time", 34 | "timeEnd", 35 | "trace" 36 | ], 37 | "no-construct": true, 38 | "no-debugger": true, 39 | "no-duplicate-key": true, 40 | "no-duplicate-variable": true, 41 | "no-empty": false, 42 | "no-eval": true, 43 | "no-inferrable-types": true, 44 | "no-shadowed-variable": true, 45 | "no-string-literal": false, 46 | "no-switch-case-fall-through": true, 47 | "no-trailing-whitespace": true, 48 | "no-unused-expression": true, 49 | "no-unused-variable": true, 50 | "no-unreachable": true, 51 | "no-use-before-declare": true, 52 | "no-var-keyword": true, 53 | "object-literal-sort-keys": false, 54 | "one-line": [ 55 | true, 56 | "check-open-brace", 57 | "check-catch", 58 | "check-else", 59 | "check-whitespace" 60 | ], 61 | //"quotemark": [ 62 | // true, 63 | // "single" 64 | //], 65 | "radix": true, 66 | "semicolon": [ 67 | "always" 68 | ], 69 | "triple-equals": [ 70 | true, 71 | "allow-null-check" 72 | ], 73 | "typedef-whitespace": [ 74 | true, 75 | { 76 | "call-signature": "nospace", 77 | "index-signature": "nospace", 78 | "parameter": "nospace", 79 | "property-declaration": "nospace", 80 | "variable-declaration": "nospace" 81 | } 82 | ], 83 | "variable-name": false, 84 | "whitespace": [ 85 | true, 86 | "check-branch", 87 | "check-decl", 88 | "check-operator", 89 | "check-separator", 90 | "check-type" 91 | ] 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/base/base.manage.index.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {TISService} from '../common/tis.service'; 20 | import {Component, OnInit} from '@angular/core'; 21 | import {ActivatedRoute, Router} from "@angular/router"; 22 | import {NzDrawerService} from "ng-zorro-antd/drawer"; 23 | 24 | @Component({ 25 | // templateUrl: '/runtime/baseManageIndex.htm' 26 | template: ` 27 | 28 |
29 | 30 |
31 | 32 | 33 | ` 34 | }) 35 | export class BaseMangeIndexComponent implements OnInit { 36 | constructor(private router: Router, private route: ActivatedRoute, private tisService: TISService, private drawerService: NzDrawerService) { 37 | 38 | } 39 | 40 | ngOnInit(): void { 41 | // console.log(this.router.config); 42 | // console.log(this.route.pathFromRoot); 43 | } 44 | 45 | // goZeppelin() { 46 | // } 47 | // 48 | // openNotebook() { 49 | // const drawerRef = this.drawerService.create({ 50 | // nzWidth: "80%", 51 | // nzPlacement: "right", 52 | // nzTitle: `插件管理`, 53 | // nzContent: NotebookwrapperComponent, 54 | // nzContentParams: {} 55 | // }); 56 | // this.router.navigate(["/", {outlets: {"zeppelin": 'z/zeppelin/notebook/2HMEN4XX3'}}], {relativeTo: this.route}) 57 | // } 58 | } 59 | -------------------------------------------------------------------------------- /src/common/breadcrumb.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {AfterContentInit, Component, Input} from "@angular/core"; 20 | 21 | 22 | // implements OnInit, AfterContentInit 23 | @Component({ 24 | selector: 'tis-breadcrumb', 25 | template: ` 26 | 27 | 28 | Home 29 | 30 | 31 | Application List 32 | 33 | 34 | An Application 35 | 36 | 37 | `, 38 | styles: [ 39 | ` 40 | nz-breadcrumb { 41 | margin: 10px 0 20px 0; 42 | } 43 | ` 44 | ] 45 | }) 46 | export class TisBreadcrumbComponent implements AfterContentInit { 47 | @Input() 48 | result: { success: boolean, msg: any[], errormsg: any[] } 49 | = {success: false, msg: [], errormsg: []}; 50 | 51 | public get showSuccessMsg(): boolean { 52 | 53 | return (this.result != null) && (this.result.success === true) 54 | && (this.result.msg !== null) && this.result.msg.length > 0; 55 | 56 | } 57 | 58 | public get showErrorMsg(): boolean { 59 | return this.result != null && !this.result.success 60 | && this.result.errormsg && this.result.errormsg.length > 0; 61 | } 62 | 63 | ngAfterContentInit() { 64 | 65 | } 66 | 67 | jsonStr(v: any): string { 68 | return JSON.stringify(v); 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/common/freshman.readme.component.ts: -------------------------------------------------------------------------------- 1 | 2 | import {Component, OnInit} from "@angular/core"; 3 | 4 | 5 | @Component({ 6 | selector: "full-build-history", 7 | template: ` 8 |
9 |
10 |

开启您的数据集成之旅,让数据流动更简单高效

11 |
12 | 13 |
14 | 15 |
16 |
17 |

🚀新人快速启航

18 |
19 | 32 |
33 | 34 | 35 | 47 |
48 |
49 | 50 | `, 51 | styles: [ 52 | ` 53 | ` 54 | ] 55 | }) 56 | export class FreshmanReadmeComponent implements OnInit { 57 | ngOnInit(): void { 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /CLAUDE.md: -------------------------------------------------------------------------------- 1 | # CLAUDE.md 2 | 3 | This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. 4 | 5 | ## 项目概述 6 | 7 | 这是一个基于Angular 12的TIS(数据集成平台)前端控制台项目,主要用于数据同步、ETL处理和集群管理的Web界面。 8 | 9 | ## 开发环境设置 10 | 11 | ### 依赖安装 12 | ```bash 13 | npm install 14 | ``` 15 | 16 | 为了加快安装速度,可以使用预打包的node_modules: 17 | ```bash 18 | # 下载并解压预打包的node_modules 19 | # https://tis-release.oss-cn-beijing.aliyuncs.com/tis-console-ng-node-modules.tar 20 | ``` 21 | 22 | ### 常用开发命令 23 | 24 | #### 开发环境运行 25 | ```bash 26 | # 基于系统架构选择相应命令 27 | npm run ng:serve-jit-arm64 # ARM64架构(M1/M2 Mac) 28 | npm run ng:serve-jit-amd64 # AMD64架构(Intel Mac/x86) 29 | ``` 30 | 31 | #### 生产环境打包 32 | ```bash 33 | npm run ng:serve-aot # AOT编译生产环境打包 34 | ``` 35 | 36 | #### 代码检查和构建 37 | ```bash 38 | npm run lint # TypeScript代码检查 39 | npm run build # TypeScript编译 40 | npm run build:watch # 监听模式编译 41 | ``` 42 | 43 | #### 测试命令 44 | ```bash 45 | npm run test # 运行测试 46 | npm run test:once # 单次运行测试 47 | npm run e2e # 端到端测试 48 | ``` 49 | 50 | ## 架构概述 51 | 52 | ### 模块化结构 53 | 项目采用Angular模块化架构,主要模块包括: 54 | 55 | - **base**: 基础应用管理模块 (`/base`) 56 | - **common**: 通用组件和服务 (`src/common/`) 57 | - **datax**: DataX数据同步模块 (`/x/:name`) 58 | - **offline**: 离线任务模块 (`/offline`) 59 | - **runtime**: 核心运行时组件和路由 (`src/runtime/`) 60 | - **user**: 用户权限管理模块 (`/usr`) 61 | 62 | ### 路由配置 63 | - `/` - 首页欢迎界面 64 | - `/base` - 基础应用管理 65 | - `/usr` - 用户权限管理 66 | - `/offline` - 离线模块 67 | - `/c/:name` - 索引控制台(Core) 68 | - `/x/:name` - DataX控制台 69 | 70 | ### 技术栈 71 | - **框架**: Angular 12 + TypeScript 4.2 72 | - **UI库**: ng-zorro-antd 12.0 (Ant Design for Angular) 73 | - **图表**: ng2-charts, Chart.js, @antv/g6 74 | - **代码编辑器**: CodeMirror 75 | - **构建工具**: Angular CLI 76 | - **代理配置**: 开发环境通过proxy.conf.json代理到后端服务 77 | 78 | ### 代理服务配置 79 | 开发环境代理配置: 80 | - `/tjs` -> `http://localhost:8080` (主要后端服务) 81 | - `/tis-assemble` -> `http://localhost:8083` (装配服务) 82 | 83 | ### 样式和主题 84 | - 主要样式文件:`src/theme.less` 85 | - 支持Font Awesome图标和自定义TIS图标 86 | - 使用LESS预处理器 87 | 88 | ### 重要的开发约定 89 | - 组件命名遵循Angular风格指南 90 | - 使用TSLint进行代码质量检查(最大行长度500字符) 91 | - 跳过大部分单元测试生成(skipTests: true) 92 | - 支持AOT和JIT编译模式 93 | 94 | ### 环境配置 95 | - 开发环境配置:`src/environments/environment.ts` 96 | - 生产环境配置:`src/environments/environment.prod.ts` 97 | 98 | ### 国际化 99 | - 默认中文语言环境(zh_CN) 100 | - 使用Angular i18n支持 -------------------------------------------------------------------------------- /src/common/loading-state.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import { Component, Input } from '@angular/core'; 20 | 21 | export type LoadingState = 'idle' | 'loading' | 'success' | 'error'; 22 | 23 | @Component({ 24 | selector: 'tis-loading-state', 25 | template: ` 26 | 27 |
28 | 29 |
30 |
31 |
32 | 33 | 34 |
35 | 39 |
40 | 43 |
44 |
45 |
46 | 47 | 48 |
49 | 50 |
51 | `, 52 | styles: [` 53 | .loading-container { 54 | display: flex; 55 | justify-content: center; 56 | align-items: center; 57 | min-height: 200px; 58 | } 59 | 60 | .loading-content { 61 | width: 100%; 62 | height: 200px; 63 | } 64 | 65 | .error-container { 66 | padding: 20px; 67 | text-align: center; 68 | } 69 | `] 70 | }) 71 | export class LoadingStateComponent { 72 | @Input() state: LoadingState = 'idle'; 73 | @Input() loadingText = '加载中...'; 74 | @Input() errorTitle = '加载失败'; 75 | @Input() errorMessage = '请求发生错误,请稍后重试'; 76 | @Input() showRetry = true; 77 | 78 | onRetry() { 79 | // 子组件可以监听这个事件来处理重试逻辑 80 | this.state = 'loading'; 81 | } 82 | } -------------------------------------------------------------------------------- /src/runtime/css/prettify.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* Pretty printing styles. Used with prettify.js. */ 20 | 21 | /* SPAN elements with the classes below are added by prettyprint. */ 22 | .pln { color: #000 } /* plain text */ 23 | 24 | @media screen { 25 | .str { color: #080 } /* string content */ 26 | .kwd { color: #008 } /* a keyword */ 27 | .com { color: #800 } /* a comment */ 28 | .typ { color: #606 } /* a type name */ 29 | .lit { color: #066 } /* a literal value */ 30 | /* punctuation, lisp open bracket, lisp close bracket */ 31 | .pun, .opn, .clo { color: #660 } 32 | .tag { color: #008 } /* a markup tag name */ 33 | .atn { color: #606 } /* a markup attribute name */ 34 | .atv { color: #080 } /* a markup attribute value */ 35 | .dec, .var { color: #606 } /* a declaration; a variable name */ 36 | .fun { color: red } /* a function name */ 37 | } 38 | 39 | /* Use higher contrast and text-weight for printable form. */ 40 | @media print, projection { 41 | .str { color: #060 } 42 | .kwd { color: #006; font-weight: bold } 43 | .com { color: #600; font-style: italic } 44 | .typ { color: #404; font-weight: bold } 45 | .lit { color: #044 } 46 | .pun, .opn, .clo { color: #440 } 47 | .tag { color: #006; font-weight: bold } 48 | .atn { color: #404 } 49 | .atv { color: #060 } 50 | } 51 | 52 | /* Put a border around prettyprinted code snippets. */ 53 | pre.prettyprint { padding: 2px; border: 1px solid #888 } 54 | 55 | /* Specify class=linenums on a pre to get line numbering */ 56 | ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ 57 | li.L0, 58 | li.L1, 59 | li.L2, 60 | li.L3, 61 | li.L5, 62 | li.L6, 63 | li.L7, 64 | li.L8 { list-style-type: none } 65 | /* Alternate shading for lines */ 66 | li.L1, 67 | li.L3, 68 | li.L5, 69 | li.L7, 70 | li.L9 { background: #eee } 71 | -------------------------------------------------------------------------------- /src/runtime/pojo.component.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * Licensed to the Apache Software Foundation (ASF) under one 3 | // * or more contributor license agreements. See the NOTICE file 4 | // * distributed with this work for additional information 5 | // * regarding copyright ownership. The ASF licenses this file 6 | // * to you under the Apache License, Version 2.0 (the 7 | // * "License"); you may not use this file except in compliance 8 | // * with the License. You may obtain a copy of the License at 9 | // * 10 | // * http://www.apache.org/licenses/LICENSE-2.0 11 | // * 12 | // * Unless required by applicable law or agreed to in writing, software 13 | // * distributed under the License is distributed on an "AS IS" BASIS, 14 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // * See the License for the specific language governing permissions and 16 | // * limitations under the License. 17 | // */ 18 | // 19 | // /** 20 | // * Created by baisui on 2017/3/29 0029. 21 | // */ 22 | // import {Component, ElementRef, ViewChild} from '@angular/core'; 23 | // import {TISService} from '../common/tis.service'; 24 | // // import {BasicEditComponent} from '../corecfg/basic.edit.component'; 25 | // // import {ScriptService} from '../service/script.service'; 26 | // 27 | // import {AppFormComponent, CurrentCollection} from '../common/basic.form.component'; 28 | // import {ActivatedRoute} from '@angular/router'; 29 | // import {EditorConfiguration} from "codemirror"; 30 | // import {NzModalService} from "ng-zorro-antd/modal"; 31 | // 32 | // @Component({ 33 | // template: ` 34 | // 35 | // `, 36 | // }) 37 | // export class PojoComponent extends AppFormComponent { 38 | // // private code: ElementRef; 39 | // 40 | // pojoJavaContent: string; 41 | // 42 | // // @ViewChild('codeArea', {static: false}) set codeArea(e: ElementRef) { 43 | // // this.code = e; 44 | // // } 45 | // 46 | // constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService) { 47 | // super(tisService, route, modalService); 48 | // } 49 | // 50 | // get codeMirrirOpts(): EditorConfiguration { 51 | // return { 52 | // mode: "text/x-java", 53 | // lineNumbers: true 54 | // }; 55 | // } 56 | // 57 | // protected initialize(app: CurrentCollection): void { 58 | // console.log(app); 59 | // this.httpPost('/coredefine/corenodemanage.ajax' 60 | // , 'action=core_action&emethod=get_pojo_data') 61 | // .then((r) => { 62 | // if (r.success) { 63 | // // this.code.nativeElement.innerHTML = r.bizresult; 64 | // this.pojoJavaContent = r.bizresult; 65 | // } 66 | // }); 67 | // } 68 | // 69 | // } 70 | -------------------------------------------------------------------------------- /src/base/error.detail.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, Input, OnInit} from '@angular/core'; 20 | 21 | import {NzModalService} from "ng-zorro-antd/modal"; 22 | import {BasicFormComponent, BasicSideBar} from "../common/basic.form.component"; 23 | import {TISService} from "../common/tis.service"; 24 | import {EditorConfiguration} from "codemirror"; 25 | import {NzDrawerRef} from "ng-zorro-antd/drawer"; 26 | 27 | // 查看操作日志 28 | @Component({ 29 | template: ` 30 | 31 | 32 | 异常列表 33 | 34 | 36 | ` 37 | }) 38 | export class ErrorDetailComponent extends BasicFormComponent implements OnInit { 39 | @Input() 40 | logFileName: string; 41 | 42 | @Input() 43 | showErrlistLink = true; 44 | 45 | content = ''; 46 | 47 | constructor(tisService: TISService, modalService: NzModalService, private drawerRef: NzDrawerRef) { 48 | super(tisService, modalService); 49 | } 50 | 51 | get codeMirrirOpts(): EditorConfiguration { 52 | return { 53 | mode: {name: 'shell', alignCDATA: true}, 54 | lineNumbers: true 55 | }; 56 | } 57 | 58 | ngOnInit(): void { 59 | // if (this.sysErrCode) { 60 | // switch (this.sysErrCode) { 61 | // case SystemError.FLINK_CLUSTER_LOSS_OF_CONTACT: { 62 | // 63 | // break; 64 | // } 65 | // default: 66 | // } 67 | // } 68 | 69 | this.httpPost('/runtime/operation_detail.ajax' 70 | , `action=operation_log_action&event_submit_do_get_error_detail=y&logfilename=${this.logFileName}`) 71 | .then((result) => { 72 | this.content = result.bizresult; 73 | }); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/common/selectedtab/table.base.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from "@angular/core"; 2 | import {TISService} from "../../common/tis.service"; 3 | import {NzDrawerRef} from "ng-zorro-antd/drawer"; 4 | import {HeteroList, PluginSaveResponse, SavePluginEvent, VerifyConfig} from "../../common/tis.plugin"; 5 | import {BasicSelectedTabManagerComponent} from "./basic-selected-tab-manager-component"; 6 | const KEY_SKIP_TRANSFORMER = 'skip'; 7 | 8 | @Component({ 9 | // selector: 'nz-drawer-custom-component', 10 | template: ` 11 | 12 | 14 | 15 | 18 | 19 | 20 | 25 | 26 | `, 27 | styles: [` 28 | button { 29 | margin-right: 10px; 30 | }`] 31 | }) 32 | export class TableBaseComponent extends BasicSelectedTabManagerComponent implements OnInit { 33 | 34 | 35 | constructor(tisService: TISService, drawer: NzDrawerRef<{ hetero: HeteroList }>) { 36 | super(tisService, drawer); 37 | } 38 | 39 | verifyPluginConfig(e: PluginSaveResponse) { 40 | if (e.saveSuccess) { 41 | //console.log([ 'shallSkip' ,this.shallSkip(e),e]); 42 | if (this.shallSkip(e)) { 43 | this.drawer.close({hetero: this.dto.baseHetero[0]}); 44 | } else { 45 | this.dto.offsetStep++; 46 | this.nextStep.emit(this.dto); 47 | } 48 | } 49 | } 50 | 51 | ngOnInit(): void { 52 | // console.log([this.pluginMeta,this.hetero,this.dto]); 53 | 54 | } 55 | 56 | 57 | createStepNext() { 58 | let evt = this.createSaveEvent(false); 59 | this.savePlugin.emit(evt); 60 | 61 | } 62 | 63 | saveAndSkipTransformer() { 64 | let evt = this.createSaveEvent(true); 65 | this.savePlugin.emit(evt); 66 | } 67 | 68 | private createSaveEvent(skip: boolean) { 69 | let evt = new SavePluginEvent(); 70 | // evt.verifyConfig = true; 71 | evt.verifyConfig = VerifyConfig.VERIFY; 72 | evt.postPayload = {}; 73 | evt.postPayload[KEY_SKIP_TRANSFORMER] = skip; 74 | return evt; 75 | } 76 | 77 | private shallSkip(e: PluginSaveResponse): boolean { 78 | return e.getPostPayloadPropery(KEY_SKIP_TRANSFORMER); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/datax/datax.config.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; 20 | import {TISService} from '../common/tis.service'; 21 | import {ActivatedRoute, Router} from '@angular/router'; 22 | import {AppFormComponent, CurrentCollection} from '../common/basic.form.component'; 23 | 24 | import {NzModalService} from "ng-zorro-antd/modal"; 25 | import {DataxAddComponent, DataxDTO} from "../base/datax.add.component"; 26 | import {ExecModel} from "../base/datax.add.step7.confirm.component"; 27 | import {StepType} from "../common/steps.component"; 28 | import {Descriptor, PluginType} from "../common/tis.plugin"; 29 | 30 | 31 | @Component({ 32 | selector: "datax-cfg" , 33 | changeDetection: ChangeDetectionStrategy.Default, 34 | template: ` 35 | 37 | 38 | 39 | `, 40 | styles: [` 41 | `] 42 | }) 43 | export class DataxConfigComponent extends AppFormComponent implements OnInit { 44 | 45 | public dto: DataxDTO = null; 46 | stepType: StepType; 47 | // public stepType: StepType = StepType.CreateDatax; 48 | 49 | constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService, private router: Router) { 50 | super(tisService, route, modalService); 51 | this.stepType = this.route.snapshot.data["stepType"]; 52 | this.getCurrentAppCache = false 53 | if (!this.stepType) { 54 | this.stepType = StepType.CreateDatax 55 | } 56 | } 57 | 58 | protected initialize(app: CurrentCollection): void { 59 | // console.log(app); 60 | DataxAddComponent.getDataXMeta(this, this.stepType, app).then((dto) => { 61 | //console.log(dto); 62 | this.dto = dto; 63 | }); 64 | } 65 | 66 | 67 | get execModel(): ExecModel { 68 | return ExecModel.Reader; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 18 | 49 | 55 | 56 | 58 | 59 | -------------------------------------------------------------------------------- /src/service/script.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // import {Injectable} from '@angular/core'; 20 | // import {ScriptStore} from './script.store'; 21 | // 22 | // declare var document: any; 23 | // 24 | // @Injectable() 25 | // export class ScriptService { 26 | // 27 | // private scripts: any = {}; 28 | // 29 | // constructor() { 30 | // ScriptStore.forEach((script: any) => { 31 | // this.scripts[script.name] = { 32 | // loaded: false, 33 | // src: script.src 34 | // }; 35 | // }); 36 | // } 37 | // 38 | // load(...scripts: string[]): Promise { 39 | // let promises: any[] = []; 40 | // scripts.forEach((script) => promises.push(this.loadScript(script))); 41 | // return Promise.all(promises); 42 | // } 43 | // 44 | // loadScript(name: string) { 45 | // return new Promise((resolve, reject) => { 46 | // // resolve if already loaded 47 | // if (this.scripts[name].loaded) { 48 | // resolve({script: name, loaded: true, status: 'Already Loaded'}); 49 | // } else { 50 | // // load script 51 | // let script = document.createElement('script'); 52 | // script.type = 'text/javascript'; 53 | // script.src = this.scripts[name].src; 54 | // if (script.readyState) { // IE 55 | // script.onreadystatechange = () => { 56 | // if (script.readyState === 'loaded' || script.readyState === 'complete') { 57 | // script.onreadystatechange = null; 58 | // this.scripts[name].loaded = true; 59 | // resolve({script: name, loaded: true, status: 'Loaded'}); 60 | // } 61 | // }; 62 | // } else { // Others 63 | // script.onload = () => { 64 | // this.scripts[name].loaded = true; 65 | // resolve({script: name, loaded: true, status: 'Loaded'}); 66 | // }; 67 | // } 68 | // script.onerror = (error: any) => resolve({script: name, loaded: false, status: 'Loaded'}); 69 | // document.getElementsByTagName('head')[0].appendChild(script); 70 | // } 71 | // }); 72 | // } 73 | // 74 | // } 75 | -------------------------------------------------------------------------------- /src/common/msg.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {AfterContentInit, Component, Input} from "@angular/core"; 20 | import {TisResponseResult} from "./tis.plugin"; 21 | 22 | 23 | // implements OnInit, AfterContentInit 24 | @Component({ 25 | selector: 'tis-msg', 26 | template: ` 27 | 28 |
29 | 30 | 31 | 32 | 33 | 40 | 41 |
42 |
43 | 44 | 45 | 46 |
    47 |
  • {{m| errormsg}}
  • 48 |
49 |
50 |
51 | 52 | ` 53 | , 54 | styles: [ 55 | ` 56 | ` 57 | ] 58 | }) 59 | export class TisMsgComponent implements AfterContentInit { 60 | TisResponseResult 61 | @Input() 62 | result: TisResponseResult 63 | = {success: false, msg: [], errormsg: []}; 64 | 65 | public get showSuccessMsg(): boolean { 66 | 67 | return (this.result != null) && (this.result.success === true) 68 | && (this.result.msg !== null) && this.result.msg.length > 0; 69 | 70 | } 71 | 72 | public get showErrorMsg(): boolean { 73 | return this.result != null && !this.result.success 74 | && this.result.errormsg && this.result.errormsg.length > 0; 75 | } 76 | 77 | ngAfterContentInit() { 78 | 79 | } 80 | 81 | jsonStr(v: any): string { 82 | return JSON.stringify(v); 83 | } 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/common/date.format.pipe.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Created by baisui on 2017/4/18 0018. 21 | */ 22 | import {Pipe, PipeTransform} from '@angular/core'; 23 | import {ItemPropVal} from "./tis.plugin"; 24 | 25 | // @Pipe({name: 'dateformat'}) 26 | // export class DateFormatPipe implements PipeTransform { 27 | // 28 | // transform(value: number, args?: string[]): any { 29 | // let t = new Date(); 30 | // t.setTime(value); 31 | // return t.getFullYear() + '/' + t.getMonth() + '/' + t.getDate() + ' ' + t.getHours() + ':' + t.getMinutes(); 32 | // } 33 | // } 34 | 35 | 36 | @Pipe({name: 'timeconsume'}) 37 | export class TimeConsumePipe implements PipeTransform { 38 | 39 | transform(value: number, args?: string[]): any { 40 | let diff = (value / 1000); 41 | // tslint:disable-next-line:no-bitwise 42 | let sec = (diff % 60) | 0; 43 | diff = diff / 60; 44 | // tslint:disable-next-line:no-bitwise 45 | let m = ((diff % 60)) | 0; 46 | // tslint:disable-next-line:no-bitwise 47 | let h = (diff / 60) | 0; 48 | if (h > 0) { 49 | return `${h}小时 ${m}分 ${sec}秒`; 50 | } else if (m > 0) { 51 | return `${m}分 ${sec}秒`; 52 | } else { 53 | return `${sec}秒`; 54 | } 55 | } 56 | } 57 | 58 | @Pipe({name: 'itemPropFilter'}) 59 | export class ItemPropValPipe implements PipeTransform { 60 | 61 | transform(value: ItemPropVal[], all = false): ItemPropVal[] { 62 | if (all) { 63 | return value; 64 | } 65 | return value.filter((ip) => { 66 | return !ip.advance; 67 | }); 68 | } 69 | } 70 | 71 | @Pipe({name: 'errormsg'}) 72 | export class ErrorMsgPipe implements PipeTransform { 73 | 74 | // @ts-ignore 75 | transform(value: any): string { 76 | if (typeof value === 'string') { 77 | return value 78 | } 79 | 80 | if (value && value.message) { 81 | return value.message; 82 | } 83 | } 84 | } 85 | 86 | 87 | @Pipe({ 88 | name: 'maxLength' 89 | }) 90 | export class MaxLengthPipe implements PipeTransform { 91 | 92 | transform(value: string, maxLength: number): string { 93 | if (value && maxLength > 0) { 94 | return value.length > maxLength ? value.substring(0, maxLength) + '...' : value; 95 | } 96 | return value; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/runtime/snapshot.change.log.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * Licensed to the Apache Software Foundation (ASF) under one 3 | // * or more contributor license agreements. See the NOTICE file 4 | // * distributed with this work for additional information 5 | // * regarding copyright ownership. The ASF licenses this file 6 | // * to you under the Apache License, Version 2.0 (the 7 | // * "License"); you may not use this file except in compliance 8 | // * with the License. You may obtain a copy of the License at 9 | // * 10 | // * http://www.apache.org/licenses/LICENSE-2.0 11 | // * 12 | // * Unless required by applicable law or agreed to in writing, software 13 | // * distributed under the License is distributed on an "AS IS" BASIS, 14 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // * See the License for the specific language governing permissions and 16 | // * limitations under the License. 17 | // */ 18 | // 19 | // /** 20 | // * Created by baisui on 2017/4/10 0010. 21 | // */ 22 | // // 23 | // import {Component, OnInit} from '@angular/core'; 24 | // import {TISService} from '../common/tis.service'; 25 | // import {BasicEditComponent} from '../corecfg/basic.edit.component'; 26 | // // import {ScriptService} from '../service/script.service'; 27 | // 28 | // import {AppFormComponent, BasicFormComponent, CurrentCollection} from '../common/basic.form.component'; 29 | // import {ActivatedRoute} from '@angular/router'; 30 | // import {NzModalService} from "ng-zorro-antd/modal"; 31 | // 32 | // @Component({ 33 | // // templateUrl: '/runtime/operation_log_special_app.htm' 34 | // template: ` 35 | //
36 | // 37 | // 38 | // 39 | // 40 | // 41 | // 42 | // 43 | // 44 | // 45 | // 46 | // 47 | // 48 | // 49 | // 50 | // 51 | // 52 | // 53 | //
操作人日志时间
{{l.usrName}}{{l.memo}}{{l.createTime}}
54 | //
55 | // ` 56 | // }) 57 | // export class SnapshotChangeLogComponent extends AppFormComponent { 58 | // logs: any[] = []; 59 | // 60 | // constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService) { 61 | // super(tisService, route, modalService); 62 | // } 63 | // 64 | // protected initialize(app: CurrentCollection): void { 65 | // this.httpPost('/runtime/operation_log_special_app.ajax' 66 | // , 'action=operation_log_action&emethod=get_init_data&tab=server_group&opt=updateByExampleSelective') 67 | // .then((r) => { 68 | // if (r.success) { 69 | // this.logs = r.bizresult; 70 | // } 71 | // }); 72 | // } 73 | // } 74 | -------------------------------------------------------------------------------- /src/common/init.system.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, OnInit} from "@angular/core"; 20 | import {BasicFormComponent} from "./basic.form.component"; 21 | import {TISService} from "./tis.service"; 22 | import {NzModalRef} from "ng-zorro-antd/modal"; 23 | import {ActivatedRoute, Router} from "@angular/router"; 24 | import {NzProgressStatusType} from "ng-zorro-antd/progress"; 25 | 26 | @Component({ 27 | template: ` 28 | 29 | 30 | 31 | 32 | 33 | ` 34 | }) 35 | export class InitSystemComponent extends BasicFormComponent implements OnInit { 36 | _startInitialize = false; 37 | _percent = 0; 38 | 39 | _progressStatus: NzProgressStatusType = 'active'; 40 | 41 | constructor(tisService: TISService, private activeModal: NzModalRef, private router: Router, private route: ActivatedRoute) { 42 | super(tisService); 43 | } 44 | 45 | ngOnInit(): void { 46 | } 47 | 48 | startInitialize() { 49 | 50 | this._startInitialize = true; 51 | let timer = setInterval(() => { 52 | if (this._percent >= 100) { 53 | clearInterval(timer); 54 | return; 55 | } 56 | this._percent += 2; 57 | }, 500); 58 | let url = '/runtime/applist.ajax?action=sys_initialize_action&emethod=init'; 59 | this.httpPost(url, 'disableTransaction=true').then((r) => { 60 | clearInterval(timer); 61 | if (r.success) { 62 | this.activeModal.close(r); 63 | this._progressStatus = "success"; 64 | // this.router.navigateByUrl('/', {skipLocationChange: true}) 65 | // .then(() => { 66 | // this.router.navigate(["/"]); 67 | // }); 68 | window.location.reload(); 69 | } else { 70 | this.processResult(r); 71 | this._progressStatus = 'exception'; 72 | } 73 | }, () => { 74 | this._progressStatus = 'exception'; 75 | }).finally(() => { 76 | 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/offline/db.add.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Created by baisui on 2017/4/26 0026. 21 | */ 22 | import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; 23 | import {BasicFormComponent} from '../common/basic.form.component'; 24 | import {TISService} from '../common/tis.service'; 25 | import {Location} from '@angular/common'; 26 | 27 | // @ts-ignore 28 | import * as $ from 'jquery'; 29 | import {NzModalRef} from "ng-zorro-antd/modal"; 30 | import {HeteroList, Item, PluginSaveResponse} from "../common/tis.plugin"; 31 | import {DbPojo} from "../common/ds.utils"; 32 | 33 | 34 | @Component({ 35 | template: ` 36 | 38 | ` 39 | }) 40 | export class DbAddComponent extends BasicFormComponent implements OnInit { 41 | switchType = 'single'; 42 | dbEnums: DbEnum[] = []; 43 | @Input() dbPojo: DbPojo = new DbPojo(); 44 | errorItem: Item = Item.create([]); 45 | 46 | hlist: HeteroList[] = []; 47 | 48 | @Output() successSubmit = new EventEmitter(); 49 | 50 | isAdd: boolean; 51 | confirmBtn: string; 52 | 53 | // get dbNameReadOnly(): boolean { 54 | // return !this.dbPojo.facade && this.dbPojo.dbId != null; 55 | // } 56 | 57 | 58 | constructor(tisService: TISService, 59 | private location: Location 60 | , public activeModal: NzModalRef) { 61 | super(tisService); 62 | } 63 | 64 | 65 | get title(): string { 66 | // return this._title; 67 | return (this.isAdd ? "添加" : "更新") + (this.dbPojo.facade ? "门面" : "") + "数据库"; 68 | } 69 | 70 | ngOnInit(): void { 71 | if (this.dbPojo.dbId) { 72 | this.isAdd = false; 73 | } else { 74 | this.isAdd = true; 75 | } 76 | } 77 | 78 | 79 | 80 | onResponse(resp: PluginSaveResponse) { 81 | if (resp.saveSuccess) { 82 | // this.activeModal.close(this.dbPojo); 83 | } 84 | } 85 | 86 | } 87 | 88 | export class DbEnum { 89 | dbName: string; 90 | host: string; 91 | 92 | constructor(dbName: string, host: string) { 93 | this.dbName = dbName; 94 | this.host = host; 95 | } 96 | } 97 | 98 | -------------------------------------------------------------------------------- /src/user/user.add.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, OnInit} from '@angular/core'; 20 | import {BasicFormComponent} from '../common/basic.form.component'; 21 | import {TISService} from '../common/tis.service'; 22 | import {Router} from '@angular/router'; 23 | 24 | import {NzModalService} from "ng-zorro-antd/modal"; 25 | 26 | @Component({ 27 | // from:/runtime/usradd.htm 28 | template: ` 29 | 30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 | 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 |
48 | 49 | 50 |
51 |
52 | 53 | 54 |
55 | 56 |
57 | 58 | 59 | 60 | 63 |
64 |
65 | ` 66 | }) 67 | export class UserAddComponent extends BasicFormComponent implements OnInit { 68 | 69 | constructor(tisService: TISService, private router: Router 70 | , modalService: NzModalService) { 71 | super(tisService, modalService); 72 | } 73 | 74 | 75 | ngOnInit(): void { 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/images/icon/cog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/offline/table.cols.meta.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, ComponentFactoryResolver, Input, OnInit, ViewChild, ViewContainerRef} from '@angular/core'; 20 | import {TISService} from '../common/tis.service'; 21 | import {BasicFormComponent} from '../common/basic.form.component'; 22 | 23 | import {ActivatedRoute} from '@angular/router'; 24 | // @ts-ignore 25 | import * as $ from 'jquery'; 26 | import {NzModalRef} from "ng-zorro-antd/modal"; 27 | import { 28 | DataBase, 29 | HeteroList, 30 | IColumnMeta, 31 | Item, 32 | ItemPropVal, 33 | SuccessAddedDBTabs, 34 | TisResponseResult 35 | } from "../common/tis.plugin"; 36 | import {MultiViewDAG} from "../common/MultiViewDAG"; 37 | import {DataxAddStep3Component} from "../base/datax.add.step3.component"; 38 | import {DataxAddStep4Component} from "../base/datax.add.step4.component"; 39 | import {ExecModel} from "../base/datax.add.step7.confirm.component"; 40 | import {TableAddStep1Component} from "./table.add.step1.component"; 41 | import {DataxDTO} from "../base/datax.add.component"; 42 | import {NzNotificationService} from "ng-zorro-antd/notification"; 43 | 44 | 45 | @Component({ 46 | selector: "table-cols-meta", 47 | template: ` 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {{col.type.typeDesc}} 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | ` 72 | }) 73 | export class TableColsMetaComponent extends BasicFormComponent { 74 | @Input() 75 | colsMeta: Array; 76 | 77 | 78 | constructor(tisService: TISService) { 79 | super(tisService); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /OPTIMIZATION_GUIDE.md: -------------------------------------------------------------------------------- 1 | # TIS控制台优化指南 2 | 3 | 本文档描述了对TIS控制台项目进行的性能和用户体验优化。 4 | 5 | ## 已完成的优化 6 | 7 | ### 1. 依赖包升级 8 | - Angular 12.0.0 → 12.2.16 9 | - Chart.js 2.9.3 → 3.9.1 (包含适配器) 10 | - @antv/g6 3.0.4 → 4.8.24 11 | - jQuery 3.3.1 → 3.7.1 12 | - 其他关键依赖包升级到兼容的最新版本 13 | 14 | ### 2. 代码质量工具 15 | - 添加了ESLint配置替代已废弃的TSLint 16 | - 集成Prettier代码格式化 17 | - 配置Husky Git钩子 18 | - 启用TypeScript严格模式 19 | 20 | ### 3. 组件生命周期管理 21 | - 创建了`BaseComponent`类来统一管理订阅 22 | - 防止内存泄露问题 23 | - 所有新组件都应继承`BaseComponent` 24 | 25 | ### 4. 用户体验组件 26 | - 创建了骨架屏组件(`SkeletonLoaderComponent`) 27 | - 创建了加载状态组件(`LoadingStateComponent`) 28 | - 提供一致的加载体验 29 | 30 | ### 5. 构建优化 31 | - 优化Bundle大小限制 32 | - 启用更激进的构建优化 33 | - 配置TypeScript严格模式 34 | 35 | ## 使用指南 36 | 37 | ### 组件生命周期管理 38 | 39 | 所有需要处理订阅的组件都应该继承`BaseComponent`: 40 | 41 | ```typescript 42 | import { Component, OnInit } from '@angular/core'; 43 | import { BaseComponent } from '../common/base.component'; 44 | import { takeUntil } from 'rxjs/operators'; 45 | 46 | @Component({ 47 | selector: 'app-example', 48 | template: '...' 49 | }) 50 | export class ExampleComponent extends BaseComponent implements OnInit { 51 | 52 | constructor(private someService: SomeService) { 53 | super(); 54 | } 55 | 56 | ngOnInit() { 57 | // 使用takeUntil自动管理订阅 58 | this.someService.getData() 59 | .pipe(takeUntil(this.destroy$)) 60 | .subscribe(data => { 61 | // 处理数据 62 | }); 63 | } 64 | } 65 | ``` 66 | 67 | ### 骨架屏使用 68 | 69 | ```html 70 | 71 |
实际内容
72 |
73 | ``` 74 | 75 | ### 加载状态使用 76 | 77 | ```html 78 | 83 |
成功加载的内容
84 |
85 | ``` 86 | 87 | ```typescript 88 | export class ExampleComponent { 89 | loadingState: LoadingState = 'loading'; 90 | 91 | loadData() { 92 | this.loadingState = 'loading'; 93 | this.dataService.getData() 94 | .subscribe({ 95 | next: data => { 96 | this.loadingState = 'success'; 97 | }, 98 | error: err => { 99 | this.loadingState = 'error'; 100 | } 101 | }); 102 | } 103 | } 104 | ``` 105 | 106 | ## 安装新依赖 107 | 108 | 运行以下命令安装升级的依赖: 109 | 110 | ```bash 111 | npm install 112 | ``` 113 | 114 | ## 代码格式化 115 | 116 | 新的代码格式化工具已配置,使用以下命令: 117 | 118 | ```bash 119 | # 格式化所有代码 120 | npm run format 121 | 122 | # 检查格式化 123 | npm run format:check 124 | 125 | # 代码质量检查 126 | npm run lint 127 | ``` 128 | 129 | ## 构建命令 130 | 131 | 现有的构建命令保持不变: 132 | 133 | ```bash 134 | # 开发环境 (ARM64) 135 | npm run ng:serve-jit-arm64 136 | 137 | # 开发环境 (AMD64) 138 | npm run ng:serve-jit-amd64 139 | 140 | # 生产构建 141 | npm run ng:serve-aot 142 | ``` 143 | 144 | ## 注意事项 145 | 146 | 1. **TypeScript严格模式**: 启用了严格模式,可能需要修复一些类型错误 147 | 2. **Chart.js升级**: Chart.js 3.x有破坏性变更,需要更新图表配置 148 | 3. **ESLint**: 替代了TSLint,需要修复新的代码质量问题 149 | 150 | ## 后续优化建议 151 | 152 | 1. **Angular版本升级**: 考虑升级到Angular 17+获得更好性能 153 | 2. **虚拟滚动**: 对长列表实现虚拟滚动 154 | 3. **懒加载**: 进一步拆分模块实现懒加载 155 | 4. **状态管理**: 引入NgRx或类似状态管理库 -------------------------------------------------------------------------------- /src/datax/datax.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {NgModule, OnInit} from '@angular/core'; 20 | 21 | import {CommonModule} from '@angular/common'; 22 | import {FormsModule, ReactiveFormsModule} from '@angular/forms'; 23 | 24 | import {NzLayoutModule} from 'ng-zorro-antd/layout'; 25 | 26 | import {NzCollapseModule} from 'ng-zorro-antd/collapse'; 27 | 28 | import {NzStepsModule} from 'ng-zorro-antd/steps'; 29 | import {NzButtonModule} from 'ng-zorro-antd/button'; 30 | import {NgTerminalModule} from 'ng-terminal'; 31 | import {NzTabsModule} from 'ng-zorro-antd/tabs'; 32 | import {NzFormModule} from 'ng-zorro-antd/form'; 33 | import {NzInputModule} from 'ng-zorro-antd/input'; 34 | import {NzSelectModule} from 'ng-zorro-antd/select'; 35 | import {NzInputNumberModule} from 'ng-zorro-antd/input-number'; 36 | import {BaseChartDirective} from 'ng2-charts'; 37 | import {NzDividerModule} from 'ng-zorro-antd/divider'; 38 | import {NzIconModule} from 'ng-zorro-antd/icon'; 39 | import {NzTableModule} from 'ng-zorro-antd/table'; 40 | import {NzTagModule} from 'ng-zorro-antd/tag'; 41 | import {NzPopoverModule} from 'ng-zorro-antd/popover'; 42 | import {TisCommonModule} from "../common/common.module"; 43 | import {DataxRoutingModule} from "./datax-routing.module"; 44 | import {DataxIndexComponent} from "./datax.index.component"; 45 | import {DataxMainComponent} from "./datax.main.component"; 46 | import {DataxConfigComponent} from "./datax.config.component"; 47 | import {CoreNodeManageModule} from "../runtime/core.node.manage.module"; 48 | //import {NotebookEntryComponent} from "./notebook.entry.component"; 49 | import {PipelineControllerComponent} from "./pipeline.controller.component"; 50 | 51 | @NgModule({ 52 | id: 'datax', 53 | imports: [CommonModule, DataxRoutingModule, FormsModule, CoreNodeManageModule, TisCommonModule, NzLayoutModule, NzCollapseModule 54 | , NzStepsModule, NzButtonModule, NzTabsModule, NgTerminalModule, NzFormModule, NzInputModule, ReactiveFormsModule, NzSelectModule, NzInputNumberModule 55 | , BaseChartDirective, NzDividerModule, NzIconModule, NzTableModule, NzTagModule, NzPopoverModule 56 | ], 57 | declarations: [DataxIndexComponent, DataxMainComponent, DataxConfigComponent, PipelineControllerComponent //,NotebookEntryComponent 58 | ], 59 | providers: [ 60 | // {provide: NZ_ICON_DEFAULT_TWOTONE_COLOR, useValue: '#00ff00'}, // 不提供的话,即为 Ant Design 的主题蓝色 61 | // {provide: NZ_ICONS, useValue: icons} 62 | ] 63 | }) 64 | export class DataxModule implements OnInit { 65 | ngOnInit(): void { 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/base/datax.add.base.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {TISService} from "../common/tis.service"; 20 | import {AppFormComponent, CurrentCollection} from "../common/basic.form.component"; 21 | 22 | import {NzModalService} from "ng-zorro-antd/modal"; 23 | import {NzNotificationService} from "ng-zorro-antd/notification"; 24 | import {EventEmitter, Injectable, Input, Output} from "@angular/core"; 25 | import {DataxDTO} from "./datax.add.component"; 26 | import {ActivatedRoute, Router} from "@angular/router"; 27 | import {StepType} from "../common/steps.component"; 28 | 29 | @Injectable() 30 | export abstract class BasicDataXAddComponent extends AppFormComponent { 31 | 32 | @Output() 33 | public nextStep = new EventEmitter(); 34 | @Output() 35 | protected preStep = new EventEmitter(); 36 | @Input() 37 | public dto: DataxDTO; 38 | 39 | public _offsetStep = -1; 40 | 41 | protected constructor(tisService: TISService, modalService: NzModalService, protected r: Router, route: ActivatedRoute, notification?: NzNotificationService) { 42 | super(tisService, route, modalService, notification); 43 | } 44 | 45 | public get stepType(): StepType { 46 | return this.dto.processModel; // ? StepType.UpdateDataxReader : StepType.CreateDatax; 47 | } 48 | 49 | protected initialize(app: CurrentCollection): void { 50 | } 51 | 52 | public offsetStep(step: number): number { 53 | //console.log(step); 54 | return this.tisService._zone.run(() => { 55 | if (this._offsetStep > -1) { 56 | return this._offsetStep; 57 | } 58 | switch (this.dto.processModel) { 59 | case StepType.UpdateDataxReader: 60 | this._offsetStep = step - 1; 61 | break; 62 | case StepType.UpdateDataxWriter: 63 | this._offsetStep = step - 2; 64 | break; 65 | default: 66 | this._offsetStep = step; 67 | } 68 | return this._offsetStep; 69 | }); 70 | } 71 | 72 | // public get componentName(): string { 73 | // return this.constructor.name; 74 | // } 75 | // tisService: TISService, protected route: ActivatedRoute, modalService: NzModalService 76 | 77 | 78 | cancel() { 79 | if (this.dto.processModel === StepType.CreateDatax) { 80 | this.r.navigate(['/base/applist'], {relativeTo: this.route}); 81 | } else if (this.dto.processModel === StepType.CreateWorkflow) { 82 | this.r.navigate(['/offline/wf'], {relativeTo: this.route}); 83 | } else { 84 | this.r.navigate(['/x', this.dto.dataxPipeName, "config"], {relativeTo: this.route}); 85 | } 86 | } 87 | 88 | goback() { 89 | this.preStep.next(this.dto); 90 | } 91 | } 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/common/snapshot.link.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Created by baisui on 2017/4/18 0018. 21 | */ 22 | import {Component, Input} from '@angular/core'; 23 | import {BasicFormComponent} from "./basic.form.component"; 24 | import {TISService} from "./tis.service"; 25 | import {ActivatedRoute, Router} from "@angular/router"; 26 | import {NzModalService} from "ng-zorro-antd/modal"; 27 | 28 | 29 | @Component({ 30 | selector: "snapshot-linker", 31 | template: ` 32 | [schema.xml] 33 | 34 |
    35 |
  • xml
  • 36 |
  • 高级
  • 37 |
38 |
39 | 40 | `, 41 | }) 42 | export class SnapshotLinkComponent extends BasicFormComponent { 43 | @Input() snapshot: SnapshotLink; 44 | 45 | // constructor(private modalService: NgbModal) { 46 | // 47 | // } 48 | 49 | constructor(tisService: TISService, modalService: NzModalService, private router: Router, private route: ActivatedRoute) { 50 | super(tisService, modalService); 51 | } 52 | 53 | openSchemaDialog(editable: boolean): boolean { 54 | this.router.navigate(['../xml_conf/', 'schema', this.snapshot.snId], {relativeTo: this.route}); 55 | return false; 56 | } 57 | 58 | openSchemaVisualDialog(): void { 59 | // let modalRef: NgbModalRef = this.openNormalDialog(SchemaEditVisualizingModelComponent); 60 | // modalRef.componentInstance.snapshotid = this.snapshot.snId; 61 | 62 | this.router.navigate(['../schema_visual/', this.snapshot.snId], {relativeTo: this.route}); 63 | } 64 | 65 | 66 | openSolrConfigDialog(): void { 67 | this.router.navigate(['../xml_conf/', 'config', this.snapshot.snId], {relativeTo: this.route}); 68 | } 69 | 70 | } 71 | 72 | // { 73 | // "appId":111498, 74 | // "createTime":1557187739000, 75 | // "createUserId":999, 76 | // "createUserName":"baisui", 77 | // "preSnId":20664, 78 | // "resApplicationId":13380, 79 | // "resCorePropId":13307, 80 | // "resJarId":13226, 81 | // "resSchemaId":15002, 82 | // "resSolrId":14478, 83 | // "snId":20688, 84 | // "updateTime":1557187739000 85 | // }, 86 | interface SnapshotLink { 87 | snId: number; 88 | resSolrId: number; 89 | resSchemaId: number; 90 | appId: number; 91 | createTime: number; 92 | } 93 | -------------------------------------------------------------------------------- /src/user/user.list.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, OnInit} from '@angular/core'; 20 | import {BasicFormComponent} from '../common/basic.form.component'; 21 | import {TISService} from '../common/tis.service'; 22 | import {Router} from '@angular/router'; 23 | import {UserAddComponent} from './user.add.component'; 24 | 25 | import {Pager} from '../common/pagination.component'; 26 | import {NzModalService} from "ng-zorro-antd/modal"; 27 | 28 | @Component({ 29 | template: ` 30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {{u.getRoleName}} 44 | 初始账户 45 | 46 | 47 | {{u.createTime|date : "yyyy/MM/dd HH:mm:ss"}} 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
57 | ` 58 | }) 59 | export class UserListComponent extends BasicFormComponent implements OnInit { 60 | 61 | usrs: any[] = []; 62 | pager: Pager = new Pager(1, 2); 63 | 64 | constructor(tisService: TISService, private router: Router, modalService: NzModalService) { 65 | super(tisService, modalService); 66 | } 67 | 68 | 69 | ngOnInit(): void { 70 | // console.info( this.tisService.daily); 71 | this.gotoPage(1); 72 | } 73 | 74 | public gotoPage(page: number): void { 75 | this.httpPost('/runtime/usrlist.ajax' 76 | , 'action=user_action&emethod=get_init_data&page=' + page) 77 | .then((r) => { 78 | if (r.success) { 79 | this.usrs = r.bizresult.rows; 80 | this.pager = new Pager(r.bizresult.curPage, r.bizresult.totalPage); 81 | } 82 | }); 83 | } 84 | 85 | public usradd(): void { 86 | this.openDialog(UserAddComponent, {nzTitle: "添加用户"}); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/runtime/incr.build.step3.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {AfterContentInit, AfterViewInit, Component, EventEmitter, Input, Output} from "@angular/core"; 20 | import {TISService} from "../common/tis.service"; 21 | import {AppFormComponent, CurrentCollection} from "../common/basic.form.component"; 22 | 23 | import {ActivatedRoute, Router} from "@angular/router"; 24 | import {NzModalService} from "ng-zorro-antd/modal"; 25 | import {IndexIncrStatus} from "./misc/RCDeployment"; 26 | 27 | 28 | @Component({ 29 | template: ` 30 | 31 | 32 | 33 | 38 | 39 | 40 | 45 |
46 | 47 |
48 |
49 | ` 50 | }) 51 | export class IncrBuildStep3Component extends AppFormComponent implements AfterContentInit, AfterViewInit { 52 | @Output() nextStep = new EventEmitter(); 53 | @Output() preStep = new EventEmitter(); 54 | @Input() dto: IndexIncrStatus; 55 | private currCollection: CurrentCollection; 56 | 57 | constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService, private router: Router) { 58 | super(tisService, route, modalService); 59 | } 60 | 61 | protected initialize(app: CurrentCollection): void { 62 | this.currCollection = app; 63 | } 64 | 65 | ngAfterViewInit(): void { 66 | } 67 | 68 | ngAfterContentInit(): void { 69 | } 70 | 71 | public createIndexStepPre() { 72 | this.preStep.emit(this.dto); 73 | } 74 | 75 | createIncrSyncChannal() { 76 | 77 | } 78 | 79 | createIndexStepNext() { 80 | this.nextStep.emit(this.dto); 81 | } 82 | 83 | cancelStep() { 84 | } 85 | 86 | gotoManage() { 87 | // this.router.navigate(["."], {relativeTo: this.route}); 88 | 89 | IndexIncrStatus.getIncrStatusThenEnter(this, (incrStatus) => { 90 | let k8sRCCreated = incrStatus.k8sReplicationControllerCreated; 91 | if (k8sRCCreated) { 92 | this.nextStep.emit(incrStatus); 93 | } 94 | }); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/runtime/incr.build.step0.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {AfterContentInit, Component, EventEmitter, Output} from "@angular/core"; 20 | import {TISService} from "../common/tis.service"; 21 | import {AppFormComponent, CurrentCollection} from "../common/basic.form.component"; 22 | 23 | import {ActivatedRoute} from "@angular/router"; 24 | import {NzModalService} from "ng-zorro-antd/modal"; 25 | import {IndexIncrStatus} from "./misc/RCDeployment"; 26 | import {NzNotificationService} from "ng-zorro-antd/notification"; 27 | 28 | 29 | @Component({ 30 | template: ` 31 | 32 | 37 | 38 |

39 | 40 |

41 |
42 | 43 | MySQ实时同步Doris作为示例,让初次使用者能够更快熟悉操作 44 | 45 | 46 | 47 | 48 |
49 |
50 | `, 51 | styles:[ 52 | ` 53 | .container { 54 | margin-top: 30px; 55 | } 56 | ` 57 | ] 58 | }) 59 | export class IncrBuildStep0Component extends AppFormComponent implements AfterContentInit { 60 | @Output() nextStep = new EventEmitter(); 61 | 62 | constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService, notification: NzNotificationService) { 63 | super(tisService, route, modalService, notification); 64 | } 65 | 66 | protected initialize(app: CurrentCollection): void { 67 | } 68 | 69 | ngAfterContentInit(): void { 70 | } 71 | 72 | public createIncrSyncChannal(): void { 73 | 74 | this.httpPost('/coredefine/corenodemanage.ajax', 'action=core_action&emethod=start_incr_sync_channal') 75 | .then((r) => { 76 | if (r.success) { 77 | let dto: IndexIncrStatus = r.bizresult; 78 | // console.log(dto); 79 | if (!dto.readerDesc.supportIncr) { 80 | this.errNotify(dto.readerDesc.impl + "类型的Source暂时不支持增量同步", 10000); 81 | return; 82 | } 83 | if (!dto.writerDesc.supportIncr) { 84 | // console.log(dto.writerDesc); 85 | this.errNotify(dto.writerDesc.impl + "类型的Sink暂时不支持增量同步", 10000); 86 | return; 87 | } 88 | this.nextStep.next(dto); 89 | } 90 | }); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/base/global.update.param.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * Licensed to the Apache Software Foundation (ASF) under one 3 | // * or more contributor license agreements. See the NOTICE file 4 | // * distributed with this work for additional information 5 | // * regarding copyright ownership. The ASF licenses this file 6 | // * to you under the Apache License, Version 2.0 (the 7 | // * "License"); you may not use this file except in compliance 8 | // * with the License. You may obtain a copy of the License at 9 | // * 10 | // * http://www.apache.org/licenses/LICENSE-2.0 11 | // * 12 | // * Unless required by applicable law or agreed to in writing, software 13 | // * distributed under the License is distributed on an "AS IS" BASIS, 14 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // * See the License for the specific language governing permissions and 16 | // * limitations under the License. 17 | // */ 18 | // 19 | // import {TISService} from '../common/tis.service'; 20 | // import {Component, Injector, Input, OnInit} from '@angular/core'; 21 | // 22 | // import {BasicFormComponent} from '../common/basic.form.component'; 23 | // import {NzModalService} from "ng-zorro-antd/modal"; 24 | // 25 | // 26 | // // 设置全局参数 27 | // @Component({ 28 | // // templateUrl: '/runtime/config_file_parameters_set.htm' 29 | // template: ` 30 | // 31 | //
32 | // 38 | // 60 | //
61 | // ` 62 | // }) 63 | // export class GlobalUpdateParamComponent extends BasicFormComponent implements OnInit { 64 | // 65 | // 66 | // resparam: any = {value: '', keyName: ''}; 67 | // rpidVal: number; 68 | // 69 | // constructor(tisService: TISService, modalService: NzModalService 70 | // , private injector: Injector) { 71 | // super(tisService, modalService); 72 | // } 73 | // 74 | // ngOnInit(): void { 75 | // this.httpPost('/runtime/config_file_parameters_set.ajax' 76 | // , 'event_submit_do_get_param=y&action=config_file_parameters_action&rpid=' + this.rpidVal) 77 | // .then(result => { 78 | // if (result.success) { 79 | // this.resparam = result.bizresult; 80 | // } 81 | // }); 82 | // } 83 | // 84 | // @Input() set rpid(val: number) { 85 | // this.rpidVal = val; 86 | // 87 | // } 88 | // 89 | // 90 | // // 添加参数 91 | // public event_submit_do_set_parameter(form: any) { 92 | // this.submitForm('/runtime/config_file_parameters_set.ajax' 93 | // , form); 94 | // } 95 | // 96 | // deleteParam() { 97 | // } 98 | // } 99 | -------------------------------------------------------------------------------- /src/common/multi-selected/basic.tuples.view.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Injectable, Input} from "@angular/core"; 2 | import {BasicFormComponent} from "../basic.form.component"; 3 | import {DataTypeMeta, ReaderColMeta} from "../tis.plugin"; 4 | import {TISService} from "../tis.service"; 5 | import {NzModalService} from "ng-zorro-antd/modal"; 6 | import {NzNotificationService} from "ng-zorro-antd/notification"; 7 | import {TuplesProperty} from "../plugin/type.utils"; 8 | 9 | export interface Pair { 10 | name: string; 11 | value: string | Array 12 | } 13 | 14 | export interface UdfDesc { 15 | pairs: Array 16 | } 17 | 18 | @Component({ 19 | selector: "udf-desc-literia", 20 | template: ` 21 | 22 | 23 | 24 | 25 | 26 | 27 |
    28 |
  • {{pair.name}}: 29 | 30 | "{{pair.value}}" 31 |
    32 | 34 |
    35 |
    36 |
  • 37 |
38 | 39 |
40 | 41 |
42 | 43 | `, 44 | styles: [` 45 | .pair-key { 46 | font-size: 14px; 47 | } 48 | 49 | .pair-val { 50 | display: inline-block; 51 | margin-left: 5px; 52 | color: #04b604; 53 | font-size: 14px; 54 | } 55 | 56 | .desc-literia { 57 | margin: 0px 0px 0px 10px; 58 | padding: 0px; 59 | } 60 | 61 | .desc-literia li { 62 | display: inline-block; 63 | margin: 0px 10px 0px 0px; 64 | list-style-type: none; 65 | } 66 | 67 | .pairs li { 68 | float: left; 69 | } 70 | `] 71 | }) 72 | export class UdfDescLiteria { 73 | 74 | @Input() 75 | descAry: Array 76 | 77 | 78 | isArray(val: any): boolean { 79 | return Array.isArray(val); 80 | } 81 | } 82 | 83 | @Injectable() 84 | export abstract class BasicTuplesViewComponent extends BasicFormComponent { 85 | 86 | 87 | /** 88 | * 显示的列表信息(Mongodb列,Transformer规则) 89 | */ 90 | // @Input() 91 | abstract set colsMeta(colsMeta: Array) ; 92 | 93 | /** 94 | * 支持的所有类型枚举 95 | */ 96 | @Input() 97 | typeMetas: Map = new Map(); 98 | 99 | _view: TuplesProperty; 100 | 101 | constructor(tisService: TISService, modalService: NzModalService, notification: NzNotificationService) { 102 | super(tisService, modalService, notification); 103 | } 104 | 105 | @Input() 106 | public set tabletView(view: TuplesProperty) { 107 | // console.log(view); 108 | this.colsMeta = view.mcols; 109 | this.typeMetas = BasicTuplesViewComponent.type2Map(view.typeMetas); 110 | this._view = view; 111 | // 112 | } 113 | 114 | // private _typeMap: Map 115 | static type2Map(typeMetas: Array): Map { 116 | if (typeMetas && typeMetas.length > 0) { 117 | let result = new Map(); 118 | for (let type of typeMetas) { 119 | result.set(type.type.type, type); 120 | } 121 | return result; 122 | } else { 123 | throw new Error("this.typeMetas can not be empty"); 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * This file includes polyfills needed by Angular and is loaded before the app. 21 | * You can add your own extra polyfills to this file. 22 | * 23 | * This file is divided into 2 sections: 24 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 25 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 26 | * file. 27 | * 28 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 29 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 30 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 31 | * 32 | * Learn more in https://angular.io/guide/browser-support 33 | */ 34 | 35 | /*************************************************************************************************** 36 | * BROWSER POLYFILLS 37 | */ 38 | 39 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 40 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 41 | 42 | /** 43 | * Web Animations `@angular/platform-browser/animations` 44 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 45 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 46 | */ 47 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 48 | 49 | /** 50 | * By default, zone.js will patch all possible macroTask and DomEvents 51 | * user can disable parts of macroTask/DomEvents patch by setting following flags 52 | * because those flags need to be set before `zone.js` being loaded, and webpack 53 | * will put import in the top of bundle, so user need to create a separate file 54 | * in this directory (for example: zone-flags.ts), and put the following flags 55 | * into that file, and then add the following code before importing zone.js. 56 | * import './zone-flags.ts'; 57 | * 58 | * The flags allowed in zone-flags.ts are listed here. 59 | * 60 | * The following flags will work for all browsers. 61 | * 62 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 63 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 64 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 65 | * 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | * 69 | * (window as any).__Zone_enable_cross_context_check = true; 70 | * 71 | */ 72 | 73 | /*************************************************************************************************** 74 | * Zone JS is required by default for Angular itself. 75 | */ 76 | import 'zone.js'; 77 | 78 | 79 | /*************************************************************************************************** 80 | * APPLICATION IMPORTS 81 | */ 82 | import '@angular/localize/init' 83 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tis-console", 3 | "version": "1.0.0", 4 | "description": "tis-console", 5 | "scripts": { 6 | "build": "tsc -p ./src", 7 | "build:watch": "tsc -p ./src/ -w", 8 | "build:e2e": "tsc -p e2e/", 9 | "ng:serve-aot": "ng build --aot --configuration production", 10 | "ng:serve-aot-arm64": "export NODE_OPTIONS=--openssl-legacy-provider && ng build --aot --configuration production ", 11 | "ng:serve-jit-arm64": "export NODE_OPTIONS=--openssl-legacy-provider && ng serve --proxy-config proxy.conf.json", 12 | "ng:serve-jit-amd64": " ng serve --proxy-config proxy.conf.json", 13 | "build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js_bak", 14 | "rollup": "rollup -c rollup-config.js_bak", 15 | "serve": "lite-server -c=bs-config.json", 16 | "serve:e2e": "lite-server -c=bs-config.e2e.json", 17 | "prestart": "npm run build", 18 | "start": "concurrently \"npm run build:watch\" \"npm run serve\"", 19 | "pree2e": "npm run build:e2e", 20 | "e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first", 21 | "preprotractor": "webdriver-manager update", 22 | "protractor": "protractor protractor.config.js", 23 | "pretest": "npm run build", 24 | "test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"", 25 | "pretest:once": "npm run build", 26 | "test:once": "karma start karma.conf.js --single-run", 27 | "lint": "eslint \"src/**/*.ts\" --fix", 28 | "format": "prettier --write \"src/**/*.{ts,html,css,less,json}\"", 29 | "format:check": "prettier --check \"src/**/*.{ts,html,css,less,json}\"", 30 | "prepare": "husky install" 31 | }, 32 | "keywords": [], 33 | "author": "", 34 | "license": "MIT", 35 | "dependencies": { 36 | "@angular/animations": "^17.3.12", 37 | "@angular/common": "^17.3.12", 38 | "@angular/compiler": "^17.3.12", 39 | "@angular/core": "^17.3.12", 40 | "@angular/forms": "^17.3.12", 41 | "@angular/localize": "^17.3.12", 42 | "@angular/platform-browser": "^17.3.12", 43 | "@angular/platform-browser-dynamic": "^17.3.12", 44 | "@angular/router": "^17.3.12", 45 | "@antv/g6": "^4.8.24", 46 | "@ctrl/tinycolor": "^4.2.0", 47 | "@shopify/draggable": "^1.1.4", 48 | "chart.js": "^3.9.1", 49 | "chartjs-adapter-date-fns": "^2.0.0", 50 | "codemirror": "^5.65.16", 51 | "core-js": "^3.36.0", 52 | "font-awesome": "^4.7.0", 53 | "jquery": "^3.7.1", 54 | "marked": "^16.3.0", 55 | "ng-terminal": "^6.5.0", 56 | "ng-zorro-antd": "^17.4.1", 57 | "ng2-charts": "^8.0.0", 58 | "ngx-markdown": "^17.2.1", 59 | "nprogress": "^0.2.0", 60 | "rxjs": "^7.8.1", 61 | "tslib": "^2.6.2", 62 | "zone.js": "~0.14.10" 63 | }, 64 | "devDependencies": { 65 | "@angular-devkit/build-angular": "^17.3.10", 66 | "@angular/cli": "^17.3.10", 67 | "@angular/compiler-cli": "^17.3.12", 68 | "@angular/language-service": "^17.3.12", 69 | "@rollup/plugin-commonjs": "^28.0.1", 70 | "@rollup/plugin-node-resolve": "^15.3.0", 71 | "@rollup/plugin-terser": "^0.4.4", 72 | "@types/codemirror": "^5.60.15", 73 | "@types/jasmine": "~5.1.4", 74 | "@types/node": "^18.19.0", 75 | "@typescript-eslint/eslint-plugin": "^7.18.0", 76 | "@typescript-eslint/parser": "^7.18.0", 77 | "concurrently": "^7.6.0", 78 | "dagre-d3": "^0.6.4", 79 | "eslint": "^8.57.0", 80 | "husky": "^8.0.3", 81 | "jasmine-core": "^5.1.0", 82 | "jasmine-spec-reporter": "~7.0.0", 83 | "karma": "~6.4.3", 84 | "karma-chrome-launcher": "~3.2.0", 85 | "karma-coverage": "~2.2.1", 86 | "karma-jasmine": "~5.1.0", 87 | "karma-jasmine-html-reporter": "^2.1.0", 88 | "lint-staged": "^15.2.2", 89 | "lodash": "^4.17.21", 90 | "postcss": "^8.4.35", 91 | "prettier": "^3.2.5", 92 | "protractor": "~7.0.0", 93 | "rollup": "^4.24.0", 94 | "ts-node": "~10.9.2", 95 | "typescript": "~5.4.5" 96 | }, 97 | "repository": {} 98 | } 99 | -------------------------------------------------------------------------------- /src/service/tis.service.ts.orig: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | <<<<<<< HEAD 3 | 4 | 5 | import 'rxjs/add/operator/toPromise'; 6 | import {Http, Headers, RequestOptionsArgs} from '@angular/http'; 7 | ======= 8 | 9 | import 'rxjs/add/operator/toPromise'; 10 | import {Headers, Http, RequestOptionsArgs} from '@angular/http'; 11 | >>>>>>> aa80d33f314a3c626b6adb9fb2e0f8626159f9db 12 | 13 | import {CurrentCollection} from '../common/basic.form.component'; 14 | 15 | declare var TIS: any; 16 | 17 | @Injectable() 18 | export class TISService { 19 | // 导航栏头部的应用是否可以选择? 20 | // private appSelectable: boolean = false; 21 | private isDailyRuntime: boolean; 22 | 23 | constructor(protected http: Http, private modalService: NgbModal) { 24 | this.isDailyRuntime = true; 25 | } 26 | 27 | // 是否是日常环境 28 | public get daily(): boolean { 29 | return TIS.daily; 30 | } 31 | 32 | // 通过部门id 33 | public getIndexListByDptId(dptid: number): Promise { 34 | 35 | return this.http.get('/runtime/changedomain.ajax?event_submit_do_select_change=y&action=change_domain_action&bizid=' + dptid) 36 | .toPromise() 37 | .then(response => response.json().bizresult as any) 38 | .catch(this.handleError); 39 | } 40 | 41 | public isDaily(): boolean { 42 | return this.isDailyRuntime; 43 | } 44 | 45 | public set currentApp(currApp: CurrentCollection) { 46 | 47 | } 48 | 49 | // 发送http post请求 50 | public httpPost(url: string, body: string): Promise { 51 | 52 | let headers = new Headers(); 53 | headers.append('content-type', 'application/x-www-form-urlencoded; charset=UTF-8'); 54 | this.appendHeaders(headers); 55 | 56 | let opts: RequestOptionsArgs = {headers: headers}; 57 | 58 | return this.http.post(url, body, opts) 59 | .toPromise() 60 | .then(response => { 61 | return this.processResult(response.json()); 62 | }).catch(this.handleError); 63 | } 64 | 65 | protected appendHeaders(headers: Headers): void { 66 | 67 | } 68 | 69 | 70 | // 发送json表单 71 | public jsonPost(url: string, body: any): Promise { 72 | let headers = new Headers(); 73 | headers.append('content-type', 'text/json; charset=UTF-8'); 74 | this.appendHeaders(headers); 75 | let opts: RequestOptionsArgs = {headers: headers}; 76 | 77 | return this.http.post(url, body, opts) 78 | .toPromise() 79 | .then(response => { 80 | return this.processResult(response.json()); 81 | }).catch(this.handleError); 82 | } 83 | 84 | public jPost(url: string, o: any): Promise { 85 | return this.jsonPost(url, JSON.stringify(o)); 86 | } 87 | 88 | private processResult(result: { bizresult: any, success: boolean, errormsg: string[] }): any { 89 | 90 | if (result.success) { 91 | return result; 92 | } else { 93 | // faild 94 | // var errs: string[] = result.errormsg; 95 | // 96 | // //this.modalService.open(InfoDialogComponent,{size:'sm'}); 97 | // console.info(errs); 98 | return result; 99 | } 100 | } 101 | 102 | protected handleError(error: any): Promise { 103 | console.error('An error occurred', error); 104 | return Promise.reject(error.message || error); 105 | } 106 | 107 | } 108 | 109 | @Injectable() 110 | export class AppTISService extends TISService { 111 | // 当前上下文中使用的索引实例 112 | private currApp: CurrentCollection; 113 | 114 | constructor(http: Http, modalService: NgbModal) { 115 | super(http, modalService); 116 | } 117 | 118 | public set currentApp(currApp: CurrentCollection) { 119 | this.currApp = currApp; 120 | } 121 | 122 | public get currentApp() { 123 | return this.currApp; 124 | } 125 | 126 | protected appendHeaders(headers: Headers): void { 127 | if (this.currApp) { 128 | headers.append('appname', this.currApp.appName); 129 | headers.append('appid', '' + this.currApp.appid); 130 | } 131 | } 132 | } 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /src/common/selectedtab/table.transformer.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, EventEmitter, OnInit} from "@angular/core"; 2 | import { 3 | DATAX_PREFIX_DB, 4 | Descriptor, 5 | EXTRA_PARAM_DATAX_NAME, 6 | HeteroList, 7 | PluginMeta, 8 | PluginSaveResponse 9 | } from "../../common/tis.plugin"; 10 | import {PluginsComponent} from "../../common/plugins.component"; 11 | import {TISService} from "../../common/tis.service"; 12 | import {NzDrawerRef} from "ng-zorro-antd/drawer"; 13 | import {DataxAddStep4Component} from "../../base/datax.add.step4.component"; 14 | import {BasicSelectedTabManagerComponent} from "./basic-selected-tab-manager-component"; 15 | import {processSubFormHeteroList} from "../ds.utils"; 16 | 17 | 18 | @Component({ 19 | 20 | template: ` 21 | 22 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 38 | ` 39 | }) 40 | export class TableTransformerComponent extends BasicSelectedTabManagerComponent implements OnInit { 41 | transformerPluginMeta: PluginMeta[] = []; 42 | transformerSavePlugin = new EventEmitter<{ verifyConfig: boolean }>(); 43 | transformerHetero: HeteroList[] = []; 44 | 45 | readonly :boolean = false; 46 | 47 | constructor(tisService: TISService, drawer: NzDrawerRef<{ hetero: HeteroList }>) { 48 | super(tisService, drawer); 49 | } 50 | 51 | // constructor(tisService: TISService) { 52 | // super(tisService, null); 53 | // } 54 | 55 | ngOnInit(): void { 56 | // this.dto.offsetStep = 1; 57 | // console.log(this.dto.); 58 | 59 | // let currApp = this.tisService.currentApp; 60 | this.tisService.selectedTab = this.dto; 61 | this.transformerPluginMeta = [ 62 | { 63 | name: "transformer", 64 | require: true 65 | // , extraParam: EXTRA_PARAM_DATAX_NAME + currApp.appName + ",id_" + this.dto.meta.id 66 | , extraParam: this.dto.dataXReaderTargetName + ",id_" + this.dto.meta.id 67 | , descFilter: 68 | { 69 | localDescFilter: (desc: Descriptor) => true 70 | } 71 | } 72 | ]; 73 | this.initTransformerHetero(); 74 | } 75 | 76 | get getDataXReaderTargetName() { 77 | // return this.dto.tablePojo ? (DATAX_PREFIX_DB + this.dto.tablePojo.dbName) : (EXTRA_PARAM_DATAX_NAME + this.dto.dataxPipeName); 78 | return null; 79 | } 80 | 81 | verifyPluginConfig(e: PluginSaveResponse) { 82 | //console.log([e.saveSuccess,e.verify]); 83 | if (e.saveSuccess) { 84 | this.drawer.close({hetero: this.dto.baseHetero[0]}); 85 | } 86 | } 87 | initTransformerHetero() { 88 | // console.log(this.pluginMeta); 89 | 90 | let m = this.transformerPluginMeta[0]; 91 | processSubFormHeteroList(this, m, this.dto.meta, null 92 | ).then((hlist: HeteroList[]) => { 93 | 94 | hlist.forEach((h) => { 95 | PluginsComponent.addDefaultItem(m, h); 96 | }) 97 | 98 | this.transformerHetero = hlist; 99 | }); 100 | } 101 | 102 | createStepNext() { 103 | this.transformerSavePlugin.emit({verifyConfig: false}); 104 | } 105 | 106 | goBack() { 107 | --this.dto.offsetStep; 108 | this.preStep.emit(this.dto); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/base/common/datax.common.ts: -------------------------------------------------------------------------------- 1 | import {BasicFormComponent} from "../../common/basic.form.component"; 2 | import {Descriptor, getPluginMetaParam, HeteroList, PluginType, TisResponseResult} from "../../common/tis.plugin"; 3 | import {PluginsComponent} from "../../common/plugins.component"; 4 | 5 | export const KEY_DATAFLOW_PARSER = "数据流分析(EMR)"; 6 | 7 | export function getUserProfile( 8 | module: BasicFormComponent // 9 | , targetActionMethod?: { action: string, method: string }) 10 | : Promise<{ hlist: HeteroList, userProfileCategory: PluginType, result: TisResponseResult }> { 11 | let targetDisplayName = 'UserProfile'; 12 | let pluginCategory: PluginType = { 13 | name: 'params-cfg-user-isolation', 14 | require: true, 15 | extraParam: `update_true,targetItemDesc_${targetDisplayName}` 16 | } 17 | 18 | // this.userProfileCategory = [pluginCategory]; 19 | 20 | let actionMethod = targetActionMethod 21 | ? `action=${targetActionMethod.action}&emethod=${targetActionMethod.method}` 22 | : "action=plugin_action&emethod=get_describle"; 23 | 24 | 25 | return module.httpPost('/coredefine/corenodemanage.ajax' 26 | , actionMethod + '&plugin=' 27 | + getPluginMetaParam(pluginCategory) + `&name=${targetDisplayName}&hetero=` + pluginCategory.name) 28 | .then((r) => { 29 | if (r.success) { 30 | let hlist: HeteroList = PluginsComponent.wrapperHeteroList(targetActionMethod ? r.bizresult.hetero : r.bizresult, pluginCategory); 31 | if (hlist.items.length < 1) { 32 | Descriptor.addNewItem(hlist, hlist.descriptorList[0], false, (key, p) => { 33 | if (key === 'name' && !p.primary) { 34 | module.appMeta.then((profile) => { 35 | p.primary = profile.usr.name; 36 | }) 37 | } 38 | return p; 39 | }); 40 | } 41 | return {hlist: hlist, userProfileCategory: pluginCategory, result: r} 42 | } 43 | }); 44 | } 45 | 46 | 47 | /** 48 | * 被选中的列 49 | */ 50 | export interface ISelectedCol { 51 | label: string; 52 | value: string; 53 | checked: boolean; 54 | pk: boolean; 55 | } 56 | 57 | export interface ISelectedTabMeta { 58 | 59 | tableName: string, 60 | selectableCols: Array // r.bizresult 61 | } 62 | 63 | export class DataxProfile { 64 | projectName: string; 65 | recept: string; 66 | dptId: string; 67 | } 68 | 69 | // "transformerInfo":[ 70 | // { 71 | // "ruleCount":3, 72 | // "tableName":"base" 73 | // } 74 | // ] 75 | export interface TransformerInfo { 76 | ruleCount: number; 77 | tableName: string; 78 | 79 | /** 80 | * example: dataxName_mysql_mysql or dataxDB_xxxx 81 | */ 82 | pipeParma: string; 83 | } 84 | 85 | export interface DataXCfgFile { 86 | dbFactoryId?: string; 87 | fileName: string;//:"totalpayinfo_0.json" 88 | } 89 | 90 | export class AddStep2ComponentCfg { 91 | public readerCptNeed = true; 92 | public headerCaption = 'Reader & Writer类型'; 93 | public writerTypeLable = "Writer类型"; 94 | public writerPluginTag: string = ''; 95 | 96 | public stepIndex = 0; 97 | 98 | get stepToolbarNeed(): boolean { 99 | return true; //this.readerCptNeed; 100 | } 101 | 102 | installableExtension: Array = ['com.qlangtech.tis.datax.impl.DataxReader', 'com.qlangtech.tis.datax.impl.DataxWriter']; 103 | } 104 | 105 | export interface DataXCreateProcessMeta { 106 | readerRDBMS: boolean; 107 | readerRDBMSChangeableInLifetime?: boolean; 108 | // DataX Reader 是否有明确的表名 109 | explicitTable: boolean; 110 | 111 | // writer 是否符合关系型数据库要求 112 | writerRDBMS: boolean; 113 | // reader 中是否可以选择多个表,例如像elastic这样的writer中对于column的设置比较复杂,需要在writer plugin页面中完成,所以就不能支持在reader中选择多个表了 114 | writerSupportMultiTab: boolean; 115 | } 116 | -------------------------------------------------------------------------------- /src/common/MultiViewDAG.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {ComponentFactoryResolver, ComponentRef, Type, ViewContainerRef} from "@angular/core"; 20 | import {Tis} from "../environments/environment"; 21 | import {Subject} from "rxjs"; 22 | 23 | 24 | /** 25 | * 多步骤跳转VIEW逻辑实现 26 | */ 27 | export class MultiViewDAG { 28 | stepChange$ = new Subject(); 29 | // 历史回退使用 30 | history: Array> = []; 31 | private current: Type = null; 32 | 33 | constructor(private configFST: Map, private _componentFactoryResolver: ComponentFactoryResolver 37 | , private stepViewPlaceholder: ViewContainerRef) { 38 | if (!stepViewPlaceholder) { 39 | throw new Error("param stepViewPlaceholder can not be empty"); 40 | } 41 | } 42 | 43 | public get lastCpt(): Type { 44 | return Tis.environment.production ? null : this.current; 45 | } 46 | 47 | // 通过跳转状态机加载Component 48 | public loadComponent(cpt: Type, dto: any) { 49 | // var cpt = AddAppFormComponent; 50 | this.current = cpt; 51 | let componentRef = this.setComponentView(cpt); 52 | let nextCpt = this.configFST.get(cpt).next; 53 | let preCpt = this.configFST.get(cpt).pre; 54 | 55 | if (dto) { 56 | componentRef.instance.dto = dto; 57 | } 58 | 59 | // console.log({next: nextCpt, pre: preCpt}); 60 | 61 | if (nextCpt !== null) { 62 | componentRef.instance.nextStep.subscribe((e: IntendDirect | any) => { 63 | this.history.push(this.current); 64 | if (e.dto) { 65 | if (!e.cpt) { 66 | throw new Error("prop cpt can not be null"); 67 | } 68 | // console.log("this.stepChange$") 69 | this.stepChange$.next(e.dto); 70 | this.loadComponent(e.cpt, e.dto); 71 | } else { 72 | // console.log("this.stepChange$") 73 | this.stepChange$.next(e); 74 | this.loadComponent(nextCpt, e); 75 | } 76 | } 77 | ); 78 | } 79 | 80 | if (preCpt !== null) { 81 | componentRef.instance.preStep.subscribe((e: any) => { 82 | let lastCpt = this.history.pop(); 83 | if (lastCpt) { 84 | // lastCpt = this.history.pop(); 85 | // if (lastCpt) { 86 | preCpt = lastCpt; 87 | //} 88 | } 89 | console.log("this.stepChange$") 90 | this.stepChange$.next(e); 91 | this.loadComponent(preCpt, e); 92 | } 93 | ); 94 | } 95 | } 96 | 97 | private setComponentView(component: Type): ComponentRef { 98 | let componentFactory = this._componentFactoryResolver.resolveComponentFactory(component); 99 | // 100 | // let viewContainerRef = this.stepViewPlaceholder.viewContainerRef; 101 | // viewContainerRef.clear(); 102 | this.stepViewPlaceholder.clear(); 103 | return this.stepViewPlaceholder.createComponent(componentFactory); 104 | } 105 | } 106 | 107 | /** 108 | * 由各个分步骤对应的component内部决定下一步应该到哪儿去,而不是由最顶层导演决定(因为情况是复杂的嘛) 109 | */ 110 | export interface IntendDirect { 111 | dto: any; 112 | // 下一步的component 113 | cpt: Type; 114 | } 115 | -------------------------------------------------------------------------------- /src/base/global.add.param.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * Licensed to the Apache Software Foundation (ASF) under one 3 | // * or more contributor license agreements. See the NOTICE file 4 | // * distributed with this work for additional information 5 | // * regarding copyright ownership. The ASF licenses this file 6 | // * to you under the Apache License, Version 2.0 (the 7 | // * "License"); you may not use this file except in compliance 8 | // * with the License. You may obtain a copy of the License at 9 | // * 10 | // * http://www.apache.org/licenses/LICENSE-2.0 11 | // * 12 | // * Unless required by applicable law or agreed to in writing, software 13 | // * distributed under the License is distributed on an "AS IS" BASIS, 14 | // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // * See the License for the specific language governing permissions and 16 | // * limitations under the License. 17 | // */ 18 | // 19 | // import {TISService} from '../common/tis.service'; 20 | // import {Component} from '@angular/core'; 21 | // 22 | // import {BasicFormComponent} from '../common/basic.form.component'; 23 | // import {NzModalService} from "ng-zorro-antd/modal"; 24 | // 25 | // // declare var jQuery: any; 26 | // 27 | // // 添加全局参数 28 | // @Component({ 29 | // // templateUrl: '/runtime/config_file_parameters_add.htm' 30 | // template: ` 31 | // 32 | //
33 | // 39 | // 73 | //
74 | // ` 75 | // }) 76 | // export class AddGlobalParamComponent extends BasicFormComponent { 77 | // constructor(tisService: TISService, modalService: NzModalService) { 78 | // super(tisService, modalService); 79 | // } 80 | // 81 | // // 添加参数 82 | // public event_submit_do_add_parameter(form: any) { 83 | // this.submitForm('/runtime/config_file_parameters_add.ajax?action=config_file_parameters_action&event_submit_do_add_parameter=y' 84 | // , form); 85 | // } 86 | // 87 | // } 88 | -------------------------------------------------------------------------------- /src/base/error.list.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, OnInit} from '@angular/core'; 20 | 21 | 22 | import {ActivatedRoute, Router} from "@angular/router"; 23 | import {NzModalService} from "ng-zorro-antd/modal"; 24 | import {BasicFormComponent} from "../common/basic.form.component"; 25 | import {Pager} from "../common/pagination.component"; 26 | import {TISService} from "../common/tis.service"; 27 | import {NzDrawerService} from "ng-zorro-antd/drawer"; 28 | 29 | // 查看操作日志 30 | @Component({ 31 | template: ` 32 | 33 | 34 | 35 | 36 | 37 | {{l.abstractInfo}} 38 | 39 | 40 | {{l.createTime | date : "yyyy/MM/dd HH:mm:ss"}} 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | ` 50 | }) 51 | export class ErrorListComponent extends BasicFormComponent implements OnInit { 52 | logs: any[] = []; 53 | private detailLog: string; 54 | pager: Pager = new Pager(1, 1); 55 | logVisible: boolean; 56 | showBreadcrumb: boolean; 57 | 58 | constructor(tisService: TISService, modalService: NzModalService 59 | , private router: Router, private route: ActivatedRoute, private drawerService: NzDrawerService) { 60 | super(tisService, modalService); 61 | } 62 | 63 | 64 | ngOnInit(): void { 65 | // showBreadcrumb 66 | let sn = this.route.snapshot; 67 | this.showBreadcrumb = sn.data["showBreadcrumb"]; 68 | this.route.queryParams.subscribe((param) => { 69 | this.httpPost('/runtime/operation_log.ajax' 70 | , `action=operation_log_action&emethod=get_error_log_list&page=${param['page']}`) 71 | .then((r) => { 72 | this.pager = Pager.create(r); 73 | this.logs = r.bizresult.rows; 74 | }); 75 | }); 76 | } 77 | 78 | public get showDetail(): boolean { 79 | return this.detail != null; 80 | } 81 | 82 | 83 | // 显示详细信息 84 | public sysErrorDetail(logFileName: string): void { 85 | 86 | // console.log(logFileName); 87 | TISService.openSysErrorDetail(this.drawerService, false, logFileName); 88 | 89 | // this.httpPost( 90 | // '/runtime/operation_detail.ajax?action=operation_log_action&event_submit_do_get_detail=y&opid=' + opId, '') 91 | // .then(result => { 92 | // this.detailLog = result.bizresult.opDesc; 93 | // this.logVisible = true; 94 | // }); 95 | } 96 | 97 | public get detail(): string { 98 | return this.detailLog; 99 | } 100 | 101 | goPage(pageNum: number) { 102 | Pager.go(this.router, this.route, pageNum); 103 | } 104 | 105 | logViewClose() { 106 | this.logVisible = false; 107 | this.detailLog = null; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/base/base.manage.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {NgModule} from "@angular/core"; 20 | 21 | import {CommonModule} from "@angular/common"; 22 | import {FormsModule} from "@angular/forms"; 23 | import {BaseMangeRoutingModule} from "./base.manage-routing.module"; 24 | import {ApplistComponent} from "./applist.component"; 25 | import {BaseMangeIndexComponent} from "./base.manage.index.component"; 26 | import {DepartmentListComponent} from "./department.list.component"; 27 | import {AddAppFormComponent} from "./addapp-form.component"; 28 | import {AddAppStepFlowComponent} from "./addapp.step.flow.component"; 29 | import {AddAppFlowDirective} from "./addapp.directive"; 30 | import {AddAppConfirmComponent} from "./addapp-confirm.component"; 31 | import {TisCommonModule} from "../common/common.module"; 32 | 33 | import {NzStepsModule} from 'ng-zorro-antd/steps'; 34 | import {NzInputModule} from 'ng-zorro-antd/input'; 35 | import {NzButtonModule} from 'ng-zorro-antd/button'; 36 | import {NzTabsModule} from 'ng-zorro-antd/tabs'; 37 | import {BaseConfigComponent} from "./base-config.component"; 38 | import {AddappSelectNodesComponent} from "./addapp-select-nodes.component"; 39 | import {DepartmentAddComponent} from "./department.add.component"; 40 | import {DataxWorkerComponent} from "./datax.worker.component"; 41 | import {DataxWorkerAddStep1Component} from "./datax.worker.add.step1.component"; 42 | import {DataxWorkerAddStep0Component} from "./datax.worker.add.step0.component"; 43 | import {DataxWorkerAddStep2Component} from "./datax.worker.add.step2.component"; 44 | import {DataxWorkerAddStep3Component} from "./datax.worker.add.step3.component"; 45 | import {DataxWorkerRunningComponent, PodsListComponent, RCSpecComponent} from "./datax.worker.running.component"; 46 | 47 | import {MarkdownModule} from "ngx-markdown"; 48 | import {ErrorListComponent} from "./error.list.component"; 49 | import {DataxWorkerAddStep22Component} from "./datax.worker.add.step2-2.component"; 50 | import {DataxWorkerAddExistPowerjobClusterComponent} from "./datax.worker.add.exist.powerjob.cluster.component"; 51 | import {NgTerminalModule} from "ng-terminal"; 52 | import {FlinkClusterListComponent} from "./flink.cluster.list.component"; 53 | import {EndCptListComponent} from "./end.cpt.list.component"; 54 | import {UserProfileComponent} from "./user.profile.component"; 55 | 56 | 57 | @NgModule({ 58 | id: 'basemanage', 59 | imports: [MarkdownModule.forChild(), CommonModule, FormsModule, BaseMangeRoutingModule, TisCommonModule 60 | , NzStepsModule, NzInputModule, NzButtonModule, NzTabsModule, NgTerminalModule], 61 | declarations: [EndCptListComponent,FlinkClusterListComponent, 62 | ApplistComponent, ErrorListComponent, DepartmentAddComponent, BaseMangeIndexComponent // 63 | , BaseConfigComponent, DepartmentListComponent 64 | , AddAppFormComponent, AddAppStepFlowComponent, AddAppFlowDirective, AddAppConfirmComponent, AddappSelectNodesComponent 65 | , DataxWorkerComponent, DataxWorkerAddStep1Component, DataxWorkerAddStep0Component, DataxWorkerAddStep2Component 66 | , DataxWorkerAddExistPowerjobClusterComponent 67 | , DataxWorkerAddStep22Component, DataxWorkerAddStep3Component 68 | , DataxWorkerRunningComponent, PodsListComponent, RCSpecComponent,UserProfileComponent 69 | ], 70 | // providers: [TISService,ScriptService] 71 | exports: [AddAppFlowDirective] 72 | }) 73 | export class BasiManageModule { 74 | } 75 | -------------------------------------------------------------------------------- /src/runtime/line.chart.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, Input, OnInit} from "@angular/core"; 20 | import {BasicFormComponent} from "../common/basic.form.component"; 21 | import {TISService} from "../common/tis.service"; 22 | import {ChartOptions} from "chart.js"; 23 | import {ChartDataset} from 'chart.js'; 24 | 25 | export declare type ChartType = 'solrQuery' | 'docUpdate'; 26 | 27 | interface ChartTypeStrategy { 28 | getMetricNumber(result: any): number; 29 | getCaption(): string; 30 | } 31 | 32 | @Component({ 33 | selector: "line-chart", 34 | template: ` 35 | 36 | 38 | 39 | 40 | 41 | {{_chartStrategy.getCaption()}} 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ` 51 | }) 52 | export class LineChartComponent extends BasicFormComponent implements OnInit { 53 | rageVal = '1440'; 54 | // 近期各时段更新量监控 55 | public lineChartData: ChartDataset[] = [ 56 | // {data: [], label: 'updateCount'} 57 | {backgroundColor: '#95e4fa', data: []}, 58 | ]; 59 | lineChartLabels: Array = []; 60 | 61 | _chartStrategy: ChartTypeStrategy; 62 | 63 | lineChartOptions: ChartOptions = { 64 | responsive: true, 65 | // maintainAspectRatio: false, 66 | // aspectRatio: 1.7, 67 | scales: { 68 | y: { 69 | beginAtZero: true, 70 | min: 0 71 | } 72 | } 73 | }; 74 | 75 | 76 | constructor(tisService: TISService) { 77 | super(tisService); 78 | } 79 | 80 | @Input() 81 | set queryType(type: ChartType) { 82 | if (type === 'solrQuery') { 83 | this._chartStrategy = { 84 | getMetricNumber: (val) => val.requestCount, 85 | getCaption: () => `查询` 86 | } 87 | } else if (type === 'docUpdate') { 88 | this._chartStrategy = { 89 | getMetricNumber: (val) => val.updateCount, 90 | getCaption: () => `文档更新` 91 | } 92 | } 93 | } 94 | 95 | reload_cluster_state(range: string) { 96 | this.httpPost('/runtime/cluster_status.ajax', 'action=cluster_state_collect_action&event_submit_do_collect=y&m=' + range) 97 | .then((data) => { 98 | let rows = data.bizresult; 99 | let serialData: ChartDataset = {label: "UpdateCount", data: []}; 100 | let labels: Array = []; 101 | this.lineChartLabels = []; 102 | rows.forEach((r: any) => { 103 | serialData.data.push(this._chartStrategy.getMetricNumber(r)); 104 | labels.push(r.label); 105 | }); 106 | this.lineChartData = [serialData]; 107 | this.lineChartLabels = labels; 108 | }); 109 | } 110 | 111 | ngOnInit(): void { 112 | this.reload_cluster_state(this.rageVal); 113 | } 114 | } 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/offline/offline.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {NgModule} from "@angular/core"; 20 | 21 | import {CommonModule} from "@angular/common"; 22 | import {FormsModule, ReactiveFormsModule} from "@angular/forms"; 23 | import {DatasourceComponent} from "./ds.component"; 24 | import {WorkflowComponent} from "./workflow.component"; 25 | import {OfflineRoutingModule} from "./offline-routing.module"; 26 | import {OffileIndexComponent} from "./offline.index.component"; 27 | import {DbAddComponent} from "./db.add.component"; 28 | import {TableAddComponent} from "./table.add.component"; 29 | import {TableAddStep1Component} from "./table.add.step1.component"; 30 | import {WorkflowAddComponent} from "./workflow.add.component"; 31 | import {NzTabsModule} from 'ng-zorro-antd/tabs'; 32 | 33 | import {NzGridModule} from 'ng-zorro-antd/grid'; 34 | import {NzTableModule} from 'ng-zorro-antd/table'; 35 | import {TisCommonModule} from "../common/common.module"; 36 | import {NzButtonModule} from 'ng-zorro-antd/button'; 37 | import {NzCascaderModule} from 'ng-zorro-antd/cascader'; 38 | import {NzFormModule} from 'ng-zorro-antd/form'; 39 | 40 | import {WorkflowAddDbtableSetterComponent} from "./workflow.add.dbtable.setter.component"; 41 | import {BasiManageModule} from "../base/base.manage.module"; 42 | import {NzSelectModule} from 'ng-zorro-antd/select'; 43 | import {WorkflowAddJoinComponent} from "./workflow.add.join.component"; 44 | import {WorkflowAddUnionComponent} from "./workflow.add.union.component"; 45 | import {WorkflowAddNestComponent} from "./workflow.add.nest.component"; 46 | import {NzTreeModule} from 'ng-zorro-antd/tree'; 47 | import {NzLayoutModule} from 'ng-zorro-antd/layout'; 48 | import {NzInputModule} from 'ng-zorro-antd/input'; 49 | import {NzDescriptionsModule} from 'ng-zorro-antd/descriptions'; 50 | import {NzNotificationModule} from 'ng-zorro-antd/notification'; 51 | import {NzDividerModule} from 'ng-zorro-antd/divider'; 52 | 53 | import {NzCollapseModule} from 'ng-zorro-antd/collapse'; 54 | import {WorkflowERComponent} from "./workflow.er.component"; 55 | import {WorkflowAddErCardinalityComponent} from "./workflow.add.er.cardinality.component"; 56 | import {WorkflowAddErMetaComponent} from "./workflow.add.er.meta.component"; 57 | import {WFControllerComponent} from "./workflow.controller.component"; 58 | import {WorkflowOfflineEngineSelectComponent} from "./workflow.offline.engine.select.component"; 59 | import {TableColsMetaComponent} from "./table.cols.meta.component"; 60 | 61 | 62 | 63 | @NgModule({ 64 | id: 'offline', 65 | imports: [ // CommonModule, 66 | NzCollapseModule, 67 | NzTabsModule, 68 | NzInputModule, NzTableModule, 69 | FormsModule, BasiManageModule, NzTreeModule, NzLayoutModule, NzDescriptionsModule 70 | , OfflineRoutingModule, // TreeModule, 71 | TisCommonModule, NzButtonModule, NzCascaderModule 72 | , CommonModule, NzFormModule, NzSelectModule, ReactiveFormsModule, NzNotificationModule 73 | , NzDividerModule, NzGridModule 74 | ], 75 | providers: [ 76 | ], 77 | declarations: [ 78 | WorkflowComponent, WorkflowOfflineEngineSelectComponent, WFControllerComponent, DatasourceComponent ,OffileIndexComponent, DbAddComponent, WorkflowAddErMetaComponent 79 | , TableColsMetaComponent, TableAddComponent, TableAddStep1Component, // TableAddStep2Component, 80 | WorkflowAddComponent, 81 | WorkflowAddDbtableSetterComponent, WorkflowAddJoinComponent, WorkflowAddUnionComponent 82 | // tslint:disable-next-line:whitespace 83 | , WorkflowAddNestComponent, WorkflowERComponent, WorkflowAddErCardinalityComponent 84 | ] 85 | }) 86 | export class OfflineModule { 87 | } 88 | -------------------------------------------------------------------------------- /src/common/control.panel.component.ts: -------------------------------------------------------------------------------- 1 | import {ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output} from "@angular/core"; 2 | import {BasicFormComponent} from "./basic.form.component"; 3 | import {TISService} from "./tis.service"; 4 | import {NzModalService} from "ng-zorro-antd/modal"; 5 | import {NzNotificationService} from "ng-zorro-antd/notification"; 6 | 7 | export declare type PanelType = 'normal-stop-incr' | 'danger-delete'; 8 | 9 | class PanelMeta { 10 | constructor(public title: string, public subTitle: string, public danger: boolean, public btnType: string, public btnLabel: string) { 11 | } 12 | } 13 | 14 | const typeMeta = new Map(); 15 | typeMeta.set('danger-delete', new PanelMeta("危险操作", "以下操作可能造成某些组件功能不可用", true, 'delete', '删除')); 16 | typeMeta.set('normal-stop-incr', new PanelMeta("一般操作", "", false, 'stop', '停止')); 17 | // const typeMeta: { key: PanelType, val: PanelMeta } = { 18 | // 'danger-delete': new PanelMeta("危险操作", "以下操作可能造成某些组件功能不可用", true) 19 | // } 20 | 21 | 22 | @Component({ 23 | changeDetection: ChangeDetectionStrategy.OnPush, 24 | selector: "control-prompt", 25 | template: ` 26 |
27 | 28 | 29 | 30 | 33 | 34 | {{this.procDesc}} 35 | 40 | 41 | 42 |
43 | `, 44 | styles: [ 45 | ` 46 | .typography-panel { 47 | margin-left: 20px; 48 | 49 | } 50 | 51 | nz-descriptions { 52 | margin-top: 15px; 53 | } 54 | 55 | nz-tab { 56 | padding-left: 10px; 57 | } 58 | 59 | .danger-control-title { 60 | margin-top: 20px; 61 | padding: 0px 0; 62 | } 63 | 64 | .ant-advanced-search-form { 65 | padding: 10px; 66 | #background: #fbfbfb; 67 | border: 2px solid; 68 | border-radius: 6px; 69 | margin-bottom: 10px; 70 | clear: both; 71 | } 72 | 73 | .ant-advanced-search-form-danger { 74 | border-color: #d97f85; 75 | } 76 | 77 | .ant-advanced-search-form-normal { 78 | border-color: #91d5ff; 79 | } 80 | 81 | .typography-desc { 82 | font-size: 10px; 83 | color: #999999; 84 | } 85 | 86 | [nz-row] { 87 | margin-bottom: 10px; 88 | } 89 | ` 90 | ] 91 | }) 92 | export class ControlPanelComponent extends BasicFormComponent //implements AfterContentInit, OnDestroy 93 | { 94 | constructor(tisService: TISService, modalService: NzModalService, notification: NzNotificationService, private cd: ChangeDetectorRef) { 95 | super(tisService, modalService, notification); 96 | } 97 | 98 | get typeMeta(): PanelMeta { 99 | return typeMeta.get(this.panelType); 100 | } 101 | 102 | @Input() 103 | panelType: PanelType 104 | 105 | 106 | @Input() 107 | procDesc: string; 108 | 109 | @Input() 110 | disabled: boolean; 111 | 112 | @Output() 113 | controlClick = new EventEmitter(); 114 | 115 | public restoreInitialState() { 116 | this.formDisabled = false; 117 | this.cd.detectChanges(); 118 | } 119 | 120 | btnClick() { 121 | //'${this.currentApp.appName}' 122 | // console.log(this.currentApp); 123 | this.modalService.confirm({ 124 | nzTitle: this.typeMeta.title, 125 | nzContent: `是否确定要${this.procDesc}`, 126 | nzOkText: '执行', 127 | nzCancelText: '取消', 128 | nzOnOk: () => { 129 | this.formDisabled = true; 130 | this.controlClick.emit(this); 131 | this.cd.detectChanges(); 132 | } 133 | }); 134 | } 135 | 136 | public enableComponent() { 137 | this.formDisabled = false; 138 | this.cd.detectChanges(); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /src/offline/workflow.add.union.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {AfterContentInit, AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; 20 | import {BasicSideBar, IDataFlowMainComponent} from '../common/basic.form.component'; 21 | import {TISService} from '../common/tis.service'; 22 | // @ts-ignore 23 | // import * as $ from 'jquery'; 24 | import 'codemirror/mode/sql/sql.js'; 25 | import {EditorConfiguration, fromTextArea} from 'codemirror'; 26 | import {NzModalService} from "ng-zorro-antd/modal"; 27 | import {NzDrawerRef} from "ng-zorro-antd/drawer"; 28 | 29 | 30 | @Component({ 31 | template: ` 32 |
33 | 35 | 36 |
37 | 38 |

39 |
40 | 42 | 44 | 45 |
46 |

47 |
48 | 49 |
50 | 51 | 52 |
53 | 54 |
55 | 56 | `, 57 | 58 | styles: [ 59 | ` 60 | .CodeMirror { 61 | width: 100%; 62 | height: 600px; 63 | border: #2f2ded; 64 | } 65 | 66 | .item-head { 67 | margin: 20px 0px 0px 0px; 68 | } 69 | 70 | #sqleditorBlock { 71 | width: 100%; 72 | } 73 | 74 | .clear { 75 | clear: both; 76 | } 77 | `] 78 | }) 79 | // JOIN 节点设置 80 | export class WorkflowAddUnionComponent 81 | extends BasicSideBar implements OnInit, AfterContentInit, AfterViewInit { 82 | 83 | 84 | @ViewChild('sqleditor', {static: false}) sqleditor: ElementRef; 85 | listOfOption: Array<{ label: string; value: string }> = []; 86 | listOfTagOptions: any[] = []; 87 | 88 | constructor(tisService: TISService, // 89 | modalService: NzModalService, drawerRef: NzDrawerRef) { 90 | super(tisService, modalService, drawerRef); 91 | } 92 | 93 | ngOnInit(): void { 94 | const children: Array<{ label: string; value: string }> = []; 95 | for (let i = 10; i < 36; i++) { 96 | children.push({label: i.toString(36) + i, value: i.toString(36) + i}); 97 | } 98 | this.listOfOption = children; 99 | } 100 | 101 | 102 | ngAfterViewInit(): void { 103 | let sqlmirror = fromTextArea(this.sqleditor.nativeElement, this.sqleditorOption); 104 | sqlmirror.setValue("select * from mytable;"); 105 | } 106 | 107 | ngAfterContentInit(): void { 108 | } 109 | 110 | private get sqleditorOption(): EditorConfiguration { 111 | return { 112 | mode: "text/x-hive", 113 | lineNumbers: true, 114 | }; 115 | } 116 | 117 | subscribeSaveClick(graph: any, $: any, model: any, _: IDataFlowMainComponent): boolean { 118 | return true; 119 | } 120 | 121 | initComponent(_: IDataFlowMainComponent): void { 122 | } 123 | 124 | 125 | _deleteNode() { 126 | } 127 | } 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /src/common/operation.log.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import {Component, OnInit} from '@angular/core'; 20 | import {TISService} from './tis.service'; 21 | import {BasicFormComponent} from './basic.form.component'; 22 | 23 | import {Pager} from "./pagination.component"; 24 | import {ActivatedRoute, Router} from "@angular/router"; 25 | import {NzModalService} from "ng-zorro-antd/modal"; 26 | 27 | // 查看操作日志 28 | @Component({ 29 | template: ` 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {{l.tabName}}#{{l.opType}} 38 | 39 | 40 | 41 | 42 | {{l.createTime | date : "yyyy/MM/dd HH:mm:ss"}} 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 58 |
{{detail}}
59 |
60 | ` 61 | }) 62 | export class OperationLogComponent extends BasicFormComponent implements OnInit { 63 | logs: any[] = []; 64 | private detailLog: string; 65 | pager: Pager = new Pager(1, 1); 66 | logVisible: boolean; 67 | showBreadcrumb: boolean; 68 | 69 | constructor(tisService: TISService, modalService: NzModalService, private router: Router, private route: ActivatedRoute) { 70 | super(tisService, modalService); 71 | } 72 | 73 | 74 | ngOnInit(): void { 75 | // showBreadcrumb 76 | let sn = this.route.snapshot; 77 | this.showBreadcrumb = sn.data["showBreadcrumb"]; 78 | this.route.queryParams.subscribe((param) => { 79 | this.httpPost('/runtime/operation_log.ajax' 80 | , `action=operation_log_action&emethod=get_init_data&page=${param['page']}`) 81 | .then((r) => { 82 | this.pager = Pager.create(r); 83 | this.logs = r.bizresult.rows; 84 | }); 85 | }); 86 | } 87 | 88 | public get showDetail(): boolean { 89 | return this.detail != null; 90 | } 91 | 92 | 93 | // 显示详细信息 94 | public operationDetail(opId: number): void { 95 | this.httpPost( 96 | '/runtime/operation_detail.ajax?action=operation_log_action&event_submit_do_get_detail=y&opid=' + opId, '') 97 | .then(result => { 98 | this.detailLog = result.bizresult.opDesc; 99 | this.logVisible = true; 100 | }); 101 | } 102 | 103 | public get detail(): string { 104 | return this.detailLog; 105 | } 106 | 107 | goPage(pageNum: number) { 108 | Pager.go(this.router, this.route, pageNum); 109 | } 110 | 111 | logViewClose() { 112 | this.logVisible = false; 113 | this.detailLog = null; 114 | } 115 | } 116 | --------------------------------------------------------------------------------