Skip to content
Snippets Groups Projects
Commit fbbd0d5b authored by Sandro Weber's avatar Sandro Weber Committed by Antoine Detailleur
Browse files

change of commit messages to NRRPLT-8094 code

parent c25572a5
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,9 @@ const SHORT_DESCRIPTION_LENGTH = 200;
export default class ExperimentListElement extends React.Component {
constructor(props) {
super(props);
this.state = {};
this.state = {
showSimDetails: true
};
//TODO: put in service?
this.canLaunchExperiment = (this.props.experiment.private && this.props.experiment.owned) ||
......@@ -164,8 +166,8 @@ export default class ExperimentListElement extends React.Component {
}}>
<div className='btn-group' role='group' >
{this.canLaunchExperiment &&
exp.configuration.experimentFile && exp.configuration.bibiConfSrc
? <button onClick={() => {
exp.configuration.experimentFile && exp.configuration.bibiConfSrc ?
<button onClick={() => {
ExperimentExecutionService.instance.startNewExperiment(exp, false);
}}
disabled={this.isLaunchDisabled()}
......@@ -177,74 +179,76 @@ export default class ExperimentListElement extends React.Component {
{this.canLaunchExperiment && config.brainProcesses > 1 &&
this.props.availableServers.length > 0 &&
exp.configuration.experimentFile && exp.configuration.bibiConfSrc
? <button className='btn btn-default'>
exp.configuration.experimentFile && exp.configuration.bibiConfSrc ?
<button className='btn btn-default'>
<i className='fa fa-plus'></i> Launch in Single Process Mode
</button>
: null}
{this.canLaunchExperiment && this.props.availableServers.length > 1 &&
exp.configuration.experimentFile && exp.configuration.bibiConfSrc
? <button className='btn btn-default' >
exp.configuration.experimentFile && exp.configuration.bibiConfSrc ?
<button className='btn btn-default' >
<i className='fa fa-layer-group'></i> Launch Multiple
</button>
: null}
{/* isPrivateExperiment */}
{this.canLaunchExperiment
? <button className='btn btn-default'>
{this.canLaunchExperiment ?
<button className='btn btn-default'>
<i className='fa fa-times'></i> Delete
</button>
: null}
{/* Records button */}
{this.canLaunchExperiment
? <button className='btn btn-default'>
{this.canLaunchExperiment ?
<button className='btn btn-default'>
<i className='fa fa-sign-in'></i> Recordings »
</button>
: null}
{/* Export button */}
{this.canLaunchExperiment
? <button className='btn btn-default'>
{this.canLaunchExperiment ?
<button className='btn btn-default'>
<i className='fa fa-file-export'></i> Export
</button>
: null}
{/* Simulations button */}
{this.canLaunchExperiment && exp.joinableServers.length > 0
? <button className='btn btn-default' >
{this.canLaunchExperiment && exp.joinableServers.length > 0 ?
<button className='btn btn-default'
onClick={() => {
this.setState({ showSimDetails: !this.state.showSimDetails });
}}>
<i className='fa fa-sign-in'></i> Simulations »
</button>
: null}
{/* Clone button */}
{config.canCloneExperiments && (!exp.configuration.privateStorage ||
(exp.configuration.experimentFile && exp.configuration.bibiConfSrc))
? <button className='btn btn-default'>
(exp.configuration.experimentFile && exp.configuration.bibiConfSrc)) ?
<button className='btn btn-default'>
<i className='fa fa-pencil-alt'></i> Clone
</button>
: null}
{/* Files button */}
{this.canLaunchExperiment
? <button className='btn btn-default' >
{this.canLaunchExperiment ?
<button className='btn btn-default' >
<i className='fa fa-list-alt'></i> Files
</button>
: null}
{/* Shared button */}
{this.canLaunchExperiment
? <button className='btn btn-default'>
{this.canLaunchExperiment ?
<button className='btn btn-default'>
<i className='fas fa-share-alt'></i> Share
</button>
: null}
</div>
</div>
}
{this.state.selected /*&& exp.joinableServers.length > 0*/ ?
{this.state.selected && exp.joinableServers.length > 0 && this.state.showSimDetails ?
<SimulationDetails simulations={exp.joinableServers} />
: null
}
......
......@@ -16,4 +16,10 @@ li.nostyle {
grid-area: experiments;
color: black;
background-color: white;
}
.no-items-notification {
margin: 10px;
font-size: 1.5em;
font-weight: bold;
}
\ No newline at end of file
......@@ -10,19 +10,19 @@ export default class ExperimentList extends React.Component {
return (
<div className='experiment-list-wrapper'>
<div className='experiment-list'>
<ImportExperimentButtons />
<ol>
{this.props.experiments.map(experiment => {
return (
<li key={experiment.id} className='nostyle'>
<ExperimentListElement experiment={experiment}
availableServers={this.props.availableServers}
startingExperiment={this.props.startingExperiment} />
</li>
);
}
)}
</ol>
{this.props.experiments.length === 0 ?
<div className='no-items-notification'>List is currently empty ...</div> :
<ol>
{this.props.experiments.map(experiment => {
return (
<li key={experiment.id} className='nostyle'>
<ExperimentListElement experiment={experiment}
availableServers={this.props.availableServers}
startingExperiment={this.props.startingExperiment} />
</li>
);
})}
</ol>}
</div>
</div>
);
......
......@@ -59,7 +59,7 @@ class ExperimentExecutionService extends HttpService {
//TODO: placeholder, register actual progress callback later
let progressCallback = (msg) => {
console.info(msg);
//console.info(msg);
};
let launchOnNextServer = async () => {
......@@ -157,10 +157,10 @@ class ExperimentExecutionService extends HttpService {
.then((simulation) => {
ExperimentServerService.instance.initConfigFiles(serverURL, simulation.simulationID)
.then(() => {
ExperimentExecutionService.instance.emit(ExperimentExecutionService.EVENTS.START_EXPERIMENT, undefined);
let simulationURL = 'esv-private/experiment-view/' + server + '/' + experimentID + '/' +
privateExperiment + '/' + simulation.simulationID;
resolve(simulationURL);
ExperimentExecutionService.instance.emit(ExperimentExecutionService.EVENTS.START_EXPERIMENT, undefined);
})
.catch(reject);
})
......
......@@ -17,9 +17,9 @@ let _instance = null;
const SINGLETON_ENFORCER = Symbol();
let rosConnections = new Map();
const SLURM_MONITOR_POLL_INTERVAL = 5000;
const POLL_INTERVAL_SERVER_AVAILABILITY = 3000;
const CHECK_SIMULATION_READY_INTERVAL = 1000;
const INTERVAL_POLL__SLURM_MONITOR = 5000;
const INTERVAL_POLL_SERVER_AVAILABILITY = 3000;
const INTERVAL_CHECK_SIMULATION_READY = 1000;
let clusterAvailability = { free: 'N/A', total: 'N/A' };
/**
......@@ -33,7 +33,7 @@ class ExperimentServerService extends HttpService {
}
//TODO: a bit too much code for a constructor, move into its own function
this.clusterAvailabilityObservable = timer(0, SLURM_MONITOR_POLL_INTERVAL)
this.clusterAvailabilityObservable = timer(0, INTERVAL_POLL__SLURM_MONITOR)
.pipe(switchMap(() => {
try {
return this.httpRequestGET(slurmMonitorURL);
......@@ -82,7 +82,7 @@ class ExperimentServerService extends HttpService {
() => {
this.getServerAvailability(true);
},
POLL_INTERVAL_SERVER_AVAILABILITY
INTERVAL_POLL_SERVER_AVAILABILITY
);
}
......@@ -190,7 +190,7 @@ class ExperimentServerService extends HttpService {
verifySimulation();
}
}).catch(reject);
}, CHECK_SIMULATION_READY_INTERVAL);
}, INTERVAL_CHECK_SIMULATION_READY);
};
verifySimulation();
......@@ -239,6 +239,7 @@ class ExperimentServerService extends HttpService {
});
};
//TODO: maybe move to separate simulation-status-service
async getSimulationState(serverURL, simulationID) {
let url = serverURL + '/simulation/' + simulationID + '/state';
try {
......
......@@ -66,6 +66,7 @@ class ExperimentStorageService extends HttpService {
* them in the experiments class property. If the experiments are already
* there it just returns them, else does an HTTP request.
*
* @param {boolean} forceUpdate forces an update of the list
* @return experiments - the list of template experiments
*/
async getExperiments(forceUpdate = false) {
......@@ -74,6 +75,7 @@ class ExperimentStorageService extends HttpService {
this.experiments = await response.json();
this.sortExperiments();
await this.fillExperimentDetails();
console.info('experiment lsit update');
this.emit(ExperimentStorageService.EVENTS.UPDATE_EXPERIMENTS, this.experiments);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment