Skip to content

Commit

Permalink
Add unmount button for buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
nosaraei committed Feb 8, 2023
1 parent d7a0d82 commit f1450f1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/channel/BucketsChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,13 @@ storage_class = STANDARD`;
});

}

async unMountBucket(){

if(GlobalData.RClone){
GlobalData.RClone.kill();
}
}
}

const instance = new BucketsChannel();
Expand Down
28 changes: 28 additions & 0 deletions src/sections/BucketsList/BucketsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,28 @@ const BucketsList = () => {

};

const handleUnMountBucket = async (params) => {

try{

await window.channel("Buckets@unMountBucket");

layout.notify(params.row.Name + " unmounted successfully", {
severity: "success"
});

}
catch (e) {

console.log(e);

layout.notify("Error in bucket unmount", {
severity: "error"
});
}

};

function getCreationDateAttribute(params) {

return moment(params.value).locale('en').format('DD MMMM YYYY - HH:mm');
Expand Down Expand Up @@ -350,6 +372,12 @@ const BucketsList = () => {
</ListItemIcon>
<ListItemText>Mount as drive</ListItemText>
</MenuItem>
<MenuItem onClick={handleUnMountBucket.bind(this, params)}>
<ListItemIcon>
<SaveIcon fontSize="small" />
</ListItemIcon>
<ListItemText>Unmount bucket</ListItemText>
</MenuItem>
<MenuItem onClick={handleCopyBucket.bind(this, params)}>
<ListItemIcon>
<FolderCopyIcon fontSize="small" />
Expand Down

0 comments on commit f1450f1

Please sign in to comment.