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
7f3319bd
Commit
7f3319bd
authored
Nov 11, 2021
by
gxkai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 下载空间
parent
3a57fc43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
index.ts
libs/remix-ui/workspace/src/lib/actions/index.ts
+6
-3
No files found.
libs/remix-ui/workspace/src/lib/actions/index.ts
View file @
7f3319bd
...
@@ -235,14 +235,17 @@ const saveAs = (blob, name) => {
...
@@ -235,14 +235,17 @@ const saveAs = (blob, name) => {
}
}
},
0
)
// 40s
},
0
)
// 40s
}
}
// todo
下载文件夹
// todo
选中目标下载
export
const
downloadFile
=
async
(
folder
?:
string
)
=>
{
export
const
downloadFile
=
async
(
folder
?:
string
)
=>
{
try
{
try
{
tooltip
(
'preparing files for download, please wait..'
)
tooltip
(
'preparing files for download, please wait..'
)
const
fileProviders
=
globalRegistry
.
get
(
'fileproviders'
).
api
const
fileProviders
=
globalRegistry
.
get
(
'fileproviders'
).
api
const
zip
=
new
JSZip
()
const
zip
=
new
JSZip
()
await
fileProviders
.
browser
.
copyFolderToJson
(
`/`
,
({
path
,
content
})
=>
{
await
fileProviders
.
browser
.
copyFolderToJson
(
`/`
,
({
path
,
content
})
=>
{
zip
.
file
(
`
${
folder
}${
path
}
`
,
content
)
const
path$
=
path
.
replace
(
/
\/([^\/]
*
)\/
/
,
''
)
if
(
path$
.
startsWith
(
folder
))
{
zip
.
file
(
path$
,
content
)
}
})
})
zip
.
generateAsync
({
type
:
'blob'
}).
then
(
function
(
blob
)
{
zip
.
generateAsync
({
type
:
'blob'
}).
then
(
function
(
blob
)
{
saveAs
(
blob
,
`
${
folder
}
.zip`
)
saveAs
(
blob
,
`
${
folder
}
.zip`
)
...
...
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