diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py index aa4cbe6d977..be170db0e13 100644 --- a/web/pgadmin/browser/server_groups/servers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/__init__.py @@ -165,6 +165,7 @@ def get_shared_server_properties(server, sharedserver): server.tunnel_username = sharedserver.tunnel_username server.tunnel_password = sharedserver.tunnel_password server.save_password = sharedserver.save_password + server.tunnel_identity_file = sharedserver.tunnel_identity_file if hasattr(server, 'connection_params') and \ hasattr(sharedserver, 'connection_params') and \ 'passfile' in server.connection_params and \ diff --git a/web/pgadmin/static/js/components/FormComponents.jsx b/web/pgadmin/static/js/components/FormComponents.jsx index 02066d7266e..4517e2b46b9 100644 --- a/web/pgadmin/static/js/components/FormComponents.jsx +++ b/web/pgadmin/static/js/components/FormComponents.jsx @@ -44,6 +44,7 @@ import { withColorPicker } from '../helpers/withColorPicker'; import { useWindowSize } from '../custom_hooks'; import PgTreeView from '../PgTreeView'; import Loader from 'sources/components/Loader'; +import { MY_STORAGE } from '../../../misc/file_manager/static/js/components/FileManagerConstants'; const useStyles = makeStyles((theme) => ({ @@ -459,8 +460,12 @@ export function InputFileSelect({ controlProps, onChange, disabled, readonly, is dialog_title: controlProps.dialogTitle || '', btn_primary: controlProps.btnPrimary || '', }; - showFileManager(params, (fileName)=>{ - onChange?.(decodeURI(fileName)); + showFileManager(params, (fileName, dir)=>{ + if (dir === MY_STORAGE){ + onChange?.(decodeURI(fileName)); + }else{ + onChange?.(dir + ':/' + decodeURI(fileName)); + } inpRef.current.focus(); }); }; diff --git a/web/pgadmin/utils/__init__.py b/web/pgadmin/utils/__init__.py index 733cb0c5326..56ba8563ab2 100644 --- a/web/pgadmin/utils/__init__.py +++ b/web/pgadmin/utils/__init__.py @@ -226,7 +226,14 @@ def get_complete_file_path(file, validate=True): if current_app.PGADMIN_RUNTIME or not current_app.config['SERVER_MODE']: return file if os.path.isfile(file) else None - storage_dir = get_storage_directory() + dir_path = '' + if file.find('://') != -1: + dir_file_paths = file.split('://') + dir_path = dir_file_paths[0] + file = dir_file_paths[1] + + storage_dir = get_storage_directory(shared_storage=dir_path) if dir_path \ + else get_storage_directory() if storage_dir: file = os.path.join( storage_dir,