Partial S3 support

This commit is contained in:
2020-08-15 13:14:44 -05:00
parent 3846c85500
commit 27aa0ae8dc
17 changed files with 588 additions and 385 deletions

View File

@@ -4,7 +4,7 @@ const helpers = require('../../helpers');
const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Get_Config, (event, data) => {
helpers
.getConfig(data.Version, data.Provider, data.Remote)
.getConfig(data.Version, data.Provider, data.Remote, data.S3)
.then((data) => {
if (data.Code === 0) {
standardIPCReply(event, Constants.IPC_Get_Config_Reply, {
@@ -21,7 +21,7 @@ const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Get_Config_Template, (event, data) => {
helpers
.getConfigTemplate(data.Version, data.Provider, data.Remote)
.getConfigTemplate(data.Version, data.Provider, data.Remote, data.S3)
.then((data) => {
standardIPCReply(event, Constants.IPC_Get_Config_Template_Reply, {
Template: data,
@@ -36,7 +36,7 @@ const addListeners = (ipcMain, {standardIPCReply}) => {
const setConfigValue = (i) => {
if (i < data.Items.length) {
helpers
.setConfigValue(data.Items[i].Name, data.Items[i].Value, data.Provider, data.Remote, data.Version)
.setConfigValue(data.Items[i].Name, data.Items[i].Value, data.Provider, data.Remote, data.S3, data.Version)
.then(() => {
setConfigValue(++i);
})

View File

@@ -55,7 +55,7 @@ const unmountAllDrives = () => {
// Unmount all items
for (const i in mountedLocations) {
const data = mountedData[mountedLocations[i]];
helpers.stopMountProcessSync(data.Version, data.Provider, data.Remote);
helpers.stopMountProcessSync(data.Version, data.Provider, data.Remote, data.S3);
}
mountedLocations = [];
@@ -206,6 +206,7 @@ const addListeners = (ipcMain, {setTrayImage, standardIPCReply}) => {
mountedData[data.Location] = {
Provider: data.Provider,
Remote: data.Remote,
S3: data.S3,
Version: data.Version,
};
const errorHandler = (pid, error) => {
@@ -219,16 +220,18 @@ const addListeners = (ipcMain, {setTrayImage, standardIPCReply}) => {
Location: data.Location,
Provider: data.Provider,
Remote: data.Remote,
S3: data.S3,
}, error || Error(data.Provider + ' Unmounted'));
};
helpers
.executeMount(data.Version, data.Provider, data.Remote, data.Location, (error, pid) => {
.executeMount(data.Version, data.Provider, data.Remote, data.S3, data.Location, (error, pid) => {
errorHandler(pid, error);
})
.then(() => {
standardIPCReply(event, Constants.IPC_Mount_Drive_Reply, {
Provider: data.Provider,
Remote: data.Remote,
S3: data.S3,
});
})
.catch(error => {
@@ -259,7 +262,7 @@ const addListeners = (ipcMain, {setTrayImage, standardIPCReply}) => {
expectedUnmount[data.Provider] = true;
helpers
.stopMountProcess(data.Version, data.Provider, data.Remote)
.stopMountProcess(data.Version, data.Provider, data.Remote, data.S3)
.then(result => {
console.log(result);
})