Skip to content

Commit

Permalink
modify incr channel wethear is null
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Mar 27, 2024
1 parent 58a7b9b commit 88fee9d
Show file tree
Hide file tree
Showing 14 changed files with 246 additions and 111 deletions.
23 changes: 14 additions & 9 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/base/base.manage-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {DataxWorkerAddStep0Component} from "./datax.worker.add.step0.component";
import {K8SRCSpec} from "../common/k8s.replics.spec.component";
import {FlinkClusterListComponent} from "./flink.cluster.list.component";
import {DataxWorkerAddStep3Component} from "./datax.worker.add.step3.component";
import {DataxWorkerRunningComponent} from "./datax.worker.running.component";

const get_job_worker_meta = "get_job_worker_meta";
const flinkClusterCfgTargetName = PowerjobCptType.FlinkCluster.toString();// "flink-cluster";
Expand All @@ -51,11 +52,15 @@ export const dataXWorkerCfg: { processMeta: ProcessMeta }
= {

processMeta: {
endType: 'powerjob',
step1PluginType: {
name: 'datax-worker',
require: true,
extraParam: "dataxName_" + PowerjobCptType.Server
},
afterSuccessDelete: (cpt: DataxWorkerRunningComponent) => {
cpt.nextStep.emit(Object.assign(new DataxWorkerDTO(), {processMeta: cpt.dto.processMeta}));
},
successCreateNext: (step3: DataxWorkerAddStep3Component) => {
DataxWorkerComponent.getJobWorkerMeta(step3, null, step3.dto.processMeta)
.then((dataXWorkerStatus) => {
Expand Down Expand Up @@ -174,11 +179,15 @@ const FlinkSessionPageHeader = "添加Kubernetes Session执行器";
export const flinkClusterCfg: { processMeta: ProcessMeta }
= {
processMeta: {
endType: 'flink',
step1PluginType: {
name: PowerjobCptType.FlinkCluster,
require: true,
extraParam: "dataxName_" + PowerjobCptType.FlinkCluster
},
afterSuccessDelete: (cpt: DataxWorkerRunningComponent) => {
cpt.nextStep.emit(Object.assign(new DataxWorkerDTO(), {processMeta: cpt.dto.processMeta}));
},
breadcrumbGetter: (params) => {
let crumb: Breadcrumb = flinkSessionDetail.processMeta.breadcrumbGetter(params);
return {
Expand Down Expand Up @@ -273,13 +282,18 @@ const get_flink_session = 'get_flink_session';
export const flinkSessionDetail: { processMeta: ProcessMeta }
= {
processMeta: {
endType: 'flink',
step1PluginType: null,
breadcrumbGetter: (params) => {
return {
breadcrumb: ['Flink Cluster', '/base/flink-cluster-list'],
name: params[KEY_TARGET_NAME]
}
},
afterSuccessDelete: (cpt: DataxWorkerRunningComponent) => {
// cpt.nextStep.emit(Object.assign(new DataxWorkerDTO(), {processMeta: cpt.dto.processMeta}));
cpt.router.navigate(["/base/flink-cluster-list"]);
},
successCreateNext: (step3: DataxWorkerAddStep3Component) => {
throw new Error("shall not execute");
},
Expand Down
89 changes: 48 additions & 41 deletions src/base/datax.worker.add.step0.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,40 @@ import {NzDrawerService} from "ng-zorro-antd/drawer";

@Component({
template: `
<nz-spin [nzSpinning]="this.formDisabled" nzSize="large">
<!-- <nz-alert nzType="warning" nzMessage="告知" [nzDescription]="unableToUseK8SController"-->
<!-- nzShowIcon></nz-alert>-->
<!-- <ng-template #unableToUseK8SController>-->
<!-- 因架构调整,基于K8S执行的分布式DataX任务执行器,和Flink任务执行器需要做新的调整,会将Zookeeper组建依赖去掉,会在<strong>4.0.0版本</strong>中重新与大家见面-->
<!-- </ng-template>-->
<nz-empty style="height: 500px"
nzNotFoundImage="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
[nzNotFoundFooter]="footerTpl"
[nzNotFoundContent]="contentTpl"
>
<ng-template #contentTpl>
<span>{{this.dto.processMeta.notCreateTips}}</span>
</ng-template>
<ng-template #footerTpl>
<nz-space class="btn-block">
<ng-container *ngFor="let btn of this.dto.processMeta.step1Buttons;let i =index">
<button *nzSpaceItem [disabled]="this.formDisabled" nz-button
[nzType]="i<1 ? 'primary':'default'"
(click)="btn.click(this)">{{btn.label}}</button>
</ng-container>
</nz-space>
</ng-template>
</nz-empty>
</nz-spin>
<nz-spin [nzSpinning]="this.formDisabled" nzSize="large">
<!-- <nz-alert nzType="warning" nzMessage="告知" [nzDescription]="unableToUseK8SController"-->
<!-- nzShowIcon></nz-alert>-->
<!-- <ng-template #unableToUseK8SController>-->
<!-- 因架构调整,基于K8S执行的分布式DataX任务执行器,和Flink任务执行器需要做新的调整,会将Zookeeper组建依赖去掉,会在<strong>4.0.0版本</strong>中重新与大家见面-->
<!-- </ng-template>-->
<nz-empty style="height: 500px"
[nzNotFoundImage]="notFoundImage"
[nzNotFoundFooter]="footerTpl"
[nzNotFoundContent]="contentTpl"
>
<ng-template #contentTpl>
<span>{{this.dto.processMeta.notCreateTips}}</span>
</ng-template>
<ng-template #footerTpl>
<nz-space class="btn-block">
<ng-container *ngFor="let btn of this.dto.processMeta.step1Buttons;let i =index">
<button *nzSpaceItem [disabled]="this.formDisabled" nz-button
[nzType]="i<1 ? 'primary':'default'"
(click)="btn.click(this)">{{btn.label}}</button>
</ng-container>
</nz-space>
</ng-template>
<ng-template #notFoundImage>
<p style="margin: 20px">
<span style="font-size: 8em" nz-icon [nzType]="dto.processMeta.endType" nzTheme="fill"></span>
</p>
</ng-template>
</nz-empty>
</nz-spin>
`
})
export class DataxWorkerAddStep0Component extends BasicFormComponent implements AfterViewInit, OnInit {
Expand All @@ -85,7 +90,17 @@ export class DataxWorkerAddStep0Component extends BasicFormComponent implements
// let promise = Promise.resolve();
let success$ = new Subject<any>();

DataxWorkerAddStep0Component.getWorkDescs(dataXWorkerCfg.processMeta.targetName, true, module)
let opt: SavePluginEvent = null;

if (appendParams) {
let p = appendParams.find((param) => param.key === KEY_APPNAME);
if (p) {
opt = new SavePluginEvent();
opt.overwriteHttpHeaderOfAppName(p.val);
}
}

DataxWorkerAddStep0Component.getWorkDescs(dataXWorkerCfg.processMeta.targetName, true, module, opt)
.then((dto) => {
let rList = dto.workDesc;
let desc = Array.from(rList.values());
Expand All @@ -96,15 +111,7 @@ export class DataxWorkerAddStep0Component extends BasicFormComponent implements
appendParams: appendParams
};
// console.log([pluginDesc,pluginCategory]);
let opt = null;

if (appendParams) {
let p = appendParams.find((param) => param.key === KEY_APPNAME);
if (p) {
opt = new SavePluginEvent();
opt.overwriteHttpHeaderOfAppName(p.val);
}
}

// console.log(dto);
let containTplRewriterPlugin = dto.typedPluginCount[PowerjobCptType.JobTplAppOverwrite];
let modelRef = PluginsComponent.openPluginDialog({
Expand All @@ -128,9 +135,9 @@ export class DataxWorkerAddStep0Component extends BasicFormComponent implements
return success$.asObservable();
}

public static getWorkDescs(targetName: string, addJobTplOverwritePlugin: boolean, module: BasicFormComponent): Promise<WorkerDTO> {
public static getWorkDescs(targetName: string, addJobTplOverwritePlugin: boolean, module: BasicFormComponent, e?: SavePluginEvent): Promise<WorkerDTO> {
return module.httpPost('/coredefine/corenodemanage.ajax'
, `action=datax_action&emethod=worker_desc&targetName=${targetName}&addJobTplOverwritePlugin=${addJobTplOverwritePlugin}`)
, `action=datax_action&emethod=worker_desc&targetName=${targetName}&addJobTplOverwritePlugin=${addJobTplOverwritePlugin}`, e)
.then((r) => {
if (r.success) {
let rList = PluginsComponent.wrapDescriptors(r.bizresult.pluginDesc);
Expand Down
14 changes: 11 additions & 3 deletions src/base/datax.worker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export class DataxWorkerComponent extends AppFormComponent implements AfterViewI

this.multiViewDAG = new MultiViewDAG(configFST, this._componentFactoryResolver, this.containerRef);

this.route.params.subscribe((params) => {
//console.log(params);
let next = (params) => {
console.log(params);
DataxWorkerComponent.getJobWorkerMeta(this, params, this.processMeta).then((dataXWorkerStatus) => {
if (dataXWorkerStatus.k8sReplicationControllerCreated) {
this.multiViewDAG.loadComponent(DataxWorkerRunningComponent, dataXWorkerStatus);
Expand All @@ -152,7 +152,15 @@ export class DataxWorkerComponent extends AppFormComponent implements AfterViewI

}
})
});
};

// this.route.queryParams.subscribe((query) => {
// // 当实例删除后为了页面刷新一下,加了一个update参数
// if (query['update']) {
// next.apply(this.route.params);
// }
// });
this.route.params.subscribe(next);


// this.httpPost('/coredefine/corenodemanage.ajax'
Expand Down
27 changes: 15 additions & 12 deletions src/base/datax.worker.running.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const KEY_APPNAME = "appname";
<nz-tabset nzSize="large" [(nzSelectedIndex)]="tabSelectIndex" [nzTabBarExtraContent]="extraTemplate"
#tabsetComponent>
<ng-container *ngIf="dto.rcDeployment?.status">
<nz-tab nzTitle="基本" (nzSelect)="profileTabSelect()">
<nz-tab [nzTitle]="profileTitle" (nzSelect)="profileTabSelect()">
<ng-template nz-tab>
<div style="margin-top: 8px;"
*ngTemplateOutlet="promoteServerHost;context:{server_port_host:this.dto.payloads['server_port_host']}">
Expand All @@ -87,7 +87,7 @@ export const KEY_APPNAME = "appname";
-->
</ng-template>
</nz-tab>
<nz-tab nzTitle="规格" (nzSelect)="envTabSelect()">
<nz-tab [nzTitle]="specificationTitle" (nzSelect)="envTabSelect()">
<ng-template nz-tab>
<rc-spec *ngFor="let rc of dto.rcDeployments" [rcDeployment]="rc"></rc-spec>
</ng-template>
Expand Down Expand Up @@ -214,16 +214,23 @@ export const KEY_APPNAME = "appname";
<ng-template #unableToUseK8SController>
可直接打开PowerJob控制台 &nbsp;<a target="_blank"
[href]="server_port_host"><i nz-icon nzType="link"
nzTheme="outline"></i>控制台</a>
可直接打开{{this.dto.processMeta.pageHeader}}控制台 &nbsp;<a target="_blank" [href]="server_port_host"><i nz-icon nzType="link" nzTheme="outline"></i>控制台</a>
</ng-template>
</nz-alert>
</ng-template>
<ng-template #profileTitle>
<span nz-icon [nzType]="dto.processMeta.endType" nzTheme="outline"></span>基本
</ng-template>
<ng-template #cfgTitle>
<span nz-icon nzType="file" nzTheme="outline"></span>配置
</ng-template>
<ng-template #specificationTitle>
<span nz-icon nzType="ordered-list" nzTheme="outline"></span>规格
</ng-template>
<ng-template #controller>
<span nz-icon nzType="setting" nzTheme="outline"></span>操作
</ng-template>
Expand Down Expand Up @@ -282,7 +289,7 @@ export class DataxWorkerRunningComponent extends AppFormComponent implements Aft
workflows: PowerJobWorkflow[] = [];


constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService, private router: Router, notification: NzNotificationService, public _zone: NgZone) {
constructor(tisService: TISService, route: ActivatedRoute, modalService: NzModalService, public router: Router, notification: NzNotificationService, public _zone: NgZone) {
super(tisService, route, modalService, notification);
}

Expand Down Expand Up @@ -423,17 +430,13 @@ export class DataxWorkerRunningComponent extends AppFormComponent implements Aft

dataXWorkerDelete(cpt: ControlPanelComponent) {

// this.confirm(`是否确定要将${this.dto.processMeta.pageHeader}从K8S容器中删除`, () => {
//
// });

this.jsonPost('/coredefine/corenodemanage.ajax?action=datax_action&emethod=remove_datax_worker&targetName=' + this.currentApp.name //this.dto.processMeta.targetName
, {})
.then((r) => {
// console.log("xxxxxxxx");
cpt.enableComponent();
if (r.success) {
this.nextStep.emit(Object.assign(new DataxWorkerDTO(), {processMeta: this.dto.processMeta}));
this.dto.processMeta.afterSuccessDelete(this);
// this.nextStep.emit(Object.assign(new DataxWorkerDTO(), {processMeta: this.dto.processMeta}));
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/common/basic.form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ export class BasicFormComponent {
}

// 发送http post请求
public httpPost(url: string, body: string): Promise<TisResponseResult> {
public httpPost(url: string, body: string, e?: SavePluginEvent): Promise<TisResponseResult> {
this.formDisabled = true;
NProgress.start();
this.clearProcessResult();
return this.tisService.httpPost(url, body).then(this.webExecuteCallback).catch(this.handleError);
return this.tisService.httpPost(url, body, e).then(this.webExecuteCallback).catch(this.handleError);
// return this.tisService._zone.runOutsideAngular(()=>{
//
// })
Expand Down
4 changes: 2 additions & 2 deletions src/common/launch.waitting.process.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export function openWaittingProcessComponent(drawerService: NzDrawerService, sub
<nz-page-header-extra>
<button nz-button nzType="primary" *ngIf="!this.errScalaLog && this.execStatus === 'error'"
(click)="reExecute()">
重新执行
<span nz-icon nzType="reload" nzTheme="outline"></span> 重新执行
</button>
<button nz-button (click)="closeDrawer()">
关闭
关闭
</button>
</nz-page-header-extra>
<nz-page-header-content>
Expand Down
5 changes: 5 additions & 0 deletions src/common/navigate.bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ import {expressionType} from "@angular/compiler/src/output/output_ast";
</nz-select>
</li>
</ng-container>
<li class="user-profile" nz-menu-item nzMatchRouter>
<button nz-button nzType="link" (click)="openTisAbout()">关于</button>
<button nz-button nz-dropdown [nzDropdownMenu]="user">
<i nz-icon nzType="user" style="margin: 0px" nzTheme="outline"></i>{{userProfile?.name}}
Expand All @@ -154,6 +156,9 @@ import {expressionType} from "@angular/compiler/src/output/output_ast";
</svg>
</ng-template>
</li>
<li class="user-profile" nz-menu-item nzMatchRouter>
<a href="https://github.com/datavane/tis" target="_blank"><span style="color: white;font-size: 1.2em" nz-icon nzType="github" nzTheme="outline"></span></a>
</li>
<!--
<li nz-menu-item>
<a class="nav-link dropdown-toggle" href="#" id="navbarUsers" data-toggle="dropdown"
Expand Down
Loading

0 comments on commit 88fee9d

Please sign in to comment.