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
50c762d3
Commit
50c762d3
authored
Sep 07, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move back the listen on network link logic to editor-panel
parent
b108fbbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
86 deletions
+82
-86
app.js
src/app.js
+77
-83
editor-panel.js
src/app/panels/editor-panel.js
+5
-3
No files found.
src/app.js
View file @
50c762d3
...
@@ -168,13 +168,89 @@ module.exports = App
...
@@ -168,13 +168,89 @@ module.exports = App
function
run
()
{
function
run
()
{
var
self
=
this
var
self
=
this
// ----------------- UniversalDApp -----------------
var
transactionContextAPI
=
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
},
getValue
:
(
cb
)
=>
{
try
{
var
comp
=
$
(
'#value'
).
val
().
split
(
' '
)
cb
(
null
,
executionContext
.
web3
().
toWei
(
comp
[
0
],
comp
.
slice
(
1
).
join
(
' '
)))
}
catch
(
e
)
{
cb
(
e
)
}
},
getGasLimit
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#gasLimit'
).
val
())
}
}
var
udapp
=
new
UniversalDApp
({
api
:
{
logMessage
:
(
msg
)
=>
{
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
}
},
opt
:
{
removable
:
false
,
removable_instances
:
true
}
})
udapp
.
reset
({},
transactionContextAPI
)
udapp
.
event
.
register
(
'debugRequested'
,
this
,
function
(
txResult
)
{
startdebugging
(
txResult
.
transactionHash
)
})
// ----------------- Tx listener -----------------
var
transactionReceiptResolver
=
{
_transactionReceipts
:
{},
resolve
:
function
(
tx
,
cb
)
{
if
(
this
.
_transactionReceipts
[
tx
.
hash
])
{
return
cb
(
null
,
this
.
_transactionReceipts
[
tx
.
hash
])
}
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
tx
.
hash
,
(
error
,
receipt
)
=>
{
if
(
!
error
)
{
this
.
_transactionReceipts
[
tx
.
hash
]
=
receipt
cb
(
null
,
receipt
)
}
else
{
cb
(
error
)
}
})
}
}
var
compiledContracts
=
function
()
{
if
(
compiler
.
lastCompilationResult
&&
compiler
.
lastCompilationResult
.
data
)
{
return
compiler
.
lastCompilationResult
.
data
.
contracts
}
return
null
}
var
txlistener
=
new
Txlistener
({
api
:
{
contracts
:
compiledContracts
,
resolveReceipt
:
function
(
tx
,
cb
)
{
transactionReceiptResolver
.
resolve
(
tx
,
cb
)
}
},
event
:
{
udapp
:
udapp
.
event
}})
var
eventsDecoder
=
new
EventsDecoder
({
api
:
{
resolveReceipt
:
function
(
tx
,
cb
)
{
transactionReceiptResolver
.
resolve
(
tx
,
cb
)
}
}
})
txlistener
.
startListening
()
// ----------------- editor ----------------------------
// ----------------- editor ----------------------------
this
.
_components
.
editor
=
new
Editor
({})
// @TODO: put into editorpanel
this
.
_components
.
editor
=
new
Editor
({})
// @TODO: put into editorpanel
// ----------------- editor panel ----------------------
// ----------------- editor panel ----------------------
this
.
_components
.
editorpanel
=
new
EditorPanel
({
this
.
_components
.
editorpanel
=
new
EditorPanel
({
api
:
{
api
:
{
editor
:
self
.
_components
.
editor
,
editor
:
self
.
_components
.
editor
,
config
:
self
.
_api
.
config
config
:
self
.
_api
.
config
,
txListener
:
txlistener
}
}
})
})
this
.
_components
.
editorpanel
.
event
.
register
(
'resize'
,
direction
=>
self
.
_adjustLayout
(
direction
))
this
.
_components
.
editorpanel
.
event
.
register
(
'resize'
,
direction
=>
self
.
_adjustLayout
(
direction
))
...
@@ -336,37 +412,6 @@ function run () {
...
@@ -336,37 +412,6 @@ function run () {
}
}
var
staticanalysis
=
new
StaticAnalysis
(
staticAnalysisAPI
,
compiler
.
event
)
var
staticanalysis
=
new
StaticAnalysis
(
staticAnalysisAPI
,
compiler
.
event
)
// ----------------- UniversalDApp -----------------
var
transactionContextAPI
=
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
},
getValue
:
(
cb
)
=>
{
try
{
var
comp
=
$
(
'#value'
).
val
().
split
(
' '
)
cb
(
null
,
executionContext
.
web3
().
toWei
(
comp
[
0
],
comp
.
slice
(
1
).
join
(
' '
)))
}
catch
(
e
)
{
cb
(
e
)
}
},
getGasLimit
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#gasLimit'
).
val
())
}
}
var
udapp
=
new
UniversalDApp
({
api
:
{
logMessage
:
(
msg
)
=>
{
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
}
},
opt
:
{
removable
:
false
,
removable_instances
:
true
}
})
udapp
.
reset
({},
transactionContextAPI
)
udapp
.
event
.
register
(
'debugRequested'
,
this
,
function
(
txResult
)
{
startdebugging
(
txResult
.
transactionHash
)
})
// ---------------- Righthand-panel --------------------
// ---------------- Righthand-panel --------------------
var
rhpAPI
=
{
var
rhpAPI
=
{
config
:
config
,
config
:
config
,
...
@@ -494,57 +539,6 @@ function run () {
...
@@ -494,57 +539,6 @@ function run () {
transactionDebugger
.
addProvider
(
'web3'
,
executionContext
.
web3
())
transactionDebugger
.
addProvider
(
'web3'
,
executionContext
.
web3
())
transactionDebugger
.
switchProvider
(
executionContext
.
getProvider
())
transactionDebugger
.
switchProvider
(
executionContext
.
getProvider
())
// ----------------- Tx listener -----------------
var
transactionReceiptResolver
=
{
_transactionReceipts
:
{},
resolve
:
function
(
tx
,
cb
)
{
if
(
this
.
_transactionReceipts
[
tx
.
hash
])
{
return
cb
(
null
,
this
.
_transactionReceipts
[
tx
.
hash
])
}
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
tx
.
hash
,
(
error
,
receipt
)
=>
{
if
(
!
error
)
{
this
.
_transactionReceipts
[
tx
.
hash
]
=
receipt
cb
(
null
,
receipt
)
}
else
{
cb
(
error
)
}
})
}
}
var
compiledContracts
=
function
()
{
if
(
compiler
.
lastCompilationResult
&&
compiler
.
lastCompilationResult
.
data
)
{
return
compiler
.
lastCompilationResult
.
data
.
contracts
}
return
null
}
var
txlistener
=
new
Txlistener
({
api
:
{
contracts
:
compiledContracts
,
resolveReceipt
:
function
(
tx
,
cb
)
{
transactionReceiptResolver
.
resolve
(
tx
,
cb
)
}
},
event
:
{
udapp
:
udapp
.
event
}})
self
.
_components
.
editorpanel
.
terminal
().
event
.
register
(
'listenOnNetWork'
,
(
listenOnNetWork
)
=>
{
txlistener
.
setListenOnNetwork
(
listenOnNetWork
)
})
var
eventsDecoder
=
new
EventsDecoder
({
api
:
{
resolveReceipt
:
function
(
tx
,
cb
)
{
transactionReceiptResolver
.
resolve
(
tx
,
cb
)
}
}
})
txlistener
.
startListening
()
var
txLogger
=
new
TxLogger
({
var
txLogger
=
new
TxLogger
({
api
:
{
api
:
{
editorpanel
:
self
.
_components
.
editorpanel
,
editorpanel
:
self
.
_components
.
editorpanel
,
...
...
src/app/panels/editor-panel.js
View file @
50c762d3
...
@@ -168,6 +168,11 @@ class EditorPanel {
...
@@ -168,6 +168,11 @@ class EditorPanel {
})
})
}
}
self
.
_components
.
terminal
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'top'
,
delta
))
self
.
_components
.
terminal
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'top'
,
delta
))
if
(
self
.
_api
.
txListener
)
{
self
.
_components
.
terminal
.
event
.
register
(
'listenOnNetWork'
,
(
listenOnNetWork
)
=>
{
self
.
_api
.
txListener
.
setListenOnNetwork
(
listenOnNetWork
)
})
}
}
}
_adjustLayout
(
direction
,
delta
)
{
_adjustLayout
(
direction
,
delta
)
{
var
limitUp
=
36
var
limitUp
=
36
...
@@ -231,9 +236,6 @@ class EditorPanel {
...
@@ -231,9 +236,6 @@ class EditorPanel {
var
self
=
this
var
self
=
this
return
self
.
_components
.
terminal
.
registerCommand
(
name
,
command
)
return
self
.
_components
.
terminal
.
registerCommand
(
name
,
command
)
}
}
terminal
()
{
return
this
.
_components
.
terminal
}
_renderTabsbar
()
{
_renderTabsbar
()
{
var
self
=
this
var
self
=
this
if
(
self
.
_view
.
tabsbar
)
return
self
.
_view
.
tabsbar
if
(
self
.
_view
.
tabsbar
)
return
self
.
_view
.
tabsbar
...
...
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