From ff6d9323fd104ed90664f9127c87b3c03f91ff9f Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Thu, 23 Jul 2015 13:10:40 +0100 Subject: [PATCH 01/11] Add support for launching iTerm 2.9+ The AppleScript bridge changed at some point since 2.1. While marked as beta, the 2.9 series is the author's recommended version to use. The two bridges are incompatible, requiring another function and version checks. --- resources/terminal | 61 +++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/resources/terminal b/resources/terminal index af5af69872..ade48d0f32 100755 --- a/resources/terminal +++ b/resources/terminal @@ -16,22 +16,49 @@ EOF` function open_iterm () { osascript > /dev/null < /dev/null < Date: Wed, 10 Feb 2016 21:07:10 -0800 Subject: [PATCH 02/11] Updating Dockerfile Signed-off-by: Mary Anthony --- docs/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Dockerfile b/docs/Dockerfile index 06dd3ad23e..da11b2de13 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -5,7 +5,7 @@ RUN svn checkout https://github.com/docker/compose/trunk/docs /docs/content/comp RUN svn checkout https://github.com/docker/docker/trunk/docs /docs/content/docker RUN svn checkout https://github.com/docker/swarm/trunk/docs /docs/content/swarm RUN svn checkout https://github.com/docker/distribution/trunk/docs /docs/content/registry -RUN svn checkout https://github.com/docker/tutorials/trunk/docs /docs/content +RUN svn checkout https://github.com/docker/notary/trunk/docs /docs/content/notary RUN svn checkout https://github.com/docker/opensource/trunk/docs /docs/content/opensource RUN svn checkout https://github.com/docker/machine/trunk/docs /docs/content/machine RUN svn checkout https://github.com/docker/toolbox/trunk/docs /docs/content/toolbox From 5a2baa13698cc9fb9c942c325cb2a2457bd08b59 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 15 Feb 2016 16:04:35 -0800 Subject: [PATCH 03/11] Fix typos in comments of src/utils. Signed-off-by: Dongjoon Hyun --- src/utils/SetupUtil.js | 2 +- src/utils/Util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/SetupUtil.js b/src/utils/SetupUtil.js index 08fb41c750..d000fc26ca 100644 --- a/src/utils/SetupUtil.js +++ b/src/utils/SetupUtil.js @@ -91,7 +91,7 @@ export default { try { setupServerActions.started({started: false}); - // Make sure virtulBox and docker-machine are installed + // Make sure virtualBox and docker-machine are installed let virtualBoxInstalled = virtualBox.installed(); let machineInstalled = machine.installed(); if (!virtualBoxInstalled || !machineInstalled) { diff --git a/src/utils/Util.js b/src/utils/Util.js index 590e9c2791..872827c892 100644 --- a/src/utils/Util.js +++ b/src/utils/Util.js @@ -92,7 +92,7 @@ module.exports = { // An official repo is alphanumeric characters separated by dashes or // underscores. // Examples: myrepo, my-docker-repo, my_docker_repo - // Non-exapmles: mynamespace/myrepo, my%!repo + // Non-examples: mynamespace/myrepo, my%!repo var repoRegexp = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/; return repoRegexp.test(name); }, From 58e77236bffffeb3daf63c058323400e0c7d3552 Mon Sep 17 00:00:00 2001 From: French Ben Date: Thu, 3 Dec 2015 12:14:25 -0800 Subject: [PATCH 04/11] Cleaner socket support and updated unmount calls Signed-off-by: French Ben --- package.json | 1 + src/actions/SetupActions.js | 5 ++ src/app.js | 1 + src/browser.js | 1 - src/components/ContainerHomeFolders.react.js | 1 + .../ContainerSettingsVolumes.react.js | 6 +- src/components/Containers.react.js | 78 +++++++++---------- src/components/Setup.react.js | 25 ++++-- src/utils/DockerMachineUtil.js | 9 ++- src/utils/DockerUtil.js | 47 +++++++++-- src/utils/SetupUtil.js | 63 +++++++++++---- src/utils/Util.js | 16 +++- 12 files changed, 176 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index 2d8a42cae1..08a3352965 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "dockerode": "^2.2.7", "install": "^0.1.8", "jquery": "^2.1.3", + "JSONStream": "^1.0.7", "mixpanel": "kitematic/mixpanel-node", "mkdirp": "^0.5.0", "node-uuid": "^1.4.3", diff --git a/src/actions/SetupActions.js b/src/actions/SetupActions.js index 9278430224..c4d5bbc4a9 100644 --- a/src/actions/SetupActions.js +++ b/src/actions/SetupActions.js @@ -6,6 +6,11 @@ class SetupActions { this.dispatch({removeVM}); setupUtil.retry(removeVM); } + + useVbox () { + this.dispatch({}); + setupUtil.useVbox(); + } } export default alt.createActions(SetupActions); diff --git a/src/app.js b/src/app.js index 293cf72481..aa8307f965 100644 --- a/src/app.js +++ b/src/app.js @@ -1,4 +1,5 @@ require.main.paths.splice(0, 0, process.env.NODE_PATH); + import electron from 'electron'; const remote = electron.remote; const Menu = remote.Menu; diff --git a/src/browser.js b/src/browser.js index 4b2e83af83..3c4c58445a 100644 --- a/src/browser.js +++ b/src/browser.js @@ -4,7 +4,6 @@ const BrowserWindow = electron.BrowserWindow; import fs from 'fs'; import os from 'os'; - import path from 'path'; import child_process from 'child_process'; diff --git a/src/components/ContainerHomeFolders.react.js b/src/components/ContainerHomeFolders.react.js index cab35902df..fbbc704bf0 100644 --- a/src/components/ContainerHomeFolders.react.js +++ b/src/components/ContainerHomeFolders.react.js @@ -32,6 +32,7 @@ var ContainerHomeFolder = React.createClass({ mounts.forEach(m => { if (m.Destination === destination) { m.Source = util.windowsToLinuxPath(newSource); + m.Driver = null; } }); diff --git a/src/components/ContainerSettingsVolumes.react.js b/src/components/ContainerSettingsVolumes.react.js index 914fa57494..7462db8c04 100644 --- a/src/components/ContainerSettingsVolumes.react.js +++ b/src/components/ContainerSettingsVolumes.react.js @@ -28,7 +28,7 @@ var ContainerSettingsVolumes = React.createClass({ metrics.track('Choose Directory for Volume'); - var mounts = _.clone(this.props.container.Mounts); + let mounts = _.clone(this.props.container.Mounts); _.each(mounts, m => { if (m.Destination === dockerVol) { m.Source = util.windowsToLinuxPath(directory); @@ -36,7 +36,7 @@ var ContainerSettingsVolumes = React.createClass({ } }); - var binds = mounts.map(m => { + let binds = mounts.map(m => { return m.Source + ':' + m.Destination; }); @@ -50,7 +50,7 @@ var ContainerSettingsVolumes = React.createClass({ from: 'settings' }); - var mounts = _.clone(this.props.container.Mounts); + let mounts = _.clone(this.props.container.Mounts); _.each(mounts, m => { if (m.Destination === dockerVol) { m.Source = null; diff --git a/src/components/Containers.react.js b/src/components/Containers.react.js index d7b611168f..655a7930b3 100644 --- a/src/components/Containers.react.js +++ b/src/components/Containers.react.js @@ -106,44 +106,44 @@ var Containers = React.createClass({ metrics.track('Opened Issue Reporter', { from: 'app' }); - shell.openExternal('https://github.com/kitematic/kitematic/issues/new'); + shell.openExternal('https://github.com/docker/kitematic/issues/new'); }, - handleMouseEnterDockerTerminal: function () { - this.setState({ - currentButtonLabel: 'Open terminal to use Docker command line.' - }); - }, - - handleMouseLeaveDockerTerminal: function () { - this.setState({ - currentButtonLabel: '' - }); - }, - - handleMouseEnterReportIssue: function () { - this.setState({ - currentButtonLabel: 'Report an issue or suggest feedback.' - }); - }, - - handleMouseLeaveReportIssue: function () { - this.setState({ - currentButtonLabel: '' - }); - }, - - handleMouseEnterPreferences: function () { - this.setState({ - currentButtonLabel: 'Change app preferences.' - }); - }, - - handleMouseLeavePreferences: function () { - this.setState({ - currentButtonLabel: '' - }); - }, + // handleMouseEnterDockerTerminal: function () { + // this.setState({ + // currentButtonLabel: 'Open terminal to use Docker command line.' + // }); + // }, + // + // handleMouseLeaveDockerTerminal: function () { + // this.setState({ + // currentButtonLabel: '' + // }); + // }, + // + // handleMouseEnterReportIssue: function () { + // this.setState({ + // currentButtonLabel: 'Report an issue or suggest feedback.' + // }); + // }, + // + // handleMouseLeaveReportIssue: function () { + // this.setState({ + // currentButtonLabel: '' + // }); + // }, + // + // handleMouseEnterPreferences: function () { + // this.setState({ + // currentButtonLabel: 'Change app preferences.' + // }); + // }, + // + // handleMouseLeavePreferences: function () { + // this.setState({ + // currentButtonLabel: '' + // }); + // }, render: function () { var sidebarHeaderClass = 'sidebar-header'; @@ -169,9 +169,9 @@ var Containers = React.createClass({
- DOCKER CLI - - + DOCKER CLI + +
diff --git a/src/components/Setup.react.js b/src/components/Setup.react.js index 741322e174..80827ef3da 100644 --- a/src/components/Setup.react.js +++ b/src/components/Setup.react.js @@ -3,12 +3,13 @@ import Router from 'react-router'; import Radial from './Radial.react.js'; import RetinaImage from 'react-retina-image'; import Header from './Header.react'; -import Util from '../utils/Util'; +import util from '../utils/Util'; import metrics from '../utils/MetricsUtil'; import setupStore from '../stores/SetupStore'; import setupActions from '../actions/SetupActions'; import shell from 'shell'; + var Setup = React.createClass({ mixins: [Router.Navigation], @@ -32,6 +33,10 @@ var Setup = React.createClass({ setupActions.retry(false); }, + handleUseVbox: function () { + setupActions.useVbox(); + }, + handleErrorRemoveRetry: function () { console.log('Deleting VM and trying again.' ); setupActions.retry(true); @@ -63,6 +68,12 @@ var Setup = React.createClass({ }, renderProgress: function () { + let title = 'Starting Docker VM'; + let descr = 'To run Docker containers on your computer, Kitematic is starting a Linux virtual machine. This may take a minute...'; + if (util.isNative()) { + title = 'Checking Docker'; + descr = 'To run Docker containers on your computer, Kitematic is checking the Docker connection.'; + } return (
@@ -72,8 +83,8 @@ var Setup = React.createClass({
-

Starting Docker VM

-

To run Docker containers on your computer, Kitematic is starting a Linux virtual machine. This may take a minute...

+

{title}

+

{descr}

@@ -84,14 +95,18 @@ var Setup = React.createClass({ renderError: function () { let deleteVmAndRetry; - if (Util.isLinux()) { + if (util.isLinux()) { if (!this.state.started) { deleteVmAndRetry = ( ); } } else { - if (this.state.started) { + if (util.isNative()) { + deleteVmAndRetry = ( + + ); + } else if (this.state.started) { deleteVmAndRetry = ( ); diff --git a/src/utils/DockerMachineUtil.js b/src/utils/DockerMachineUtil.js index 49886372c4..e676416c30 100644 --- a/src/utils/DockerMachineUtil.js +++ b/src/utils/DockerMachineUtil.js @@ -158,11 +158,12 @@ var DockerMachine = { } }); }); - } else if (util.isLinux()) { + } else if (util.isNative()) { cmd = cmd || process.env.SHELL; - var terminal = util.linuxTerminal(); - if (terminal) - util.execFile(terminal.concat([cmd])).then(() => {}); + var terminal = util.isLinux() ? util.linuxTerminal() : path.join(process.env.RESOURCES_PATH, 'terminal'); + if (terminal) { + util.exec([terminal, cmd]).then(() => {}); + } } else { cmd = cmd || process.env.SHELL; this.url(machineName).then(machineUrl => { diff --git a/src/utils/DockerUtil.js b/src/utils/DockerUtil.js index a06765d330..1942791936 100644 --- a/src/utils/DockerUtil.js +++ b/src/utils/DockerUtil.js @@ -11,6 +11,9 @@ import containerServerActions from '../actions/ContainerServerActions'; import rimraf from 'rimraf'; import stream from 'stream'; import JSONStream from 'JSONStream'; +import Promise from 'bluebird'; + + export default { host: null, @@ -20,20 +23,23 @@ export default { activeContainerName: null, setup (ip, name) { - if (!ip || !name) { + if (!ip && !name) { throw new Error('Falsy ip or name passed to docker client setup'); } + this.host = ip; - if (util.isLinux()) { - this.host = 'localhost'; - this.client = new dockerode({socketPath: '/var/run/docker.sock'}); + if (ip.indexOf('local') !== -1) { + try { + this.client = new dockerode({socketPath: '/var/run/docker.sock'}); + } catch (error) { + throw new Error('Cannot connect to the Docker daemon. Is the daemon running?'); + } } else { let certDir = path.join(util.home(), '.docker/machine/machines/', name); if (!fs.existsSync(certDir)) { throw new Error('Certificate directory does not exist'); } - this.host = ip; this.client = new dockerode({ protocol: 'https', host: ip, @@ -45,6 +51,28 @@ export default { } }, + async version () { + let version = null; + let maxRetries = 10; + let retries = 0; + let error_message = ""; + while (version == null && retries < maxRetries) { + this.client.version((error,data) => { + if (!error) { + version = data.Version; + } else { + error_message = error; + } + retries++; + }); + await Promise.delay(1000); + } + if (version == null) { + throw new Error(error_message); + } + return version; + }, + init () { this.placeholders = JSON.parse(localStorage.getItem('placeholders')) || {}; this.fetchAllContainers(); @@ -88,6 +116,7 @@ export default { container.start((error) => { if (error) { containerServerActions.error({name, error}); + console.log('error starting: %o - %o', name, error); return; } containerServerActions.started({name, error}); @@ -117,7 +146,7 @@ export default { if (!containerData.HostConfig || (containerData.HostConfig && !containerData.HostConfig.PortBindings)) { containerData.PublishAllPorts = true; } - + if (image.Config.Cmd) { containerData.Cmd = image.Config.Cmd; } else if (!image.Config.Entrypoint) { @@ -156,6 +185,7 @@ export default { fetchAllContainers () { this.client.listContainers({all: true}, (err, containers) => { if (err) { + console.error(err); return; } async.map(containers, (container, callback) => { @@ -171,6 +201,7 @@ export default { containers = containers.filter(c => c !== null); if (err) { // TODO: add a global error handler for this + console.error(err); return; } containerServerActions.allUpdated({containers: _.indexBy(containers.concat(_.values(this.placeholders)), 'Name')}); @@ -367,6 +398,8 @@ export default { timestamps: 1 }, (err, logStream) => { if (err) { + // socket hang up can be captured + console.error(err); return; } @@ -393,6 +426,8 @@ export default { timestamps: 1 }, (err, logStream) => { if (err) { + // Socket hang up also can be found here + console.error(err); return; } diff --git a/src/utils/SetupUtil.js b/src/utils/SetupUtil.js index d000fc26ca..7b50ec6e6a 100644 --- a/src/utils/SetupUtil.js +++ b/src/utils/SetupUtil.js @@ -18,6 +18,7 @@ const precreateCheckExitCode = 3; let _retryPromise = null; let _timers = []; +let useNative = util.isNative() ? util.isNative() : true; export default { simulateProgress (estimateSeconds) { @@ -36,12 +37,21 @@ export default { _timers = []; }, + async useVbox () { + metrics.track('Retried Setup with VBox'); + localStorage.setItem('settings.useNative', false); + router.get().transitionTo('loading'); + setupServerActions.error({ error: { message: null }}); + _retryPromise.resolve(); + }, + retry (removeVM) { metrics.track('Retried Setup', { removeVM }); router.get().transitionTo('loading'); + setupServerActions.error({ error: { message: null }}); if (removeVM) { machine.rm().finally(() => { _retryPromise.resolve(); @@ -56,35 +66,50 @@ export default { return _retryPromise.promise; }, - setup() { - return util.isLinux() ? this.nativeSetup() : this.nonNativeSetup(); - }, - - async nativeSetup () { + async setup () { while (true) { try { - docker.setup('localhost', machine.name()); - docker.isDockerRunning(); - - break; + if (util.isNative()) { + localStorage.setItem('setting.useNative', true); + let stats = fs.statSync('/var/run/docker.sock'); + if (stats.isSocket()) { + await this.nativeSetup(); + } else { + throw new Error('File found is not a socket'); + } + } else { + await this.nonNativeSetup(); + } + return; } catch (error) { - router.get().transitionTo('setup'); metrics.track('Native Setup Failed'); setupServerActions.error({error}); - let message = error.message.split('\n'); - let lastLine = message.length > 1 ? message[message.length - 2] : 'Docker Machine encountered an error.'; - bugsnag.notify('Native Setup Failed', lastLine, { - 'Docker Machine Logs': error.message + bugsnag.notify('Native Setup Failed', error.message, { + 'Docker Error': error.message }, 'info'); - this.clearTimers(); await this.pause(); } } }, + async nativeSetup () { + while (true) { + try { + router.get().transitionTo('setup'); + docker.setup(util.isLinux() ? 'localhost':'docker.local'); + setupServerActions.started({started: true}); + this.simulateProgress(20); + return docker.version(); + } catch (error) { + throw new Error(error); + } + } + }, + async nonNativeSetup () { + console.log('Non-native setup'); let virtualBoxVersion = null; let machineVersion = null; while (true) { @@ -127,13 +152,16 @@ export default { } else { let state = await machine.status(); if (state !== 'Running') { + router.get().transitionTo('setup'); + setupServerActions.started({started: true}); if (state === 'Saved') { - router.get().transitionTo('setup'); this.simulateProgress(10); } else if (state === 'Stopped') { - router.get().transitionTo('setup'); this.simulateProgress(25); + } else { + this.simulateProgress(40); } + await machine.start(); } } @@ -151,6 +179,7 @@ export default { if (ip) { docker.setup(ip, machine.name()); + await docker.version(); } else { throw new Error('Could not determine IP from docker-machine.'); } diff --git a/src/utils/Util.js b/src/utils/Util.js index 872827c892..873241ff26 100644 --- a/src/utils/Util.js +++ b/src/utils/Util.js @@ -37,6 +37,18 @@ module.exports = { isLinux: function () { return process.platform === 'linux'; }, + isNative: function () { + let native = JSON.parse(localStorage.getItem('settings.useNative')); + if (native === null) { + try { + let stats = fs.statSync('/var/run/docker.sock'); + native = true; + } catch(e){ + native = false; + } + } + return native; + }, binsPath: function () { return this.isWindows() ? path.join(this.home(), 'Kitematic-bins') : path.join('/usr/local/bin'); }, @@ -163,9 +175,9 @@ module.exports = { dialog.showMessageBox({ type: 'warning', buttons: ['OK'], - message: 'The terminal emulator symbolic link doesn\'t exists. Please read the Wiki at https://github.com/kitematic/kitematic/wiki/Common-Issues-and-Fixes#early-linux-support-from-zedtux.' + message: 'The terminal emulator symbolic link doesn\'t exists. Please read the Wiki at https://github.com/docker/kitematic/wiki/Early-Linux-Support.' }); - return; + return false; } }, webPorts: ['80', '8000', '8080', '8888', '3000', '5000', '2368', '9200', '8983'] From c64b899259194e7645a4b80653252ab7e09ec690 Mon Sep 17 00:00:00 2001 From: French Ben Date: Thu, 4 Feb 2016 13:20:36 -0800 Subject: [PATCH 05/11] Updated all unmount calls and better socket revamp Signed-off-by: French Ben --- src/components/ContainerListItem.react.js | 2 +- src/components/Containers.react.js | 38 +--------------------- src/components/NewContainerSearch.react.js | 1 - src/components/Setup.react.js | 2 +- src/utils/SetupUtil.js | 1 - 5 files changed, 3 insertions(+), 41 deletions(-) diff --git a/src/components/ContainerListItem.react.js b/src/components/ContainerListItem.react.js index 2791ca9d22..1e6af7a9a7 100644 --- a/src/components/ContainerListItem.react.js +++ b/src/components/ContainerListItem.react.js @@ -97,7 +97,7 @@ var ContainerListItem = React.createClass({ return ( -
  • +
  • {state}
    diff --git a/src/components/Containers.react.js b/src/components/Containers.react.js index 655a7930b3..130557f15f 100644 --- a/src/components/Containers.react.js +++ b/src/components/Containers.react.js @@ -26,7 +26,7 @@ var Containers = React.createClass({ containerStore.listen(this.update); }, - componentDidUnmount: function () { + componentWillUnmount: function () { containerStore.unlisten(this.update); }, @@ -109,42 +109,6 @@ var Containers = React.createClass({ shell.openExternal('https://github.com/docker/kitematic/issues/new'); }, - // handleMouseEnterDockerTerminal: function () { - // this.setState({ - // currentButtonLabel: 'Open terminal to use Docker command line.' - // }); - // }, - // - // handleMouseLeaveDockerTerminal: function () { - // this.setState({ - // currentButtonLabel: '' - // }); - // }, - // - // handleMouseEnterReportIssue: function () { - // this.setState({ - // currentButtonLabel: 'Report an issue or suggest feedback.' - // }); - // }, - // - // handleMouseLeaveReportIssue: function () { - // this.setState({ - // currentButtonLabel: '' - // }); - // }, - // - // handleMouseEnterPreferences: function () { - // this.setState({ - // currentButtonLabel: 'Change app preferences.' - // }); - // }, - // - // handleMouseLeavePreferences: function () { - // this.setState({ - // currentButtonLabel: '' - // }); - // }, - render: function () { var sidebarHeaderClass = 'sidebar-header'; if (this.state.sidebarOffset) { diff --git a/src/components/NewContainerSearch.react.js b/src/components/NewContainerSearch.react.js index 06b72dc946..410b4e43ff 100644 --- a/src/components/NewContainerSearch.react.js +++ b/src/components/NewContainerSearch.react.js @@ -73,7 +73,6 @@ module.exports = React.createClass({ nextPage = (page + 1 > this.state.totalPage) ? this.state.totalPage : page + 1; totalPage = this.state.totalPage; } - this.setState({ query: query, loading: true, diff --git a/src/components/Setup.react.js b/src/components/Setup.react.js index 80827ef3da..d72a291076 100644 --- a/src/components/Setup.react.js +++ b/src/components/Setup.react.js @@ -21,7 +21,7 @@ var Setup = React.createClass({ setupStore.listen(this.update); }, - componentDidUnmount: function () { + componentWillUnmount: function () { setupStore.unlisten(this.update); }, diff --git a/src/utils/SetupUtil.js b/src/utils/SetupUtil.js index 7b50ec6e6a..2e55a8eab1 100644 --- a/src/utils/SetupUtil.js +++ b/src/utils/SetupUtil.js @@ -109,7 +109,6 @@ export default { }, async nonNativeSetup () { - console.log('Non-native setup'); let virtualBoxVersion = null; let machineVersion = null; while (true) { From dfdf9e326e853768c5e02b13ae1277a15d645d63 Mon Sep 17 00:00:00 2001 From: French Ben Date: Thu, 11 Feb 2016 13:03:26 -0800 Subject: [PATCH 06/11] Updated exec call for terminal Signed-off-by: French Ben --- src/utils/DockerMachineUtil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/DockerMachineUtil.js b/src/utils/DockerMachineUtil.js index e676416c30..8cd949f88c 100644 --- a/src/utils/DockerMachineUtil.js +++ b/src/utils/DockerMachineUtil.js @@ -162,7 +162,7 @@ var DockerMachine = { cmd = cmd || process.env.SHELL; var terminal = util.isLinux() ? util.linuxTerminal() : path.join(process.env.RESOURCES_PATH, 'terminal'); if (terminal) { - util.exec([terminal, cmd]).then(() => {}); + util.execFile([terminal, cmd]).then(() => {}); } } else { cmd = cmd || process.env.SHELL; From d1a49abcf6778517602e5f2ff9ea1d4e3836c403 Mon Sep 17 00:00:00 2001 From: French Ben Date: Wed, 2 Mar 2016 17:36:40 -0800 Subject: [PATCH 07/11] Updated logic and removed pref Signed-off-by: French Ben --- src/components/Setup.react.js | 24 +++++++++++------------- src/utils/Util.js | 14 ++++++++++---- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/components/Setup.react.js b/src/components/Setup.react.js index d72a291076..3635092cee 100644 --- a/src/components/Setup.react.js +++ b/src/components/Setup.react.js @@ -101,20 +101,18 @@ var Setup = React.createClass({ ); } + } else if (util.isNative()) { + deleteVmAndRetry = ( + + ); + } else if (this.state.started) { + deleteVmAndRetry = ( + + ); } else { - if (util.isNative()) { - deleteVmAndRetry = ( - - ); - } else if (this.state.started) { - deleteVmAndRetry = ( - - ); - } else { - deleteVmAndRetry = ( - - ); - } + deleteVmAndRetry = ( + + ); } return (
    diff --git a/src/utils/Util.js b/src/utils/Util.js index 873241ff26..f383506ac9 100644 --- a/src/utils/Util.js +++ b/src/utils/Util.js @@ -38,13 +38,19 @@ module.exports = { return process.platform === 'linux'; }, isNative: function () { - let native = JSON.parse(localStorage.getItem('settings.useNative')); + // let native = JSON.parse(localStorage.getItem('settings.useNative')); + let native = null; if (native === null) { try { - let stats = fs.statSync('/var/run/docker.sock'); + // Check if file exists + fs.statSync('/var/run/docker.sock'); native = true; - } catch(e){ - native = false; + } catch (e) { + if (this.isLinux()) { + native = true; + } else { + native = false; + } } } return native; From e639851f454f836ac1d419ff182e2595337dc0cf Mon Sep 17 00:00:00 2001 From: Thomas Florin Date: Mon, 14 Mar 2016 11:25:49 -0500 Subject: [PATCH 08/11] fix for displaying no description on repo containers that had short descriptions Signed-off-by: Thomas Florin --- src/components/ImageCard.react.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/ImageCard.react.js b/src/components/ImageCard.react.js index e9d494ff7a..fe979c9ef1 100644 --- a/src/components/ImageCard.react.js +++ b/src/components/ImageCard.react.js @@ -105,6 +105,8 @@ var ImageCard = React.createClass({ var description; if (this.props.image.description) { description = this.props.image.description; + } else if(this.props.image.short_description){ + description = this.props.image.short_description; } else { description = "No description."; } From 3ca0c24fd74fd48cfc08343dd2382a126ce2ea63 Mon Sep 17 00:00:00 2001 From: Brett Bieber Date: Mon, 14 Mar 2016 16:24:09 -0500 Subject: [PATCH 09/11] Grammar fix, s/seem/seems/ The subject of the sentence `an error` is singular, therefore `seems` should be used instead of `seem`. --- src/components/ContainerHome.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ContainerHome.react.js b/src/components/ContainerHome.react.js index dad139c8a8..acfe406e0d 100644 --- a/src/components/ContainerHome.react.js +++ b/src/components/ContainerHome.react.js @@ -52,7 +52,7 @@ var ContainerHome = React.createClass({ if (this.props.container.Error) { body = (
    -

    We're sorry. There seem to be an error:

    +

    We're sorry. There seems to be an error:

    {this.props.container.Error}

    If this error is invalid, please file a ticket on our Github repo.

    File Ticket From 570cd6a1876cb8deae6dd9c043b539cc1bbd0409 Mon Sep 17 00:00:00 2001 From: Thomas Florin Date: Mon, 14 Mar 2016 19:06:54 -0500 Subject: [PATCH 10/11] Updated Jest config to work on windows Signed-off-by: Thomas Florin --- jest-unit.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jest-unit.json b/jest-unit.json index bc91f0f679..19685d46ae 100644 --- a/jest-unit.json +++ b/jest-unit.json @@ -13,6 +13,7 @@ "object-assign", "underscore", "source-map-support", - "/node_modules/.*JSONStream" + "/node_modules/.*JSONStream", + "/node_modules/core-js" ] } From 032f94b637705c8d7ecbf8b5cc4e0767bafa8a3e Mon Sep 17 00:00:00 2001 From: Enrico Hoffmann Date: Thu, 17 Mar 2016 10:04:29 +0100 Subject: [PATCH 11/11] #1550 enhancement remove duplicated entry in package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 08a3352965..c4890e6ad9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "license": "Apache-2.0", "electron-version": "0.35.4", "dependencies": { - "JSONStream": "^1.0.7", "alt": "^0.16.2", "ansi-to-html": "0.3.0", "any-promise": "^0.1.0",