Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9fb41f0
add listentries
esimkowitz Feb 1, 2025
7791512
list entries implemented
esimkowitz Feb 1, 2025
1d804fa
more impls
esimkowitz Feb 2, 2025
91a936c
cat is working!
esimkowitz Feb 2, 2025
eeeedf6
save
esimkowitz Feb 2, 2025
b2ce931
fix "directory" handling for ls and rm
esimkowitz Feb 2, 2025
cd54d9b
save tar copy work
esimkowitz Feb 2, 2025
bafd175
save
esimkowitz Feb 2, 2025
8cb908f
copyremote initial impl, fix for wavefs
esimkowitz Feb 2, 2025
506fd72
save work
esimkowitz Feb 4, 2025
14c51cf
check dir walk error
esimkowitz Feb 4, 2025
09f3bce
save
esimkowitz Feb 4, 2025
92bb98e
add dir mode
esimkowitz Feb 5, 2025
24ac975
lots of fixes
esimkowitz Feb 6, 2025
b7c2444
Merge branch 'main' into evan/s3fs
esimkowitz Feb 6, 2025
4b610d3
add s3 trailing slash test
esimkowitz Feb 6, 2025
5b7cf86
add back quick add for pathtree
esimkowitz Feb 6, 2025
39cd7ce
Update pkg/util/fileutil/fileutil.go
esimkowitz Feb 6, 2025
297f400
fix readstream for s3
esimkowitz Feb 6, 2025
527e31d
Merge branch 'main' into evan/s3fs
esimkowitz Feb 6, 2025
97fdd52
Merge branch 'main' into evan/s3fs
esimkowitz Feb 7, 2025
0ae9ecd
bad merge
esimkowitz Feb 7, 2025
dc951dd
revert wshremote
esimkowitz Feb 7, 2025
c22a560
put back data close
esimkowitz Feb 7, 2025
264ff2d
fix empty file info error with readfilestream
esimkowitz Feb 7, 2025
db84722
Remove recursive from cp, make it default
esimkowitz Feb 8, 2025
5da7740
save
esimkowitz Feb 9, 2025
abb8e0d
save
esimkowitz Feb 9, 2025
e57f869
save
esimkowitz Feb 9, 2025
20badde
fix preceding slashes in tar headers
esimkowitz Feb 9, 2025
ad56f14
handle case where singleFile flag is set twice
esimkowitz Feb 9, 2025
b0ce1c2
update comment
esimkowitz Feb 9, 2025
62de973
Merge branch 'evan/copy-improvements' into evan/s3fs
esimkowitz Feb 9, 2025
b6a67d8
save
esimkowitz Feb 9, 2025
f56e189
remove s3 cp recursive flag, unnecessary context cancel
esimkowitz Feb 9, 2025
3c4aa68
more gracefulclose
esimkowitz Feb 9, 2025
4aa64c4
add traversal error
esimkowitz Feb 9, 2025
03ae872
apply suggestion
esimkowitz Feb 9, 2025
24b26ac
apply suggestion
esimkowitz Feb 9, 2025
5a512f4
apply suggestion
esimkowitz Feb 9, 2025
3102452
Merge branch 'main' into evan/s3fs
esimkowitz Feb 9, 2025
0e45087
add dirmode to wavefs
esimkowitz Feb 9, 2025
6582c63
Merge branch 'main' into evan/s3fs
esimkowitz Feb 9, 2025
4e01482
Merge branch 'main' into evan/s3fs
esimkowitz Feb 10, 2025
3840be3
remove logs, fix trailing slash in normalized filepath in dir preview
esimkowitz Feb 11, 2025
ff62039
save
esimkowitz Feb 11, 2025
6ace12a
save
esimkowitz Feb 11, 2025
c81ef48
Update pkg/remote/fileshare/s3fs/s3fs.go
esimkowitz Feb 11, 2025
afdb44d
Merge branch 'main' into evan/s3fs
esimkowitz Feb 11, 2025
501b79d
save
esimkowitz Feb 11, 2025
abed821
fix putfile
esimkowitz Feb 11, 2025
a74e1eb
fix putfile better
esimkowitz Feb 11, 2025
d75b7cd
fix parent dirs
esimkowitz Feb 12, 2025
c3714b3
Update pkg/remote/fileshare/fsutil/fsutil.go
esimkowitz Feb 12, 2025
9933e12
Update pkg/remote/fileshare/fsutil/fsutil.go
esimkowitz Feb 12, 2025
b63b196
clean up formatRemoteUri
esimkowitz Feb 12, 2025
9a0d3d9
fix local single file copy
esimkowitz Feb 12, 2025
9e1bed9
fix scrollintoview, also add pageup/pagedown handlers
sawka Feb 12, 2025
65fe8b1
save
esimkowitz Feb 12, 2025
efab0bf
fix propagation
sawka Feb 12, 2025
c98ef36
fix branch and drain channel fn
esimkowitz Feb 13, 2025
3ce3c24
more centralizing of the listEntries code
esimkowitz Feb 13, 2025
6111360
more notfound fixes
esimkowitz Feb 13, 2025
69577d2
save
esimkowitz Feb 13, 2025
654db39
save
esimkowitz Feb 13, 2025
73a86d0
save
esimkowitz Feb 14, 2025
59e3fb6
fix wavefs rm
esimkowitz Feb 14, 2025
de2e8e7
fix connparse for multiple slashes
esimkowitz Feb 14, 2025
91b594f
Merge branch 'main' into evan/s3fs
esimkowitz Feb 14, 2025
5091310
fix: revert fileContentAtom
oneirocosm Feb 14, 2025
70c23a8
test: fix behavior of test026
oneirocosm Feb 14, 2025
5470f9a
fix: copy dir behavior with target dir
oneirocosm Feb 14, 2025
c979dce
test: split up test 48 and 49
oneirocosm Feb 14, 2025
c590242
fix: revert getParentInfo and goParentDirectory
oneirocosm Feb 14, 2025
1a21231
fix dir in wshremote
esimkowitz Feb 15, 2025
ff0f5b7
merge main
sawka Feb 15, 2025
477f6e5
fix ~ path
sawka Feb 15, 2025
fd1d9ec
Revert "fix ~ path"
esimkowitz Feb 15, 2025
7e8e3ee
don't un-normalize path with home dir, fix display
esimkowitz Feb 15, 2025
ad89824
fix name
esimkowitz Feb 15, 2025
ebabb53
Revert "fix name"
esimkowitz Feb 15, 2025
e9c3ff8
Revert "Revert "fix ~ path""
esimkowitz Feb 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cmd/wsh/cmd/wshcmd-connserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/wavetermdev/waveterm/pkg/remote/fileshare/wshfs"
"github.com/wavetermdev/waveterm/pkg/util/packetparser"
"github.com/wavetermdev/waveterm/pkg/util/sigutil"
"github.com/wavetermdev/waveterm/pkg/util/utilfn"
"github.com/wavetermdev/waveterm/pkg/wavebase"
"github.com/wavetermdev/waveterm/pkg/wshrpc"
"github.com/wavetermdev/waveterm/pkg/wshrpc/wshclient"
Expand Down Expand Up @@ -162,9 +163,7 @@ func serverRunRouter(jwtToken string) error {
// just ignore and drain the rawCh (stdin)
// when stdin is closed, shutdown
defer wshutil.DoShutdown("", 0, true)
for range rawCh {
// ignore
}
utilfn.DrainChannelSafe(rawCh, "serverRunRouter:stdin")
}()
go func() {
for msg := range termProxy.FromRemoteCh {
Expand Down
51 changes: 11 additions & 40 deletions cmd/wsh/cmd/wshcmd-file-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
package cmd

import (
"context"
"encoding/base64"
"fmt"
"io"
"io/fs"
"strings"

"github.com/wavetermdev/waveterm/pkg/remote/connparse"
"github.com/wavetermdev/waveterm/pkg/remote/fileshare/fsutil"
"github.com/wavetermdev/waveterm/pkg/util/fileutil"
"github.com/wavetermdev/waveterm/pkg/util/wavefileutil"
"github.com/wavetermdev/waveterm/pkg/wshrpc"
Expand All @@ -27,15 +29,15 @@ func convertNotFoundErr(err error) error {
return err
}

func ensureFile(origName string, fileData wshrpc.FileData) (*wshrpc.FileInfo, error) {
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
func ensureFile(fileData wshrpc.FileData) (*wshrpc.FileInfo, error) {
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
err = convertNotFoundErr(err)
if err == fs.ErrNotExist {
err = wshclient.FileCreateCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
err = wshclient.FileCreateCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return nil, fmt.Errorf("creating file: %w", err)
}
info, err = wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
info, err = wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return nil, fmt.Errorf("getting file info: %w", err)
}
Expand All @@ -51,12 +53,12 @@ func streamWriteToFile(fileData wshrpc.FileData, reader io.Reader) error {
// First truncate the file with an empty write
emptyWrite := fileData
emptyWrite.Data64 = ""
err := wshclient.FileWriteCommand(RpcClient, emptyWrite, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
err := wshclient.FileWriteCommand(RpcClient, emptyWrite, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return fmt.Errorf("initializing file with empty write: %w", err)
}

const chunkSize = 32 * 1024 // 32KB chunks
const chunkSize = wshrpc.FileChunkSize // 32KB chunks
buf := make([]byte, chunkSize)
totalWritten := int64(0)

Expand Down Expand Up @@ -89,40 +91,9 @@ func streamWriteToFile(fileData wshrpc.FileData, reader io.Reader) error {
return nil
}

func streamReadFromFile(fileData wshrpc.FileData, size int64, writer io.Writer) error {
const chunkSize = 32 * 1024 // 32KB chunks
for offset := int64(0); offset < size; offset += chunkSize {
// Calculate the length of this chunk
length := chunkSize
if offset+int64(length) > size {
length = int(size - offset)
}

// Set up the ReadAt request
fileData.At = &wshrpc.FileDataAt{
Offset: offset,
Size: length,
}

// Read the chunk
data, err := wshclient.FileReadCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: int64(fileTimeout)})
if err != nil {
return fmt.Errorf("reading chunk at offset %d: %w", offset, err)
}

// Decode and write the chunk
chunk, err := base64.StdEncoding.DecodeString(data.Data64)
if err != nil {
return fmt.Errorf("decoding chunk at offset %d: %w", offset, err)
}

_, err = writer.Write(chunk)
if err != nil {
return fmt.Errorf("writing chunk at offset %d: %w", offset, err)
}
}

return nil
func streamReadFromFile(ctx context.Context, fileData wshrpc.FileData, writer io.Writer) error {
ch := wshclient.FileReadStreamCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
return fsutil.ReadFileStreamToWriter(ctx, ch, writer)
}

type fileListResult struct {
Expand Down
89 changes: 37 additions & 52 deletions cmd/wsh/cmd/wshcmd-file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"encoding/base64"
"fmt"
"io"
"io/fs"
"log"
"os"
"path"
Expand All @@ -31,8 +30,7 @@ const (
WaveFileScheme = "wavefile"
WaveFilePrefix = "wavefile://"

DefaultFileTimeout = 5000
TimeoutYear = int64(365) * 24 * 60 * 60 * 1000
TimeoutYear = int64(365) * 24 * 60 * 60 * 1000

UriHelpText = `

Expand Down Expand Up @@ -83,12 +81,12 @@ Wave Terminal is capable of managing files from remote SSH hosts, S3-compatible
systems, and the internal Wave filesystem. Files are addressed via URIs, which
vary depending on the storage system.` + UriHelpText}

var fileTimeout int
var fileTimeout int64

func init() {
rootCmd.AddCommand(fileCmd)

fileCmd.PersistentFlags().IntVarP(&fileTimeout, "timeout", "t", 15000, "timeout in milliseconds for long operations")
fileCmd.PersistentFlags().Int64VarP(&fileTimeout, "timeout", "t", 15000, "timeout in milliseconds for long operations")

fileListCmd.Flags().BoolP("recursive", "r", false, "list subdirectories recursively")
fileListCmd.Flags().BoolP("long", "l", false, "use long listing format")
Expand All @@ -103,7 +101,6 @@ func init() {
fileCmd.AddCommand(fileInfoCmd)
fileCmd.AddCommand(fileAppendCmd)
fileCpCmd.Flags().BoolP("merge", "m", false, "merge directories")
fileCpCmd.Flags().BoolP("recursive", "r", false, "copy directories recursively")
fileCpCmd.Flags().BoolP("force", "f", false, "force overwrite of existing files")
fileCmd.AddCommand(fileCpCmd)
fileMvCmd.Flags().BoolP("recursive", "r", false, "move directories recursively")
Expand Down Expand Up @@ -174,7 +171,7 @@ var fileAppendCmd = &cobra.Command{
var fileCpCmd = &cobra.Command{
Use: "cp [source-uri] [destination-uri]" + UriHelpText,
Aliases: []string{"copy"},
Short: "copy files between storage systems",
Short: "copy files between storage systems, recursively if needed",
Long: "Copy files between different storage systems." + UriHelpText,
Example: " wsh file cp wavefile://block/config.txt ./local-config.txt\n wsh file cp ./local-config.txt wavefile://block/config.txt\n wsh file cp wsh://user@ec2/home/user/config.txt wavefile://client/config.txt",
Args: cobra.ExactArgs(2),
Expand Down Expand Up @@ -202,17 +199,7 @@ func fileCatRun(cmd *cobra.Command, args []string) error {
Info: &wshrpc.FileInfo{
Path: path}}

// Get file info first to check existence and get size
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: 2000})
err = convertNotFoundErr(err)
if err == fs.ErrNotExist {
return fmt.Errorf("%s: no such file", path)
}
if err != nil {
return fmt.Errorf("getting file info: %w", err)
}

err = streamReadFromFile(fileData, info.Size, os.Stdout)
err = streamReadFromFile(cmd.Context(), fileData, os.Stdout)
if err != nil {
return fmt.Errorf("reading file: %w", err)
}
Expand All @@ -229,7 +216,7 @@ func fileInfoRun(cmd *cobra.Command, args []string) error {
Info: &wshrpc.FileInfo{
Path: path}}

info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
err = convertNotFoundErr(err)
if err != nil {
return fmt.Errorf("getting file info: %w", err)
Expand Down Expand Up @@ -265,20 +252,8 @@ func fileRmRun(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
fileData := wshrpc.FileData{
Info: &wshrpc.FileInfo{
Path: path}}

_, err = wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
err = convertNotFoundErr(err)
if err == fs.ErrNotExist {
return fmt.Errorf("%s: no such file", path)
}
if err != nil {
return fmt.Errorf("getting file info: %w", err)
}

err = wshclient.FileDeleteCommand(RpcClient, wshrpc.CommandDeleteFileData{Path: path, Recursive: recursive}, &wshrpc.RpcOpts{Timeout: DefaultFileTimeout})
err = wshclient.FileDeleteCommand(RpcClient, wshrpc.CommandDeleteFileData{Path: path, Recursive: recursive}, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return fmt.Errorf("removing file: %w", err)
}
Expand All @@ -295,14 +270,31 @@ func fileWriteRun(cmd *cobra.Command, args []string) error {
Info: &wshrpc.FileInfo{
Path: path}}

_, err = ensureFile(path, fileData)
capability, err := wshclient.FileShareCapabilityCommand(RpcClient, fileData.Info.Path, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return err
return fmt.Errorf("getting fileshare capability: %w", err)
}

err = streamWriteToFile(fileData, WrappedStdin)
if err != nil {
return fmt.Errorf("writing file: %w", err)
if capability.CanAppend {
err = streamWriteToFile(fileData, WrappedStdin)
if err != nil {
return fmt.Errorf("writing file: %w", err)
}
} else {
buf := make([]byte, MaxFileSize)
n, err := WrappedStdin.Read(buf)
if err != nil && err != io.EOF {
return fmt.Errorf("reading input: %w", err)
}
if int64(n) == MaxFileSize {
if _, err := WrappedStdin.Read(make([]byte, 1)); err != io.EOF {
return fmt.Errorf("input exceeds maximum file size of %d bytes", MaxFileSize)
}
}
fileData.Data64 = base64.StdEncoding.EncodeToString(buf[:n])
err = wshclient.FileWriteCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return fmt.Errorf("writing file: %w", err)
}
}

return nil
Expand All @@ -317,7 +309,7 @@ func fileAppendRun(cmd *cobra.Command, args []string) error {
Info: &wshrpc.FileInfo{
Path: path}}

info, err := ensureFile(path, fileData)
info, err := ensureFile(fileData)
if err != nil {
return err
}
Expand Down Expand Up @@ -346,7 +338,7 @@ func fileAppendRun(cmd *cobra.Command, args []string) error {

if buf.Len() >= 8192 { // 8KB batch size
fileData.Data64 = base64.StdEncoding.EncodeToString(buf.Bytes())
err = wshclient.FileAppendCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: int64(fileTimeout)})
err = wshclient.FileAppendCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return fmt.Errorf("appending to file: %w", err)
}
Expand All @@ -357,7 +349,7 @@ func fileAppendRun(cmd *cobra.Command, args []string) error {

if buf.Len() > 0 {
fileData.Data64 = base64.StdEncoding.EncodeToString(buf.Bytes())
err = wshclient.FileAppendCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: int64(fileTimeout)})
err = wshclient.FileAppendCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
return fmt.Errorf("appending to file: %w", err)
}
Expand Down Expand Up @@ -398,10 +390,6 @@ func getTargetPath(src, dst string) (string, error) {

func fileCpRun(cmd *cobra.Command, args []string) error {
src, dst := args[0], args[1]
recursive, err := cmd.Flags().GetBool("recursive")
if err != nil {
return err
}
merge, err := cmd.Flags().GetBool("merge")
if err != nil {
return err
Expand All @@ -419,9 +407,9 @@ func fileCpRun(cmd *cobra.Command, args []string) error {
if err != nil {
return fmt.Errorf("unable to parse dest path: %w", err)
}
log.Printf("Copying %s to %s; recursive: %v, merge: %v, force: %v", srcPath, destPath, recursive, merge, force)
log.Printf("Copying %s to %s; merge: %v, force: %v", srcPath, destPath, merge, force)
rpcOpts := &wshrpc.RpcOpts{Timeout: TimeoutYear}
err = wshclient.FileCopyCommand(RpcClient, wshrpc.CommandFileCopyData{SrcUri: srcPath, DestUri: destPath, Opts: &wshrpc.FileCopyOpts{Recursive: recursive, Merge: merge, Overwrite: force, Timeout: TimeoutYear}}, rpcOpts)
err = wshclient.FileCopyCommand(RpcClient, wshrpc.CommandFileCopyData{SrcUri: srcPath, DestUri: destPath, Opts: &wshrpc.FileCopyOpts{Merge: merge, Overwrite: force, Timeout: TimeoutYear}}, rpcOpts)
if err != nil {
return fmt.Errorf("copying file: %w", err)
}
Expand Down Expand Up @@ -449,7 +437,7 @@ func fileMvRun(cmd *cobra.Command, args []string) error {
}
log.Printf("Moving %s to %s; recursive: %v, force: %v", srcPath, destPath, recursive, force)
rpcOpts := &wshrpc.RpcOpts{Timeout: TimeoutYear}
err = wshclient.FileMoveCommand(RpcClient, wshrpc.CommandFileCopyData{SrcUri: srcPath, DestUri: destPath, Opts: &wshrpc.FileCopyOpts{Recursive: recursive, Overwrite: force, Timeout: TimeoutYear}}, rpcOpts)
err = wshclient.FileMoveCommand(RpcClient, wshrpc.CommandFileCopyData{SrcUri: srcPath, DestUri: destPath, Opts: &wshrpc.FileCopyOpts{Overwrite: force, Timeout: TimeoutYear, Recursive: recursive}}, rpcOpts)
if err != nil {
return fmt.Errorf("moving file: %w", err)
}
Expand Down Expand Up @@ -562,10 +550,7 @@ func fileListRun(cmd *cobra.Command, args []string) error {

filesChan := wshclient.FileListStreamCommand(RpcClient, wshrpc.FileListData{Path: path, Opts: &wshrpc.FileListOpts{All: recursive}}, &wshrpc.RpcOpts{Timeout: 2000})
// Drain the channel when done
defer func() {
for range filesChan {
}
}()
defer utilfn.DrainChannelSafe(filesChan, "fileListRun")
if longForm {
return filePrintLong(filesChan)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/wsh/cmd/wshcmd-view.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var viewMagnified bool

var viewCmd = &cobra.Command{
Use: "view {file|directory|URL}",
Aliases: []string{"preview", "open"},
Short: "preview/edit a file or directory",
RunE: viewRun,
PreRunE: preRunSetupRpcClient,
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/block/blockframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ const BlockFrame_Default_Component = (props: BlockFrameProps) => {
"--magnified-block-blur": `${magnifiedBlockBlur}px`,
} as React.CSSProperties
}
{...({ inert: preview ? "1" : undefined } as any)} // sets insert="1" ... but tricks TS into accepting it
// @ts-ignore: inert does exist in the DOM, just not in react
inert={preview ? "1" : undefined} //
>
<BlockMask nodeModel={nodeModel} />
{preview || viewModel == null ? null : (
Expand Down
14 changes: 7 additions & 7 deletions frontend/app/modals/conntypeahead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,10 @@ const ChangeConnectionBlockModal = React.memo(
// typeahead was opened. good candidate for verbose log level.
//console.log("unable to load wsl list from backend. using blank list: ", e)
});
/////////
// TODO-S3
// this needs an rpc call to generate a list of s3 profiles
const newS3List = [];
setS3List(newS3List);
/////////
}, [changeConnModalOpen, setConnList]);
RpcApi.ConnListAWSCommand(TabRpcClient, { timeout: 2000 })
.then((s3List) => setS3List(s3List ?? []))
.catch((e) => console.log("unable to load s3 list from backend:", e));
}, [changeConnModalOpen]);

const changeConnection = React.useCallback(
async (connName: string) => {
Expand All @@ -393,10 +390,13 @@ const ChangeConnectionBlockModal = React.memo(
if (connName == blockData?.meta?.connection) {
return;
}
const isAws = connName?.startsWith("aws:");
const oldCwd = blockData?.meta?.file ?? "";
let newCwd: string;
if (oldCwd == "") {
newCwd = "";
} else if (isAws) {
newCwd = "/";
} else {
newCwd = "~";
}
Expand Down
11 changes: 11 additions & 0 deletions frontend/app/store/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,17 @@ function getConnStatusAtom(conn: string): PrimitiveAtom<ConnStatus> {
wshenabled: false,
};
rtn = atom(connStatus);
} else if (conn.startsWith("aws:")) {
const connStatus: ConnStatus = {
connection: conn,
connected: true,
error: null,
status: "connected",
hasconnected: true,
activeconnnum: 0,
wshenabled: false,
};
rtn = atom(connStatus);
} else {
const connStatus: ConnStatus = {
connection: conn,
Expand Down
Loading
Loading