From 5fecb0589fd1873ac8d78e20a2adfc1689792ae4 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Thu, 24 Oct 2024 22:46:34 -0700 Subject: [PATCH 1/2] Placeholder for compose file --- src/containers/apps/Apps.tsx | 2 +- src/containers/apps/CreateNewApp.tsx | 221 ++++++++++++++++----------- 2 files changed, 135 insertions(+), 88 deletions(-) diff --git a/src/containers/apps/Apps.tsx b/src/containers/apps/Apps.tsx index facdcd68..81a051e0 100644 --- a/src/containers/apps/Apps.tsx +++ b/src/containers/apps/Apps.tsx @@ -90,7 +90,7 @@ export default class Apps extends ApiComponent< span: 24, }} lg={{ - span: 13, + span: 24, }} > - {self.props.isMobile ? ( - - +
+ {localize( + 'create_new_app.scratch', + 'Create from scratch' + )} +
+
+ {self.createProjectInApp()} + + + self.setState({ + hasPersistency: !!e.target.checked, + }) + } + > + {localize( + 'create_new_app.has_persistent_data', + 'Has Persistent Data' + )}{' '} + +    + + + + + + + + + {self.props.isMobile ? ( + + + self.setState({ + appName: e.target.value, + }) + } + /> + + + ) : ( + self.setState({ appName: e.target.value, }) } + onSearch={(value) => + self.onCreateNewAppClicked() + } /> - -
- ) : ( - - self.setState({ - appName: e.target.value, - }) - } - onSearch={(value) => self.onCreateNewAppClicked()} - /> - )} - - - {self.createProjectInApp()} - - - - self.setState({ - hasPersistency: !!e.target.checked, - }) - } - > - {localize( - 'create_new_app.has_persistent_data', - 'Has Persistent Data' - )}{' '} - -    - - - - - - - +
+ +
+ +
+
+ +
+
+ - - -
-

- {localize( - 'create_new_app.or_select_from', - 'Or Select From' - )} -

- - -
) } @@ -172,7 +220,6 @@ class CreateNewApp extends Component< {' '}
From fb7fa7340e604805b1b6f274141eea8e08dcd973 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 26 Oct 2024 19:10:02 -0700 Subject: [PATCH 2/2] Placeholder for compose file --- src/containers/PageRoot.tsx | 5 ++ src/containers/apps/Apps.tsx | 5 ++ src/containers/apps/CreateNewApp.tsx | 3 +- .../apps/compose/DockerComposeEntry.tsx | 48 +++++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/containers/apps/compose/DockerComposeEntry.tsx diff --git a/src/containers/PageRoot.tsx b/src/containers/PageRoot.tsx index 24dc3cbd..68cb1ddd 100644 --- a/src/containers/PageRoot.tsx +++ b/src/containers/PageRoot.tsx @@ -19,6 +19,7 @@ import Sidebar from './Sidebar' import Apps from './apps/Apps' import ProjectDetailsEdit from './apps/ProjectDetailsEdit' import AppDetails from './apps/appDetails/AppDetails' +import DockerComposeEntry from './apps/compose/DockerComposeEntry' import OneClickAppSelector from './apps/oneclick/selector/OneClickAppSelector' import OneClickAppConfigPage from './apps/oneclick/variables/OneClickAppConfigPage' import ApiComponent from './global/ApiComponent' @@ -327,6 +328,10 @@ class PageRoot extends ApiComponent< path="/apps/oneclick" component={OneClickAppSelector} /> + { self.props.history.push('/apps/oneclick') }} + onDockerComposeClicked={() => { + self.props.history.push( + '/apps/dockercompose' + ) + }} /> diff --git a/src/containers/apps/CreateNewApp.tsx b/src/containers/apps/CreateNewApp.tsx index 571ccd9b..8fe9cc9f 100644 --- a/src/containers/apps/CreateNewApp.tsx +++ b/src/containers/apps/CreateNewApp.tsx @@ -15,6 +15,7 @@ interface MyProps { hasPersistency: boolean ) => void onOneClickAppClicked: () => void + onDockerComposeClicked: () => void projects: ProjectDefinition[] } @@ -192,7 +193,7 @@ class CreateNewApp extends Component< block type="default" onClick={() => { - self.props.onOneClickAppClicked() + self.props.onDockerComposeClicked() }} > {localize( diff --git a/src/containers/apps/compose/DockerComposeEntry.tsx b/src/containers/apps/compose/DockerComposeEntry.tsx new file mode 100644 index 00000000..5474087b --- /dev/null +++ b/src/containers/apps/compose/DockerComposeEntry.tsx @@ -0,0 +1,48 @@ +import { Card, Col, Row } from 'antd' +import { RouteComponentProps } from 'react-router' +import ApiComponent from '../../global/ApiComponent' +import CodeEdit from '../../global/CodeEdit' + +export const TEMPLATE_ONE_CLICK_APP = 'TEMPLATE_ONE_CLICK_APP' +export const ONE_CLICK_APP_STRINGIFIED_KEY = 'oneClickAppStringifiedData' + +export default class OneClickAppSelector extends ApiComponent< + RouteComponentProps, + { + templateOneClickAppData: string + } +> { + constructor(props: any) { + super(props) + this.state = { + templateOneClickAppData: '', + } + } + + componentDidMount() { + // const self = this + } + + render() { + const self = this + + return ( +
+ + + +
+ Testing Docker Compose + { + // self.setState({ templateOneClickAppData: newValue }) + }} + /> +
+
+ +
+
+ ) + } +}