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
7ea8d95e
Commit
7ea8d95e
authored
Jul 23, 2021
by
davidzagi93@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getting response from scriptRunnser
parent
6dbe5547
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
12 deletions
+36
-12
terminal.js
apps/remix-ide/src/app/panels/terminal.js
+12
-12
remix-ui-terminal.tsx
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
+24
-0
No files found.
apps/remix-ide/src/app/panels/terminal.js
View file @
7ea8d95e
...
@@ -92,18 +92,18 @@ class Terminal extends Plugin {
...
@@ -92,18 +92,18 @@ class Terminal extends Plugin {
}
}
onActivation
()
{
onActivation
()
{
this
.
on
(
'scriptRunner'
,
'log'
,
(
msg
)
=>
{
//
this.on('scriptRunner', 'log', (msg) => {
this
.
commands
.
log
.
apply
(
this
.
commands
,
msg
.
data
)
//
this.commands.log.apply(this.commands, msg.data)
})
//
})
this
.
on
(
'scriptRunner'
,
'info'
,
(
msg
)
=>
{
//
this.on('scriptRunner', 'info', (msg) => {
this
.
commands
.
info
.
apply
(
this
.
commands
,
msg
.
data
)
//
this.commands.info.apply(this.commands, msg.data)
})
//
})
this
.
on
(
'scriptRunner'
,
'warn'
,
(
msg
)
=>
{
//
this.on('scriptRunner', 'warn', (msg) => {
this
.
commands
.
warn
.
apply
(
this
.
commands
,
msg
.
data
)
//
this.commands.warn.apply(this.commands, msg.data)
})
//
})
this
.
on
(
'scriptRunner'
,
'error'
,
(
msg
)
=>
{
//
this.on('scriptRunner', 'error', (msg) => {
this
.
commands
.
error
.
apply
(
this
.
commands
,
msg
.
data
)
//
this.commands.error.apply(this.commands, msg.data)
})
//
})
this
.
renderComponent
()
this
.
renderComponent
()
}
}
...
...
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
View file @
7ea8d95e
...
@@ -217,6 +217,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -217,6 +217,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
// events
// events
useEffect
(()
=>
{
useEffect
(()
=>
{
registerLogScriptRunnerAction
(
props
.
thisState
,
'log'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerInfoScriptRunnerAction
(
props
.
thisState
,
'info'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerWarnScriptRunnerAction
(
props
.
thisState
,
'warn'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerErrorScriptRunnerAction
(
props
.
thisState
,
'error'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerCommandAction
(
'html'
,
_blocksRenderer
(
'html'
),
{
activate
:
true
},
dispatch
)
registerCommandAction
(
'html'
,
_blocksRenderer
(
'html'
),
{
activate
:
true
},
dispatch
)
registerCommandAction
(
'log'
,
_blocksRenderer
(
'log'
),
{
activate
:
true
},
dispatch
)
registerCommandAction
(
'log'
,
_blocksRenderer
(
'log'
),
{
activate
:
true
},
dispatch
)
registerCommandAction
(
'info'
,
_blocksRenderer
(
'info'
),
{
activate
:
true
},
dispatch
)
registerCommandAction
(
'info'
,
_blocksRenderer
(
'info'
),
{
activate
:
true
},
dispatch
)
...
@@ -234,6 +238,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -234,6 +238,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
filterFnAction
(
'warn'
,
basicFilter
,
filterDispatch
)
filterFnAction
(
'warn'
,
basicFilter
,
filterDispatch
)
filterFnAction
(
'error'
,
basicFilter
,
filterDispatch
)
filterFnAction
(
'error'
,
basicFilter
,
filterDispatch
)
filterFnAction
(
'script'
,
basicFilter
,
filterDispatch
)
filterFnAction
(
'script'
,
basicFilter
,
filterDispatch
)
registerLogScriptRunnerAction
(
props
.
thisState
,
'log'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerInfoScriptRunnerAction
(
props
.
thisState
,
'info'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerWarnScriptRunnerAction
(
props
.
thisState
,
'warn'
,
newstate
.
commands
,
scriptRunnerDispatch
)
registerErrorScriptRunnerAction
(
props
.
thisState
,
'error'
,
newstate
.
commands
,
scriptRunnerDispatch
)
// console.log({ htmlresullt }, { logresult })
// console.log({ htmlresullt }, { logresult })
// dispatch({ type: 'html', payload: { commands: htmlresullt.commands } })
// dispatch({ type: 'html', payload: { commands: htmlresullt.commands } })
// dispatch({ type: 'log', payload: { _commands: logresult._commands } })
// dispatch({ type: 'log', payload: { _commands: logresult._commands } })
...
@@ -398,10 +406,26 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -398,10 +406,26 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
/* end of mouse event */
/* end of mouse event */
useEffect
(()
=>
{
useEffect
(()
=>
{
// document.addEventListener('mousemove', changeBg)
// function changeBg () {
// document.getElementById('dragId').style.backgroundColor = 'skyblue'
// }
// document.addEventListener('mouseup', changeBg2)
// function changeBg2 () {
// document.getElementById('dragId').style.backgroundColor = ''
// }
document
.
addEventListener
(
'mousemove'
,
onMouseMove
)
document
.
addEventListener
(
'mousemove'
,
onMouseMove
)
document
.
addEventListener
(
'mouseup'
,
onMouseUp
)
document
.
addEventListener
(
'mouseup'
,
onMouseUp
)
return
()
=>
{
return
()
=>
{
// document.addEventListener('mousemove', changeBg)
// function changeBg () {
// document.getElementById('dragId').style.backgroundColor = 'skyblue'
// }
// document.addEventListener('mouseup', changeBg2)
// function changeBg2 () {
// document.getElementById('dragId').style.backgroundColor = ''
// }
document
.
removeEventListener
(
'mousemove'
,
onMouseMove
)
document
.
removeEventListener
(
'mousemove'
,
onMouseMove
)
document
.
removeEventListener
(
'mouseup'
,
onMouseUp
)
document
.
removeEventListener
(
'mouseup'
,
onMouseUp
)
}
}
...
...
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