diff --git a/public/hbp.png b/public/hbp.png new file mode 100644 index 0000000000000000000000000000000000000000..d6c728ac784e552cd87262aac310d5dcf6c359f0 Binary files /dev/null and b/public/hbp.png differ diff --git a/public/hbp75.png b/public/hbp75.png new file mode 100644 index 0000000000000000000000000000000000000000..4dfc63a64049f08f887815e30e64cb0edb2c8adc Binary files /dev/null and b/public/hbp75.png differ diff --git a/public/index.html b/public/index.html index dd172158746c1c6a64bd030dc00ee0ab7f45c857..141a45a57899c0219880663c0b6d4d013329f20e 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ <html lang="en"> <head> <meta charset="utf-8" /> - <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> + <link rel="icon" href="%PUBLIC_URL%/hbp.png" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="theme-color" content="#000000" /> diff --git a/public/manifest.json b/public/manifest.json index 6aade0618dfce2b4f33a1ad6eec479369910f8ec..35ac71bdcb9d862244f45506b73818ffdecca29b 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -3,9 +3,14 @@ "name": "Neurorobotics Platform", "icons": [ { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" + "src": "hbp.png", + "sizes": "32x32", + "type": "image/png" + }, + { + "src": "hbp75.png", + "sizes": "75x75", + "type": "image/png" }, { "src": "logo192.png", diff --git a/src/components/experiment-list/import-experiment-buttons.js b/src/components/experiment-list/import-experiment-buttons.js index 4c2863164bf256272de06d355c6b7e4827d4068a..bdb5d10944a88b1416d31ed78c6c4b0f2da65df8 100644 --- a/src/components/experiment-list/import-experiment-buttons.js +++ b/src/components/experiment-list/import-experiment-buttons.js @@ -7,12 +7,18 @@ import ExperimentStorageService from '../../services/experiments/files/experimen import './experiment-list-element.css'; import './import-experiment-buttons.css'; + +import frontendConfig from '../../config.json'; + import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import Tooltip from 'react-bootstrap/Tooltip'; export default class ImportExperimentButtons extends React.Component { constructor(props) { super(props); this.state = {}; + // By default, we enable the scan storage button, even if it's not in the config. + // For the online version, we explicitly disable it. + this.scanStorage = frontendConfig.scanStorage !== undefined ? frontendConfig.scanStorage : true; } importFolderPopupClick() { @@ -152,47 +158,50 @@ export default class ImportExperimentButtons extends React.Component { {/* Import buttons */} {/* TODO: [NRRPLT-8721] restore experiment import funtionality */} <div className='list-entry-buttons flex-container center'> - <input disabled={true} id='folder' type='file' style={{display:'none'}} + <input disabled={true} id='folder' type='file' style={{ display: 'none' }} multiple directory='' webkitdirectory='' - onChange={(event) => this.importExperimentFolderChange(event)}/> - <input disabled={true} id='zip' type='file' style={{display:'none'}} + onChange={(event) => this.importExperimentFolderChange(event)} /> + <input disabled={true} id='zip' type='file' style={{ display: 'none' }} multiple accept='.zip' - onChange={(event) => this.importZippedExperimentChange(event)}/> - {!this.state.isImporting - ? <div className='btn-group' role='group'> - <OverlayTrigger placement='bottom' - key='folder-tooltip' - overlay={ - <Tooltip id='tooltip-folder'> - The import of the experiments is comming soon! - </Tooltip> - } - > - <button type='button' className='btn btn-outline-dark'> - <label htmlFor='folder' className='import-button'> - <FaFolder/> Import folder - </label> - </button> - </OverlayTrigger> - <OverlayTrigger placement='bottom' - key='zip-tooltip' - overlay={ - <Tooltip id='tooltip-zip'> - The import of the zipped experiments is comming soon! - </Tooltip> - } - > - <button type='button' className='btn btn-outline-dark' - data-toggle='tooltip' data-placement='bottom' title='Tooltip on bottom' - > - <label htmlFor='zip' className='import-button'><FaFileArchive /> Import zip</label> - </button > - </OverlayTrigger> - <button type='button' className='btn btn-outline-dark' onClick={() => this.scanStorageClick()}> - <FaAudible/> Scan Storage + onChange={(event) => this.importZippedExperimentChange(event)} /> + <div className='btn-group' role='group'> + <OverlayTrigger placement='bottom' + key='folder-tooltip' + overlay={ + <Tooltip id='tooltip-folder'> + The import of the experiments is coming soon! + </Tooltip> + } + > + <button type='button' className='btn btn-outline-dark'> + <label htmlFor='folder' className='import-button'> + <FaFolder /> Import folder + </label> </button> - </div> - : null} + </OverlayTrigger> + <OverlayTrigger placement='bottom' + key='zip-tooltip' + overlay={ + <Tooltip id='tooltip-zip'> + The import of the zipped experiments is coming soon! + </Tooltip> + } + > + <button type='button' className='btn btn-outline-dark' + data-toggle='tooltip' data-placement='bottom' title='Tooltip on bottom' + > + <label htmlFor='zip' className='import-button'><FaFileArchive /> Import zip</label> + </button > + </OverlayTrigger> + + { + this.scanStorage ? + <button type='button' className='btn btn-outline-dark' onClick={() => this.scanStorageClick()}> + <FaAudible /> Scan Storage + </button> : + null + } + </div> </div> </div> ); diff --git a/src/components/nrp-core-dashboard/nrp-core-dashboard.js b/src/components/nrp-core-dashboard/nrp-core-dashboard.js index a82678a390351782e4d5f53d0f0601d510e54e16..3dae07fde0c5fad6635cea2e604e1d9bc2f7f978 100644 --- a/src/components/nrp-core-dashboard/nrp-core-dashboard.js +++ b/src/components/nrp-core-dashboard/nrp-core-dashboard.js @@ -5,6 +5,8 @@ import NrpUserService from '../../services/proxy/nrp-user-service.js'; import EventProxyService from '../../services/proxy/event-proxy-service'; import ExperimentStorageService from '../../services/experiments/files/experiment-storage-service'; +import frontendConfig from '../../config.json'; + import Grid from '@material-ui/core/Grid'; import { Alert, AlertTitle } from '@material-ui/lab'; import Button from '@material-ui/core/Button'; @@ -29,6 +31,9 @@ export default class NrpCoreDashboard extends React.Component { proxyConnected: EventProxyService.instance.isConnected(), reconnectDisabled: EventProxyService.instance.isConnected() }; + // By default, we enable the scan storage button, even if it's not in the config. + // For the online version, we explicitly disable it. + this.scanStorage = frontendConfig.scanStorage !== undefined ? frontendConfig.scanStorage : true; this.mqttBrokerUrl = MqttClientService.instance.getBrokerURL(); } @@ -130,11 +135,15 @@ export default class NrpCoreDashboard extends React.Component { {this.state.proxyConnected ? 'Connected' : 'Could not get response from the Proxy'} </Alert> </Grid> - <Grid item xs={12}> - <Button onClick={this.triggerProxyScanStorage} disabled={!this.state.proxyConnected}> - Proxy Scan Storage - </Button> - </Grid> + { + this.scanStorage ? + <Grid item xs={12}> + <Button onClick={this.triggerProxyScanStorage} disabled={!this.state.proxyConnected}> + Proxy Scan Storage + </Button> + </Grid> : + null + } {/*<Grid item xs={12}> <button onClick={NrpUserService.instance.getCurrentUser()}>Try to login</button> </Grid> */} diff --git a/src/config.json.sample.docker b/src/config.json.sample.docker index 1cb3c6733ddedb9dca5574ae0daac2300ebd782e..53c9b430cb739ae6df882bca97ca402afea00ea1 100644 --- a/src/config.json.sample.docker +++ b/src/config.json.sample.docker @@ -17,5 +17,6 @@ "errors": "runtime_error", "status": "status" } - } + }, + "scanStorage": true } diff --git a/src/config.json.sample.local b/src/config.json.sample.local index 1cb3c6733ddedb9dca5574ae0daac2300ebd782e..53c9b430cb739ae6df882bca97ca402afea00ea1 100644 --- a/src/config.json.sample.local +++ b/src/config.json.sample.local @@ -17,5 +17,6 @@ "errors": "runtime_error", "status": "status" } - } + }, + "scanStorage": true } diff --git a/src/config.json.sample.oidc b/src/config.json.sample.oidc index 358b94a4a68198342b389e4d5263f341bc79deb2..561a210c9a457354125b77ee1dfb185ec87d125a 100644 --- a/src/config.json.sample.oidc +++ b/src/config.json.sample.oidc @@ -18,5 +18,6 @@ "errors": "runtime_error", "status": "status" } - } + }, + "scanStorage": false }