prettier
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { createResponseDialogAction } from '../utils';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
import {createResponseDialogAction} from '../utils';
|
||||
|
||||
export const confirmYesNoAction = createResponseDialogAction('common', 'confirmYesNo');
|
||||
|
||||
import * as Constants from '../../constants';
|
||||
import { getIPCRenderer } from '../../utils.jsx';
|
||||
import {getIPCRenderer} from '../../utils.jsx';
|
||||
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
|
||||
@@ -12,7 +12,7 @@ export const NOTIFY_APPLICATION_BUSY = 'common/notifyApplicationBusy';
|
||||
export const notifyApplicationBusy = (busy, transparent) => {
|
||||
return {
|
||||
type: NOTIFY_APPLICATION_BUSY,
|
||||
payload: { busy, transparent },
|
||||
payload: {busy, transparent},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ export const saveState = () => {
|
||||
}
|
||||
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.send(Constants.IPC_Save_State, { State: currentState });
|
||||
ipcRenderer.send(Constants.IPC_Save_State, {State: currentState});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
|
||||
import * as Constants from '../../constants';
|
||||
import { getIPCRenderer } from '../../utils.jsx';
|
||||
import {getIPCRenderer} from '../../utils.jsx';
|
||||
|
||||
import { notifyError } from './error_actions';
|
||||
import { installDependency, installRelease, installUpgrade } from './install_actions';
|
||||
import {notifyError} from './error_actions';
|
||||
import {installDependency, installRelease, installUpgrade} from './install_actions';
|
||||
|
||||
export const setAllowDownload = createAction('download/setAllowDownload');
|
||||
|
||||
export const SET_DOWNLOAD_BEGIN = 'download/setDownloadBegin';
|
||||
export const setDownloadBegin = (name, type, url) => {
|
||||
return { type: SET_DOWNLOAD_BEGIN, payload: { name, type, url } };
|
||||
return {type: SET_DOWNLOAD_BEGIN, payload: {name, type, url}};
|
||||
};
|
||||
|
||||
export const setDownloadEnd = createAction('download/setDownloadEnd');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { showWindow, shutdownApplication } from './common_actions';
|
||||
import {showWindow, shutdownApplication} from './common_actions';
|
||||
|
||||
let ErrorActions = [];
|
||||
|
||||
@@ -57,13 +57,13 @@ export const notifyInfo = (title, msg, saveToFile, fileName, extension) => {
|
||||
|
||||
export const SET_ERROR_INFO = 'error/setErrorInfo';
|
||||
export const setErrorInfo = (msg, critical) => {
|
||||
return { type: SET_ERROR_INFO, payload: { msg, critical } };
|
||||
return {type: SET_ERROR_INFO, payload: {msg, critical}};
|
||||
};
|
||||
|
||||
export const SET_INFO = 'error/setInfo';
|
||||
export const setInfo = (title, msg, saveToFile, fileName, extension) => {
|
||||
return {
|
||||
type: SET_INFO,
|
||||
payload: { title, msg, saveToFile, fileName, extension },
|
||||
payload: {title, msg, saveToFile, fileName, extension},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { createResponseDialogAction } from '../utils';
|
||||
import {createResponseDialogAction} from '../utils';
|
||||
|
||||
export const addEditHostAction = createResponseDialogAction('host', 'displayAddEditHost');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
|
||||
import * as Constants from '../../constants';
|
||||
import { getIPCRenderer, getSelectedVersionFromState } from '../../utils.jsx';
|
||||
import {getIPCRenderer, getSelectedVersionFromState} from '../../utils.jsx';
|
||||
|
||||
import {
|
||||
confirmYesNoAction,
|
||||
@@ -11,9 +11,9 @@ import {
|
||||
showWindow,
|
||||
shutdownApplication,
|
||||
} from './common_actions';
|
||||
import { downloadItem, setAllowDownload } from './download_actions';
|
||||
import { notifyError } from './error_actions';
|
||||
import { unmountAll } from './mount_actions';
|
||||
import {downloadItem, setAllowDownload} from './download_actions';
|
||||
import {notifyError} from './error_actions';
|
||||
import {unmountAll} from './mount_actions';
|
||||
import {
|
||||
setActiveRelease,
|
||||
setInstalledVersion,
|
||||
@@ -60,7 +60,7 @@ export const checkInstalled = (dependencies, version) => {
|
||||
dispatch(setAllowMount(false));
|
||||
const versionString = getState().relver.VersionLookup[Constants.RELEASE_TYPES[release]][
|
||||
version
|
||||
];
|
||||
];
|
||||
const urls = getState().relver.LocationsLookup[versionString].urls;
|
||||
const fileName = versionString + '.zip';
|
||||
dispatch(downloadItem(fileName, Constants.INSTALL_TYPES.Release, urls));
|
||||
@@ -166,13 +166,13 @@ export const installReleaseByVersion = (release, version) => {
|
||||
};
|
||||
|
||||
if (getState().mounts.MountsBusy) {
|
||||
dispatch(confirmYesNoAction.display(true, null, { title: 'Unmount all drives?' }))
|
||||
.then(({ changed }) => {
|
||||
if (changed) {
|
||||
dispatch(unmountAll(install));
|
||||
}
|
||||
})
|
||||
.catch((error) => notifyError(error));
|
||||
dispatch(confirmYesNoAction.display(true, null, {title: 'Unmount all drives?'}))
|
||||
.then(({changed}) => {
|
||||
if (changed) {
|
||||
dispatch(unmountAll(install));
|
||||
}
|
||||
})
|
||||
.catch((error) => notifyError(error));
|
||||
} else {
|
||||
install();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
|
||||
import * as Constants from '../../constants';
|
||||
import { getIPCRenderer } from '../../utils.jsx';
|
||||
import {getIPCRenderer} from '../../utils.jsx';
|
||||
|
||||
import { confirmYesNoAction, saveState } from './common_actions';
|
||||
import { notifyError } from './error_actions';
|
||||
import {confirmYesNoAction, saveState} from './common_actions';
|
||||
import {notifyError} from './error_actions';
|
||||
|
||||
export const addRemoteMount = (hostNameOrIp, port, token) => {
|
||||
return (dispatch, getState) => {
|
||||
@@ -30,10 +30,10 @@ export const addRemoteMount = (hostNameOrIp, port, token) => {
|
||||
|
||||
ipcRenderer.send(Constants.IPC_Set_Config_Values, {
|
||||
Items: [
|
||||
{ Name: 'RemoteMount.RemoteHostNameOrIp', Value: hostNameOrIp },
|
||||
{ Name: 'RemoteMount.RemoteToken', Value: token },
|
||||
{ Name: 'RemoteMount.RemotePort', Value: port.toString() },
|
||||
{ Name: 'RemoteMount.IsRemoteMount', Value: 'true' },
|
||||
{Name: 'RemoteMount.RemoteHostNameOrIp', Value: hostNameOrIp},
|
||||
{Name: 'RemoteMount.RemoteToken', Value: token},
|
||||
{Name: 'RemoteMount.RemotePort', Value: port.toString()},
|
||||
{Name: 'RemoteMount.IsRemoteMount', Value: 'true'},
|
||||
],
|
||||
Provider: provider,
|
||||
Remote: true,
|
||||
@@ -65,11 +65,11 @@ export const addS3Mount = (name, accessKey, secretKey, region, bucketName, url)
|
||||
|
||||
ipcRenderer.send(Constants.IPC_Set_Config_Values, {
|
||||
Items: [
|
||||
{ Name: 'S3Config.AccessKey', Value: accessKey },
|
||||
{ Name: 'S3Config.SecretKey', Value: secretKey },
|
||||
{ Name: 'S3Config.Region', Value: region },
|
||||
{ Name: 'S3Config.BucketName', Value: bucketName },
|
||||
{ Name: 'S3Config.URL', Value: url },
|
||||
{Name: 'S3Config.AccessKey', Value: accessKey},
|
||||
{Name: 'S3Config.SecretKey', Value: secretKey},
|
||||
{Name: 'S3Config.Region', Value: region},
|
||||
{Name: 'S3Config.BucketName', Value: bucketName},
|
||||
{Name: 'S3Config.URL', Value: url},
|
||||
],
|
||||
Provider: provider,
|
||||
S3: true,
|
||||
@@ -100,7 +100,7 @@ export const removeMount = (provider) => {
|
||||
confirmYesNoAction.display(true, null, {
|
||||
title: 'Delete [' + provider.substr(isRemote ? 6 : 2) + ']?',
|
||||
})
|
||||
).then(({ changed }) => {
|
||||
).then(({changed}) => {
|
||||
if (changed) {
|
||||
dispatch(removeMount2(provider));
|
||||
}
|
||||
@@ -129,34 +129,34 @@ export const removeMount3 = createAction('mounts/removeMount3');
|
||||
|
||||
export const RESET_MOUNTS_STATE = 'mounts/resetMountsState';
|
||||
export const resetMountsState = () => {
|
||||
return { type: RESET_MOUNTS_STATE, payload: null };
|
||||
return {type: RESET_MOUNTS_STATE, payload: null};
|
||||
};
|
||||
|
||||
export const SET_ALLOW_MOUNT = 'mounts/setAllowMount';
|
||||
export const setAllowMount = (provider, allow) => {
|
||||
return { type: SET_ALLOW_MOUNT, payload: { provider, allow } };
|
||||
return {type: SET_ALLOW_MOUNT, payload: {provider, allow}};
|
||||
};
|
||||
|
||||
export const SET_AUTO_MOUNT_PROCESSED = 'mounts/setAutoMountProcessed';
|
||||
export const setAutoMountProcessed = (provider, processed) => {
|
||||
return { type: SET_AUTO_MOUNT_PROCESSED, payload: { provider, processed } };
|
||||
return {type: SET_AUTO_MOUNT_PROCESSED, payload: {provider, processed}};
|
||||
};
|
||||
|
||||
export const setBusy = createAction('mounts/setBusy');
|
||||
|
||||
export const SET_MOUNT_STATE = 'mounts/setMountState';
|
||||
export const setMountState = (provider, state) => {
|
||||
return { type: SET_MOUNT_STATE, payload: { provider, state } };
|
||||
return {type: SET_MOUNT_STATE, payload: {provider, state}};
|
||||
};
|
||||
|
||||
export const SET_MOUNTED = 'mounts/setMounted';
|
||||
export const setMounted = (provider, mounted) => {
|
||||
return { type: SET_MOUNTED, payload: { provider, mounted } };
|
||||
return {type: SET_MOUNTED, payload: {provider, mounted}};
|
||||
};
|
||||
|
||||
export const SET_PROVIDER_STATE = 'mounts/setProviderState';
|
||||
export const setProviderState = (provider, state) => {
|
||||
return { type: SET_PROVIDER_STATE, payload: { provider, state } };
|
||||
return {type: SET_PROVIDER_STATE, payload: {provider, state}};
|
||||
};
|
||||
|
||||
export const unmountAll = (completedCallback) => {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
|
||||
export const displayPinnedManager = createAction('pinned/displayPinnedManager');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
import axios from 'axios';
|
||||
|
||||
import * as Constants from '../../constants';
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
getSelectedVersionFromState,
|
||||
} from '../../utils.jsx';
|
||||
|
||||
import { saveState, setAllowMount, setApplicationReady, showWindow } from './common_actions';
|
||||
import { notifyError } from './error_actions';
|
||||
import { checkVersionInstalled, setDismissDependencies } from './install_actions';
|
||||
import { unmountAll } from './mount_actions';
|
||||
import {saveState, setAllowMount, setApplicationReady, showWindow} from './common_actions';
|
||||
import {notifyError} from './error_actions';
|
||||
import {checkVersionInstalled, setDismissDependencies} from './install_actions';
|
||||
import {unmountAll} from './mount_actions';
|
||||
|
||||
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
|
||||
export const clearUIUpgrade = () => {
|
||||
@@ -36,35 +36,35 @@ const cleanupOldReleases = (versionList) => {
|
||||
export const detectUIUpgrade = () => {
|
||||
return (dispatch, getState) => {
|
||||
axios
|
||||
.get(Constants.UI_RELEASES_URL)
|
||||
.then((response) => {
|
||||
const state = getState();
|
||||
const appPlatform = state.common.AppPlatform;
|
||||
const version = state.common.Version;
|
||||
const data = response.data;
|
||||
.get(Constants.UI_RELEASES_URL)
|
||||
.then((response) => {
|
||||
const state = getState();
|
||||
const appPlatform = state.common.AppPlatform;
|
||||
const version = state.common.Version;
|
||||
const data = response.data;
|
||||
|
||||
if (
|
||||
data.Versions &&
|
||||
data.Versions[appPlatform] &&
|
||||
data.Versions[appPlatform].length > 0 &&
|
||||
data.Versions[appPlatform][0] !== version
|
||||
) {
|
||||
dispatch(
|
||||
setUIUpgradeData(
|
||||
data.Locations[appPlatform][data.Versions[appPlatform][0]],
|
||||
data.Versions[appPlatform][0]
|
||||
)
|
||||
);
|
||||
if (!state.relver.UpgradeDismissed) {
|
||||
dispatch(showWindow());
|
||||
}
|
||||
} else {
|
||||
dispatch(clearUIUpgrade());
|
||||
if (
|
||||
data.Versions &&
|
||||
data.Versions[appPlatform] &&
|
||||
data.Versions[appPlatform].length > 0 &&
|
||||
data.Versions[appPlatform][0] !== version
|
||||
) {
|
||||
dispatch(
|
||||
setUIUpgradeData(
|
||||
data.Locations[appPlatform][data.Versions[appPlatform][0]],
|
||||
data.Versions[appPlatform][0]
|
||||
)
|
||||
);
|
||||
if (!state.relver.UpgradeDismissed) {
|
||||
dispatch(showWindow());
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
} else {
|
||||
dispatch(clearUIUpgrade());
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
dispatch(clearUIUpgrade());
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -121,61 +121,61 @@ export const loadReleases = () => {
|
||||
};
|
||||
|
||||
axios
|
||||
.get(Constants.RELEASES_URL)
|
||||
.then((response) => {
|
||||
const appPlatform = getState().common.AppPlatform;
|
||||
const versionLookup = {
|
||||
Release: response.data.Versions.Release[appPlatform],
|
||||
RC: response.data.Versions.RC[appPlatform],
|
||||
Beta: response.data.Versions.Beta[appPlatform],
|
||||
Alpha: response.data.Versions.Alpha[appPlatform],
|
||||
};
|
||||
const locationsLookup = {
|
||||
...response.data.Locations[appPlatform],
|
||||
};
|
||||
.get(Constants.RELEASES_URL)
|
||||
.then((response) => {
|
||||
const appPlatform = getState().common.AppPlatform;
|
||||
const versionLookup = {
|
||||
Release: response.data.Versions.Release[appPlatform],
|
||||
RC: response.data.Versions.RC[appPlatform],
|
||||
Beta: response.data.Versions.Beta[appPlatform],
|
||||
Alpha: response.data.Versions.Alpha[appPlatform],
|
||||
};
|
||||
const locationsLookup = {
|
||||
...response.data.Locations[appPlatform],
|
||||
};
|
||||
|
||||
const storedReleases = localStorage.getItem('releases');
|
||||
let newReleases = [];
|
||||
if (storedReleases && storedReleases.length > 0) {
|
||||
newReleases = getNewReleases(
|
||||
JSON.parse(storedReleases).VersionLookup,
|
||||
versionLookup,
|
||||
getSelectedVersionFromState(getState())
|
||||
);
|
||||
}
|
||||
|
||||
localStorage.setItem(
|
||||
'releases',
|
||||
JSON.stringify({
|
||||
LocationsLookup: locationsLookup,
|
||||
VersionLookup: versionLookup,
|
||||
})
|
||||
const storedReleases = localStorage.getItem('releases');
|
||||
let newReleases = [];
|
||||
if (storedReleases && storedReleases.length > 0) {
|
||||
newReleases = getNewReleases(
|
||||
JSON.parse(storedReleases).VersionLookup,
|
||||
versionLookup,
|
||||
getSelectedVersionFromState(getState())
|
||||
);
|
||||
}
|
||||
|
||||
localStorage.setItem(
|
||||
'releases',
|
||||
JSON.stringify({
|
||||
LocationsLookup: locationsLookup,
|
||||
VersionLookup: versionLookup,
|
||||
})
|
||||
);
|
||||
dispatchActions(locationsLookup, versionLookup);
|
||||
|
||||
dispatch(setNewReleasesAvailable(newReleases));
|
||||
if (getState().relver.NewReleasesAvailable.length > 0) {
|
||||
dispatch(setNewReleasesAvailable2(newReleases));
|
||||
localStorage.setItem('previous_releases', storedReleases);
|
||||
dispatch(showWindow());
|
||||
} else if (
|
||||
(newReleases = checkNewReleases(getSelectedVersionFromState(getState()))).length > 0
|
||||
) {
|
||||
dispatch(setNewReleasesAvailable2(newReleases));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
const releases = localStorage.getItem('releases');
|
||||
if (releases && releases.length > 0) {
|
||||
const obj = JSON.parse(releases);
|
||||
const locationsLookup = obj.LocationsLookup;
|
||||
const versionLookup = obj.VersionLookup;
|
||||
|
||||
dispatchActions(locationsLookup, versionLookup);
|
||||
|
||||
dispatch(setNewReleasesAvailable(newReleases));
|
||||
if (getState().relver.NewReleasesAvailable.length > 0) {
|
||||
dispatch(setNewReleasesAvailable2(newReleases));
|
||||
localStorage.setItem('previous_releases', storedReleases);
|
||||
dispatch(showWindow());
|
||||
} else if (
|
||||
(newReleases = checkNewReleases(getSelectedVersionFromState(getState()))).length > 0
|
||||
) {
|
||||
dispatch(setNewReleasesAvailable2(newReleases));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
const releases = localStorage.getItem('releases');
|
||||
if (releases && releases.length > 0) {
|
||||
const obj = JSON.parse(releases);
|
||||
const locationsLookup = obj.LocationsLookup;
|
||||
const versionLookup = obj.VersionLookup;
|
||||
|
||||
dispatchActions(locationsLookup, versionLookup);
|
||||
} else {
|
||||
dispatch(notifyError(error, true));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
dispatch(notifyError(error, true));
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ export const NOTIFY_ACTIVE_RELEASE = 'relver/notifyActiveRelease';
|
||||
export const notifyActiveRelease = (release, version) => {
|
||||
return {
|
||||
type: NOTIFY_ACTIVE_RELEASE,
|
||||
payload: { release: release, version: version },
|
||||
payload: {release: release, version: version},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
|
||||
export const displaySkynetExport = createAction('skynet/displaySkynetExport');
|
||||
export const displaySkynetImport = createAction('skynet/displaySkynetImport');
|
||||
|
||||
Reference in New Issue
Block a user