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
bf40a9e5
Commit
bf40a9e5
authored
Jun 29, 2020
by
LianaHus
Committed by
ioedeveloper
Jul 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
read dear on '/' down
parent
c9916460
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
19 deletions
+54
-19
app.js
apps/remix-ide/src/app.js
+1
-1
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+38
-6
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+9
-10
testTab.js
apps/remix-ide/src/app/tabs/testTab/testTab.js
+6
-2
No files found.
apps/remix-ide/src/app.js
View file @
bf40a9e5
...
...
@@ -257,7 +257,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
editor
.
event
.
register
(
'requiringToSaveCurrentfile'
,
()
=>
fileManager
.
saveCurrentFile
())
// ----------------- fileManager servive ----------------------------
const
fileManager
=
new
FileManager
(
editor
)
const
fileManager
=
new
FileManager
(
editor
,
appManager
)
registry
.
put
({
api
:
fileManager
,
name
:
'filemanager'
})
const
blockchain
=
new
Blockchain
(
registry
.
get
(
'config'
).
api
)
...
...
apps/remix-ide/src/app/files/fileManager.js
View file @
bf40a9e5
...
...
@@ -38,7 +38,7 @@ const createError = (err) => {
}
class
FileManager
extends
Plugin
{
constructor
(
editor
)
{
constructor
(
editor
,
appManager
)
{
super
(
profile
)
this
.
openedFiles
=
{}
// list all opened files
this
.
events
=
new
EventEmitter
()
...
...
@@ -46,6 +46,7 @@ class FileManager extends Plugin {
this
.
_components
=
{}
this
.
_components
.
compilerImport
=
new
CompilerImport
()
this
.
_components
.
registry
=
globalRegistry
this
.
appManager
=
appManager
this
.
init
()
}
...
...
@@ -493,6 +494,36 @@ class FileManager extends Plugin {
return
this
.
_deps
.
filesProviders
[
'browser'
]
}
// returns the list of directories inside path
dirList
(
path
)
{
const
dirPaths
=
[]
const
collectList
=
(
path
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
isDirectory
(
path
))
{
this
.
readdir
(
path
).
then
((
ls
)
=>
{
const
promises
=
Object
.
keys
(
ls
).
map
((
item
,
index
)
=>
{
const
root
=
(
path
.
indexOf
(
'/'
)
===
-
1
)
?
path
:
path
.
substr
(
0
,
path
.
indexOf
(
'/'
))
const
curPath
=
`
${
root
}
/
${
item
}
`
// adding 'browser' or 'localhost'
if
(
ls
[
item
].
isDirectory
&&
!
dirPaths
.
includes
(
curPath
))
{
dirPaths
.
push
(
curPath
)
resolve
(
dirPaths
)
}
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
})
})
Promise
.
all
(
promises
).
then
(()
=>
{
resolve
(
dirPaths
)
})
})
}
else
{
resolve
(
dirPaths
)
}
})
}
return
collectList
(
path
)
}
isRemixDActive
()
{
return
this
.
appManager
.
isActive
(
'remixd'
)
}
allPaths
()
{
const
dirPaths
=
[]
...
...
@@ -501,12 +532,12 @@ class FileManager extends Plugin {
if
(
this
.
isDirectory
(
path
))
{
if
(
!
dirPaths
.
includes
(
path
))
{
dirPaths
.
push
(
path
)
console
.
log
(
'adding .. '
,
path
)
}
this
.
readdir
(
path
).
then
((
ls
)
=>
{
const
promises
=
Object
.
keys
(
ls
).
map
((
item
,
index
)
=>
{
const
curPath
=
`browser/
${
item
}
`
const
root
=
(
path
.
indexOf
(
'/'
)
===
-
1
)
?
path
:
path
.
substr
(
0
,
path
.
indexOf
(
'/'
))
const
curPath
=
`
${
root
}
/
${
item
}
`
// adding 'browser' or 'localhost'
if
(
ls
[
item
].
isDirectory
)
{
return
findPaths
(
curPath
)
}
else
{
...
...
@@ -521,9 +552,10 @@ class FileManager extends Plugin {
})
}
const
br
=
findPaths
(
'browser'
)
const
lh
=
findPaths
(
'localhost'
)
return
Promise
.
all
([
br
,
lh
])
const
roots
=
[]
roots
.
push
(
findPaths
(
'browser'
))
if
(
this
.
appManager
.
isActive
(
'remixd'
))
roots
.
push
(
findPaths
(
'localhost'
))
return
Promise
.
all
(
roots
)
}
saveCurrentFile
()
{
...
...
apps/remix-ide/src/app/tabs/test-tab.js
View file @
bf40a9e5
...
...
@@ -485,8 +485,12 @@ module.exports = class TestTab extends ViewPlugin {
return
yo
`<span class='text-info h6'>Progress:
${
ready
}
finished (of
${
this
.
runningTestsNumber
}
)</span>`
}
allPaths () {
return this.testTabLogic.allPaths()
updateDirList (e) {
if (e.keyCode === 191) {
this.testTabLogic.dirList(this._view.el.getElementsByClassName('custom-select')[0].value).then((options) => {
options.forEach((path) => this.uiPathList.appendChild(yo`
<
option
>
$
{
path
}
<
/option>`
)
)
})
}
}
render
()
{
...
...
@@ -505,18 +509,13 @@ module.exports = class TestTab extends ViewPlugin {
data-id="uiPathInput"
name="utPath"
style="background-image: var(--primary);"
onkeydown=
${(
e
)
=>
this
.
updateDirList
(
e
)}
onchange=
${(
e
)
=>
this
.
updateCurrentPath
(
e
)}
/>
${
this
.
uiPathList
}
</div>
`
this
.
allPaths
().
then
((
options
)
=>
{
console
.
log
(
'options '
,
options
,
' length is '
,
options
.
length
)
options
.
forEach
((
path
)
=>
{
console
.
log
(
'option '
,
path
)
this
.
uiPathList
.
appendChild
(
yo
`<option>
${
path
}
</option>`
)
})
})
this
.
uiPathList
.
appendChild
(
yo
`<option>browser</option>`
)
if
(
this
.
testTabLogic
.
isRemixDActive
())
this
.
uiPathList
.
appendChild
(
yo
`<option>localhost</option>`
)
this
.
testsExecutionStopped
.
hidden
=
true
this
.
testsExecutionStoppedError
.
hidden
=
true
this
.
resultStatistics
=
this
.
createResultLabel
()
...
...
apps/remix-ide/src/app/tabs/testTab/testTab.js
View file @
bf40a9e5
...
...
@@ -32,8 +32,12 @@ class TestTabLogic {
})
}
allPaths
()
{
return
this
.
fileManager
.
allPaths
()
dirList
(
path
)
{
return
this
.
fileManager
.
dirList
(
path
)
}
isRemixDActive
()
{
return
this
.
fileManager
.
isRemixDActive
()
}
async
getTests
(
cb
)
{
...
...
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