[beta] Backports (#6163)
* Light client improvements (#6156) * no seal checking * import command and --no-seal-check for light client * fix eth_call * tweak registry dapps lookup * ignore failed requests to non-server peers * Fix connecting to wildcard addresses. (#6167) * Don't display an overlay in case the time sync check fails. (#6164) * Small improvements to time estimation. * Temporarily disable NTP time check by default.
This commit is contained in:
@@ -228,9 +228,10 @@ export default class Status {
|
||||
|
||||
_overallStatus = (health) => {
|
||||
const all = [health.peers, health.sync, health.time].filter(x => x);
|
||||
const allNoTime = [health.peers, health.sync].filter(x => x);
|
||||
const statuses = all.map(x => x.status);
|
||||
const bad = statuses.find(x => x === STATUS_BAD);
|
||||
const needsAttention = statuses.find(x => x === STATUS_WARN);
|
||||
const needsAttention = allNoTime.map(x => x.status).find(x => x === STATUS_WARN);
|
||||
const message = all.map(x => x.message).filter(x => x);
|
||||
|
||||
if (all.length) {
|
||||
|
||||
@@ -35,7 +35,7 @@ const initialState = {
|
||||
status: DEFAULT_STATUS
|
||||
},
|
||||
overall: {
|
||||
isReady: false,
|
||||
isNotReady: true,
|
||||
status: DEFAULT_STATUS,
|
||||
message: []
|
||||
}
|
||||
|
||||
@@ -101,13 +101,7 @@ export default class SecureApi extends Api {
|
||||
return 'dapps.parity';
|
||||
}
|
||||
|
||||
const { host } = this._dappsAddress;
|
||||
|
||||
if (!host || host === '0.0.0.0') {
|
||||
return window.location.hostname;
|
||||
}
|
||||
|
||||
return host;
|
||||
return this._dappsAddress.host;
|
||||
}
|
||||
|
||||
get isConnecting () {
|
||||
@@ -173,6 +167,25 @@ export default class SecureApi extends Api {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves a wildcard address to `window.location.hostname`;
|
||||
*/
|
||||
_resolveHost (url) {
|
||||
const parts = url ? url.split(':') : [];
|
||||
const port = parts[1];
|
||||
let host = parts[0];
|
||||
|
||||
if (!host) {
|
||||
return host;
|
||||
}
|
||||
|
||||
if (host === '0.0.0.0') {
|
||||
host = window.location.hostname;
|
||||
}
|
||||
|
||||
return port ? `${host}:${port}` : host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Promise that gets resolved with
|
||||
* a boolean: `true` if the node is up, `false`
|
||||
@@ -316,8 +329,8 @@ export default class SecureApi extends Api {
|
||||
this._uiApi.parity.wsUrl()
|
||||
])
|
||||
.then(([dappsUrl, wsUrl]) => {
|
||||
this._dappsUrl = dappsUrl;
|
||||
this._wsUrl = wsUrl;
|
||||
this._dappsUrl = this._resolveHost(dappsUrl);
|
||||
this._wsUrl = this._resolveHost(wsUrl);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class SyncWarning extends Component {
|
||||
|
||||
function mapStateToProps (state) {
|
||||
const { health } = state.nodeStatus;
|
||||
const isNotAvailableYet = health.overall.isReady;
|
||||
const isNotAvailableYet = health.overall.isNotReady;
|
||||
const isOk = isNotAvailableYet || health.overall.status === 'ok';
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user