Add option to hex encode the source IP of a client and use it as the ident, closes #24
This commit is contained in:
parent
e2c6cedc27
commit
c975c5d120
17 changed files with 163 additions and 41 deletions
|
@ -29,14 +29,20 @@ class Connect extends Component {
|
|||
this.setState({ showOptionals: !this.state.showOptionals });
|
||||
};
|
||||
|
||||
renderOptionals = () => (
|
||||
<div>
|
||||
<TextInput name="username" placeholder="Username" />
|
||||
{this.renderError('username')}
|
||||
<TextInput type="password" name="password" placeholder="Password" />
|
||||
<TextInput name="realname" placeholder="Realname" />
|
||||
</div>
|
||||
);
|
||||
renderOptionals = () => {
|
||||
const { hexIP } = this.props;
|
||||
|
||||
return (
|
||||
<div>
|
||||
{!hexIP && [
|
||||
<TextInput name="username" placeholder="Username" />,
|
||||
this.renderError('username')
|
||||
]}
|
||||
<TextInput type="password" name="password" placeholder="Password" />
|
||||
<TextInput name="realname" placeholder="Realname" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
renderError = name => {
|
||||
const { touched, errors } = this.props;
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import Connect from 'components/pages/Connect';
|
||||
import { getConnectDefaults } from 'state/app';
|
||||
import { getConnectDefaults, getApp } from 'state/app';
|
||||
import { join } from 'state/channels';
|
||||
import { connect as connectServer } from 'state/servers';
|
||||
import { select } from 'state/tab';
|
||||
|
||||
const mapState = createStructuredSelector({
|
||||
defaults: getConnectDefaults
|
||||
defaults: getConnectDefaults,
|
||||
hexIP: state => getApp(state).hexIP
|
||||
});
|
||||
|
||||
const mapDispatch = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Cookie from 'js-cookie';
|
||||
import { socket as socketActions } from 'state/actions';
|
||||
import { getWrapWidth, setConnectDefaults } from 'state/app';
|
||||
import { getWrapWidth, setConnectDefaults, appSet } from 'state/app';
|
||||
import { addMessages } from 'state/messages';
|
||||
import { select, updateSelection } from 'state/tab';
|
||||
import { find } from 'utils';
|
||||
|
@ -11,6 +11,7 @@ export default function initialState({ store }) {
|
|||
const env = JSON.parse(document.getElementById('env').innerHTML);
|
||||
|
||||
store.dispatch(setConnectDefaults(env.defaults));
|
||||
store.dispatch(appSet('hexIP', env.hexIP));
|
||||
|
||||
if (env.servers) {
|
||||
store.dispatch({
|
||||
|
|
|
@ -21,7 +21,8 @@ const initialState = {
|
|||
password: false,
|
||||
readonly: false,
|
||||
showDetails: false
|
||||
}
|
||||
},
|
||||
hexIP: false
|
||||
};
|
||||
|
||||
export default createReducer(initialState, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue