[fb] Fix replication factor for the currently selected file
@@ -837,7 +837,8 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
size: file.humansize,
user: file.stats.user,
group: file.stats.group,
- mtime: file.mtime
+ mtime: file.mtime,
+ replication: file.stats.replication
},
isBucket: ko.pureComputed(function(){
return file.path.toLowerCase().indexOf('s3a://') == 0 && file.path.substr(5).indexOf('/') == -1
@@ -1376,6 +1377,7 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
dataType: 'json',
success: function() {
$("#setReplicationModal").modal('hide');
+ $("#newRepFactorInput").val('');
self.retrieveData(true);
}
});
@@ -1383,6 +1385,8 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
$("#setReplicationModal").modal({
keyboard:true,
show:true
+ }).on('shown', function(){
+ $('#newRepFactorInput').val(self.selectedFile().stats.replication);
});
};
@@ -2001,20 +2005,6 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
hideContextMenu();
});
- // Allow only numeric symbols for setting replication factor
- $("#newRepFactorInput").keydown(function (e) {
- if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
- (e.keyCode == 65 && (e.ctrlKey === true || e.metaKey === true)) ||
- (e.keyCode == 67 && (e.ctrlKey === true || e.metaKey === true)) ||
- (e.keyCode == 88 && (e.ctrlKey === true || e.metaKey === true)) ||
- (e.keyCode >= 35 && e.keyCode <= 39)) {
- return;
- }
- if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
- e.preventDefault();
- }
- });
-
// Drag and drop uploads from anywhere on filebrowser screen
if (window.FileReader) {
var showHoverMsg = function (msg) {
