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
35f8e223
Commit
35f8e223
authored
Aug 30, 2021
by
filip mertens
Committed by
davidzagi93@gmail.com
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
increase timeouts
parent
48795ff5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
dgitProvider.js
apps/remix-ide/src/app/files/dgitProvider.js
+8
-4
No files found.
apps/remix-ide/src/app/files/dgitProvider.js
View file @
35f8e223
...
@@ -34,7 +34,7 @@ class DGitProvider extends Plugin {
...
@@ -34,7 +34,7 @@ class DGitProvider extends Plugin {
ipfsurl
:
'https://ipfs.remixproject.org/ipfs/'
ipfsurl
:
'https://ipfs.remixproject.org/ipfs/'
}
}
this
.
globalIPFSConfig
=
{
this
.
globalIPFSConfig
=
{
host
:
'ipfs.io'
,
host
:
'ipfs
2
.io'
,
port
:
443
,
port
:
443
,
protocol
:
'https'
,
protocol
:
'https'
,
ipfsurl
:
'https://ipfs.io/ipfs/'
ipfsurl
:
'https://ipfs.io/ipfs/'
...
@@ -417,9 +417,12 @@ class DGitProvider extends Plugin {
...
@@ -417,9 +417,12 @@ class DGitProvider extends Plugin {
const
ipfs
=
IpfsHttpClient
(
config
)
const
ipfs
=
IpfsHttpClient
(
config
)
let
result
=
false
let
result
=
false
try
{
try
{
console
.
log
(
'try '
,
config
)
const
data
=
ipfs
.
get
(
cid
,
{
timeout
:
60000
})
const
data
=
ipfs
.
get
(
cid
,
{
timeout
:
60000
})
console
.
log
(
config
,
cid
,
workspace
,
data
)
for
await
(
const
file
of
data
)
{
for
await
(
const
file
of
data
)
{
if
(
file
.
path
)
result
=
true
if
(
file
.
path
)
result
=
true
console
.
log
(
file
.
path
)
file
.
path
=
file
.
path
.
replace
(
cid
,
''
)
file
.
path
=
file
.
path
.
replace
(
cid
,
''
)
if
(
!
file
.
content
)
{
if
(
!
file
.
content
)
{
continue
continue
...
@@ -431,12 +434,13 @@ class DGitProvider extends Plugin {
...
@@ -431,12 +434,13 @@ class DGitProvider extends Plugin {
const
dir
=
path
.
dirname
(
file
.
path
)
const
dir
=
path
.
dirname
(
file
.
path
)
try
{
try
{
this
.
createDirectories
(
`
${
workspace
.
absolutePath
}
/
${
dir
}
`
)
this
.
createDirectories
(
`
${
workspace
.
absolutePath
}
/
${
dir
}
`
)
}
catch
(
e
)
{
}
}
catch
(
e
)
{
console
.
log
(
e
)
}
try
{
try
{
window
.
remixFileSystem
.
writeFileSync
(
`
${
workspace
.
absolutePath
}
/
${
file
.
path
}
`
,
Buffer
.
concat
(
content
)
||
new
Uint8Array
())
window
.
remixFileSystem
.
writeFileSync
(
`
${
workspace
.
absolutePath
}
/
${
file
.
path
}
`
,
Buffer
.
concat
(
content
)
||
new
Uint8Array
())
}
catch
(
e
)
{
}
}
catch
(
e
)
{
console
.
log
(
e
)
}
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
)
}
}
return
result
return
result
}
}
...
@@ -462,7 +466,7 @@ class DGitProvider extends Plugin {
...
@@ -462,7 +466,7 @@ class DGitProvider extends Plugin {
const
cid
=
cmd
.
cid
const
cid
=
cmd
.
cid
await
this
.
call
(
'filePanel'
,
'createWorkspace'
,
`workspace_
${
Date
.
now
()}
`
,
false
)
await
this
.
call
(
'filePanel'
,
'createWorkspace'
,
`workspace_
${
Date
.
now
()}
`
,
false
)
const
workspace
=
await
this
.
call
(
'filePanel'
,
'getCurrentWorkspace'
)
const
workspace
=
await
this
.
call
(
'filePanel'
,
'getCurrentWorkspace'
)
const
result
=
await
this
.
importIPFSFiles
(
this
.
remixIPFS
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
ipfsconfig
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
globalIPFSConfig
,
cid
,
workspace
)
const
result
=
await
this
.
importIPFSFiles
(
this
.
globalIPFSConfig
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
ipfsconfig
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
remixIPFS
,
cid
,
workspace
)
await
this
.
call
(
'fileManager'
,
'refresh'
)
await
this
.
call
(
'fileManager'
,
'refresh'
)
if
(
!
result
)
throw
new
Error
(
`Cannot pull files from IPFS at
${
cid
}
`
)
if
(
!
result
)
throw
new
Error
(
`Cannot pull files from IPFS at
${
cid
}
`
)
}
}
...
...
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