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
12c4ef65
Commit
12c4ef65
authored
Jun 09, 2020
by
ioedeveloper
Committed by
yann300
Jul 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link remixd websocket plugin apis
parent
422efde7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
20 deletions
+11
-20
remixDProvider.js
src/app/files/remixDProvider.js
+8
-14
remixd-handle.js
src/app/files/remixd-handle.js
+3
-3
file-panel.js
src/app/panels/file-panel.js
+0
-3
No files found.
src/app/files/remixDProvider.js
View file @
12c4ef65
...
@@ -59,12 +59,10 @@ module.exports = class RemixDProvider {
...
@@ -59,12 +59,10 @@ module.exports = class RemixDProvider {
cb
()
cb
()
}
}
async
init
(
cb
)
{
init
(
cb
)
{
await
this
.
_appManager
.
call
(
'remixd'
,
'sharedFolder'
,
{
currentSharedFolder
})
this
.
_appManager
.
call
(
'remixd'
,
'folderIsReadOnly'
,
{}).
then
((
result
)
=>
{
this
.
_appManager
.
call
(
'remixd'
,
'folderIsReadOnly'
,
{}).
then
((
result
)
=>
{
this
.
_isReady
=
true
this
.
_isReady
=
true
this
.
_readOnlyMode
=
result
this
.
_readOnlyMode
=
result
console
.
log
(
'this._readOnlyMode: '
,
this
.
_readOnlyMode
)
cb
&&
cb
()
cb
&&
cb
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
cb
&&
cb
(
error
)
cb
&&
cb
(
error
)
...
@@ -81,13 +79,13 @@ module.exports = class RemixDProvider {
...
@@ -81,13 +79,13 @@ module.exports = class RemixDProvider {
//
//
// this.remixd.exists(path, (error, isValid) => {})
// this.remixd.exists(path, (error, isValid) => {})
async
exists
(
path
,
cb
)
{
exists
(
path
,
cb
)
{
const
unprefixedpath
=
this
.
removePrefix
(
path
)
const
unprefixedpath
=
this
.
removePrefix
(
path
)
this
.
_appManager
.
call
(
'remixd'
,
'exists'
,
{
path
:
unprefixedpath
}).
then
((
result
)
=>
{
return
this
.
_appManager
.
call
(
'remixd'
,
'exists'
,
{
path
:
unprefixedpath
}).
then
((
result
)
=>
{
return
cb
&&
cb
(
null
,
result
)
return
cb
(
null
,
result
)
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
return
cb
&&
cb
(
error
)
return
cb
(
error
)
})
})
}
}
...
@@ -101,16 +99,14 @@ module.exports = class RemixDProvider {
...
@@ -101,16 +99,14 @@ module.exports = class RemixDProvider {
get
(
path
,
cb
)
{
get
(
path
,
cb
)
{
var
unprefixedpath
=
this
.
removePrefix
(
path
)
var
unprefixedpath
=
this
.
removePrefix
(
path
)
this
.
_appManager
.
call
(
'remixd'
,
'get'
,
{
path
:
unprefixedpath
},
(
error
,
file
)
=>
{
this
.
_appManager
.
call
(
'remixd'
,
'get'
,
{
path
:
unprefixedpath
}).
then
((
file
)
=>
{
if
(
!
error
)
{
this
.
filesContent
[
path
]
=
file
.
content
this
.
filesContent
[
path
]
=
file
.
content
if
(
file
.
readonly
)
{
this
.
_readOnlyFiles
[
path
]
=
1
}
if
(
file
.
readonly
)
{
this
.
_readOnlyFiles
[
path
]
=
1
}
cb
(
error
,
file
.
content
)
cb
(
error
,
file
.
content
)
}
else
{
}).
catch
((
error
)
=>
{
// display the last known content.
// display the last known content.
// TODO should perhaps better warn the user that the file is not synced.
// TODO should perhaps better warn the user that the file is not synced.
cb
(
null
,
this
.
filesContent
[
path
])
cb
(
null
,
this
.
filesContent
[
path
])
}
})
})
}
}
...
@@ -190,9 +186,8 @@ module.exports = class RemixDProvider {
...
@@ -190,9 +186,8 @@ module.exports = class RemixDProvider {
async
isFile
(
path
)
{
async
isFile
(
path
)
{
const
unprefixedpath
=
this
.
removePrefix
(
path
)
const
unprefixedpath
=
this
.
removePrefix
(
path
)
const
callId
=
await
this
.
_appManager
.
call
(
'remixd'
,
'isFile'
,
{
path
:
unprefixedpath
})
return
await
this
.
_
remixd
.
receiveResponse
(
callId
)
return
await
this
.
_
appManager
.
call
(
'remixd'
,
'isFile'
,
{
path
:
unprefixedpath
}
)
}
}
}
}
...
@@ -221,7 +216,6 @@ function remixapi (appManager, self) {
...
@@ -221,7 +216,6 @@ function remixapi (appManager, self) {
path
=
''
+
(
path
||
''
)
path
=
''
+
(
path
||
''
)
path
=
pathtool
.
join
(
'./'
,
path
)
path
=
pathtool
.
join
(
'./'
,
path
)
appManager
.
call
(
'remixd'
,
'resolveDirectory'
,
{
path
}).
then
((
filesList
)
=>
{
appManager
.
call
(
'remixd'
,
'resolveDirectory'
,
{
path
}).
then
((
filesList
)
=>
{
console
.
log
(
'filesList: '
,
filesList
)
callback
(
null
,
filesList
)
callback
(
null
,
filesList
)
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
callback
(
error
)
callback
(
error
)
...
...
src/app/files/remixd-handle.js
View file @
12c4ef65
...
@@ -21,7 +21,7 @@ var css = csjs`
...
@@ -21,7 +21,7 @@ var css = csjs`
const
profile
=
{
const
profile
=
{
name
:
'remixd'
,
name
:
'remixd'
,
url
:
'ws://127.0.0.1:65520'
,
url
:
'ws://127.0.0.1:65520'
,
methods
:
[
'folderIsReadOnly'
,
'resolveDirectory'
],
methods
:
[
'folderIsReadOnly'
,
'resolveDirectory'
,
'get'
,
'exists'
,
'isFile'
],
events
:
[],
events
:
[],
description
:
'Using Remixd daemon, allow to access file system'
,
description
:
'Using Remixd daemon, allow to access file system'
,
kind
:
'other'
,
kind
:
'other'
,
...
@@ -82,7 +82,7 @@ export class RemixdHandle extends WebsocketPlugin {
...
@@ -82,7 +82,7 @@ export class RemixdHandle extends WebsocketPlugin {
fn
:
()
=>
{
fn
:
()
=>
{
try
{
try
{
super
.
activate
()
super
.
activate
()
setTimeout
(()
=>
{
connection
()
},
3
000
)
setTimeout
(()
=>
{
connection
()
},
2
000
)
}
catch
(
error
)
{
}
catch
(
error
)
{
connection
(
error
)
connection
(
error
)
}
}
...
@@ -97,7 +97,7 @@ export class RemixdHandle extends WebsocketPlugin {
...
@@ -97,7 +97,7 @@ export class RemixdHandle extends WebsocketPlugin {
}
else
{
}
else
{
try
{
try
{
super
.
activate
()
super
.
activate
()
setTimeout
(()
=>
{
connection
()
},
3
000
)
setTimeout
(()
=>
{
connection
()
},
2
000
)
}
catch
(
error
)
{
}
catch
(
error
)
{
connection
(
error
)
connection
(
error
)
}
}
...
...
src/app/panels/file-panel.js
View file @
12c4ef65
...
@@ -60,9 +60,6 @@ module.exports = class Filepanel extends ViewPlugin {
...
@@ -60,9 +60,6 @@ module.exports = class Filepanel extends ViewPlugin {
var
fileExplorer
=
createProvider
(
'browser'
,
[
'createNewFile'
,
'publishToGist'
,
canUpload
?
'uploadFile'
:
''
])
var
fileExplorer
=
createProvider
(
'browser'
,
[
'createNewFile'
,
'publishToGist'
,
canUpload
?
'uploadFile'
:
''
])
var
fileSystemExplorer
=
createProvider
(
'localhost'
)
var
fileSystemExplorer
=
createProvider
(
'localhost'
)
console
.
log
(
'fileSystemExplorer: '
,
fileSystemExplorer
)
console
.
log
(
'self._deps.fileProviders: '
,
self
.
_deps
.
fileProviders
[
'localhost'
])
console
.
log
(
'appManager: '
,
appManager
)
self
.
remixdHandle
=
new
RemixdHandle
(
fileSystemExplorer
,
self
.
_deps
.
fileProviders
[
'localhost'
],
appManager
)
self
.
remixdHandle
=
new
RemixdHandle
(
fileSystemExplorer
,
self
.
_deps
.
fileProviders
[
'localhost'
],
appManager
)
const
explorers
=
yo
`
const
explorers
=
yo
`
...
...
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