+
{this.props.children}
diff --git a/pages/Layout/style.css b/pages/Layout/style.css
index 7d7e6bc5..a3dcb7df 100644
--- a/pages/Layout/style.css
+++ b/pages/Layout/style.css
@@ -9,3 +9,15 @@
line-height: 46px;
text-decoration: none;
}
+
+.appContent {
+ display: block;
+ width: 100%;
+ overflow: auto;
+}
+
+.mainLayout {
+ min-width: 1024px;
+ width: 100%;
+ box-sizing: border-box;
+}
\ No newline at end of file
diff --git a/ui/middleware.js b/ui/middleware.js
index 4214a29f..830cb5e9 100644
--- a/ui/middleware.js
+++ b/ui/middleware.js
@@ -2,6 +2,17 @@ import thunk from 'redux-thunk';
import {isImmutable, fromJS} from 'immutable';
import {REMOVE_TAB} from '../containers/TabMenu/actionTypes';
+let clientIp = null;
+
+async function initClientIp() {
+ try {
+ const res = await fetch('https://api.ipify.org?format=json');
+ const data = await res.json();
+ clientIp = data.ip;
+ } catch (err) {
+ }
+}
+
/**
* Convert action.params to plain js when action.params is immutable
*/
@@ -22,8 +33,11 @@ const getCookies = () => (typeof document === 'undefined') ? {} : document.cooki
}, {});
export default (utMethod, history) => {
- const rpc = (store) => (next) => (action) => {
+ const rpc = (store) => (next) => async(action) => {
if (action.method) {
+ if (!clientIp) {
+ await initClientIp();
+ }
const cookies = getCookies();
const corsCookie = cookies['xsrf-token'];
let importMethodParams = {};
@@ -48,7 +62,7 @@ export default (utMethod, history) => {
if (corsCookie) {
methodParams = methodParams.mergeDeep(fromJS({$http: {headers: {'x-xsrf-token': corsCookie}}}));
}
-
+ methodParams = methodParams.mergeDeep(fromJS({$http: {headers: {'x-forwarded-for': clientIp}}}));
return utMethod(action.method, importMethodParams)(methodParams.toJS())
.then(result => {
action.result = result;