зеркало из https://github.com/docker/kitematic.git
The Cmd+ and Cmd- hotkeys zoom in/out the contaier logs.
Signed-off-by: Arjun Patel <arjun453@gmail.com>
This commit is contained in:
Родитель
9e65afb02b
Коммит
7f84fa821a
|
@ -102,7 +102,7 @@ var ContainerHome = React.createClass({
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var logWidget = (
|
var logWidget = (
|
||||||
<ContainerHomeLogs container={this.props.container}/>
|
<ContainerHomeLogs container={this.props.container} />
|
||||||
);
|
);
|
||||||
var webWidget;
|
var webWidget;
|
||||||
if (this.showWeb()) {
|
if (this.showWeb()) {
|
||||||
|
|
|
@ -135,6 +135,20 @@ var MenuTemplate = function () {
|
||||||
label: 'Toggle Chromium Developer Tools',
|
label: 'Toggle Chromium Developer Tools',
|
||||||
accelerator: 'Alt+' + util.CommandOrCtrl() + '+I',
|
accelerator: 'Alt+' + util.CommandOrCtrl() + '+I',
|
||||||
click: function() { remote.getCurrentWindow().toggleDevTools(); }
|
click: function() { remote.getCurrentWindow().toggleDevTools(); }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Log Zoom In',
|
||||||
|
accelerator: util.CommandOrCtrl() + '+=',
|
||||||
|
click: function() {
|
||||||
|
util.adjustLogFontSize(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Log Zoom Out',
|
||||||
|
accelerator: util.CommandOrCtrl() + '+-',
|
||||||
|
click: function() {
|
||||||
|
util.adjustLogFontSize(-2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import $ from 'jquery';
|
||||||
import child_process from 'child_process';
|
import child_process from 'child_process';
|
||||||
import Promise from 'bluebird';
|
import Promise from 'bluebird';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
@ -55,6 +56,14 @@ module.exports = {
|
||||||
escapePath: function (str) {
|
escapePath: function (str) {
|
||||||
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
||||||
},
|
},
|
||||||
|
getLogFontSize: function() {
|
||||||
|
return parseInt($('.logs').css('font-size'));
|
||||||
|
},
|
||||||
|
adjustLogFontSize: function(offset) {
|
||||||
|
var fontSize = this.getLogFontSize();
|
||||||
|
var newFontSize = (fontSize + offset) > 0 ? (fontSize + offset) : 1;
|
||||||
|
$('.logs').css('font-size', newFontSize);
|
||||||
|
},
|
||||||
home: function () {
|
home: function () {
|
||||||
return app.getPath('home');
|
return app.getPath('home');
|
||||||
},
|
},
|
||||||
|
|
Загрузка…
Ссылка в новой задаче