浏览代码

Hue Filechooser in Workflow Page always loads abfs:// if configured and it wont load well (#GH-1764)

* [abfs] Hue Filechooser in Workflow Page always loads abfs:// if connfigured and it wont load well GH-1763
Akhil S Naik 4 年之前
父节点
当前提交
8d2c9631bc

+ 13 - 2
apps/filebrowser/src/filebrowser/views.py

@@ -204,7 +204,18 @@ def view(request, path):
   decoded_path = unquote_url(path)
   if path != decoded_path:
     path = decoded_path
-  # default_to_home is set in bootstrap.js
+
+  # default_abfs_home is set in jquery.filechooser.js
+  if 'default_abfs_home' in request.GET:
+    from azure.abfs.__init__ import get_home_dir_for_ABFS
+    home_dir_path = get_home_dir_for_ABFS()
+    if request.fs.isdir(home_dir_path):
+      return format_preserving_redirect(
+          request,
+          '/filebrowser/view=' + urllib_quote(home_dir_path.encode('utf-8'), safe=SAFE_CHARACTERS_URI_COMPONENTS)
+      )
+
+  # default_to_home is set in jquery.filechooser.js
   if 'default_to_home' in request.GET:
     home_dir_path = request.user.get_home_directory()
     if request.fs.isdir(home_dir_path):
@@ -213,7 +224,7 @@ def view(request, path):
           '/filebrowser/view=' + urllib_quote(home_dir_path.encode('utf-8'), safe=SAFE_CHARACTERS_URI_COMPONENTS)
       )
 
-  # default_to_home is set in bootstrap.js
+  # default_to_home is set in jquery.filechooser.js
   if 'default_to_trash' in request.GET:
     home_trash_path = _home_trash_path(request.fs, request.user, path)
     if request.fs.isdir(home_trash_path):

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js

@@ -112,7 +112,7 @@ const defaults = {
     abfs: {
       scheme: 'abfs',
       root: 'abfs://',
-      home: 'abfs://',
+      home: '/?default_abfs_home',
       icon: {
         svg: {
           brand: '#hi-adls',