|
@@ -47,6 +47,7 @@ from django.utils.html import escape
|
|
|
from aws.s3.s3fs import S3FileSystemException, S3ListAllBucketsException, get_s3_home_directory
|
|
from aws.s3.s3fs import S3FileSystemException, S3ListAllBucketsException, get_s3_home_directory
|
|
|
from desktop import appmanager
|
|
from desktop import appmanager
|
|
|
from desktop.auth.backend import is_admin
|
|
from desktop.auth.backend import is_admin
|
|
|
|
|
+from desktop.lib import fsmanager
|
|
|
from desktop.lib import i18n
|
|
from desktop.lib import i18n
|
|
|
from desktop.lib.conf import coerce_bool
|
|
from desktop.lib.conf import coerce_bool
|
|
|
from desktop.lib.django_util import render, format_preserving_redirect
|
|
from desktop.lib.django_util import render, format_preserving_redirect
|
|
@@ -209,6 +210,12 @@ def view(request, path):
|
|
|
if path != decoded_path:
|
|
if path != decoded_path:
|
|
|
path = decoded_path
|
|
path = decoded_path
|
|
|
|
|
|
|
|
|
|
+ if request.path.startswith('/api/') and request.fs is None:
|
|
|
|
|
+ request.fs = fsmanager.get_filesystem(request.fs_ref)
|
|
|
|
|
+
|
|
|
|
|
+ if request.user.is_authenticated and request.fs is not None:
|
|
|
|
|
+ request.fs.setuser(request.user.username)
|
|
|
|
|
+
|
|
|
# default_abfs_home is set in jquery.filechooser.js
|
|
# default_abfs_home is set in jquery.filechooser.js
|
|
|
if 'default_abfs_home' in request.GET:
|
|
if 'default_abfs_home' in request.GET:
|
|
|
from azure.abfs.__init__ import get_home_dir_for_ABFS
|
|
from azure.abfs.__init__ import get_home_dir_for_ABFS
|
|
@@ -451,6 +458,7 @@ def listdir(request, path):
|
|
|
data['files'] = [_massage_stats(request, stat_absolute_path(path, stat)) for stat in stats]
|
|
data['files'] = [_massage_stats(request, stat_absolute_path(path, stat)) for stat in stats]
|
|
|
return render('listdir.mako', request, data)
|
|
return render('listdir.mako', request, data)
|
|
|
|
|
|
|
|
|
|
+
|
|
|
def _massage_page(page, paginator):
|
|
def _massage_page(page, paginator):
|
|
|
try:
|
|
try:
|
|
|
prev_num = page.previous_page_number()
|
|
prev_num = page.previous_page_number()
|
|
@@ -517,7 +525,6 @@ def listdir_paged(request, path):
|
|
|
s3_listing_not_allowed = str(e)
|
|
s3_listing_not_allowed = str(e)
|
|
|
all_stats = []
|
|
all_stats = []
|
|
|
|
|
|
|
|
-
|
|
|
|
|
# Filter first
|
|
# Filter first
|
|
|
filter_str = request.GET.get('filter', None)
|
|
filter_str = request.GET.get('filter', None)
|
|
|
if filter_str:
|
|
if filter_str:
|
|
@@ -596,6 +603,7 @@ def listdir_paged(request, path):
|
|
|
}
|
|
}
|
|
|
return render('listdir.mako', request, data)
|
|
return render('listdir.mako', request, data)
|
|
|
|
|
|
|
|
|
|
+
|
|
|
def scheme_absolute_path(root, path):
|
|
def scheme_absolute_path(root, path):
|
|
|
splitPath = lib_urlparse(path)
|
|
splitPath = lib_urlparse(path)
|
|
|
splitRoot = lib_urlparse(root)
|
|
splitRoot = lib_urlparse(root)
|