diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py
index e6c4e004f..bc67a5943 100644
--- a/web/pgadmin/misc/file_manager/__init__.py
+++ b/web/pgadmin/misc/file_manager/__init__.py
@@ -233,36 +233,6 @@ def delete_trans_id(trans_id):
data={'status': True}
)
-
-def __get_drives(drive_name=None):
- """
- This is a generic function which returns the default path for storage
- manager dialog irrespective of any Platform type to list all
- files and directories.
- Platform windows:
- if no path is given, it will list volumes, else list directory
- Platform unix:
- it returns path to root directory if no path is specified.
- """
- if _platform == "win32":
- try:
- drives = []
- bitmask = ctypes.windll.kernel32.GetLogicalDrives()
- for letter in letters:
- if bitmask & 1:
- drives.append(letter)
- bitmask >>= 1
- if (drive_name != '' and drive_name is not None and
- drive_name in drives):
- return "{0}{1}".format(drive_name, ':/')
- else:
- return drives # return drives if no argument is passed
- except Exception:
- return 'C:/'
- else:
- return '/'
-
-
class Filemanager(object):
"""FileManager Class."""
def __init__(self, trans_id):
@@ -295,8 +265,7 @@ class Filemanager(object):
# It is used in utitlity js to decide to
# show or hide select file type options
- show_volumes = True if (isinstance(storage_dir, list) or
- not storage_dir) else False
+ show_volumes = isinstance(storage_dir, list) or not storage_dir
supp_types = allow_upload_files = params['supported_types'] \
if 'supported_types' in params else []
if fm_type == 'select_file':
@@ -395,6 +364,35 @@ class Filemanager(object):
return make_json_response(data={'status': True})
+ @staticmethod
+ def _get_drives(drive_name=None):
+ """
+ This is a generic function which returns the default path for storage
+ manager dialog irrespective of any Platform type to list all
+ files and directories.
+ Platform windows:
+ if no path is given, it will list volumes, else list directory
+ Platform unix:
+ it returns path to root directory if no path is specified.
+ """
+ if _platform == "win32":
+ try:
+ drives = []
+ bitmask = ctypes.windll.kernel32.GetLogicalDrives()
+ for letter in letters:
+ if bitmask & 1:
+ drives.append(letter)
+ bitmask >>= 1
+ if (drive_name != '' and drive_name is not None and
+ drive_name in drives):
+ return "{0}{1}".format(drive_name, ':/')
+ else:
+ return drives # return drives if no argument is passed
+ except Exception:
+ return ['C:/']
+ else:
+ return '/'
+
@staticmethod
def list_filesystem(dir, path, trans_data, file_type):
"""
@@ -402,8 +400,8 @@ class Filemanager(object):
directory.
"""
files = {}
- if (_platform == "win32" and path == '/') and (not dir):
- drives = __get_drives()
+ if (_platform == "win32" and path == '/') and dir is None:
+ drives = Filemanager._get_drives()
for drive in drives:
protected = 0
path = file_name = "{0}:/".format(drive)
@@ -426,6 +424,8 @@ class Filemanager(object):
}
return files
+ if dir is None:
+ dir = ""
orig_path = "{0}{1}".format(dir, path)
user_dir = path
folders_only = trans_data['folders_only'] if 'folders_only' in \
diff --git a/web/pgadmin/misc/file_manager/static/css/file_manager.css b/web/pgadmin/misc/file_manager/static/css/file_manager.css
index cebed17c4..069d00302 100755
--- a/web/pgadmin/misc/file_manager/static/css/file_manager.css
+++ b/web/pgadmin/misc/file_manager/static/css/file_manager.css
@@ -360,7 +360,6 @@ button.list span {
overflow: hidden;
position: relative;
top: 35px;
- font-size: 12px;
}
.file_manager .fileinfo #contents{
@@ -596,14 +595,33 @@ a.dz-remove {
border: 1px solid black;
}
+.fileinfo .fm_dimmer {
+ height: calc(100% - 32px);
+ display: none;
+ top: 0px;
+ background: black;
+ opacity: 0.5;
+ width: 100%;
+ position: absolute;
+ z-index: 3;
+}
+
.fileinfo .delete_item, .fileinfo .replace_file {
display: none;
- padding: 7px 5px;
+ padding: 15px 15px;
opacity: 0.8;
color: #fff;
border: 1px solid darkgrey;
+ border-left: 0;
+ border-right: 0;
background: #000;
- box-shadow: 1px 0px 3px 1px red;
+ box-shadow: 1px 0px 3px 1px white;
+ font-weight: bold;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 4;
}
.fileinfo .delete_item span.pull-right .btn,
@@ -612,11 +630,7 @@ a.dz-remove {
color: #000;
background: #fff;
font-size: 12px;
-}
-
-.fileinfo .delete_item span,
-.fileinfo .replace_file span {
- margin-right: 10px;
+ margin-right: 4px;
}
.upload_file .dz_cross_btn {
@@ -658,3 +672,16 @@ a.dz-remove {
background: #F9F8F7;
border: 1px inset #ccc;
}
+
+.file_listing .no_folder_found {
+ text-align: center;
+ position: absolute;
+ top: 35;
+ width: 100%;
+}
+
+.fileinfo .is_file_replace {
+ width: 100%;
+ height: 100%;
+ background: #ccc;
+}
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/index.html b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
index 51044da4a..26c54ac8e 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/index.html
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
@@ -29,6 +29,10 @@
+