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
4e242bc6
Commit
4e242bc6
authored
Mar 24, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix reference and display workspace name
parent
f945c04b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
app.js
apps/remix-ide/src/app.js
+1
-1
landing-page.js
apps/remix-ide/src/app/ui/landing-page/landing-page.js
+10
-3
migrateFileSystem.js
apps/remix-ide/src/migrateFileSystem.js
+4
-3
No files found.
apps/remix-ide/src/app.js
View file @
4e242bc6
...
@@ -325,11 +325,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -325,11 +325,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// those views depend on app_manager
// those views depend on app_manager
const
menuicons
=
new
VerticalIcons
(
appManager
)
const
menuicons
=
new
VerticalIcons
(
appManager
)
const
landingPage
=
new
LandingPage
(
appManager
,
menuicons
)
const
sidePanel
=
new
SidePanel
(
appManager
,
menuicons
)
const
sidePanel
=
new
SidePanel
(
appManager
,
menuicons
)
const
hiddenPanel
=
new
HiddenPanel
()
const
hiddenPanel
=
new
HiddenPanel
()
const
pluginManagerComponent
=
new
PluginManagerComponent
(
appManager
,
engine
)
const
pluginManagerComponent
=
new
PluginManagerComponent
(
appManager
,
engine
)
const
filePanel
=
new
FilePanel
(
appManager
)
const
filePanel
=
new
FilePanel
(
appManager
)
const
landingPage
=
new
LandingPage
(
appManager
,
menuicons
,
fileManager
,
filePanel
)
const
settings
=
new
SettingsTab
(
const
settings
=
new
SettingsTab
(
registry
.
get
(
'config'
).
api
,
registry
.
get
(
'config'
).
api
,
editor
,
editor
,
...
...
apps/remix-ide/src/app/ui/landing-page/landing-page.js
View file @
4e242bc6
import
*
as
packageJson
from
'../../../../../../package.json'
import
*
as
packageJson
from
'../../../../../../package.json'
import
{
ViewPlugin
}
from
'@remixproject/engine-web'
import
{
ViewPlugin
}
from
'@remixproject/engine-web'
import
{
migrateToWorkspace
}
from
'../../../migrateFileSystem'
const
yo
=
require
(
'yo-yo'
)
const
yo
=
require
(
'yo-yo'
)
const
csjs
=
require
(
'csjs-inject'
)
const
csjs
=
require
(
'csjs-inject'
)
...
@@ -112,9 +113,11 @@ const profile = {
...
@@ -112,9 +113,11 @@ const profile = {
}
}
export
class
LandingPage
extends
ViewPlugin
{
export
class
LandingPage
extends
ViewPlugin
{
constructor
(
appManager
,
verticalIcons
)
{
constructor
(
appManager
,
verticalIcons
,
fileManager
,
filePanel
)
{
super
(
profile
)
super
(
profile
)
this
.
profile
=
profile
this
.
profile
=
profile
this
.
fileManager
=
fileManager
this
.
filePanel
=
filePanel
this
.
appManager
=
appManager
this
.
appManager
=
appManager
this
.
verticalIcons
=
verticalIcons
this
.
verticalIcons
=
verticalIcons
this
.
gistHandler
=
new
GistHandler
()
this
.
gistHandler
=
new
GistHandler
()
...
@@ -385,8 +388,12 @@ export class LandingPage extends ViewPlugin {
...
@@ -385,8 +388,12 @@ export class LandingPage extends ViewPlugin {
const
migrateWorkspace
=
async
()
=>
{
const
migrateWorkspace
=
async
()
=>
{
tooltip
(
'migrating workspace...'
)
tooltip
(
'migrating workspace...'
)
await
migrateToWorkspace
(
globalRegistry
.
get
(
'fileManager'
).
api
,
globalRegistry
.
get
(
'filePanel'
).
api
)
try
{
tooltip
(
'done.'
)
const
workspaceName
=
await
migrateToWorkspace
(
this
.
fileManager
,
this
.
filePanel
)
tooltip
(
'done. '
+
workspaceName
+
' created.'
)
}
catch
(
e
)
{
return
tooltip
(
e
.
message
)
}
}
}
const
img
=
yo
`<img class=
${
css
.
logoImg
}
src="assets/img/guitarRemiCroped.webp" onclick="
${()
=>
playRemi
()}
"></img>`
const
img
=
yo
`<img class=
${
css
.
logoImg
}
src="assets/img/guitarRemiCroped.webp" onclick="
${()
=>
playRemi
()}
"></img>`
...
...
apps/remix-ide/src/migrateFileSystem.js
View file @
4e242bc6
...
@@ -26,13 +26,14 @@ export async function migrateToWorkspace (fileManager, filePanel) {
...
@@ -26,13 +26,14 @@ export async function migrateToWorkspace (fileManager, filePanel) {
const
workspaceProvider
=
fileManager
.
getProvider
(
'workspace'
)
const
workspaceProvider
=
fileManager
.
getProvider
(
'workspace'
)
const
files
=
await
browserProvider
.
copyFolderToJson
(
'/'
)
const
files
=
await
browserProvider
.
copyFolderToJson
(
'/'
)
console
.
log
(
files
)
console
.
log
(
files
)
if
(
Object
.
keys
(
files
).
length
>
0
)
{
const
workspaceName
=
'workspace_migrated_'
+
Date
.
now
()
const
workspaceName
=
'workspace_migrated_'
+
Date
.
now
()
if
(
Object
.
keys
(
files
).
length
>
0
)
{
const
workspacePath
=
joinPath
(
'browser'
,
workspaceProvider
.
workspacesPath
,
workspaceName
)
const
workspacePath
=
joinPath
(
'browser'
,
workspaceProvider
.
workspacesPath
,
workspaceName
)
await
filePanel
.
processCreateWorkspace
(
workspaceName
)
await
filePanel
.
processCreateWorkspace
(
workspaceName
)
filePanel
.
getWorkspaces
()
// refresh list
filePanel
.
getWorkspaces
()
// refresh list
await
populateWorkspace
(
workspacePath
,
files
,
browserProvider
)
await
populateWorkspace
(
workspacePath
,
files
,
browserProvider
)
}
}
return
workspaceName
}
}
const
populateWorkspace
=
async
(
workspace
,
json
,
browserProvider
)
=>
{
const
populateWorkspace
=
async
(
workspace
,
json
,
browserProvider
)
=>
{
...
...
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