
ide.configuration-dialog.jsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of DevCenter Show documentation
Show all versions of DevCenter Show documentation
Prompto Development Center POM
The newest version!
const { Modal, Button, Checkbox, FormGroup, ControlLabel, InputGroup, FormControl, HelpBlock } = ReactBootstrap;
class ConfigurationDialog extends React.Component {
constructor(props) {
super(props);
this.getProject = ()=>this.props.root.getProject().value;
this.state = {show: true};
this.setStateFromConfig();
this.handleClose = this.handleClose.bind(this);
this.handleSave = this.handleSave.bind(this);
this.saveConfig = this.saveConfig.bind(this);
}
setStateFromConfig() {
const project = this.props.root.getProject();
const hasStartMethod = project.type==="Batch";
const hasServerStartMethod = project.type==="Service" || project.type==="WebSite";
const hasHomePage = project && project.type==="WebSite";
if(hasStartMethod)
this.state.startMethod = project.value.startMethod;
if(hasServerStartMethod)
this.state.serverAboutToStartMethod = project.value.serverAboutToStartMethod;
if(hasHomePage)
this.state.homePage = project.value.homePage;
}
setConfigFromState(project) {
const hasStartMethod = project.type==="Batch";
const hasServerStartMethod = project.type==="Service" || project.type==="WebSite";
const hasHomePage = project && project.type==="WebSite";
if(hasStartMethod)
project.value.startMethod = this.state.startMethod;
if(hasServerStartMethod)
project.value.serverAboutToStartMethod = this.state.serverAboutToStartMethod;
if(hasHomePage)
project.value.homePage = this.state.homePage;
}
handleClose() {
this.setState({show: false});
this.props.onClose();
}
handleSave() {
// load latest full description before updating it
const dbId = (this.getProject().dbId.value || this.getProject().dbId).toString();
const params = {
params: JSON.stringify([{name: "dbId", value: dbId}, {
name: "register",
type: "Boolean",
value: false
}])
};
axios.get('/ws/run/getModuleDescription', {params: params}).then(resp => {
const response = resp.data;
if (response.error)
alert(response.error);
else
this.saveConfig(response.data);
});
}
saveConfig(project) {
this.setConfigFromState(project);
const formData = new FormData();
const params = [ {name: "module", type: project.type, value: project.value} ];
formData.append("params", JSON.stringify(params));
axios.post("/ws/run/storeModule", formData).
then(response=>{
this.props.root.loadDescription();
this.handleClose()
}).catch(error=>alert(error));
}
render() {
const project = this.props.root.getProject();
const hasStartMethod = project.type==="Batch";
const hasServerStartMethod = project.type==="Service" || project.type==="WebSite";
const hasHomePage = project && project.type==="WebSite";
return
Module configuration
;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy