Skip to content

Commit

Permalink
feat(config): database place path
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Feb 5, 2018
1 parent b640bd4 commit 8d58a7f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/app/admin-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField'
import Slider from 'material-ui/Slider'

import fs from 'fs'
const {dialog} = require('electron').remote

export default class AdminPage extends Page {
constructor(props) {
super(props)
Expand Down Expand Up @@ -87,6 +90,30 @@ export default class AdminPage extends Page {
/>
</div>

<div className='row inline w100p'>
<div style={{flex: 1}}>Collection directory</div>
<TextField
hintText="Port"
errorText={this.options.dbPath && this.options.dbPath.length > 0 ? undefined : "This field is required"}
value={this.options.dbPath}
onChange={(e, value) => {
if(!fs.existsSync(value))
return

this.options.dbPath = value
this.forceUpdate()
}}
/>
<RaisedButton style={{marginLeft: 20}} label="Browse" primary={true} onClick={() => {
const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0]
if(dir)
{
this.options.dbPath = dir
this.forceUpdate()
}
}} />
</div>

<div className='row inline w100p'>
<div style={{flex: 1}}>CPU usage limitation</div>
<Slider
Expand Down

0 comments on commit 8d58a7f

Please sign in to comment.