diff --git a/README.md b/README.md index ef5bb39..d2c11e1 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,17 @@ With no command line use needed, you can: # Installation ## From Github Release ### Ubuntu -1. `$ wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.4.0/cockpit-navigator_0.4.0-1focal_all.deb` -1. `# apt install ./cockpit-navigator_0.4.0-1focal_all.deb` +1. `$ wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator_0.4.1-1focal_all.deb` +1. `# apt install ./cockpit-navigator_0.4.1-1focal_all.deb` ### EL7 -1. `# yum install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4.0/cockpit-navigator-0.4.0-1.el7.noarch.rpm` +1. `# yum install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator-0.4.1-1.el7.noarch.rpm` ### EL8 -1. `# dnf install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4.0/cockpit-navigator-0.4.0-1.el8.noarch.rpm` +1. `# dnf install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator-0.4.1-1.el8.noarch.rpm` ## From Source 1. Ensure dependencies are installed: `cockpit`, `python3`, `rsync`, `zip`. 1. `$ git clone https://github.com/45Drives/cockpit-navigator.git` 1. `$ cd cockpit-navigator` -1. `$ git checkout ` (v0.4.0 is latest) +1. `$ git checkout ` (v0.4 is latest) 1. `# make install` ## From 45Drives Repositories ### Ubuntu diff --git a/debian/changelog b/debian/changelog index e326339..ce78205 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cockpit-navigator (0.4.1-1focal) focal; urgency=low + + * Use smaller chunk size while uploading for older versions of Cockpit. + + -- Josh Boudreau Mon, 07 Jun 2021 13:08:00 -0300 + cockpit-navigator (0.4.0-1focal) focal; urgency=low * Add icons to right click menu. diff --git a/el/cockpit-navigator.spec b/el/cockpit-navigator.spec index 3af363c..678ad9b 100644 --- a/el/cockpit-navigator.spec +++ b/el/cockpit-navigator.spec @@ -1,5 +1,5 @@ Name: cockpit-navigator -Version: 0.4.0 +Version: 0.4.1 Release: 1%{?dist} Summary: A File System Browser for Cockpit. License: GPL-3.0+ @@ -32,6 +32,8 @@ rm -rf %{buildroot} /usr/share/cockpit/navigator/* %changelog +* Mon Jun 07 2021 Josh Boudreau 0.4.1-1 +- Use smaller chunk size while uploading for older versions of Cockpit. * Mon Jun 07 2021 Josh Boudreau 0.4.0-1 - Add icons to right click menu. - Add ability to download files and directories. diff --git a/navigator/navigator.js b/navigator/navigator.js index 57d7ece..bb48ba8 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -1039,11 +1039,15 @@ class FileUpload { /** * * @param {File|Blob} file - * @param {Number} chunk_size * @param {NavWindow} nav_window_ref */ - constructor(file, chunk_size, nav_window_ref) { - this.chunk_size = chunk_size; + constructor(file, nav_window_ref) { + try { + this.chunk_size = (parseInt(cockpit.info.version) > 238)? 1048576 : 65536; + } catch(e) { + console.log(e); + this.chunk_size = 65536; + } this.filename = file.name; this.nav_window_ref = nav_window_ref; this.path = nav_window_ref.pwd().path_str() + "/" + file.name; @@ -1231,7 +1235,7 @@ class NavDragDrop { window.alert(file.name + ": Cannot upload folders."); continue; } - var uploader = new FileUpload(file, 1048576, this.nav_window_ref); + var uploader = new FileUpload(file, this.nav_window_ref); uploader.upload(); } } @@ -1239,7 +1243,7 @@ class NavDragDrop { for (let file of ev.dataTransfer.files) { if (file.type === "") continue; - var uploader = new FileUpload(file, 1048576, this.nav_window_ref); + var uploader = new FileUpload(file, this.nav_window_ref); uploader.upload(); } }