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 9d217fc9..8fe9cc9f 100644 --- a/src/containers/apps/CreateNewApp.tsx +++ b/src/containers/apps/CreateNewApp.tsx @@ -1,5 +1,5 @@ import { PlusCircleOutlined, QuestionCircleFilled } from '@ant-design/icons' -import { Button, Card, Checkbox, Divider, Input, Row, Tooltip } from 'antd' +import { Button, Card, Checkbox, Col, Input, Row, Tooltip } from 'antd' import { Component, Fragment } from 'react' import { connect } from 'react-redux' import ProjectSelector from '../../components/ProjectSelector' @@ -15,6 +15,7 @@ interface MyProps { hasPersistency: boolean ) => void onOneClickAppClicked: () => void + onDockerComposeClicked: () => void projects: ProjectDefinition[] } @@ -57,105 +58,153 @@ class CreateNewApp extends Component< marginBottom: 20, }} > - {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 +221,6 @@ class CreateNewApp extends Component< {' '}
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 }) + }} + /> +
+
+ +
+
+ ) + } +}