|
@@ -5,6 +5,12 @@ import Paper from 'material-ui/Paper'
|
|
import Table, { TableHead, TableBody, TableRow, TableCell } from 'material-ui/Table'
|
|
import Table, { TableHead, TableBody, TableRow, TableCell } from 'material-ui/Table'
|
|
import Dialog, { DialogActions, DialogContent, DialogContentText, DialogTitle } from 'material-ui/Dialog'
|
|
import Dialog, { DialogActions, DialogContent, DialogContentText, DialogTitle } from 'material-ui/Dialog'
|
|
import TextField from 'material-ui/TextField'
|
|
import TextField from 'material-ui/TextField'
|
|
|
|
+import MenuItem from 'material-ui/Menu/MenuItem'
|
|
|
|
+import Typography from 'material-ui/Typography'
|
|
|
|
+import List, { ListItem, ListItemText, ListItemSecondaryAction } from 'material-ui/List'
|
|
|
|
+import IconButton from 'material-ui/IconButton'
|
|
|
|
+import AddIcon from '../icons/AddIcon'
|
|
|
|
+import RemoveIcon from '../icons/RemoveIcon'
|
|
import { isEqual, isEmpty } from 'lodash'
|
|
import { isEqual, isEmpty } from 'lodash'
|
|
import { ODOO, REQUEST } from '../../constants/ResourceNames'
|
|
import { ODOO, REQUEST } from '../../constants/ResourceNames'
|
|
import { post, get } from '../../actions'
|
|
import { post, get } from '../../actions'
|
|
@@ -14,6 +20,15 @@ import { withStyles } from 'material-ui/styles'
|
|
const styles = theme => ({
|
|
const styles = theme => ({
|
|
gap: {
|
|
gap: {
|
|
marginTop: 25
|
|
marginTop: 25
|
|
|
|
+ },
|
|
|
|
+ transfer: {
|
|
|
|
+ display: 'flex',
|
|
|
|
+ marginTop: theme.spacing.unit * 3
|
|
|
|
+ },
|
|
|
|
+ transferPanels: {
|
|
|
|
+ height: '100%',
|
|
|
|
+ padding: 15,
|
|
|
|
+ flexGrow: 1
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -22,7 +37,7 @@ class TasksList extends Component {
|
|
super(props)
|
|
super(props)
|
|
|
|
|
|
this.state = {
|
|
this.state = {
|
|
- isDialogOpened: false,
|
|
|
|
|
|
+ showDialog: null,
|
|
isDialogValid: true,
|
|
isDialogValid: true,
|
|
name: '',
|
|
name: '',
|
|
nameConfirmation: ''
|
|
nameConfirmation: ''
|
|
@@ -39,27 +54,24 @@ class TasksList extends Component {
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- handleOpenDialog = e => {
|
|
|
|
|
|
+ handleShowDialog = (taskName, e) => {
|
|
this.setState({
|
|
this.setState({
|
|
- isDialogOpened: true
|
|
|
|
|
|
+ showDialog: taskName
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- handleCloseDialog = e => {
|
|
|
|
|
|
+ handleCloseDialog = taskName => {
|
|
this.setState({
|
|
this.setState({
|
|
- isDialogOpened: false,
|
|
|
|
- isDialogValid: true,
|
|
|
|
- name: '',
|
|
|
|
- nameConfirmation: ''
|
|
|
|
|
|
+ showDialog: null
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
- */
|
|
|
|
|
|
+ *
|
|
|
|
+ */
|
|
handleChangeName = e => {
|
|
handleChangeName = e => {
|
|
if (isEqual(e.target.id, 'name')) {
|
|
if (isEqual(e.target.id, 'name')) {
|
|
this.setState({
|
|
this.setState({
|
|
@@ -107,7 +119,6 @@ class TasksList extends Component {
|
|
name: '',
|
|
name: '',
|
|
nameConfirmation: ''
|
|
nameConfirmation: ''
|
|
})
|
|
})
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -115,7 +126,8 @@ class TasksList extends Component {
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
render() {
|
|
render() {
|
|
- const { isDialogOpened, isDialogValid } = this.state
|
|
|
|
|
|
+ const { classes } = this.props
|
|
|
|
+ const { isDialogValid, showDialog } = this.state
|
|
|
|
|
|
return (
|
|
return (
|
|
<Base title={this.props.title}>
|
|
<Base title={this.props.title}>
|
|
@@ -135,13 +147,22 @@ class TasksList extends Component {
|
|
<TableCell>Nunca</TableCell>
|
|
<TableCell>Nunca</TableCell>
|
|
<TableCell>Anónimo</TableCell>
|
|
<TableCell>Anónimo</TableCell>
|
|
<TableCell>
|
|
<TableCell>
|
|
- <Button variant='raised' color='primary' data-action='create' onClick={this.handleOpenDialog}>Ejecutar</Button>
|
|
|
|
|
|
+ <Button variant='raised' color='primary' data-action='create' onClick={e => this.handleShowDialog('create-odoo', e)}>Ejecutar</Button>
|
|
|
|
+ </TableCell>
|
|
|
|
+ </TableRow>
|
|
|
|
+ <TableRow>
|
|
|
|
+ <TableCell>Copiar/actualizar módulos de Odoo</TableCell>
|
|
|
|
+ <TableCell>Nunca</TableCell>
|
|
|
|
+ <TableCell>Anónimo</TableCell>
|
|
|
|
+ <TableCell>
|
|
|
|
+ <Button variant='raised' color='primary' data-action='create' onClick={e => this.handleShowDialog('show-modules', e)}>Ejecutar</Button>
|
|
</TableCell>
|
|
</TableCell>
|
|
</TableRow>
|
|
</TableRow>
|
|
</TableBody>
|
|
</TableBody>
|
|
</Table>
|
|
</Table>
|
|
</Paper>
|
|
</Paper>
|
|
- <Dialog open={isDialogOpened} onClose={this.handleCloseDialog}>
|
|
|
|
|
|
+ {/* Dialog for create odoo container */}
|
|
|
|
+ <Dialog open={showDialog === 'create-odoo'} onClose={this.handleCloseDialog}>
|
|
<DialogTitle>Confirmar</DialogTitle>
|
|
<DialogTitle>Confirmar</DialogTitle>
|
|
<DialogContent>
|
|
<DialogContent>
|
|
<DialogContentText>Estás solicitando crear un nuevo contenedor Odoo. Tenga en cuenta que ésta tarea puede tardar unos instantes dependiendo del tráfico de red y del uso de los recursos del servidor</DialogContentText>
|
|
<DialogContentText>Estás solicitando crear un nuevo contenedor Odoo. Tenga en cuenta que ésta tarea puede tardar unos instantes dependiendo del tráfico de red y del uso de los recursos del servidor</DialogContentText>
|
|
@@ -167,10 +188,71 @@ class TasksList extends Component {
|
|
/>
|
|
/>
|
|
</DialogContent>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<DialogActions>
|
|
- <Button color='primary' onClick={this.handleCloseDialog}>Cancelar</Button>
|
|
|
|
|
|
+ <Button color='primary'>Cancelar</Button>
|
|
<Button color='primary' onClick={this.handleAcceptDialog}>Aceptar</Button>
|
|
<Button color='primary' onClick={this.handleAcceptDialog}>Aceptar</Button>
|
|
</DialogActions>
|
|
</DialogActions>
|
|
</Dialog>
|
|
</Dialog>
|
|
|
|
+ {/* Dialog for copy odoo modules */}
|
|
|
|
+ <Dialog open={showDialog === 'show-modules'} onClose={this.handleCloseDialog} fullScreen={true}>
|
|
|
|
+ <DialogTitle>Seleccionar modulos</DialogTitle>
|
|
|
|
+ <DialogContent>
|
|
|
|
+ <DialogContentText>Seleccione los módulos que desea copiar/actualizar en un sistema desplegado.</DialogContentText>
|
|
|
|
+ <TextField label='Nombre del Sistema' fullWidth={true} margin='normal'>
|
|
|
|
+ <MenuItem value='sistema1'>Sistema 1</MenuItem>
|
|
|
|
+ <MenuItem value='sistema2'>Sistema 2</MenuItem>
|
|
|
|
+ <MenuItem value='sistema3'>Sistema 3</MenuItem>
|
|
|
|
+ </TextField>
|
|
|
|
+ <div className={classes.transfer}>
|
|
|
|
+ <div className={classes.transferPanels}>
|
|
|
|
+ <Typography variant='title'>Módulos disponibles</Typography>
|
|
|
|
+ <TextField type='search' placeholder='Buscar' fullWidth={true} margin='normal' />
|
|
|
|
+ <List>
|
|
|
|
+ <ListItem>
|
|
|
|
+ <ListItemText primary='Módulo 1' />
|
|
|
|
+ <ListItemSecondaryAction>
|
|
|
|
+ <IconButton>
|
|
|
|
+ <AddIcon />
|
|
|
|
+ </IconButton>
|
|
|
|
+ </ListItemSecondaryAction>
|
|
|
|
+ </ListItem>
|
|
|
|
+ <ListItem>
|
|
|
|
+ <ListItemText primary='Módulo 2' />
|
|
|
|
+ <ListItemSecondaryAction>
|
|
|
|
+ <IconButton>
|
|
|
|
+ <AddIcon />
|
|
|
|
+ </IconButton>
|
|
|
|
+ </ListItemSecondaryAction>
|
|
|
|
+ </ListItem>
|
|
|
|
+ <ListItem>
|
|
|
|
+ <ListItemText primary='Módulo 3' />
|
|
|
|
+ <ListItemSecondaryAction>
|
|
|
|
+ <IconButton>
|
|
|
|
+ <AddIcon />
|
|
|
|
+ </IconButton>
|
|
|
|
+ </ListItemSecondaryAction>
|
|
|
|
+ </ListItem>
|
|
|
|
+ </List>
|
|
|
|
+ </div>
|
|
|
|
+ <div className={classes.transferPanels}>
|
|
|
|
+ <Typography variant='title'>Módulos a instalar</Typography>
|
|
|
|
+ <List>
|
|
|
|
+ <ListItem>
|
|
|
|
+ <ListItemText primary='Módulo 4' />
|
|
|
|
+ <ListItemSecondaryAction>
|
|
|
|
+ <IconButton>
|
|
|
|
+ <RemoveIcon />
|
|
|
|
+ </IconButton>
|
|
|
|
+ </ListItemSecondaryAction>
|
|
|
|
+ </ListItem>
|
|
|
|
+ </List>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </DialogContent>
|
|
|
|
+ <DialogActions>
|
|
|
|
+ <Button color='primary' onClick={this.handleCloseDialog}>Cancelar</Button>
|
|
|
|
+ <Button color='primary'>Aceptar</Button>
|
|
|
|
+ </DialogActions>
|
|
|
|
+ </Dialog>
|
|
</Base>
|
|
</Base>
|
|
)
|
|
)
|
|
}
|
|
}
|