Browse Source

[ozone] Add UI changes

ayush.goyal 2 years ago
parent
commit
de3a3e686f

+ 6 - 0
apps/filebrowser/src/filebrowser/templates/fb_components.mako

@@ -51,6 +51,12 @@ else:
               <svg class="hi"><use xlink:href='#hi-adls'></use></svg>
               <svg class="hi"><use xlink:href='#hi-adls'></use></svg>
             </span>
             </span>
           </li>
           </li>
+        %elif path.lower().find('ofs://') == 0:
+          <li style="padding-top: 12px">
+            <span class="breadcrumb-link homeLink">
+              <svg class="hi"><use xlink:href='#hi-adls'></use></svg>
+            </span>
+          </li>
         %else:
         %else:
           <li><a class="pointer breadcrumb-link homeLink" data-bind="click: $root.openHome, attr:{'href': window.HUE_BASE_URL + '/filebrowser/view=' + window.USER_HOME_DIR  + '?default_to_home'}">
           <li><a class="pointer breadcrumb-link homeLink" data-bind="click: $root.openHome, attr:{'href': window.HUE_BASE_URL + '/filebrowser/view=' + window.USER_HOME_DIR  + '?default_to_home'}">
             <i class="fa fa-home"></i> ${_('Home')}</a>
             <i class="fa fa-home"></i> ${_('Home')}</a>

+ 7 - 6
apps/filebrowser/src/filebrowser/templates/listdir.mako

@@ -49,7 +49,7 @@ ${ fb_components.menubar() }
   %endif
   %endif
 </style>
 </style>
 
 
-<div id="${ path.startswith('s3a://') and 'filebrowser_s3Components' or path.startswith('abfs://') and 'filebrowser_abfsComponents' or 'filebrowserComponents' }" class="container-fluid filebrowser" style="min-height: calc(100vh - 130px);">
+<div id="${ path.startswith('s3a://') and 'filebrowser_s3Components' or path.startswith('abfs://') and 'filebrowser_abfsComponents'  or path.startswith('ofs://') and 'filebrowser_ofsComponents'or 'filebrowserComponents' }" class="container-fluid filebrowser" style="min-height: calc(100vh - 130px);">
   <div class="card card-small">
   <div class="card card-small">
     <div class="actionbar">
     <div class="actionbar">
     <%actionbar:render>
     <%actionbar:render>
@@ -66,7 +66,7 @@ ${ fb_components.menubar() }
               <span class="caret" style="line-height: 15px"></span>
               <span class="caret" style="line-height: 15px"></span>
             </button>
             </button>
             <ul class="dropdown-menu" style="top: auto">
             <ul class="dropdown-menu" style="top: auto">
-              <li><a data-hue-analytics="filebrowser:actions-menu/rename-click" href="javascript: void(0)" title="${_('Rename')}" data-bind="visible: !inTrash() && selectedFiles().length == 1, click: renameFile,
+              <li><a data-hue-analytics="filebrowser:actions-menu/rename-click" href="javascript: void(0)" title="${_('Rename')}" data-bind="visible: !inTrash() && selectedFiles().length == 1 && !isOFSRoot() && !isOFSVol(), click: renameFile,
               enable: selectedFiles().length == 1 && isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-font"></i>
               enable: selectedFiles().length == 1 && isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-font"></i>
               ${_('Rename')}</a></li>
               ${_('Rename')}</a></li>
               <li><a data-hue-analytics="filebrowser:actions-menu/move-click" href="javascript: void(0)" title="${_('Move')}" data-bind="click: move, enable: selectedFiles().length > 0 &&
               <li><a data-hue-analytics="filebrowser:actions-menu/move-click" href="javascript: void(0)" title="${_('Move')}" data-bind="click: move, enable: selectedFiles().length > 0 &&
@@ -171,7 +171,7 @@ ${ fb_components.menubar() }
           <!-- /ko -->
           <!-- /ko -->
           <!-- ko ifnot: isS3() || isABFS() -->
           <!-- ko ifnot: isS3() || isABFS() -->
           <div id="upload-dropdown" class="btn-group" style="vertical-align: middle">
           <div id="upload-dropdown" class="btn-group" style="vertical-align: middle">
-            <a data-hue-analytics="filebrowser:upload-btn-click" href="javascript: void(0)" class="btn upload-link dropdown-toggle" title="${_('Upload')}" data-bind="click: uploadFile, visible: !inTrash(), css: {'disabled': isS3() && isS3Root() || isABFS() && isABFSRoot()}">
+            <a data-hue-analytics="filebrowser:upload-btn-click" href="javascript: void(0)" class="btn upload-link dropdown-toggle" title="${_('Upload')}" data-bind="click: uploadFile, visible: !inTrash(), css: {'disabled': isS3() && isS3Root() || isABFS() && isABFSRoot() || (isOFS() && (isOFSRoot() || isOFSVol()))}">
               <i class="fa fa-arrow-circle-o-up"></i> ${_('Upload')}
               <i class="fa fa-arrow-circle-o-up"></i> ${_('Upload')}
             </a>
             </a>
           </div>
           </div>
@@ -183,12 +183,13 @@ ${ fb_components.menubar() }
               <span class="caret"></span>
               <span class="caret"></span>
             </a>
             </a>
             <ul class="dropdown-menu pull-right" style="top: auto">
             <ul class="dropdown-menu pull-right" style="top: auto">
-              <li data-bind="visible: !isS3() && !isABFS() || isS3() && !isS3Root() || isABFS() && !isABFSRoot()"><a data-hue-analytics="filebrowser:new-file-btn-click" href="javascript: void(0)" class="create-file-link" title="${_('File')}"><i class="fa fa-file-o"></i> ${_('File')}</a></li>
+              <li data-bind="visible: !isS3() && !isABFS() && !isOFS() || isS3() && !isS3Root() || isABFS() && !isABFSRoot() || isOFS() && !isOFSRoot() && !isOFSVol()"><a data-hue-analytics="filebrowser:new-file-btn-click" href="javascript: void(0)" class="create-file-link" title="${_('File')}"><i class="fa fa-file-o"></i> ${_('File')}</a></li>
               <li><a href="javascript: void(0)" class="create-directory-link" title="${_('Directory')}">
               <li><a href="javascript: void(0)" class="create-directory-link" title="${_('Directory')}">
                 <i class="fa fa-folder"></i>
                 <i class="fa fa-folder"></i>
-                <span data-bind="visible: !isS3() && !isABFS() || isS3() && !isS3Root() || isABFS() && !isABFSRoot()">${_('Directory')}</span>
-                <span data-bind="visible: isS3() && isS3Root()">${_('Bucket')}</span>
+                <span data-bind="visible: !isS3() && !isABFS() && !isOFS() || isS3() && !isS3Root() || isABFS() && !isABFSRoot() || isOFS() && !isOFSRoot() && !isOFSVol()">${_('Directory')}</span>
+                <span data-bind="visible: (isS3() && isS3Root()) || (isOFS() && isOFSVol())">${_('Bucket')}</span>
                 <span data-bind="visible: isABFS() && isABFSRoot()">${_('File System')}</span>
                 <span data-bind="visible: isABFS() && isABFSRoot()">${_('File System')}</span>
+                <span data-bind="visible: isOFS() && isOFSRoot()">${_('Volume')}</span>
               </a></li>
               </a></li>
             </ul>
             </ul>
           </div>
           </div>

+ 36 - 10
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -461,27 +461,33 @@ else:
     <div id="createDirectoryModal" class="modal hide fade">
     <div id="createDirectoryModal" class="modal hide fade">
       <div class="modal-header">
       <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-label="${ _('Close') }"><span aria-hidden="true">&times;</span></button>
         <button type="button" class="close" data-dismiss="modal" aria-label="${ _('Close') }"><span aria-hidden="true">&times;</span></button>
-        <!-- ko if: (!isS3() && !isABFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) -->
+        <!-- ko if: (!isS3() && !isABFS() && !isOFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) || (isOFS() && !isOFSRoot() && !isOFSVol())  -->
         <h2 class="modal-title">${_('Create Directory')}</h2>
         <h2 class="modal-title">${_('Create Directory')}</h2>
         <!-- /ko -->
         <!-- /ko -->
-        <!-- ko if: isS3() && isS3Root() -->
+        <!-- ko if: (isS3() && isS3Root()) || (isOFS() && isOFSVol()) -->
         <h2 class="modal-title">${_('Create Bucket')}</h2>
         <h2 class="modal-title">${_('Create Bucket')}</h2>
         <!-- /ko -->
         <!-- /ko -->
         <!-- ko if: isABFS() && isABFSRoot() -->
         <!-- ko if: isABFS() && isABFSRoot() -->
         <h2 class="modal-title">${_('Create File System')}</h2>
         <h2 class="modal-title">${_('Create File System')}</h2>
         <!-- /ko -->
         <!-- /ko -->
+        <!-- ko if: isOFS() && isOFSRoot() -->
+        <h2 class="modal-title">${_('Create Volume')}</h2>
+        <!-- /ko -->
       </div>
       </div>
       <div class="modal-body">
       <div class="modal-body">
         <label>
         <label>
-          <!-- ko if: (!isS3() && !isABFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) -->
+          <!-- ko if: (!isS3() && !isABFS() && !isOFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) || (isOFS() && !isOFSRoot() && !isOFSVol()) -->
           ${_('Directory Name')}
           ${_('Directory Name')}
           <!-- /ko -->
           <!-- /ko -->
-          <!-- ko if: isS3() && isS3Root() -->
+          <!-- ko if: (isS3() && isS3Root()) || (isOFS() && isOFSVol()) -->
           ${_('Bucket Name')}
           ${_('Bucket Name')}
           <!-- /ko -->
           <!-- /ko -->
           <!-- ko if: isABFS() && isABFSRoot() -->
           <!-- ko if: isABFS() && isABFSRoot() -->
           ${_('File System Name')}
           ${_('File System Name')}
           <!-- /ko -->
           <!-- /ko -->
+          <!-- ko if: isOFS() && isOFSRoot() -->
+          ${_('Volume Name')}
+          <!-- /ko -->
           <input id="newDirectoryNameInput" name="name" value="" type="text" class="input-xlarge"/></label>
           <input id="newDirectoryNameInput" name="name" value="" type="text" class="input-xlarge"/></label>
           <input type="hidden" name="path" data-bind="value: currentPath"/>
           <input type="hidden" name="path" data-bind="value: currentPath"/>
       </div>
       </div>
@@ -575,12 +581,12 @@ else:
   <!-- actions context menu -->
   <!-- actions context menu -->
   <ul class="context-menu dropdown-menu">
   <ul class="context-menu dropdown-menu">
   <!-- ko ifnot: $root.inTrash -->
   <!-- ko ifnot: $root.inTrash -->
-    <li data-bind="visible: (!isS3() && !isABFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()), css: {'disabled': $root.selectedFiles().length != 1 || isCurrentDirSelected().length > 0}">
+    <li data-bind="visible: (!isS3() && !isABFS() && !isOFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) || (isOFS() && !isOFSRoot() && !isOFSVol()), css: {'disabled': $root.selectedFiles().length != 1 || isCurrentDirSelected().length > 0}">
     <a href="javascript: void(0)" title="${_('Rename')}" data-bind="click: ($root.selectedFiles().length == 1 && isCurrentDirSelected().length == 0) ? $root.renameFile: void(0)"><i class="fa fa-fw fa-font"></i>
     <a href="javascript: void(0)" title="${_('Rename')}" data-bind="click: ($root.selectedFiles().length == 1 && isCurrentDirSelected().length == 0) ? $root.renameFile: void(0)"><i class="fa fa-fw fa-font"></i>
     ${_('Rename')}</a></li>
     ${_('Rename')}</a></li>
-    <li data-bind="visible: (!isS3() && !isABFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()), css: {'disabled': $root.selectedFiles().length == 0 || isCurrentDirSelected().length > 0}">
+    <li data-bind="visible: (!isS3() && !isABFS() && !isOFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) || (isOFS() && !isOFSRoot() && !isOFSVol()), css: {'disabled': $root.selectedFiles().length == 0 || isCurrentDirSelected().length > 0}">
     <a href="javascript: void(0)" title="${_('Move')}" data-bind="click: ( $root.selectedFiles().length > 0 && isCurrentDirSelected().length == 0) ? $root.move: void(0)"><i class="fa fa-fw fa-random"></i> ${_('Move')}</a></li>
     <a href="javascript: void(0)" title="${_('Move')}" data-bind="click: ( $root.selectedFiles().length > 0 && isCurrentDirSelected().length == 0) ? $root.move: void(0)"><i class="fa fa-fw fa-random"></i> ${_('Move')}</a></li>
-    <li data-bind="visible: (!isS3() && !isABFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()), css: {'disabled': $root.selectedFiles().length == 0 || isCurrentDirSelected().length > 0}">
+    <li data-bind="visible: (!isS3() && !isABFS() && !isOFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) || (isOFS() && !isOFSRoot() && !isOFSVol()), css: {'disabled': $root.selectedFiles().length == 0 || isCurrentDirSelected().length > 0}">
     <a href="javascript: void(0)" title="${_('Copy')}" data-bind="click: ($root.selectedFiles().length > 0 && isCurrentDirSelected().length == 0) ? $root.copy: void(0)"><i class="fa fa-fw fa-files-o"></i> ${_('Copy')}</a></li>
     <a href="javascript: void(0)" title="${_('Copy')}" data-bind="click: ($root.selectedFiles().length > 0 && isCurrentDirSelected().length == 0) ? $root.copy: void(0)"><i class="fa fa-fw fa-files-o"></i> ${_('Copy')}</a></li>
     % if show_download_button:
     % if show_download_button:
     <li data-bind="css: {'disabled': $root.inTrash() || $root.selectedFiles().length != 1 || selectedFile().type != 'file'}">
     <li data-bind="css: {'disabled': $root.inTrash() || $root.selectedFiles().length != 1 || selectedFile().type != 'file'}">
@@ -1062,6 +1068,10 @@ else:
         return self.currentPath().toLowerCase().indexOf('abfs://') === 0;
         return self.currentPath().toLowerCase().indexOf('abfs://') === 0;
       });
       });
 
 
+      self.isOFS = ko.pureComputed(function () {
+        return self.currentPath().toLowerCase().indexOf('ofs://') === 0;
+      });
+
       self.scheme = ko.pureComputed(function () {
       self.scheme = ko.pureComputed(function () {
         var path = self.currentPath();
         var path = self.currentPath();
         return path.substring(0, path.indexOf(':/')) || "hdfs";
         return path.substring(0, path.indexOf(':/')) || "hdfs";
@@ -1073,6 +1083,8 @@ else:
           return 'adls';
           return 'adls';
         } else if (scheme === 's3a' ){
         } else if (scheme === 's3a' ){
           return 's3';
           return 's3';
+        } else if (scheme === 'ofs' ){
+          return 'ofs';
         } else if (!scheme || scheme == 'hdfs') {
         } else if (!scheme || scheme == 'hdfs') {
           return 'hdfs';
           return 'hdfs';
         } else {
         } else {
@@ -1088,6 +1100,8 @@ else:
           return 'adl:/';
           return 'adl:/';
         } else if (path.indexOf('abfs://') >= 0) {
         } else if (path.indexOf('abfs://') >= 0) {
           return 'abfs://';
           return 'abfs://';
+        } else if (path.indexOf('ofs://') >= 0) {
+          return 'ofs://';
         } else {
         } else {
           return '/';
           return '/';
         }
         }
@@ -1106,13 +1120,13 @@ else:
         return currentPath.indexOf('/') === 0 || currentPath.indexOf('hdfs') === 0
         return currentPath.indexOf('/') === 0 || currentPath.indexOf('hdfs') === 0
       });
       });
       self.isCompressEnabled = ko.pureComputed(function () {
       self.isCompressEnabled = ko.pureComputed(function () {
-        return !self.isS3() && !self.isAdls() && !self.isABFS();
+        return !self.isS3() && !self.isAdls() && !self.isABFS() && !self.isOFS();
       });
       });
       self.isSummaryEnabled = ko.pureComputed(function () {
       self.isSummaryEnabled = ko.pureComputed(function () {
-        return self.isHdfs();
+        return self.isHdfs() || self.isOFS();
       });
       });
       self.isPermissionEnabled = ko.pureComputed(function () {
       self.isPermissionEnabled = ko.pureComputed(function () {
-        return !self.isS3() && !self.isABFSRoot();
+        return !self.isS3() && !self.isABFSRoot() && !self.isOFS();
       });
       });
       self.isReplicationEnabled = ko.pureComputed(function () {
       self.isReplicationEnabled = ko.pureComputed(function () {
         return self.isHdfs();
         return self.isHdfs();
@@ -1132,6 +1146,14 @@ else:
         return self.isABFS() && self.currentPath().toLowerCase() === 'abfs://';
         return self.isABFS() && self.currentPath().toLowerCase() === 'abfs://';
       });
       });
 
 
+      self.isOFSRoot = ko.pureComputed(function () {
+        return self.isOFS() && self.currentPath().toLowerCase() === 'ofs://';
+      });
+
+      self.isOFSVol = ko.pureComputed(function () {
+        return self.isOFS() && self.currentPath().split("/").length === 3 && self.currentPath().split("/")[2] !== '';
+      });
+
       self.inTrash = ko.computed(function() {
       self.inTrash = ko.computed(function() {
         return self.currentPath().match(/^\/user\/.+?\/\.Trash/);
         return self.currentPath().match(/^\/user\/.+?\/\.Trash/);
       });
       });
@@ -1990,6 +2012,10 @@ else:
         });
         });
 
 
         $("#fileUploader").on('fb:updatePath', function (e, options) {
         $("#fileUploader").on('fb:updatePath', function (e, options) {
+          const uploadingToOzone = self.currentPath().startsWith("ofs://");          
+          if (uploadingToOzone && UPLOAD_CHUNK_SIZE) {
+            uploader.setOption('sizeLimit', UPLOAD_CHUNK_SIZE);
+          }  
           uploader.setParams({
           uploader.setParams({
             dest: options.dest,
             dest: options.dest,
             fileFieldLabel: "hdfs_file"
             fileFieldLabel: "hdfs_file"

+ 68 - 1
desktop/core/src/desktop/js/api/apiHelper.js

@@ -70,6 +70,7 @@ class ApiHelper {
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'hdfs' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'hdfs' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'adls' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'adls' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'abfs' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'abfs' }), {});
+      setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'ofs' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'git' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'git' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 's3' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 's3' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'collections' }), {});
       setInLocalStorage(this.getAssistCacheIdentifier({ sourceType: 'collections' }), {});
@@ -215,7 +216,7 @@ class ApiHelper {
    *
    *
    * @param {Object} options
    * @param {Object} options
    * @param {string[]} options.path
    * @param {string[]} options.path
-   * @param {string} options.type - 's3', 'adls', 'abfs' or 'hdfs'
+   * @param {string} options.type - 's3', 'adls', 'abfs', 'ofs' or 'hdfs'
    * @param {number} [options.offset]
    * @param {number} [options.offset]
    * @param {number} [options.length]
    * @param {number} [options.length]
    * @param {boolean} [options.silenceErrors]
    * @param {boolean} [options.silenceErrors]
@@ -228,6 +229,8 @@ class ApiHelper {
       url = URLS.ADLS_API_PREFIX;
       url = URLS.ADLS_API_PREFIX;
     } else if (options.type === 'abfs') {
     } else if (options.type === 'abfs') {
       url = URLS.ABFS_API_PREFIX;
       url = URLS.ABFS_API_PREFIX;
+    } else if (options.type === 'ofs') {
+      url = URLS.OFS_API_PREFIX;
     } else {
     } else {
       url = URLS.HDFS_API_PREFIX;
       url = URLS.HDFS_API_PREFIX;
     }
     }
@@ -461,7 +464,71 @@ class ApiHelper {
       })
       })
     );
     );
   }
   }
+  /**
+   * @param {Object} options
+   * @param {Function} options.successCallback
+   * @param {Function} [options.errorCallback]
+   * @param {boolean} [options.silenceErrors]
+   * @param {Number} [options.timeout]
+   * @param {Object} [options.editor] - Ace editor
+   *
+   * @param {string[]} options.pathParts
+   * @param {number} [options.pageSize] - Default 500
+   * @param {number} [options.page] - Default 1
+   * @param {string} [options.filter]
+   */
+  fetchOfsPath(options) {
+    let url =
+      URLS.OFS_API_PREFIX +
+      options.pathParts.join('/') +
+      '?format=json&sortby=name&descending=false&pagesize=' +
+      (options.pageSize || 500) +
+      '&pagenum=' +
+      (options.page || 1);
+    if (options.filter) {
+      url += '&filter=' + options.filter;
+    }
+    const fetchFunction = storeInCache => {
+      if (options.timeout === 0) {
+        assistErrorCallback(options)({ status: -1 });
+        return;
+      }
+      return $.ajax({
+        dataType: 'json',
+        url: url,
+        timeout: options.timeout,
+        success: data => {
+          if (
+            !data.error &&
+            !successResponseIsError(data) &&
+            typeof data.files !== 'undefined' &&
+            data.files !== null
+          ) {
+            if (data.files.length > 2 && !options.filter) {
+              storeInCache(data);
+            }
+            options.successCallback(data);
+          } else {
+            assistErrorCallback(options)(data);
+          }
+        }
+      })
+        .fail(assistErrorCallback(options))
+        .always(() => {
+          if (typeof options.editor !== 'undefined' && options.editor !== null) {
+            options.editor.hideSpinner();
+          }
+        });
+    };
 
 
+    return this.fetchCached(
+      $.extend({}, options, {
+        sourceType: 'ofs',
+        url: url,
+        fetchFunction: fetchFunction
+      })
+    );
+  }
   /**
   /**
    * @param {Object} options
    * @param {Object} options
    * @param {Function} options.successCallback
    * @param {Function} options.successCallback

+ 1 - 0
desktop/core/src/desktop/js/api/urls.js

@@ -23,6 +23,7 @@ export const DOCUMENTS_SEARCH_API = '/desktop/api2/docs/';
 export const GET_HUE_CONFIG_API = '/desktop/api2/get_hue_config';
 export const GET_HUE_CONFIG_API = '/desktop/api2/get_hue_config';
 export const FETCH_CONFIG_API = '/api/get_config/';
 export const FETCH_CONFIG_API = '/api/get_config/';
 export const HDFS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('/');
 export const HDFS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('/');
+export const OFS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('ofs://');
 export const ADLS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('adl:/');
 export const ADLS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('adl:/');
 export const ABFS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('ABFS://');
 export const ABFS_API_PREFIX = '/filebrowser/view=' + encodeURIComponent('ABFS://');
 export const GIT_API_PREFIX = '/desktop/api/vcs/contents/';
 export const GIT_API_PREFIX = '/desktop/api/vcs/contents/';

+ 3 - 0
desktop/core/src/desktop/js/apps/editor/components/aceEditor/autocomplete/AutocompleteResults.ts

@@ -1192,6 +1192,9 @@ class AutocompleteResults {
       }
       }
     } else if (/^hdfs:\/\//i.test(path)) {
     } else if (/^hdfs:\/\//i.test(path)) {
       path = path.substring(6);
       path = path.substring(6);
+    } else if (/^ofs:\/\//i.test(path)) {
+      fetchFunction = 'fetchOfsPath';
+      path = path.substring(5);
     }
     }
 
 
     const parts = path.split('/');
     const parts = path.split('/');

+ 2 - 0
desktop/core/src/desktop/js/components/sidebar/HueSidebar.vue

@@ -308,6 +308,8 @@
               adaptedName = 'adls';
               adaptedName = 'adls';
             } else if (location.href.indexOf('=abfs') !== -1) {
             } else if (location.href.indexOf('=abfs') !== -1) {
               adaptedName = 'abfs';
               adaptedName = 'abfs';
+            } else if (location.href.indexOf('=ofs') !== -1) {
+              adaptedName = 'ofs';
             } else {
             } else {
               adaptedName = 'hdfs';
               adaptedName = 'hdfs';
             }
             }

+ 3 - 0
desktop/core/src/desktop/js/ext/fileuploader.custom.js

@@ -315,6 +315,9 @@ qq.FileUploaderBasic.prototype = {
     setParams: function(params){
     setParams: function(params){
         this._options.params = params;
         this._options.params = params;
     },
     },
+    setOption: function(key, val){
+        this._options[key] = val;
+    },
     getInProgress: function(){
     getInProgress: function(){
         return this._filesInProgress;
         return this._filesInProgress;
     },
     },

+ 17 - 0
desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js

@@ -125,6 +125,23 @@ const defaults = {
         home: '',
         home: '',
         name: 'ABFS'
         name: 'ABFS'
       }
       }
+    },
+    ofs: {
+      scheme: 'ofs',
+      root: 'ofs://',
+      home: '/?default_ofs_home',
+      icon: {
+        svg: {
+          brand: '#hi-adls',
+          home: '#hi-adls'
+        },
+        brand: 'fa-windows',
+        home: 'fa-windows'
+      },
+      label: {
+        home: '',
+        name: 'OFS'
+      }
     }
     }
   },
   },
   fsSelected: 'hdfs',
   fsSelected: 'hdfs',

+ 10 - 0
desktop/core/src/desktop/js/ko/bindings/ace/ko.aceEditor.js

@@ -640,6 +640,16 @@ registerBinding(NAME, {
       dblClickAbfsItemSub.remove();
       dblClickAbfsItemSub.remove();
     });
     });
 
 
+    const dblClickOfsItemSub = huePubSub.subscribe('assist.dblClickOfsItem', assistHdfsEntry => {
+      if ($el.data('last-active-editor')) {
+        editor.session.insert(editor.getCursorPosition(), 'ofs://' + assistHdfsEntry.path + "'");
+      }
+    });
+
+    disposeFunctions.push(() => {
+      dblClickOfsItemSub.remove();
+    });
+
     const dblClickGitItemSub = huePubSub.subscribe('assist.dblClickGitItem', assistGitEntry => {
     const dblClickGitItemSub = huePubSub.subscribe('assist.dblClickGitItem', assistGitEntry => {
       if ($el.data('last-active-editor')) {
       if ($el.data('last-active-editor')) {
         editor.session.setValue(assistGitEntry.fileContent());
         editor.session.setValue(assistGitEntry.fileContent());

+ 5 - 0
desktop/core/src/desktop/js/ko/components/assist/assistStorageEntry.js

@@ -39,6 +39,10 @@ const TYPE_SPECIFICS = {
   s3: {
   s3: {
     apiHelperFetchFunction: 'fetchS3Path',
     apiHelperFetchFunction: 'fetchS3Path',
     dblClickPubSubId: 'assist.dblClickS3Item'
     dblClickPubSubId: 'assist.dblClickS3Item'
+  },
+  ofs: {
+    apiHelperFetchFunction: 'fetchOfsPath',
+    dblClickPubSubId: 'assist.dblClickOfsItem'
   }
   }
 };
 };
 
 
@@ -356,6 +360,7 @@ class AssistStorageEntry {
     type = type.replace(/s3.*/i, 's3');
     type = type.replace(/s3.*/i, 's3');
     type = type.replace(/adl.*/i, 'adls');
     type = type.replace(/adl.*/i, 'adls');
     type = type.replace(/abfs.*/i, 'abfs');
     type = type.replace(/abfs.*/i, 'abfs');
+    type = type.replace(/ofs.*/i, 'ofs');
 
 
     // TODO: connector.id for browser connectors
     // TODO: connector.id for browser connectors
     const connector = findBrowserConnector(connector => connector.type === type);
     const connector = findBrowserConnector(connector => connector.type === type);

+ 2 - 1
desktop/core/src/desktop/js/ko/components/assist/ko.assistPanel.js

@@ -130,7 +130,8 @@ class AssistPanel {
               interpreter.type === 'adls' ||
               interpreter.type === 'adls' ||
               interpreter.type === 'hdfs' ||
               interpreter.type === 'hdfs' ||
               interpreter.type === 's3' ||
               interpreter.type === 's3' ||
-              interpreter.type === 'abfs'
+              interpreter.type === 'abfs' ||
+              interpreter.type === 'ofs'
           );
           );
 
 
           if (storageBrowsers.length) {
           if (storageBrowsers.length) {

+ 3 - 1
desktop/core/src/desktop/js/ko/components/assist/ko.assistStoragePanel.js

@@ -221,7 +221,9 @@ class AssistStoragePanel {
 
 
     huePubSub.subscribe('assist.storage.go.home', () => {
     huePubSub.subscribe('assist.storage.go.home', () => {
       const path =
       const path =
-        this.activeSource().type === 's3' || this.activeSource().type === 'abfs'
+        this.activeSource().type === 's3' ||
+        this.activeSource().type === 'abfs' ||
+        this.activeSource().type === 'ofs'
           ? '/'
           ? '/'
           : window.USER_HOME_DIR;
           : window.USER_HOME_DIR;
       this.loadPath(path);
       this.loadPath(path);

+ 2 - 1
desktop/core/src/desktop/js/ko/components/ko.editorDroppableMenu.js

@@ -115,7 +115,8 @@ class EditorDroppableMenu extends DisposableComponent {
           meta.type === 's3' ||
           meta.type === 's3' ||
           meta.type === 'hdfs' ||
           meta.type === 'hdfs' ||
           meta.type === 'adls' ||
           meta.type === 'adls' ||
-          meta.type === 'abfs'
+          meta.type === 'abfs' ||
+          meta.type === 'ofs'
         ) {
         ) {
           text = "'" + meta.definition.path + "'";
           text = "'" + meta.definition.path + "'";
         }
         }

+ 3 - 0
desktop/core/src/desktop/js/sql/autocompleteResults.js

@@ -1448,6 +1448,9 @@ class AutocompleteResults {
       }
       }
     } else if (/^hdfs:\/\//i.test(path)) {
     } else if (/^hdfs:\/\//i.test(path)) {
       path = path.substring(6);
       path = path.substring(6);
+    } else if (/^ofs:\/\//i.test(path)) {
+      fetchFunction = 'fetchOfsPath';
+      path = path.substring(5);
     }
     }
 
 
     const parts = path.split('/');
     const parts = path.split('/');