-
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] update flink kubernetes template add step…
…s form (#660) * feature: update flink kubernetes template steps * feature: update flink kubernetes template steps
- Loading branch information
Showing
12 changed files
with
221 additions
and
27 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
33 changes: 33 additions & 0 deletions
33
scaleph-ui-react/src/pages/Project/Workspace/Kubernetes/Template/Steps/AdvancedStepForm.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,33 @@ | ||
import React from "react"; | ||
import {ProCard} from "@ant-design/pro-components"; | ||
import AdvancedBasic from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedBasic"; | ||
import AdvancedResource from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedResource"; | ||
import AdvancedCheckpoint from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedCheckpoint"; | ||
import AdvancedPeriodicSavepoint | ||
from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedPeriodicSavepoint"; | ||
import AdvancedRestart from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedRestart"; | ||
import AdvancedFaultTolerance | ||
from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedFaultTolerance"; | ||
import AdvancedHighAvailability | ||
from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedHighAvailability"; | ||
import AdvancedAdditionalDependencies | ||
from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedAdditionalDependencies"; | ||
import AdvancedAdditional from "@/pages/Project/Workspace/Kubernetes/Template/Detail/Advanced/AdvancedAdditional"; | ||
|
||
const FlinkKubernetesTemplateAdvancedStep: React.FC = () => { | ||
return ( | ||
<ProCard> | ||
<AdvancedBasic/> | ||
<AdvancedResource/> | ||
<AdvancedCheckpoint/> | ||
<AdvancedPeriodicSavepoint/> | ||
<AdvancedRestart/> | ||
<AdvancedFaultTolerance/> | ||
<AdvancedHighAvailability/> | ||
<AdvancedAdditionalDependencies/> | ||
<AdvancedAdditional/> | ||
</ProCard> | ||
); | ||
} | ||
|
||
export default FlinkKubernetesTemplateAdvancedStep; |
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
...eact/src/pages/Project/Workspace/Kubernetes/Template/Steps/YAML/DefaultTemplateEditor.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, {useEffect, useRef} from "react"; | ||
import Editor, {Monaco, useMonaco} from "@monaco-editor/react"; | ||
import {connect} from "umi"; | ||
|
||
const FlinkKubernetesTemplateYAMLStepDefaultEditor: React.FC = (props: any) => { | ||
const editorRef = useRef(null); | ||
const monaco = useMonaco(); | ||
|
||
useEffect(() => { | ||
monaco?.languages.typescript.javascriptDefaults.setEagerModelSync(true); | ||
}, [monaco]); | ||
|
||
const handleEditorDidMount = (editor, monaco: Monaco) => { | ||
editorRef.current = editor; | ||
} | ||
|
||
return ( | ||
<Editor | ||
width="730" | ||
height="600px" | ||
language="yaml" | ||
theme="vs-white" | ||
value={props.flinkKubernetesTemplateSteps.templateYamlWithDefault} | ||
options={{ | ||
selectOnLineNumbers: true, | ||
readOnly: true, | ||
minimap: { | ||
enabled: false | ||
} | ||
}} | ||
onMount={handleEditorDidMount} | ||
/> | ||
); | ||
} | ||
|
||
const mapModelToProps = ({flinkKubernetesTemplateSteps}: any) => ({flinkKubernetesTemplateSteps}) | ||
export default connect(mapModelToProps)(FlinkKubernetesTemplateYAMLStepDefaultEditor); |
40 changes: 40 additions & 0 deletions
40
...ph-ui-react/src/pages/Project/Workspace/Kubernetes/Template/Steps/YAML/TemplateEditor.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,40 @@ | ||
import React, {useEffect, useRef} from "react"; | ||
import Editor, {Monaco, useMonaco} from "@monaco-editor/react"; | ||
import {Props} from '@/app.d'; | ||
import {WsFlinkKubernetesTemplate} from "@/services/project/typings"; | ||
import {connect} from "umi"; | ||
|
||
const FlinkKubernetesTemplateYAMLStepEditor: React.FC<Props<WsFlinkKubernetesTemplate>> = (props: any) => { | ||
const editorRef = useRef(null); | ||
const monaco = useMonaco(); | ||
|
||
useEffect(() => { | ||
// do conditional chaining | ||
monaco?.languages.typescript.javascriptDefaults.setEagerModelSync(true); | ||
}, [monaco]); | ||
|
||
const handleEditorDidMount = (editor, monaco: Monaco) => { | ||
editorRef.current = editor; | ||
} | ||
|
||
return ( | ||
<Editor | ||
width="730" | ||
height="600px" | ||
language="yaml" | ||
theme="vs-white" | ||
value={props.flinkKubernetesTemplateSteps.templateYaml} | ||
options={{ | ||
selectOnLineNumbers: true, | ||
readOnly: true, | ||
minimap: { | ||
enabled: false | ||
} | ||
}} | ||
onMount={handleEditorDidMount} | ||
/> | ||
); | ||
} | ||
|
||
const mapModelToProps = ({flinkKubernetesTemplateSteps}: any) => ({flinkKubernetesTemplateSteps}) | ||
export default connect(mapModelToProps)(FlinkKubernetesTemplateYAMLStepEditor); |
28 changes: 28 additions & 0 deletions
28
scaleph-ui-react/src/pages/Project/Workspace/Kubernetes/Template/Steps/YAMLStepForm.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,28 @@ | ||
import React from "react"; | ||
import {Col, Row} from "antd"; | ||
import {ProCard} from "@ant-design/pro-components"; | ||
import FlinkKubernetesTemplateYAMLStepEditor | ||
from "@/pages/Project/Workspace/Kubernetes/Template/Steps/YAML/TemplateEditor"; | ||
import FlinkKubernetesTemplateYAMLStepDefaultEditor | ||
from "@/pages/Project/Workspace/Kubernetes/Template/Steps/YAML/DefaultTemplateEditor"; | ||
|
||
const FlinkKubernetesTemplateYAMLStep: React.FC = () => { | ||
return ( | ||
<ProCard> | ||
<Row> | ||
<Col span={12}> | ||
<ProCard title={"Template"}> | ||
<FlinkKubernetesTemplateYAMLStepEditor/> | ||
</ProCard> | ||
</Col> | ||
<Col span={12}> | ||
<ProCard title={"Template & Defaults"}> | ||
<FlinkKubernetesTemplateYAMLStepDefaultEditor/> | ||
</ProCard> | ||
</Col> | ||
</Row> | ||
</ProCard> | ||
); | ||
} | ||
|
||
export default FlinkKubernetesTemplateYAMLStep; |
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