From f9f22042072d0aedfb5583377cd74b86c7ddbc9a Mon Sep 17 00:00:00 2001 From: dushixiang <798148596@qq.com> Date: Thu, 18 Feb 2021 18:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=8C=E5=85=B3=E4=BA=8E?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BA=92=E4=BC=A0=E7=9A=84bug=E3=80=8D=20clo?= =?UTF-8?q?se=20#63=20=E4=BF=AE=E5=A4=8Dremote=20app=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=AE=BE=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 2 +- pkg/api/session.go | 7 +++---- pkg/guacd/guacd.go | 4 ++++ pkg/model/asset-attribute.go | 2 +- web/package.json | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index b8951ae..7df68bc 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,7 @@ import ( "time" ) -const Version = "v0.2.3" +const Version = "v0.2.4" func main() { log.Fatal(Run()) diff --git a/pkg/api/session.go b/pkg/api/session.go index ab2a0d8..2f1eceb 100644 --- a/pkg/api/session.go +++ b/pkg/api/session.go @@ -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 { @@ -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 @@ -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 diff --git a/pkg/guacd/guacd.go b/pkg/guacd/guacd.go index 5fa29a9..c767f90 100644 --- a/pkg/guacd/guacd.go +++ b/pkg/guacd/guacd.go @@ -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" diff --git a/pkg/model/asset-attribute.go b/pkg/model/asset-attribute.go index eeaf1af..bf2f8fd 100644 --- a/pkg/model/asset-attribute.go +++ b/pkg/model/asset-attribute.go @@ -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} diff --git a/web/package.json b/web/package.json index 1ae93ef..2963780 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "next-terminal", - "version": "0.2.3", + "version": "0.2.4", "private": true, "dependencies": { "@ant-design/icons": "^4.3.0",