Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
import { chainName$, isLoading } from '@parity/light.js';
import light from '@parity/light.js-react';
import withHealth, { STATUS } from '../utils/withHealth';
chainName: chainName$
<div className='status'>
<span className={['status_icon', this.statusToClassName()].join(' ')}>
<svg viewBox='0 0 20 20'>
<circle fill='#DDD' cx='10' cy='10' r='10' />
</svg>
<span className='status_text'>{this.statusToFriendlyMessage()}</span>
/**
* Get className from the status icon from the status enum
*/
return '-syncing';
default:
return '-bad';
}
};
health: { status, payload },
chainName
const chainNameAppend = isLoading(chainName) ? '' : ` (${chainName})`;
Luke Schoen
committed
case STATUS.NO_NODE_CONNECTED_AND_NO_INTERNET:
return 'No internet. No nodes connected';
Luke Schoen
committed
return `Downloading Parity Ethereum... (${payload.percentage}%)`;
case STATUS.LAUNCHING:
return 'Launching the node...';
Luke Schoen
committed
case STATUS.NODE_CONNECTED_AND_NO_INTERNET:
return 'No internet. Connected to node.';
case STATUS.NO_CLOCK_SYNC:
return 'Clock of host not in sync';
case STATUS.NO_PEERS:
return 'No peer node connections';
payload && payload.percentage && payload.percentage.gt(0)
? ` (${payload.percentage.toFixed(0)}%)`
: ''
}${chainNameAppend}`;
Luke Schoen
committed
case STATUS.GOOD:
return `Synced${chainNameAppend}`;
default:
return JSON.stringify(payload); // Just in case payload is an object
}
};