From 6d8c709de8a5e31d8c57916740a6eb57d3f69073 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 9 May 2024 18:11:15 +0100 Subject: [PATCH] Delete unused UIWindowDownloadProgress.js --- src/UI/UIWindowDownloadProgress.js | 81 ------------------------------ src/css/style.css | 4 +- src/helpers/download.js | 3 -- 3 files changed, 2 insertions(+), 86 deletions(-) delete mode 100644 src/UI/UIWindowDownloadProgress.js diff --git a/src/UI/UIWindowDownloadProgress.js b/src/UI/UIWindowDownloadProgress.js deleted file mode 100644 index 337fdcda..00000000 --- a/src/UI/UIWindowDownloadProgress.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (C) 2024 Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import UIWindow from './UIWindow.js' - -// todo do this using uid rather than item_path, since item_path is way mroe expensive on the DB -async function UIWindowDownloadProgress(options){ - let h = ''; - h += `
`; - h += `
`; - // Spinner - h +=`circle anim`; - // Progress report - h +=`
`; - // msg - h += `${i18n('downloading')}...${options.item_name ?? ''}`; - h += `
`; - // Progress - h += `
`; - h += `
`; - h += `
`; - // Cancel - h += ``; - h +=`
`; - h += `
`; - - const el_window = await UIWindow({ - title: `Upload`, - icon: window.icons[`app-icon-uploader.svg`], - uid: null, - is_dir: false, - body_content: h, - has_head: false, - selectable_body: false, - draggable_body: true, - allow_context_menu: false, - is_resizable: false, - is_droppable: false, - init_center: true, - allow_native_ctxmenu: false, - allow_user_select: false, - window_class: 'window-upload-progress', - width: 450, - dominant: true, - window_css:{ - height: 'initial', - }, - body_css: { - padding: '22px', - width: 'initial', - 'background-color': 'rgba(231, 238, 245, .95)', - 'backdrop-filter': 'blur(3px)', - } - }); - - // cancel download button clicked - $(el_window).find('.download-cancel-btn').on('click', function(){ - window.operation_cancelled[options.operation_id] = true; - $(el_window).close(); - }) - - return el_window; -} - -export default UIWindowDownloadProgress \ No newline at end of file diff --git a/src/css/style.css b/src/css/style.css index dbecf56b..a2657158 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -2708,7 +2708,7 @@ fieldset[name=number-code] { } } -.progress-bar-container, .download-progress-bar-container { +.progress-bar-container { box-sizing: border-box; width: 100%; height: 17px; @@ -2718,7 +2718,7 @@ fieldset[name=number-code] { box-shadow: inset -1px 3px 4px #dfdfdf; } -.progress-bar, .download-progress-bar { +.progress-bar { width: 0; height: 100%; background-color: rgb(0 137 255); diff --git a/src/helpers/download.js b/src/helpers/download.js index 5ccbb8a2..b00d9bca 100644 --- a/src/helpers/download.js +++ b/src/helpers/download.js @@ -109,9 +109,6 @@ const download = function(options){ let batch_progress = ((batch_download_progress[0].cloud_uploaded + batch_download_progress[0].downloaded)/batch_download_progress[0].total * 100).toFixed(0); batch_progress = batch_progress > 100 ? 100 : batch_progress; - // Update the progress bar - $(`[data-download-operation-id="${options.operation_id}"]`).find('.download-progress-bar').css( 'width', batch_progress+'%'); - // If download is finished resolve promise if((item_progress >= 1 || item_progress === 0) && item){ // For a better UX, resolve 0.5 second after operation is finished.