mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
fix: implement guacamole drive redirection file transfer
This commit is contained in:
@@ -201,6 +201,10 @@ router.post(
|
|||||||
|
|
||||||
switch (connectionType) {
|
switch (connectionType) {
|
||||||
case "rdp":
|
case "rdp":
|
||||||
|
if (guacConfig["enable-drive"] && !guacConfig["drive-path"]) {
|
||||||
|
guacConfig["drive-path"] = "/drive";
|
||||||
|
guacConfig["create-drive-path"] = true;
|
||||||
|
}
|
||||||
token = tokenService.createRdpToken(hostname, username, password, {
|
token = tokenService.createRdpToken(hostname, username, password, {
|
||||||
port: port || 3389,
|
port: port || 3389,
|
||||||
domain,
|
domain,
|
||||||
|
|||||||
@@ -388,6 +388,20 @@ export const GuacamoleDisplay = forwardRef<
|
|||||||
Guacamole.AudioPlayer.getInstance(stream, mimetype);
|
Guacamole.AudioPlayer.getInstance(stream, mimetype);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
client.onfile = (stream: Guacamole.InputStream, mimetype: string, filename: string) => {
|
||||||
|
const reader = new Guacamole.BlobReader(stream, mimetype);
|
||||||
|
reader.onend = () => {
|
||||||
|
const blob = reader.getBlob();
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
a.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
};
|
||||||
|
stream.sendAck("OK", Guacamole.Status.Code.SUCCESS);
|
||||||
|
};
|
||||||
|
|
||||||
client.connect();
|
client.connect();
|
||||||
}, [
|
}, [
|
||||||
getWebSocketUrl,
|
getWebSocketUrl,
|
||||||
|
|||||||
Reference in New Issue
Block a user