Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
5657f0d4
Unverified
Commit
5657f0d4
authored
Nov 13, 2019
by
Rob
Committed by
GitHub
Nov 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2434 from ethereum/gpr
web3 provider connection dialog improvement
parents
b3da51d8
7d481686
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
settings.js
src/app/tabs/runTab/settings.js
+19
-8
No files found.
src/app/tabs/runTab/settings.js
View file @
5657f0d4
...
...
@@ -178,14 +178,11 @@ class SettingsUI {
selectExEnv
.
addEventListener
(
'change'
,
(
event
)
=>
{
let
context
=
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
this
.
settings
.
changeExecutionContext
(
context
,
()
=>
{
const
modal
=
modalDialogCustom
.
confirm
(
'External node request'
,
'Are you sure you want to connect to an ethereum node?'
,
()
=>
{
modal
.
hide
()
modalDialogCustom
.
prompt
(
'External node request'
,
'Web3 Provider Endpoint'
,
'http://localhost:8545'
,
(
target
)
=>
{
this
.
settings
.
setProviderFromEndpoint
(
target
,
context
,
(
alertMsg
)
=>
{
if
(
alertMsg
)
addTooltip
(
alertMsg
)
this
.
setFinalContext
()
})
},
this
.
setFinalContext
.
bind
(
this
))
modalDialogCustom
.
prompt
(
'External node request'
,
this
.
web3ProviderDialogBody
(),
'http://localhost:8545'
,
(
target
)
=>
{
this
.
settings
.
setProviderFromEndpoint
(
target
,
context
,
(
alertMsg
)
=>
{
if
(
alertMsg
)
addTooltip
(
alertMsg
)
this
.
setFinalContext
()
})
},
this
.
setFinalContext
.
bind
(
this
))
},
(
alertMsg
)
=>
{
addTooltip
(
alertMsg
)
...
...
@@ -195,6 +192,20 @@ class SettingsUI {
selectExEnv
.
value
=
this
.
settings
.
getProvider
()
}
web3ProviderDialogBody
()
{
return
yo
`
<div class="">
<span>Note: If you are using </span>
<a href="https://geth.ethereum.org/docs/rpc/server" target="blank">Geth</a>
<span>, please configure it to allow requests from Remix:</span>
<br>
<b>geth --rpc --rpccorsdomain https://remix.ethereum.org</b>
<br><br>
<span>Web3 Provider Endpoint</span>
</div>
`
}
setFinalContext
()
{
// set the final context. Cause it is possible that this is not the one we've originaly selected
this
.
selectExEnv
.
value
=
this
.
settings
.
getProvider
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment