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
3279cba9
Commit
3279cba9
authored
Jun 08, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Connect websocket client to server
parent
a9a97104
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
15 deletions
+16
-15
app.js
apps/remix-ide/src/app.js
+6
-7
remixDProvider.js
apps/remix-ide/src/app/files/remixDProvider.js
+6
-6
remixd-handle.js
apps/remix-ide/src/app/files/remixd-handle.js
+3
-2
remixd.js
apps/remix-ide/src/lib/remixd.js
+1
-0
No files found.
apps/remix-ide/src/app.js
View file @
3279cba9
...
...
@@ -143,18 +143,17 @@ class App {
registry
.
put
({
api
:
config
,
name
:
'config'
})
// load file system
self
.
appManager
=
new
RemixAppManager
({})
self
.
_components
.
filesProviders
=
{}
self
.
_components
.
filesProviders
[
'browser'
]
=
new
FileProvider
(
'browser'
)
registry
.
put
({
api
:
self
.
_components
.
filesProviders
[
'browser'
],
name
:
'fileproviders/browser'
})
//
var remixd = new Remixd(65520)
//
registry.put({api: remixd, name: 'remixd'})
//
remixd.event.register('system', (message) => {
//
if (message.error) toolTip(message.error)
//
})
var
remixd
=
new
Remixd
(
65520
)
registry
.
put
({
api
:
remixd
,
name
:
'remixd'
})
remixd
.
event
.
register
(
'system'
,
(
message
)
=>
{
if
(
message
.
error
)
toolTip
(
message
.
error
)
})
self
.
_components
.
filesProviders
[
'localhost'
]
=
new
RemixDProvider
(
self
.
appManager
)
self
.
_components
.
filesProviders
[
'localhost'
]
=
new
RemixDProvider
(
remixd
,
self
.
appManager
)
registry
.
put
({
api
:
self
.
_components
.
filesProviders
[
'localhost'
],
name
:
'fileproviders/localhost'
})
registry
.
put
({
api
:
self
.
_components
.
filesProviders
,
name
:
'fileproviders'
})
...
...
apps/remix-ide/src/app/files/remixDProvider.js
View file @
3279cba9
...
...
@@ -17,9 +17,9 @@ module.exports = class RemixDProvider {
var
remixdEvents
=
[
'connecting'
,
'connected'
,
'errored'
,
'closed'
]
remixdEvents
.
forEach
((
value
)
=>
{
//
remixd.event.register(value, (event) => {
//
this.event.trigger(value, [event])
//
})
remixd
.
event
.
register
(
value
,
(
event
)
=>
{
this
.
event
.
trigger
(
value
,
[
event
])
})
})
// remixd.event.register('notified', (data) => {
...
...
@@ -69,7 +69,7 @@ module.exports = class RemixDProvider {
})
}
// @TODO: refactor all `this._
appManager
.call(....)` uses into `this.remixd[api](...)`
// @TODO: refactor all `this._
remixd
.call(....)` uses into `this.remixd[api](...)`
// where `api = ...`:
// this.remixd.read(path, (error, content) => {})
// this.remixd.write(path, content, (error, result) => {})
...
...
@@ -182,7 +182,7 @@ module.exports = class RemixDProvider {
const
unprefixedpath
=
this
.
removePrefix
(
path
)
const
callId
=
await
this
.
_appManager
.
call
(
'remixd'
,
'isDirectory'
,
{
path
:
unprefixedpath
})
return
await
this
.
_
appManager
.
receiveResponse
(
callId
)
return
await
this
.
_
remixd
.
receiveResponse
(
callId
)
}
async
isFile
(
path
)
{
...
...
@@ -192,7 +192,7 @@ module.exports = class RemixDProvider {
}
}
function
remixapi
(
appManager
,
self
)
{
function
remixapi
(
remixd
,
self
)
{
const
read
=
(
path
,
callback
)
=>
{
path
=
''
+
(
path
||
''
)
path
=
pathtool
.
join
(
'./'
,
path
)
...
...
apps/remix-ide/src/app/files/remixd-handle.js
View file @
3279cba9
...
...
@@ -21,7 +21,7 @@ var css = csjs`
const
profile
=
{
name
:
'remixd'
,
url
:
'ws://127.0.0.1:65520'
,
methods
:
[
'folderIsReadOnly'
,
'resolveDirectory'
,
'get'
,
'exists'
,
'isFile'
],
methods
:
[
'folderIsReadOnly'
],
events
:
[],
description
:
'Using Remixd daemon, allow to access file system'
,
kind
:
'other'
,
...
...
@@ -43,7 +43,8 @@ export class RemixdHandle extends WebsocketPlugin {
})
}
activate
()
{
async
activate
()
{
await
super
.
activate
()
this
.
connectToLocalhost
()
}
...
...
apps/remix-ide/src/lib/remixd.js
View file @
3279cba9
...
...
@@ -106,6 +106,7 @@ class Remixd {
reject
(
error
)
return
}
console
.
log
(
'this.socket: '
,
this
.
socket
)
if
(
this
.
socket
&&
this
.
socket
.
readyState
===
this
.
socket
.
OPEN
)
{
var
data
=
this
.
format
(
service
,
fn
,
args
)
this
.
callbacks
[
data
.
id
]
=
callback
...
...
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