|
|
@@ -461,27 +461,33 @@ else:
|
|
|
<div id="createDirectoryModal" class="modal hide fade">
|
|
|
<div class="modal-header">
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="${ _('Close') }"><span aria-hidden="true">×</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>
|
|
|
<!-- /ko -->
|
|
|
- <!-- ko if: isS3() && isS3Root() -->
|
|
|
+ <!-- ko if: (isS3() && isS3Root()) || (isOFS() && isOFSVol()) -->
|
|
|
<h2 class="modal-title">${_('Create Bucket')}</h2>
|
|
|
<!-- /ko -->
|
|
|
<!-- ko if: isABFS() && isABFSRoot() -->
|
|
|
<h2 class="modal-title">${_('Create File System')}</h2>
|
|
|
<!-- /ko -->
|
|
|
+ <!-- ko if: isOFS() && isOFSRoot() -->
|
|
|
+ <h2 class="modal-title">${_('Create Volume')}</h2>
|
|
|
+ <!-- /ko -->
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<label>
|
|
|
- <!-- ko if: (!isS3() && !isABFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) -->
|
|
|
+ <!-- ko if: (!isS3() && !isABFS() && !isOFS()) || (isS3() && !isS3Root()) || (isABFS() && !isABFSRoot()) || (isOFS() && !isOFSRoot() && !isOFSVol()) -->
|
|
|
${_('Directory Name')}
|
|
|
<!-- /ko -->
|
|
|
- <!-- ko if: isS3() && isS3Root() -->
|
|
|
+ <!-- ko if: (isS3() && isS3Root()) || (isOFS() && isOFSVol()) -->
|
|
|
${_('Bucket Name')}
|
|
|
<!-- /ko -->
|
|
|
<!-- ko if: isABFS() && isABFSRoot() -->
|
|
|
${_('File System Name')}
|
|
|
<!-- /ko -->
|
|
|
+ <!-- ko if: isOFS() && isOFSRoot() -->
|
|
|
+ ${_('Volume Name')}
|
|
|
+ <!-- /ko -->
|
|
|
<input id="newDirectoryNameInput" name="name" value="" type="text" class="input-xlarge"/></label>
|
|
|
<input type="hidden" name="path" data-bind="value: currentPath"/>
|
|
|
</div>
|
|
|
@@ -575,12 +581,12 @@ else:
|
|
|
<!-- actions context menu -->
|
|
|
<ul class="context-menu dropdown-menu">
|
|
|
<!-- 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>
|
|
|
${_('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>
|
|
|
- <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>
|
|
|
% if show_download_button:
|
|
|
<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;
|
|
|
});
|
|
|
|
|
|
+ self.isOFS = ko.pureComputed(function () {
|
|
|
+ return self.currentPath().toLowerCase().indexOf('ofs://') === 0;
|
|
|
+ });
|
|
|
+
|
|
|
self.scheme = ko.pureComputed(function () {
|
|
|
var path = self.currentPath();
|
|
|
return path.substring(0, path.indexOf(':/')) || "hdfs";
|
|
|
@@ -1073,6 +1083,8 @@ else:
|
|
|
return 'adls';
|
|
|
} else if (scheme === 's3a' ){
|
|
|
return 's3';
|
|
|
+ } else if (scheme === 'ofs' ){
|
|
|
+ return 'ofs';
|
|
|
} else if (!scheme || scheme == 'hdfs') {
|
|
|
return 'hdfs';
|
|
|
} else {
|
|
|
@@ -1088,6 +1100,8 @@ else:
|
|
|
return 'adl:/';
|
|
|
} else if (path.indexOf('abfs://') >= 0) {
|
|
|
return 'abfs://';
|
|
|
+ } else if (path.indexOf('ofs://') >= 0) {
|
|
|
+ return 'ofs://';
|
|
|
} else {
|
|
|
return '/';
|
|
|
}
|
|
|
@@ -1106,13 +1120,13 @@ else:
|
|
|
return currentPath.indexOf('/') === 0 || currentPath.indexOf('hdfs') === 0
|
|
|
});
|
|
|
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 () {
|
|
|
- return self.isHdfs();
|
|
|
+ return self.isHdfs() || self.isOFS();
|
|
|
});
|
|
|
self.isPermissionEnabled = ko.pureComputed(function () {
|
|
|
- return !self.isS3() && !self.isABFSRoot();
|
|
|
+ return !self.isS3() && !self.isABFSRoot() && !self.isOFS();
|
|
|
});
|
|
|
self.isReplicationEnabled = ko.pureComputed(function () {
|
|
|
return self.isHdfs();
|
|
|
@@ -1132,6 +1146,14 @@ else:
|
|
|
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() {
|
|
|
return self.currentPath().match(/^\/user\/.+?\/\.Trash/);
|
|
|
});
|
|
|
@@ -1990,6 +2012,10 @@ else:
|
|
|
});
|
|
|
|
|
|
$("#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({
|
|
|
dest: options.dest,
|
|
|
fileFieldLabel: "hdfs_file"
|