mirror of https://github.com/docker/docs.git
fixing minor UI bugs
This commit is contained in:
parent
668ffa4bc8
commit
56b3ada8a8
4
index.js
4
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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -51,7 +51,11 @@ Router.map(function () {
|
|||
}
|
||||
startUpdatingBoot2DockerUtilization();
|
||||
startSyncingAppState();
|
||||
if (Apps.findOne()) {
|
||||
Router.go('dashboard_apps');
|
||||
} else {
|
||||
Router.go('dashboard_images');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -60,9 +60,9 @@
|
|||
{{#if $eq status 'STOPPED'}}
|
||||
<a href="#" onclick="trackLink('start container')" class="btn-icon btn-start" data-toggle="tooltip" data-placement="bottom" title="Start"><span class="typcn typcn-media-play-outline"></span></a>
|
||||
{{/if}}
|
||||
{{#if $eq status 'READY'}}
|
||||
{{#unless changingState}}
|
||||
<a href="#" onclick="trackLink('restart container')" class="btn-icon btn-restart" data-toggle="tooltip" data-placement="bottom" title="Restart"><span class="typcn typcn-refresh-outline"></span></a>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
<a href="/apps/{{name}}/logs" onclick="trackLink('container logs')" class="btn-icon btn-logs" data-toggle="tooltip" data-placement="bottom" title="Logs"><span class="typcn typcn-document-text"></span></a>
|
||||
<a href="/apps/{{name}}/settings" onclick="trackLink('container settings')" class="btn-icon" data-toggle="tooltip" data-placement="bottom" title="Settings"><span class="typcn typcn-cog-outline"></span></a>
|
||||
</div>
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<p class="help-block">You can change the folder of which your image will be built from.</p>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<h5><strong>{{this.originPath}}</strong></h5>
|
||||
<h5><strong>{{this.path}}</strong></h5>
|
||||
<h6 id="picked-directory-error" class="error"></h6>
|
||||
<a onclick="trackLink('change build directory')" href="#" id="btn-pick-directory" class="btn btn-positive btn-sm"><span class="typcn typcn-folder-open"></span> Change Directory</a>
|
||||
</div>
|
||||
|
|
|
@ -35,7 +35,7 @@ Template.dashboardImagesSettings.events({
|
|||
} else {
|
||||
Images.update(imageId, {
|
||||
$set: {
|
||||
originPath: directory
|
||||
path: directory
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
<a onclick="trackLink('create container from image')" href="#" class="btn-icon btn-create-app" data-toggle="tooltip" data-placement="bottom" title="Create Container"><span class="typcn typcn-plus-outline"></span></a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if originPath}}
|
||||
{{#if path}}
|
||||
<a onclick="trackLink('open image folder')" href="#" class="btn-icon btn-folder" target="_blank" data-toggle="tooltip" data-placement="bottom" title="Folder"><span class="typcn typcn-folder-open"></span></a>
|
||||
{{/if}}
|
||||
{{#if $neq status 'BUILDING'}}
|
||||
{{#if $or path originPath}}
|
||||
{{#if path}}
|
||||
<a onclick="trackLink('rebuild image')" href="#" class="btn-icon btn-rebuild" target="_blank" data-toggle="tooltip" data-placement="bottom" title="Rebuild"><span class="typcn typcn-refresh-outline"></span></a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
|
@ -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; }
|
||||
});
|
||||
},
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
<a onclick="trackLink('create container from image')" href="#" class="btn-create-app" data-toggle="tooltip" data-placement="bottom" title="Create Container" data-container="body"><span class="typcn typcn-plus-outline"></span></a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if originPath}}
|
||||
{{#if path}}
|
||||
<a onclick="trackLink('open image folder')" href="#" class="btn-folder" data-toggle="tooltip" data-placement="bottom" title="Folder" data-container="body"><span class="typcn typcn-folder-open"></span></a>
|
||||
{{/if}}
|
||||
{{#if $neq status 'BUILDING'}}
|
||||
{{#if originPath}}
|
||||
{{#if path}}
|
||||
<a onclick="trackLink('rebuild image')" href="#" class="btn-rebuild" data-toggle="tooltip" data-placement="bottom" title="Rebuild" data-container="body"><span class="typcn typcn-refresh-outline"></span></a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
|
@ -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; }
|
||||
});
|
||||
},
|
||||
|
|
|
@ -13,10 +13,6 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
<div class="right-section">
|
||||
{{#if $.Session.equals 'boot2dockerState' 'poweroff'}}
|
||||
<a onclick="trackLink('start boot2docker')" class="btn btn-default btn-start-boot2docker">Start Boot2Docker VM</a>
|
||||
{{else}}
|
||||
<a onclick="trackLink('stop boot2docker')" class="btn btn-negative btn-stop-boot2docker">Stop Boot2Docker VM</a>
|
||||
{{#if disk}}
|
||||
<div class="utilization disk-utilization">
|
||||
<div><strong>Disk Utilization</strong><span class="pull-right">{{disk.used_gb}}GB used of {{disk.total_gb}}GB</span></div>
|
||||
|
@ -37,7 +33,6 @@
|
|||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="section dashboard-settings">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template name="updateNotification">
|
||||
{{#if updateAvailable}}
|
||||
<div class="update-alert" role="alert"><span class="update-text">A new version of Kitematic is available.</span> <a href="#" class="btn btn-action-inverse btn-inverse btn-xs btn-update">Restart to Update</a></div>
|
||||
<div class="update-alert" role="alert"><span class="update-text">A new version of Kitematic is available.</span> <a href="#" class="btn btn-action-inverse btn-inverse btn-xs btn-update">Update Now</a></div>
|
||||
{{/if}}
|
||||
</template>
|
Loading…
Reference in New Issue