mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 04:26:01 +00:00
cloud file, folder operations
This commit is contained in:
@@ -206,7 +206,14 @@
|
||||
showModal(ConfirmModal, {
|
||||
message: `Really delete file ${data.file}?`,
|
||||
onConfirm: () => {
|
||||
apiCall('files/delete', data);
|
||||
if (data.folid && data.cntid) {
|
||||
apiCall('cloud/delete-content', {
|
||||
folid: data.folid,
|
||||
cntid: data.cntid,
|
||||
});
|
||||
} else {
|
||||
apiCall('files/delete', data);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -217,7 +224,15 @@
|
||||
label: 'New file name',
|
||||
header: 'Rename file',
|
||||
onConfirm: newFile => {
|
||||
apiCall('files/rename', { ...data, newFile });
|
||||
if (data.folid && data.cntid) {
|
||||
apiCall('cloud/rename-content', {
|
||||
folid: data.folid,
|
||||
cntid: data.cntid,
|
||||
name: newFile,
|
||||
});
|
||||
} else {
|
||||
apiCall('files/rename', { ...data, newFile });
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -226,9 +241,17 @@
|
||||
showModal(InputTextModal, {
|
||||
value: data.file,
|
||||
label: 'New file name',
|
||||
header: 'Rename file',
|
||||
header: 'Copy file',
|
||||
onConfirm: newFile => {
|
||||
apiCall('files/copy', { ...data, newFile });
|
||||
if (data.folid && data.cntid) {
|
||||
apiCall('cloud/copy-file', {
|
||||
folid: data.folid,
|
||||
cntid: data.cntid,
|
||||
name: newFile,
|
||||
});
|
||||
} else {
|
||||
apiCall('files/copy', { ...data, newFile });
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -236,11 +259,19 @@
|
||||
const handleDownload = () => {
|
||||
saveFileToDisk(
|
||||
async filePath => {
|
||||
await apiCall('files/export-file', {
|
||||
folder,
|
||||
file: data.file,
|
||||
filePath,
|
||||
});
|
||||
if (data.folid && data.cntid) {
|
||||
await apiCall('cloud/export-file', {
|
||||
folid: data.folid,
|
||||
cntid: data.cntid,
|
||||
filePath,
|
||||
});
|
||||
} else {
|
||||
await apiCall('files/export-file', {
|
||||
folder,
|
||||
file: data.file,
|
||||
filePath,
|
||||
});
|
||||
}
|
||||
},
|
||||
{ formatLabel: handler.label, formatExtension: handler.format, defaultFileName: data.file }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user