Skip to content

Commit

Permalink
修复「关于文件互传的bug」 close #63
Browse files Browse the repository at this point in the history
修复remote app参数无法设置的问题
  • Loading branch information
dushixiang committed Feb 18, 2021
1 parent 3e97c9d commit f9f2204
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"
)

const Version = "v0.2.3"
const Version = "v0.2.4"

func main() {
log.Fatal(Run())
Expand Down
7 changes: 3 additions & 4 deletions pkg/api/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ func SessionDownloadEndpoint(c echo.Context) error {
}
//remoteDir := c.Query("dir")
remoteFile := c.QueryParam("file")

// 获取带后缀的文件名称
filenameWithSuffix := path.Base(remoteFile)
if "ssh" == session.Protocol {
tun, ok := global.Store.Get(sessionId)
if !ok {
Expand All @@ -322,8 +323,6 @@ func SessionDownloadEndpoint(c echo.Context) error {
}

defer dstFile.Close()
// 获取带后缀的文件名称
filenameWithSuffix := path.Base(remoteFile)
c.Response().Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s", filenameWithSuffix))

var buff bytes.Buffer
Expand All @@ -338,7 +337,7 @@ func SessionDownloadEndpoint(c echo.Context) error {
return err
}

return c.File(path.Join(drivePath, remoteFile))
return c.Attachment(path.Join(drivePath, remoteFile), filenameWithSuffix)
}

return err
Expand Down
4 changes: 4 additions & 0 deletions pkg/guacd/guacd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const (
DisableOffscreenCaching = "disable-offscreen-caching"
DisableGlyphCaching = "disable-glyph-caching"

RemoteApp = "remote-app"
RemoteAppDir = "remote-app-dir"
RemoteAppArgs = "remote-app-args"

ColorDepth = "color-depth"
Cursor = "cursor"
SwapRedBlue = "swap-red-blue"
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/asset-attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (r *AssetAttribute) TableName() string {
}

var SSHParameterNames = []string{guacd.FontName, guacd.FontSize, guacd.ColorScheme, guacd.Backspace, guacd.TerminalType, SshMode}
var RDPParameterNames = []string{guacd.EnableWallpaper, guacd.EnableTheming, guacd.EnableFontSmoothing, guacd.EnableFullWindowDrag, guacd.EnableDesktopComposition, guacd.EnableMenuAnimations, guacd.DisableBitmapCaching, guacd.DisableOffscreenCaching, guacd.DisableGlyphCaching}
var RDPParameterNames = []string{guacd.RemoteApp, guacd.RemoteAppDir, guacd.RemoteAppArgs}
var VNCParameterNames = []string{guacd.ColorDepth, guacd.Cursor, guacd.SwapRedBlue, guacd.DestHost, guacd.DestPort}
var TelnetParameterNames = []string{guacd.FontName, guacd.FontSize, guacd.ColorScheme, guacd.Backspace, guacd.TerminalType, guacd.UsernameRegex, guacd.PasswordRegex, guacd.LoginSuccessRegex, guacd.LoginFailureRegex}

Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-terminal",
"version": "0.2.3",
"version": "0.2.4",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.3.0",
Expand Down

0 comments on commit f9f2204

Please sign in to comment.