Skip to content
Snippets Groups Projects
Commit de41b740 authored by Antoine Detailleur's avatar Antoine Detailleur
Browse files

[NRRPLT-8003] indentation corrected

parent d39e0893
No related branches found
No related tags found
No related merge requests found
...@@ -22,37 +22,37 @@ ...@@ -22,37 +22,37 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* ---LICENSE-END**/ * ---LICENSE-END**/
// This file contains filters to display times and dates // This file contains filters to display times and dates
export default function timeDDHHMMSS(input) { export default function timeDDHHMMSS(input) {
if (typeof input !== 'number') { if (typeof input !== 'number') {
return '--\u00A0--:--:--'; return '--\u00A0--:--:--';
} }
var timeValue = ''; var timeValue = '';
var timeSec = input; var timeSec = input;
var timeDay = Math.floor(timeSec / 86400); var timeDay = Math.floor(timeSec / 86400);
timeSec -= timeDay * 86400; timeSec -= timeDay * 86400;
var timeHour = Math.floor(timeSec / 3600); var timeHour = Math.floor(timeSec / 3600);
timeSec -= timeHour * 3600; timeSec -= timeHour * 3600;
var timeMin = Math.floor(timeSec / 60); var timeMin = Math.floor(timeSec / 60);
timeSec = Math.floor(timeSec) - timeMin * 60; timeSec = Math.floor(timeSec) - timeMin * 60;
if (timeDay < 10) { if (timeDay < 10) {
timeValue += '0'; timeValue += '0';
} }
timeValue += timeDay.toFixed(0) + '\u00A0'; timeValue += timeDay.toFixed(0) + '\u00A0';
if (timeHour < 10) { if (timeHour < 10) {
timeValue += '0'; timeValue += '0';
} }
timeValue += timeHour.toFixed(0) + ':'; timeValue += timeHour.toFixed(0) + ':';
if (timeMin < 10) { if (timeMin < 10) {
timeValue += '0'; timeValue += '0';
} }
timeValue += timeMin.toFixed(0) + ':'; timeValue += timeMin.toFixed(0) + ':';
if (timeSec < 10) { if (timeSec < 10) {
timeValue += '0'; timeValue += '0';
} }
timeValue += timeSec.toFixed(0); timeValue += timeSec.toFixed(0);
return timeValue; return timeValue;
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ export default class ExperimentListElement extends React.Component { ...@@ -30,7 +30,7 @@ export default class ExperimentListElement extends React.Component {
Timeout: Timeout:
{timeDDHHMMSS(exp.configuration.timeout)} {timeDDHHMMSS(exp.configuration.timeout)}
({(exp.configuration.timeoutType==='simulation' ? 'simulation' : 'real')} time) ({(exp.configuration.timeoutType==='simulation' ? 'simulation' : 'real')} time)
</i> </i>
<br /> <br />
<i> <i>
Brain processes: {exp.configuration.brainProcesses} Brain processes: {exp.configuration.brainProcesses}
...@@ -41,100 +41,101 @@ export default class ExperimentListElement extends React.Component { ...@@ -41,100 +41,101 @@ export default class ExperimentListElement extends React.Component {
<i className={{serverIcon: 1}} title='Restricted.'></i> <i className={{serverIcon: 1}} title='Restricted.'></i>
</div> </div>
</div> </div>
<div className='list-entry-buttons list-entry-container center' onClick={()=>{return exp.id === pageState.selected}}> <div className='list-entry-buttons list-entry-container center' onClick={()=>{
return exp.id === pageState.selected
}}>
<div className='btn-group' role='group' > <div className='btn-group' role='group' >
{config.canLaunchExperiments && exp.joinableServers.length > 0 && {config.canLaunchExperiments && exp.joinableServers.length > 0 &&
exp.configuration.experimentFile && exp.configuration.bibiConfSr exp.configuration.experimentFile && exp.configuration.bibiConfSr
? <button analytics-on analytics-event='Launch' analytics-category='Experiment'
? <button analytics-on analytics-event='Launch' analytics-category='Experiment' onClick={()=>{
onClick={()=>{return pageState.startingExperiment === exp.id }} return pageState.startingExperiment === exp.id
}}
disabled = {pageState.startingExperiment === exp.id || pageState.deletingExperiment} disabled = {pageState.startingExperiment === exp.id || pageState.deletingExperiment}
className='btn btn-default' > className='btn btn-default' >
<i className='fa fa-plus'></i> Launch <i className='fa fa-plus'></i> Launch
</button> </button>
:null} :null}
{config.canLaunchExperiments && exp.joinableServers.length === 0 {config.canLaunchExperiments && exp.joinableServers.length === 0
?<button className='btn btn-default disabled enable-tooltip' ?<button className='btn btn-default disabled enable-tooltip'
title='Sorry, no available servers.'> title='Sorry, no available servers.'>
<i className='fa fa-plus'></i> Launch <i className='fa fa-plus'></i> Launch
</button> </button>
: null} : null}
{config.canLaunchExperiments && config.brainProcesses > 1 && exp.joinableServers.length > 0 && {config.canLaunchExperiments && config.brainProcesses > 1 && exp.joinableServers.length > 0 &&
exp.configuration.experimentFile && exp.configuration.bibiConfSrc exp.configuration.experimentFile && exp.configuration.bibiConfSrc
? <button className='btn btn-default'> ? <button className='btn btn-default'>
<i className='fa fa-plus'></i> Launch in Single Process Mode <i className='fa fa-plus'></i> Launch in Single Process Mode
</button> </button>
: null} : null}
{config.canLaunchExperiments && exp.joinableServers.length > 1 && {config.canLaunchExperiments && exp.joinableServers.length > 1 &&
exp.configuration.experimentFile && exp.configuration.bibiConfSrc exp.configuration.experimentFile && exp.configuration.bibiConfSrc
? <button analytics-on analytics-event='Launch Multiple Instances' ? <button analytics-on analytics-event='Launch Multiple Instances'
className='btn btn-default' > className='btn btn-default' >
<i className='fa fa-layer-group'></i> Launch Multiple <i className='fa fa-layer-group'></i> Launch Multiple
</button> </button>
: null} : null}
{/* isPrivateExperiment */} {/* isPrivateExperiment */}
{config.canLaunchExperiments {config.canLaunchExperiments
? <button analytics-on analytics-event='Delete' analytics-category='Experiment' ? <button analytics-on analytics-event='Delete' analytics-category='Experiment'
className='btn btn-default'> className='btn btn-default'>
<i className='fa fa-times'></i> Delete <i className='fa fa-times'></i> Delete
</button> </button>
: null} : null}
{/* Records button */} {/* Records button */}
{config.canLaunchExperiments {config.canLaunchExperiments
? <button analytics-on analytics-event='ShowRecords' analytics-category='Experiment' canLaunchExp={config.canLaunchExperiments} ? <button analytics-on analytics-event='ShowRecords' analytics-category='Experiment' canLaunchExp={config.canLaunchExperiments}
className='btn btn-default'> className='btn btn-default'>
<i className='fa fa-sign-in'></i> Recordings » <i className='fa fa-sign-in'></i> Recordings »
</button> </button>
: null} : null}
{/* Export button */} {/* Export button */}
{config.canLaunchExperiments {config.canLaunchExperiments
? ? <button analytics-on analytics-event='ExportZip' analytics-category='Experiment' canLaunchExp={config.canLaunchExperiments}
<button analytics-on analytics-event='ExportZip' analytics-category='Experiment' canLaunchExp={config.canLaunchExperiments}
className='btn btn-default'> className='btn btn-default'>
<i className='fa fa-file-export'></i> Export <i className='fa fa-file-export'></i> Export
</button> </button>
: null} : null}
{/* Join button */} {/* Join button */}
{config.canLaunchExperiments && exp.joinableServers.length > 0 {config.canLaunchExperiments && exp.joinableServers.length > 0
? <button analytics-on analytics-event='Join' analytics-category='Experiment' canLaunchExp={config.canLaunchExperiments} jServerLength={exp.joinableServers.length} ? <button analytics-on analytics-event='Join' analytics-category='Experiment' canLaunchExp={config.canLaunchExperiments} jServerLength={exp.joinableServers.length}
className='btn btn-default' > className='btn btn-default' >
<i className='fa fa-sign-in'></i> Simulations » <i className='fa fa-sign-in'></i> Simulations »
</button> </button>
: null} : null}
{/* Clone button */} {/* Clone button */}
{config.canCloneExperiments && (!exp.configuration.privateStorage || (exp.configuration.experimentFile && exp.configuration.bibiConfSrc)) {config.canCloneExperiments && (!exp.configuration.privateStorage || (exp.configuration.experimentFile && exp.configuration.bibiConfSrc))
? <button analytics-on analytics-event='Clone' analytics-label='Collab' ? <button analytics-on analytics-event='Clone' analytics-label='Collab'
analytics-value={exp.id} className='btn btn-default'> analytics-value={exp.id} className='btn btn-default'>
<i className='fa fa-pencil-alt'></i> Clone <i className='fa fa-pencil-alt'></i> Clone
</button> </button>
: null : null}
}
{/* Files button */} {/* Files button */}
{config.canLaunchExperiments {config.canLaunchExperiments
? <button canLaunchExp={config.canLaunchExperiments} analytics-on analytics-event='Explorer' ? <button canLaunchExp={config.canLaunchExperiments} analytics-on analytics-event='Explorer'
analytics-label='Collab' expId={exp.id} className='btn btn-default' > analytics-label='Collab' expId={exp.id} className='btn btn-default' >
<i className='fa fa-list-alt'></i> Files <i className='fa fa-list-alt'></i> Files
</button> </button>
: null} : null}
{/* Shared button */} {/* Shared button */}
{config.canLaunchExperiments {config.canLaunchExperiments
? <button canLaunchExp={config.canLaunchExperiments} expId={exp.id} analytics-on analytics-event='Explorer' className='btn btn-default' analytics-label='Collab'> ? <button canLaunchExp={config.canLaunchExperiments} expId={exp.id} analytics-on analytics-event='Explorer' className='btn btn-default' analytics-label='Collab'>
<i className='fas fa-share-alt'></i> Share <i className='fas fa-share-alt'></i> Share
</button> </button>
: null} : null}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -13,7 +13,7 @@ export default class ExperimentList extends React.Component { ...@@ -13,7 +13,7 @@ export default class ExperimentList extends React.Component {
super(props); super(props);
this.state = { this.state = {
experiments: [], experiments: [],
pageState: {}, pageState: {}
}; };
} }
...@@ -22,9 +22,10 @@ export default class ExperimentList extends React.Component { ...@@ -22,9 +22,10 @@ export default class ExperimentList extends React.Component {
try { try {
const experiments = await ExperimentsService.instance.getExperiments(); const experiments = await ExperimentsService.instance.getExperiments();
this.setState({ this.setState({
experiments: experiments, experiments: experiments
}); });
} catch (error) { }
catch (error) {
console.error(`Failed to fetch the list of experiments. Error: ${error}`); console.error(`Failed to fetch the list of experiments. Error: ${error}`);
} }
} }
...@@ -57,12 +58,13 @@ export default class ExperimentList extends React.Component { ...@@ -57,12 +58,13 @@ export default class ExperimentList extends React.Component {
</div> </div>
<div className='experiment-page-experiments'> <div className='experiment-page-experiments'>
<ol> <ol>
{this.state.experiments.map(experiment => {this.state.experiments.map(experiment => {
{return ( return (
<li key={experiment.id} class='nostyle'> <li key={experiment.id} class='nostyle'>
<ExperimentListElement experiment={experiment} pageState={this.state.pageState} /> <ExperimentListElement experiment={experiment} pageState={this.state.pageState} />
</li> </li>
);} );
}
)} )}
</ol> </ol>
</div> </div>
......
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