Skip to content

Commit

Permalink
Add support to set the SSL connection option (close #72)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcnunes committed Dec 15, 2015
1 parent 5c57788 commit 82be996
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"babel-core": "^5.8.29",
"babel-runtime": "^5.8.29",
"debug": "^2.2.0",
"sqlectron-core": "^1.3.1"
"sqlectron-core": "^1.4.0"
},
"devDependencies": {
"autoprefixer-loader": "^3.1.0",
Expand Down
18 changes: 17 additions & 1 deletion src/renderer/components/server-modal-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export default class ServerModalForm extends Component {
onChecked: () => this.setState({ ssh: {} }),
onUnchecked: () => this.setState({ ssh: null }),
});

$(this.refs.ssl).checkbox({
onChecked: () => this.setState({ ssl: true }),
onUnchecked: () => this.setState({ ssl: false }),
});
}

componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -80,6 +85,7 @@ export default class ServerModalForm extends Component {
const server = {
name: state.name,
client: state.client,
ssl: state.ssl,
host: state.host && state.host.length ? state.host : null,
port: state.port,
socketPath: state.socketPath && state.socketPath.length ? state.socketPath : null,
Expand Down Expand Up @@ -148,7 +154,7 @@ export default class ServerModalForm extends Component {
<div className="content">
<form className="ui form">
<div className="fields">
<div className={`ten wide field ${this.highlightError('name')}`}>
<div className={`nine wide field ${this.highlightError('name')}`}>
<label>Name</label>
<input type="text"
name="name"
Expand All @@ -168,6 +174,16 @@ export default class ServerModalForm extends Component {
valueRenderer={this.renderClientItem}
value={this.state.client} />
</div>
<div className="one field" style={{paddingTop: '2em'}}>
<div className="ui toggle checkbox" ref="ssl">
<input type="checkbox"
name="ssl"
tabIndex="0"
className="hidden"
defaultChecked={this.state.ssl} />
<label>SSL</label>
</div>
</div>
</div>
<div className="field">
<label>Server Address</label>
Expand Down

0 comments on commit 82be996

Please sign in to comment.