-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][scaleph-ui-react] optimize flink kubernetes template steps (#…
…656) * feature: add doris instance steps form * feature: optimize common jars * feature: optimize flink kubernetes template * feature: optimize flink kubernetes template
- Loading branch information
Showing
24 changed files
with
315 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...i-react/src/models/project/workspace/kubernetes/template/flinkKubernetesTemplateDetail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {WsFlinkKubernetesTemplate} from "@/services/project/typings"; | ||
import { Reducer, Effect } from "umi"; | ||
import {WsFlinkKubernetesTemplateService} from "@/services/project/WsFlinkKubernetesTemplateService"; | ||
import YAML from "yaml"; | ||
|
||
export interface StateType { | ||
template: WsFlinkKubernetesTemplate, | ||
templateYaml: string | ||
templateYamlWithDefault: string | ||
} | ||
|
||
export interface ModelType { | ||
namespace: string; | ||
|
||
state: StateType; | ||
|
||
effects: { | ||
queryTemplate: Effect; | ||
}; | ||
|
||
reducers: { | ||
updateTemplate: Reducer<StateType>; | ||
}; | ||
} | ||
|
||
const model: ModelType = { | ||
namespace: "flinkKubernetesTemplateDetail", | ||
|
||
state: { | ||
template: null, | ||
templateYaml: null, | ||
templateYamlWithDefault: null | ||
}, | ||
|
||
effects: { | ||
*editTemplate({ payload }, { call, put }) { | ||
const { data } = yield call(WsFlinkKubernetesTemplateService.asYaml, payload); | ||
const response = yield call(WsFlinkKubernetesTemplateService.asYamlWithDefault, payload); | ||
yield put({ type: 'updateTemplate', payload: {template: payload, templateYaml: YAML.stringify(data), templateYamlWithDefault: YAML.stringify(response.data)} }); | ||
}, | ||
}, | ||
|
||
reducers: { | ||
updateTemplate(state, { payload }) { | ||
return { | ||
...state, | ||
template: payload.template, | ||
templateYaml: payload.templateYaml, | ||
templateYamlWithDefault: payload.templateYamlWithDefault, | ||
}; | ||
}, | ||
}, | ||
}; | ||
|
||
export default model; |
55 changes: 55 additions & 0 deletions
55
...ui-react/src/models/project/workspace/kubernetes/template/flinkKubernetesTemplateSteps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {WsFlinkKubernetesTemplate} from "@/services/project/typings"; | ||
import { Reducer, Effect } from "umi"; | ||
import {WsFlinkKubernetesTemplateService} from "@/services/project/WsFlinkKubernetesTemplateService"; | ||
import YAML from "yaml"; | ||
|
||
export interface StateType { | ||
template: WsFlinkKubernetesTemplate, | ||
templateYaml: string | ||
templateYamlWithDefault: string | ||
} | ||
|
||
export interface ModelType { | ||
namespace: string; | ||
|
||
state: StateType; | ||
|
||
effects: { | ||
queryTemplate: Effect; | ||
}; | ||
|
||
reducers: { | ||
updateTemplate: Reducer<StateType>; | ||
}; | ||
} | ||
|
||
const model: ModelType = { | ||
namespace: "flinkKubernetesTemplateSteps", | ||
|
||
state: { | ||
template: null, | ||
templateYaml: null, | ||
templateYamlWithDefault: null | ||
}, | ||
|
||
effects: { | ||
*editTemplate({ payload }, { call, put }) { | ||
const { data } = yield call(WsFlinkKubernetesTemplateService.asYaml, payload); | ||
const response = yield call(WsFlinkKubernetesTemplateService.asYamlWithDefault, payload); | ||
yield put({ type: 'updateTemplate', payload: {template: payload, templateYaml: YAML.stringify(data), templateYamlWithDefault: YAML.stringify(response.data)} }); | ||
}, | ||
}, | ||
|
||
reducers: { | ||
updateTemplate(state, { payload }) { | ||
return { | ||
...state, | ||
template: payload.template, | ||
templateYaml: payload.templateYaml, | ||
templateYamlWithDefault: payload.templateYamlWithDefault, | ||
}; | ||
}, | ||
}, | ||
}; | ||
|
||
export default model; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
scaleph-ui-react/src/pages/Project/Workspace/Kubernetes/Template/Steps/BaseStepForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from "react"; | ||
import {ProCard, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea} from "@ant-design/pro-components"; | ||
import {useIntl} from "umi"; | ||
import {DICT_TYPE} from "@/constant"; | ||
import {DictDataService} from "@/services/admin/dictData.service"; | ||
|
||
const FlinkKubernetesTemplateBase: React.FC = () => { | ||
const intl = useIntl(); | ||
|
||
return ( | ||
<ProCard> | ||
<ProFormDigit name={"id"} hidden/> | ||
<ProFormText | ||
name={"name"} | ||
label={intl.formatMessage({id: 'pages.project.flink.kubernetes.template.name'})} | ||
rules={[{required: true}]} | ||
/> | ||
<ProFormSelect | ||
name={"deploymentKind"} | ||
label={intl.formatMessage({id: 'pages.project.flink.kubernetes.template.deploymentKind'})} | ||
rules={[{required: true}]} | ||
request={() => DictDataService.listDictDataByType2(DICT_TYPE.deploymentKind)} | ||
/> | ||
<ProFormText | ||
name={"namespace"} | ||
label={intl.formatMessage({id: 'pages.project.flink.kubernetes.template.namespace'})} | ||
rules={[{required: true}]} | ||
/> | ||
<ProFormTextArea | ||
name={"remark"} | ||
label={intl.formatMessage({id: 'app.common.data.remark'})} | ||
/> | ||
</ProCard> | ||
); | ||
} | ||
|
||
export default FlinkKubernetesTemplateBase; |
Oops, something went wrong.