feat(config): database place path
This commit is contained in:
parent
9a99803c68
commit
17aff1aca0
@ -8,6 +8,9 @@ import RaisedButton from 'material-ui/RaisedButton';
|
|||||||
import TextField from 'material-ui/TextField'
|
import TextField from 'material-ui/TextField'
|
||||||
import Slider from 'material-ui/Slider'
|
import Slider from 'material-ui/Slider'
|
||||||
|
|
||||||
|
import fs from 'fs'
|
||||||
|
const {dialog} = require('electron').remote
|
||||||
|
|
||||||
export default class AdminPage extends Page {
|
export default class AdminPage extends Page {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
@ -87,6 +90,30 @@ export default class AdminPage extends Page {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</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 className='row inline w100p'>
|
||||||
<div style={{flex: 1}}>CPU usage limitation</div>
|
<div style={{flex: 1}}>CPU usage limitation</div>
|
||||||
<Slider
|
<Slider
|
||||||
|
Loading…
Reference in New Issue
Block a user