Added Download file, play for homebrews and ZIP explorer.
This commit is contained in:
@@ -105,6 +105,29 @@ export function FSUploader(){
|
||||
|
||||
},
|
||||
|
||||
handleDownloadFile( index ){
|
||||
let download_url = this.files[index].download_url;
|
||||
window.location.href = download_url;
|
||||
},
|
||||
|
||||
async handleFileExplorer( index ){
|
||||
|
||||
if( this.files[index].file_explorer_files !== null )
|
||||
return;
|
||||
|
||||
let file_explorer_url = this.files[index].file_explorer;
|
||||
|
||||
let response = await fetch(file_explorer_url, { method: 'GET', headers: { 'Content-Type': 'application/json' } });
|
||||
let json = await response.json();
|
||||
|
||||
if( !json.files ){
|
||||
this.files[index].file_explorer_files = [ "An error occurred during request" ];
|
||||
return;
|
||||
}
|
||||
|
||||
this.files[index].file_explorer_files = json.files;
|
||||
},
|
||||
|
||||
/**
|
||||
* Retry file uploading.
|
||||
*
|
||||
@@ -126,6 +149,8 @@ export function FSUploader(){
|
||||
* @param {number} index FSFileData index in this.files.
|
||||
*/
|
||||
handleRemoveFile( index ){
|
||||
if( this.files[index].state === 'archived')
|
||||
return;
|
||||
this.files.splice(index, 1);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user