mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
WebClient: allow to share multiple items from the files page
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -74,6 +74,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
{{- if .CanShare}}
|
||||||
|
<div class="menu-item px-3">
|
||||||
|
<a href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="share_selected">
|
||||||
|
Share
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{{- end}}
|
||||||
{{- if .CanDelete}}
|
{{- if .CanDelete}}
|
||||||
<div class="menu-item px-3">
|
<div class="menu-item px-3">
|
||||||
<a href="#" class="menu-link px-3 text-danger fs-6" data-kt-filemanager-table-select="delete_selected">
|
<a href="#" class="menu-link px-3 text-danger fs-6" data-kt-filemanager-table-select="delete_selected">
|
||||||
@@ -801,6 +808,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const shareButton = document.querySelector('[data-kt-filemanager-table-select="share_selected"]');
|
||||||
|
if (shareButton){
|
||||||
|
shareButton.addEventListener('click', function(e){
|
||||||
|
let filesArray = [];
|
||||||
|
dt.rows({ selected: true, search: 'applied' }).every(function (rowIdx, tableLoop, rowLoop){
|
||||||
|
let row = dt.row(rowIdx);
|
||||||
|
filesArray.push(getNameFromMeta(row.data()['meta']));
|
||||||
|
});
|
||||||
|
let files = encodeURIComponent(JSON.stringify(filesArray));
|
||||||
|
let shareURL = '{{.ShareURL}}';
|
||||||
|
let currentDir = '{{.CurrentDir}}';
|
||||||
|
let ts = new Date().getTime().toString();
|
||||||
|
window.open(`${shareURL}?path=${currentDir}&files=${files}&_=${ts}`,'_blank');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const deleteButton = document.querySelector('[data-kt-filemanager-table-select="delete_selected"]');
|
const deleteButton = document.querySelector('[data-kt-filemanager-table-select="delete_selected"]');
|
||||||
if (deleteButton) {
|
if (deleteButton) {
|
||||||
deleteButton.addEventListener('click', function(e){
|
deleteButton.addEventListener('click', function(e){
|
||||||
|
|||||||
Reference in New Issue
Block a user