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
28600f7d
Commit
28600f7d
authored
Nov 26, 2021
by
gxkai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加默认目录
parent
cb79f7bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
index.ts
libs/remix-ui/workspace/src/lib/actions/index.ts
+2
-2
workspace.ts
libs/remix-ui/workspace/src/lib/actions/workspace.ts
+1
-1
file-explorer.tsx
libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
+2
-3
No files found.
libs/remix-ui/workspace/src/lib/actions/index.ts
View file @
28600f7d
...
@@ -235,12 +235,12 @@ const saveAs = (blob, name) => {
...
@@ -235,12 +235,12 @@ const saveAs = (blob, name) => {
}
}
},
0
)
// 40s
},
0
)
// 40s
}
}
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
})
=>
{
const
path$
=
path
.
replace
(
/
\/([^\/]
*
)\/
/
,
''
)
const
path$
=
path
.
replace
(
/
\/([^\/]
*
)\/
/
,
''
)
if
(
path$
.
startsWith
(
folder
))
{
if
(
path$
.
startsWith
(
folder
))
{
zip
.
file
(
path$
,
content
)
zip
.
file
(
path$
,
content
)
...
...
libs/remix-ui/workspace/src/lib/actions/workspace.ts
View file @
28600f7d
...
@@ -244,7 +244,7 @@ export async function getMimeTypeOfFile (blob) {
...
@@ -244,7 +244,7 @@ export async function getMimeTypeOfFile (blob) {
return
res
?
res
.
mime
:
'Unknown filetype'
return
res
?
res
.
mime
:
'Unknown filetype'
}
}
export
const
unZipFile
=
async
(
file
,
root
)
=>
{
export
const
unZipFile
=
async
(
file
,
root
=
null
)
=>
{
const
unzipData
=
await
zip
.
loadAsync
(
file
)
const
unzipData
=
await
zip
.
loadAsync
(
file
)
const
arr
=
[]
const
arr
=
[]
for
(
const
zobj
of
Object
.
values
(
unzipData
.
files
))
{
for
(
const
zobj
of
Object
.
values
(
unzipData
.
files
))
{
...
...
libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
View file @
28600f7d
...
@@ -85,7 +85,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -85,7 +85,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
if
(
canPaste
)
{
if
(
canPaste
)
{
addMenuItems
([{
addMenuItems
([{
id
:
'paste'
,
id
:
'paste'
,
name
:
'
Paste
'
,
name
:
'
黏贴
'
,
type
:
[
'folder'
,
'file'
],
type
:
[
'folder'
,
'file'
],
path
:
[],
path
:
[],
extension
:
[],
extension
:
[],
...
@@ -96,7 +96,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -96,7 +96,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
}
else
{
}
else
{
removeMenuItems
([{
removeMenuItems
([{
id
:
'paste'
,
id
:
'paste'
,
name
:
'
Paste
'
,
name
:
'
黏贴
'
,
type
:
[
'folder'
,
'file'
],
type
:
[
'folder'
,
'file'
],
path
:
[],
path
:
[],
extension
:
[],
extension
:
[],
...
@@ -317,7 +317,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -317,7 +317,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
const
editModeOff
=
async
(
content
:
string
)
=>
{
const
editModeOff
=
async
(
content
:
string
)
=>
{
if
(
typeof
content
===
'string'
)
content
=
content
.
trim
()
if
(
typeof
content
===
'string'
)
content
=
content
.
trim
()
const
parentFolder
=
extractParentFromKey
(
state
.
focusEdit
.
element
)
const
parentFolder
=
extractParentFromKey
(
state
.
focusEdit
.
element
)
if
(
!
content
||
(
content
.
trim
()
===
''
))
{
if
(
!
content
||
(
content
.
trim
()
===
''
))
{
if
(
state
.
focusEdit
.
isNew
)
{
if
(
state
.
focusEdit
.
isNew
)
{
props
.
dispatchRemoveInputField
(
parentFolder
)
props
.
dispatchRemoveInputField
(
parentFolder
)
...
...
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