* client: if 0.0.0.0 is selected, then redirect to the current IP

Closes #655
This commit is contained in:
Ildar Kamalov
2019-03-29 16:24:59 +03:00
parent 23ac1726b7
commit 0c973334be
6 changed files with 40 additions and 14 deletions

View File

@@ -3,7 +3,12 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import * as actionCreators from '../../actions/install';
import { INSTALL_FIRST_STEP, INSTALL_TOTAL_STEPS } from '../../helpers/constants';
import { getWebAddress } from '../../helpers/helpers';
import {
INSTALL_FIRST_STEP,
INSTALL_TOTAL_STEPS,
ALL_INTERFACES_IP,
} from '../../helpers/constants';
import Loading from '../../components/ui/Loading';
import Greeting from './Greeting';
@@ -29,7 +34,13 @@ class Setup extends Component {
this.props.setAllSettings(values);
};
openDashboard = (address) => {
openDashboard = (ip, port) => {
let address = getWebAddress(ip, port);
if (ip === ALL_INTERFACES_IP) {
address = getWebAddress(window.location.hostname, port);
}
window.location.replace(address);
}