From 4a1169dc3829774aab72639b622940e1303183b2 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Thu, 21 Mar 2024 18:20:16 -0700 Subject: [PATCH] Remove unused, phased out windows --- src/UI/UIWindowRequestFiles.js | 93 ---------------------- src/UI/UIWindowSelfhostedWaitlist.js | 110 --------------------------- 2 files changed, 203 deletions(-) delete mode 100644 src/UI/UIWindowRequestFiles.js delete mode 100644 src/UI/UIWindowSelfhostedWaitlist.js diff --git a/src/UI/UIWindowRequestFiles.js b/src/UI/UIWindowRequestFiles.js deleted file mode 100644 index d2743e97..00000000 --- a/src/UI/UIWindowRequestFiles.js +++ /dev/null @@ -1,93 +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' - -async function UIWindowRequestFiles(options){ - let h = ''; - h += `
`; - h += `

File Request Link:

`; - h += ``; - h += `
`; - - const el_window = await UIWindow({ - title: `Request Files`, - icon: null, - uid: null, - is_dir: false, - body_content: h, - has_head: true, - selectable_body: false, - draggable_body: false, - allow_context_menu: false, - is_resizable: false, - is_droppable: false, - init_center: true, - allow_native_ctxmenu: true, - allow_user_select: true, - width: 400, - dominant: true, - onAppend: function(el_window){ - }, - window_class: 'window-item-properties', - window_css:{ - height: 'initial', - }, - body_css: { - padding: '10px', - width: 'initial', - 'max-height': 'calc(100vh - 200px)', - 'background-color': 'rgba(231, 238, 245)', - 'backdrop-filter': 'blur(3px)', - 'padding-bottom': 0, - 'height': 'initial', - } - }); - - //check if there is a fr token available - let stat = await puter.fs.stat(options.dir_path); - if(stat.file_request_url !== undefined && stat.file_request_url !== null && stat.file_request_url !== ''){ - $(el_window).find('.filereq-link').html(stat.file_request_url); - } - // generate new fr url - else{ - $.ajax({ - url: api_origin + "/filereq", - type: 'POST', - data: JSON.stringify({ - dir_path: options.dir_path - }), - async: true, - contentType: "application/json", - headers: { - "Authorization": "Bearer "+auth_token - }, - statusCode: { - 401: function (){ - logout(); - }, - }, - success: function (filereq){ - $(el_window).find('.filereq-link').html(filereq.url); - } - }); - } -} - -export default UIWindowRequestFiles \ No newline at end of file diff --git a/src/UI/UIWindowSelfhostedWaitlist.js b/src/UI/UIWindowSelfhostedWaitlist.js deleted file mode 100644 index 4a2a5a3f..00000000 --- a/src/UI/UIWindowSelfhostedWaitlist.js +++ /dev/null @@ -1,110 +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' - -async function UIWindowSelfhostedWaitlist(options){ - options = options ?? {}; - options.reload_on_success = options.reload_on_success ?? false; - - return new Promise(async (resolve) => { - getItem({ - key: "joined_selfhosted_waitlist", - success: async function(resp){ - if(resp.value){ - $(el_window).find('.join-waitlist-btn').hide(); - $(el_window).find('.waitlist-success-msg').show(); - }else{ - $(el_window).find('.join-waitlist-btn').show(); - $(el_window).find('.waitlist-success-msg').hide(); - } - } - }) - - let h = ``; - h += `
`; - h += `
`; - // title - h += ``; - h += `

Self-Hosted Puter is Coming soon!

`; - h += `

Join the waitlist for the launch of Self-Hosted Puter!

`; - // error msg - h += ``; - // success - h += `
You've been added to the waitlist and will receive a notification when it's your turn.
`; - // waitlist - h += ``; - h += `
`; - h += `
`; - - const el_window = await UIWindow({ - title: null, - app: 'waitlist', - single_instance: true, - icon: null, - uid: null, - is_dir: false, - body_content: h, - has_head: true, - selectable_body: false, - draggable_body: true, - allow_context_menu: false, - is_draggable: true, - is_droppable: false, - is_resizable: false, - stay_on_top: false, - allow_native_ctxmenu: true, - allow_user_select: true, - ...options.window_options, - width: 350, - dominant: true, - on_close: ()=>{ - resolve(false) - }, - onAppend: function(this_window){ - }, - window_class: 'window-login', - window_css:{ - height: 'initial', - }, - body_css: { - width: 'initial', - padding: '0', - height: 245, - 'background-color': 'rgba(231, 238, 245, .95)', - 'backdrop-filter': 'blur(3px)', - } - }) - - $(el_window).find('.join-waitlist-btn').on('click', function(e){ - $(this).addClass('disabled'); - setItem({ - key: "joined_selfhosted_waitlist", - value: true, - success: async function(){ - $(el_window).find('.join-waitlist-btn').hide(); - $(el_window).find('.waitlist-success-msg').show(); - } - }) - }) - - }) -} - -export default UIWindowSelfhostedWaitlist \ No newline at end of file