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
c206f280
Unverified
Commit
c206f280
authored
Sep 25, 2019
by
yann300
Committed by
GitHub
Sep 25, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2364 from ethereum/migrate_file_system
Migrate file system to using BrowserFS
parents
f000ed1a
38c93409
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
app.js
src/app.js
+5
-2
migrateFileSystem.js
src/migrateFileSystem.js
+18
-0
No files found.
src/app.js
View file @
c206f280
...
...
@@ -49,6 +49,8 @@ import { LandingPage } from './app/ui/landing-page/landing-page'
import
{
MainPanel
}
from
'./app/components/main-panel'
import
{
UniversalDApp
}
from
'remix-lib'
import
migrateFileSystem
from
'./migrateFileSystem'
var
css
=
csjs
`
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
...
...
@@ -102,7 +104,6 @@ class App {
var
self
=
this
self
.
_components
=
{}
// setup storage
var
fileStorage
=
new
Storage
(
'sol:'
)
var
configStorage
=
new
Storage
(
'config-v0.8:'
)
// load app config
...
...
@@ -111,7 +112,7 @@ class App {
// load file system
self
.
_components
.
filesProviders
=
{}
self
.
_components
.
filesProviders
[
'browser'
]
=
new
FileProvider
(
'browser'
,
fileStorage
)
self
.
_components
.
filesProviders
[
'browser'
]
=
new
FileProvider
(
'browser'
)
registry
.
put
({
api
:
self
.
_components
.
filesProviders
[
'browser'
],
name
:
'fileproviders/browser'
})
var
remixd
=
new
Remixd
(
65520
)
...
...
@@ -125,6 +126,8 @@ class App {
registry
.
put
({
api
:
self
.
_components
.
filesProviders
,
name
:
'fileproviders'
})
self
.
_view
=
{}
migrateFileSystem
(
self
.
_components
.
filesProviders
[
'browser'
])
}
init
()
{
...
...
src/migrateFileSystem.js
0 → 100644
View file @
c206f280
import
{
Storage
}
from
'remix-lib'
/*
Migrating the files to the BrowserFS storage instead or raw localstorage
*/
export
default
(
fileProvider
)
=>
{
const
fileStorage
=
new
Storage
(
'sol:'
)
if
(
fileStorage
.
keys
().
length
===
0
)
return
fileStorage
.
keys
().
forEach
((
path
)
=>
{
if
(
path
!==
'.remix.config'
)
{
const
content
=
fileStorage
.
get
(
path
)
fileProvider
.
set
(
path
,
content
)
fileStorage
.
remove
(
path
)
console
.
log
(
'file migrated'
,
path
)
}
})
}
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