|
|
@ -501,6 +501,12 @@ App.prototype.renderCustomOption = function (provider) { |
|
|
|
const { rpcTarget, type } = provider |
|
|
|
const { rpcTarget, type } = provider |
|
|
|
if (type !== 'rpc') return null |
|
|
|
if (type !== 'rpc') return null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Concatenate long URLs
|
|
|
|
|
|
|
|
let label = rpcTarget |
|
|
|
|
|
|
|
if (rpcTarget.length > 31) { |
|
|
|
|
|
|
|
label = label.substr(0, 34) + '...' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (rpcTarget) { |
|
|
|
switch (rpcTarget) { |
|
|
|
|
|
|
|
|
|
|
|
case 'http://localhost:8545': |
|
|
|
case 'http://localhost:8545': |
|
|
@ -508,7 +514,8 @@ App.prototype.renderCustomOption = function (provider) { |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
return h(DropMenuItem, { |
|
|
|
return h(DropMenuItem, { |
|
|
|
label: `${rpcTarget}`, |
|
|
|
label, |
|
|
|
|
|
|
|
key: rpcTarget, |
|
|
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }), |
|
|
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }), |
|
|
|
icon: h('i.fa.fa-question-circle.fa-lg'), |
|
|
|
icon: h('i.fa.fa-question-circle.fa-lg'), |
|
|
|
activeNetworkRender: 'custom', |
|
|
|
activeNetworkRender: 'custom', |
|
|
@ -526,6 +533,7 @@ App.prototype.renderCommonRpc = function (rpcList, provider) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return h(DropMenuItem, { |
|
|
|
return h(DropMenuItem, { |
|
|
|
label: rpc, |
|
|
|
label: rpc, |
|
|
|
|
|
|
|
key: rpc, |
|
|
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }), |
|
|
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }), |
|
|
|
action: () => props.dispatch(actions.setRpcTarget(rpc)), |
|
|
|
action: () => props.dispatch(actions.setRpcTarget(rpc)), |
|
|
|
icon: h('i.fa.fa-question-circle.fa-lg'), |
|
|
|
icon: h('i.fa.fa-question-circle.fa-lg'), |
|
|
|