[Antergos and Manjaro support] [Download latest detect_linux.sh if bundled script returns unknown] [Display error message if OS is detected as unknown]

This commit is contained in:
2019-07-28 21:12:40 -05:00
parent ba14f36d32
commit f996bb4a74
7 changed files with 67 additions and 21 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import './App.css';
import Box from './components/UI/Box/Box';
import Configuration from './containers/Configuration/Configuration';
import {checkVersionInstalled} from './redux/actions/install_actions';
import {connect} from 'react-redux';
import DependencyList from './components/DependencyList/DependencyList';
import DownloadProgress from './components/DownloadProgress/DownloadProgress';
@@ -11,16 +12,16 @@ import IPCContainer from './containers/IPCContainer/IPCContainer';
import Loading from './components/UI/Loading/Loading';
import Modal from './components/UI/Modal/Modal';
import MountItems from './containers/MountItems/MountItems';
import {notifyError} from './redux/actions/error_actions';
import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay';
import {saveState} from './redux/actions/common_actions';
import Text from './components/UI/Text/Text';
import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon';
import UpgradeUI from './components/UpgradeUI/UpgradeUI';
import {checkVersionInstalled} from './redux/actions/install_actions';
import {
loadReleases,
setDismissUIUpgrade
} from './redux/actions/release_version_actions';
import {saveState} from './redux/actions/common_actions';
const Constants = require('./constants');
const Scheduler = require('node-schedule');
@@ -28,7 +29,9 @@ const Scheduler = require('node-schedule');
class App extends IPCContainer {
componentDidMount() {
const detectUpgrades = () => {
if (this.props.AppPlatform !== 'unknown') {
if (this.props.AppPlatform === 'unknown') {
this.props.notifyError('Operation system is not supported.', true);
} else {
this.props.loadReleases();
}
};
@@ -199,6 +202,7 @@ const mapDispatchToProps = dispatch => {
return {
checkVersionInstalled: () => dispatch(checkVersionInstalled()),
loadReleases: ()=> dispatch(loadReleases()),
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
saveState: () => dispatch(saveState()),
setDismissUIUpgrade: dismiss => dispatch(setDismissUIUpgrade(dismiss)),
};

View File

@@ -27,8 +27,14 @@ exports.DEV_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----\n' +
'9wIDAQAB\n' +
'-----END PUBLIC KEY-----';
exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/1.0.0-release_branch/releases.json';
exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/1.0.6_branch/releases.json';
const REPERTORY_BRANCH = '1.0.1-release_branch';
const REPERTORY_UI_BRANCH = '1.0.6_branch';
exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/' + REPERTORY_BRANCH + '/releases.json';
exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/' + REPERTORY_UI_BRANCH + '/releases.json';
exports.LINUX_DETECT_SCRIPT_URL = 'https://bitbucket.org/blockstorage/repertory/raw/' + REPERTORY_BRANCH + '/detect_linux.sh';
exports.DATA_LOCATIONS = {
linux: '~/.local/repertory/ui',

View File

@@ -140,7 +140,9 @@ module.exports.downloadFile = (url, destination, progressCallback, completeCallb
response.data.on('data', (chunk) => {
stream.write(Buffer.from(chunk));
downloaded += chunk.length;
progressCallback((downloaded / total * 100.0).toFixed(2));
if (progressCallback) {
progressCallback((downloaded / total * 100.0).toFixed(2));
}
});
response.data.on('end', () => {