]}
items={[
{label: 'ID', value: item.id},
- {label: ( lang === 'zh' ? '别名' : 'Alias' ), value: item.alias},
- {label: 'Alias', value: item.alias, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/alias`},
- {label: 'Definition', value: item.definition},
- {label: 'xpubs', value: (item.xpubs || []).length},
- {label: 'Quorum', value: item.quorum},
++ {label: ( lang === 'zh' ? '别名' : 'Alias' ), value: item.alias, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/alias`},
+ {label: ( lang === 'zh' ? '定义' : 'Definition'), value: item.definition},
+ {label: ( lang === 'zh' ? '扩展公钥数' : 'xpubs' ), value: (item.xpubs || []).length},
+ {label: ( lang === 'zh' ? '签名数' : 'Quorum' ), value: item.quorum},
]}
lang={lang}
/>
const type = 'key'
class KeyList extends BaseList.ItemList {
- constructor(props) {
- super(props)
- const client = chainClient()
-
- this.setStat = () => client.mockHsm.keys.progress().then(({data}) => {
- store.dispatch({
- type: 'RECEIVED_IMPORT_STATUS',
- data
- })
-
- const isImporting = item => {
- return typeof item.percent === 'number' && item.percent < 100
- }
-
- if ((data || []).filter(isImporting).length > 0) {
- window.setTimeout(this.setStat, 5000)
- }
- })
-
- this.setStat()
- }
}
+const mapStateToProps = (state) => {
+ let titles
+ if(state.core.lang === 'zh'){
+ titles = ['别名','扩展公钥']
+ }else{
+ titles = ['Alias', 'xpub']
+ }
+
+ return {
+ ...BaseList.mapStateToProps(type, ListItem, {
+ skipQuery: true,
+ label: 'Keys',
+ wrapperComponent: TableList,
+ wrapperProps: {
+ titles: titles
+ }
+ })(state)
+ }
+}
+
export default BaseList.connect(
- BaseList.mapStateToProps(type, ListItem, {
- skipQuery: true,
- label: 'Keys',
- wrapperComponent: TableList,
- wrapperProps: {
- titles: ['Alias', 'xpub']
- }
- }),
+ mapStateToProps,
BaseList.mapDispatchToProps(type),
KeyList
)
title={lang === 'zh' ? '详情' : 'Details'}
items={[
{label: 'ID', value: item.id},
- {label: 'Timestamp', value: moment.unix(item.timestamp).format()},
- {label: 'Block ID', value: item.blockId},
- {label: 'Block Height', value: (item.blockHeight + `(${confirmation} confirmation${confirmation > 1 ? 's' : ''})`)},
- {label: 'Position', value: item.position},
+ {label: (lang === 'zh' ? '时间戳' : 'Timestamp'), value: moment.unix(item.timestamp).format()},
+ {label: (lang === 'zh' ? '区块ID' : 'Block ID'), value: item.blockId},
- {label: (lang === 'zh' ? '区块高度': 'Block Height'), value: (item.blockHeight + `(${this.props.highestBlock - item.blockHeight + 1} confirmations)`)},
++ {label: (lang === 'zh' ? '区块高度': 'Block Height'), value: (item.blockHeight + `(${confirmation} confirmation${confirmation > 1 ? 's' : ''})`)},
+ {label: (lang === 'zh' ? '位置' : 'Position'), value: item.position},
{label: 'Gas', value: gas},
]}
/>
<tbody>
{items.map((item, index) =>
<tr key={index}>
- <td className={styles.colAction}>{item.type}</td>
- <td className={styles.colLabel}>{ lang === 'zh' ? '数量' : 'amount' }</td>
+ {
+ !isCoinbase && <td className={styles.colAction}>{item.type}</td>
+ }
+ {
+ isCoinbase && <td className={styles.colAction}>
+ Coinbase
+ {!mature && <small className={styles.immature}>immature</small>}
+ </td>
+ }
- <td className={styles.colLabel}>amount</td>
++ <td className={styles.colLabel}>{ lang === 'zh' ? '数量' : 'amount' }t</td>
<td className={styles.colAmount}>
<code className={styles.amount}>{item.amount}</code>
</td>