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
3290e6fc
Commit
3290e6fc
authored
Oct 27, 2015
by
d11e9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle endpoint updating and errors
parent
48a5fccb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
universal-dapp.js
assets/js/universal-dapp.js
+3
-2
index.html
index.html
+5
-2
No files found.
assets/js/universal-dapp.js
View file @
3290e6fc
...
@@ -22,7 +22,7 @@ function UniversalDApp (contracts, options) {
...
@@ -22,7 +22,7 @@ function UniversalDApp (contracts, options) {
}
else
{
}
else
{
var
host
=
options
.
host
||
"localhost"
;
var
host
=
options
.
host
||
"localhost"
;
var
port
=
options
.
port
||
"8545"
;
var
port
=
options
.
port
||
"8545"
;
var
rpc_url
=
options
.
web3endpoint
||
(
'http://'
+
host
+
':'
+
port
);
var
rpc_url
=
options
.
getWeb3endpoint
?
options
.
getWeb3endpoint
()
:
(
'http://'
+
host
+
':'
+
port
);
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
rpc_url
)
);
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
rpc_url
)
);
}
}
...
@@ -296,7 +296,8 @@ UniversalDApp.prototype.getCallButton = function(args) {
...
@@ -296,7 +296,8 @@ UniversalDApp.prototype.getCallButton = function(args) {
}
}
tryTillResponse
(
result
,
function
(
err
,
result
)
{
tryTillResponse
(
result
,
function
(
err
,
result
)
{
if
(
isConstructor
)
{
if
(
err
)
replaceOutput
(
$result
,
$
(
'<span/>'
).
text
(
err
).
addClass
(
'error'
));
else
if
(
isConstructor
)
{
$result
.
html
(
''
);
$result
.
html
(
''
);
args
.
appendFunctions
(
result
.
contractAddress
);
args
.
appendFunctions
(
result
.
contractAddress
);
}
else
{
}
else
{
...
...
index.html
View file @
3290e6fc
...
@@ -234,7 +234,11 @@
...
@@ -234,7 +234,11 @@
$vmToggle
.
on
(
'change'
,
executionContextChange
);
$vmToggle
.
on
(
'change'
,
executionContextChange
);
$web3Toggle
.
on
(
'change'
,
executionContextChange
);
$web3Toggle
.
on
(
'change'
,
executionContextChange
);
$web3endpoint
.
on
(
'change'
,
compile
);
$web3endpoint
.
on
(
'change'
,
function
(){
var
endpoint
=
$
(
'#web3Endpoint'
).
val
();
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
endpoint
)
);
compile
();
}
);
function
executionContextChange
(
ev
)
{
function
executionContextChange
(
ev
)
{
if
(
ev
.
target
.
value
==
'web3'
&&
!
confirm
(
"Are you sure you want to connect to a local ethereum node?"
)
)
{
if
(
ev
.
target
.
value
==
'web3'
&&
!
confirm
(
"Are you sure you want to connect to a local ethereum node?"
)
)
{
...
@@ -759,7 +763,6 @@
...
@@ -759,7 +763,6 @@
removable
:
false
,
removable
:
false
,
getAddress
:
function
(){
return
$
(
'#txorigin'
).
val
();
},
getAddress
:
function
(){
return
$
(
'#txorigin'
).
val
();
},
removable_instances
:
true
,
removable_instances
:
true
,
web3endpoint
:
$
(
'#web3Endpoint'
).
val
(),
renderOutputModifier
:
function
(
contractName
,
$contractOutput
)
{
renderOutputModifier
:
function
(
contractName
,
$contractOutput
)
{
var
contract
=
data
.
contracts
[
contractName
];
var
contract
=
data
.
contracts
[
contractName
];
return
$contractOutput
return
$contractOutput
...
...
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