diff --git a/index.js b/index.js index b50cc94093..c5d7ee2547 100644 --- a/index.js +++ b/index.js @@ -135,6 +135,7 @@ app.on('ready', function() { process.on('uncaughtException', app.quit); + var saveVMOnQuit = true; app.on('will-quit', function (e) { console.log('Cleaning up children.'); if (nodeChild) { @@ -143,7 +144,9 @@ app.on('ready', function() { if (mongoChild) { mongoChild.kill(); } - exec('VBoxManage controlvm boot2docker-vm savestate', function (stderr, stdout, code) {}); + if (saveVMOnQuit) { + exec('VBoxManage controlvm boot2docker-vm savestate', function (stderr, stdout, code) {}); + } }); mainWindow.webContents.on('new-window', function (e) { @@ -178,6 +181,7 @@ app.on('ready', function() { ipc.on('command', function (event, arg) { console.log('Command: ' + arg); if (arg === 'application:quit-install') { + saveVMOnQuit = false; autoUpdater.quitAndInstall(); } }); diff --git a/meteor/client/lib/docker.js b/meteor/client/lib/docker.js index 70b993f5e4..55a3b078ba 100644 --- a/meteor/client/lib/docker.js +++ b/meteor/client/lib/docker.js @@ -104,7 +104,7 @@ Docker.runContainer = function (app, image, callback) { name: app.name }; - + if (app.docker && app.docker.NetworkSettings.Ports) { containerOpts.ExposedPorts = app.docker.NetworkSettings.Ports; } @@ -118,6 +118,9 @@ Docker.runContainer = function (app, image, callback) { var binds = []; if (app.volumesEnabled && image.docker.Config.Volumes && image.docker.Config.Volumes.length > 0) { _.each(image.docker.Config.Volumes, function (vol) { + if (vol.Path && vol.Path.length && vol.Path[0] === '/') { + vol.Path = vol.Path.substr(1); + } binds.push([Util.getHomePath(), 'Kitematic', app.name, vol.Path].join('/') + ':' + vol.Path); }); } diff --git a/meteor/client/lib/router.js b/meteor/client/lib/router.js index 4e2fef1a9b..47444c424a 100755 --- a/meteor/client/lib/router.js +++ b/meteor/client/lib/router.js @@ -51,7 +51,11 @@ Router.map(function () { } startUpdatingBoot2DockerUtilization(); startSyncingAppState(); - Router.go('dashboard_apps'); + if (Apps.findOne()) { + Router.go('dashboard_apps'); + } else { + Router.go('dashboard_images'); + } } }); } diff --git a/meteor/client/views/dashboard/apps/dashboard-single-app.html b/meteor/client/views/dashboard/apps/dashboard-single-app.html index bc383acfe5..bf3a37568e 100755 --- a/meteor/client/views/dashboard/apps/dashboard-single-app.html +++ b/meteor/client/views/dashboard/apps/dashboard-single-app.html @@ -60,9 +60,9 @@ {{#if $eq status 'STOPPED'}} {{/if}} - {{#if $eq status 'READY'}} + {{#unless changingState}} - {{/if}} + {{/unless}} diff --git a/meteor/client/views/dashboard/apps/dashboard-single-app.js b/meteor/client/views/dashboard/apps/dashboard-single-app.js index 6335295448..d862ab148c 100755 --- a/meteor/client/views/dashboard/apps/dashboard-single-app.js +++ b/meteor/client/views/dashboard/apps/dashboard-single-app.js @@ -16,6 +16,9 @@ Template.dashboardSingleApp.helpers({ return ports[0]; } return null; + }, + changingState: function () { + return this.status === 'STARTING' || this.status === 'STOPPING'; } }); @@ -49,10 +52,12 @@ Template.dashboardSingleApp.events({ }, 'click .btn-restart': function (e) { e.preventDefault(); + $('.btn-icon').tooltip('hide'); AppUtil.run(this, function (err) {}); }, 'click .btn-folder': function (e) { e.preventDefault(); + $('.btn-icon').tooltip('hide'); var app = this; if (!app) { throw new Error('Cannot find app with id: ' + app._id); @@ -61,13 +66,14 @@ Template.dashboardSingleApp.events({ var openDirectory = function () { var appPath = path.join(Util.KITE_PATH, app.name); if (app.docker.Volumes.length) { - if (app.docker.Volumes[0].Value.indexOf(path.join(Util.getHomePath(), 'Kitematic')) !== -1) { + if (_.find(app.docker.Volumes, function (volume) { return volume.Value.indexOf(path.join(Util.getHomePath(), 'Kitematic')) !== -1; })) { exec(['open', appPath], function (stderr, stdout, code) { if (code) { throw stderr; } }); return; } else { - exec(['open', app.docker.Volumes[0].Value], function (stderr, stdout, code) { + var volume = _.find(app.docker.Volumes, function (volume) { return volume.Value.indexOf(Util.getHomePath()) !== -1; }) + exec(['open', volume.Value], function (stderr, stdout, code) { if (code) { throw stderr; } }); return; @@ -101,5 +107,6 @@ Template.dashboardSingleApp.events({ }, 'click .btn-logs': function (e) { AppUtil.logs(this._id); + $('.btn-icon').tooltip('hide'); } }); diff --git a/meteor/client/views/dashboard/images/dashboard-images-settings.html b/meteor/client/views/dashboard/images/dashboard-images-settings.html index 5a6151010b..d715b885cc 100755 --- a/meteor/client/views/dashboard/images/dashboard-images-settings.html +++ b/meteor/client/views/dashboard/images/dashboard-images-settings.html @@ -59,7 +59,7 @@

You can change the folder of which your image will be built from.

-
{{this.originPath}}
+
{{this.path}}
Change Directory
diff --git a/meteor/client/views/dashboard/images/dashboard-images-settings.js b/meteor/client/views/dashboard/images/dashboard-images-settings.js index 14b045a500..2084cb102b 100755 --- a/meteor/client/views/dashboard/images/dashboard-images-settings.js +++ b/meteor/client/views/dashboard/images/dashboard-images-settings.js @@ -35,7 +35,7 @@ Template.dashboardImagesSettings.events({ } else { Images.update(imageId, { $set: { - originPath: directory + path: directory } }); } diff --git a/meteor/client/views/dashboard/images/dashboard-single-image.html b/meteor/client/views/dashboard/images/dashboard-single-image.html index 570b5b6e19..742a625d8d 100755 --- a/meteor/client/views/dashboard/images/dashboard-single-image.html +++ b/meteor/client/views/dashboard/images/dashboard-single-image.html @@ -31,11 +31,11 @@ {{/if}} {{/if}} - {{#if originPath}} + {{#if path}} {{/if}} {{#if $neq status 'BUILDING'}} - {{#if $or path originPath}} + {{#if path}} {{/if}} {{/if}} diff --git a/meteor/client/views/dashboard/images/dashboard-single-image.js b/meteor/client/views/dashboard/images/dashboard-single-image.js index 481420dced..a16bf3368d 100755 --- a/meteor/client/views/dashboard/images/dashboard-single-image.js +++ b/meteor/client/views/dashboard/images/dashboard-single-image.js @@ -13,7 +13,7 @@ Template.dashboardSingleImage.events({ $('#image-picker').hide(); }, 'click .btn-folder': function () { - exec(['open', this.originPath], function (err) { + exec(['open', this.path], function (err) { if (err) { throw err; } }); }, diff --git a/meteor/client/views/dashboard/layouts/dashboard-images-layout.html b/meteor/client/views/dashboard/layouts/dashboard-images-layout.html index 3bbb4e96f3..c264bff308 100755 --- a/meteor/client/views/dashboard/layouts/dashboard-images-layout.html +++ b/meteor/client/views/dashboard/layouts/dashboard-images-layout.html @@ -16,11 +16,11 @@ {{/if}} {{/if}} - {{#if originPath}} + {{#if path}} {{/if}} {{#if $neq status 'BUILDING'}} - {{#if originPath}} + {{#if path}} {{/if}} {{/if}} diff --git a/meteor/client/views/dashboard/layouts/dashboard-images-layout.js b/meteor/client/views/dashboard/layouts/dashboard-images-layout.js index 45dd30c0e5..2dba982338 100755 --- a/meteor/client/views/dashboard/layouts/dashboard-images-layout.js +++ b/meteor/client/views/dashboard/layouts/dashboard-images-layout.js @@ -12,7 +12,7 @@ Template.dashboardImagesLayout.events({ }, 'click .btn-folder': function () { var exec = require('exec'); - exec(['open', this.originPath], function (err) { + exec(['open', this.path], function (err) { if (err) { throw err; } }); }, diff --git a/meteor/client/views/dashboard/settings/dashboard-settings.html b/meteor/client/views/dashboard/settings/dashboard-settings.html index b1b805a770..98abacbbce 100644 --- a/meteor/client/views/dashboard/settings/dashboard-settings.html +++ b/meteor/client/views/dashboard/settings/dashboard-settings.html @@ -13,30 +13,25 @@ {{/if}}
- {{#if $.Session.equals 'boot2dockerState' 'poweroff'}} - Start Boot2Docker VM - {{else}} - Stop Boot2Docker VM - {{#if disk}} -
-
Disk Utilization{{disk.used_gb}}GB used of {{disk.total_gb}}GB
-
-
- {{disk.percent}}% -
+ {{#if disk}} +
+
Disk Utilization{{disk.used_gb}}GB used of {{disk.total_gb}}GB
+
+
+ {{disk.percent}}%
- {{/if}} - {{#if memory}} -
-
Memory Utilization{{memory.used_gb}}GB used of {{memory.total_gb}}GB
-
-
- {{memory.percent}}% -
+
+ {{/if}} + {{#if memory}} +
+
Memory Utilization{{memory.used_gb}}GB used of {{memory.total_gb}}GB
+
+
+ {{memory.percent}}%
- {{/if}} +
{{/if}}
diff --git a/meteor/client/views/includes/update-notification.html b/meteor/client/views/includes/update-notification.html index dd74bb70a2..18276a33ba 100644 --- a/meteor/client/views/includes/update-notification.html +++ b/meteor/client/views/includes/update-notification.html @@ -1,5 +1,5 @@ \ No newline at end of file +