Fixed view mode switching keyboard shortcuts (#2471)

* Replaced toggleGridMode with working actions.

* Addressed @foot's comment.
This commit is contained in:
Filip Barl
2017-04-26 14:26:47 +02:00
committed by GitHub
parent 7544f4bc7d
commit c7bf7df975
3 changed files with 24 additions and 7 deletions

View File

@@ -12,8 +12,20 @@ import Status from './status';
import Topologies from './topologies';
import TopologyOptions from './topology-options';
import { getApiDetails, getTopologies } from '../utils/web-api-utils';
import { focusSearch, pinNextMetric, hitBackspace, hitEnter, hitEsc, unpinMetric,
selectMetric, toggleHelp, toggleGridMode, shutdown } from '../actions/app-actions';
import {
focusSearch,
pinNextMetric,
hitBackspace,
hitEnter,
hitEsc,
unpinMetric,
selectMetric,
toggleHelp,
setGraphView,
setTableView,
setResourceView,
shutdown
} from '../actions/app-actions';
import Details from './details';
import Nodes from './nodes';
import ViewModeSelector from './view-mode-selector';
@@ -92,8 +104,12 @@ class App extends React.Component {
dispatch(pinNextMetric(-1));
} else if (char === '>') {
dispatch(pinNextMetric(1));
} else if (char === 't' || char === 'g') {
dispatch(toggleGridMode());
} else if (char === 'g') {
dispatch(setGraphView());
} else if (char === 't') {
dispatch(setTableView());
} else if (char === 'r') {
dispatch(setResourceView());
} else if (char === 'q') {
dispatch(unpinMetric());
dispatch(selectMetric(null));

View File

@@ -10,8 +10,9 @@ const GENERAL_SHORTCUTS = [
{key: 'esc', label: 'Close active panel'},
{key: '/', label: 'Activate search field'},
{key: '?', label: 'Toggle shortcut menu'},
{key: 't', label: 'Toggle Table mode'},
{key: 'g', label: 'Toggle Graph mode'},
{key: 'g', label: 'Switch to Graph view'},
{key: 't', label: 'Switch to Table view'},
{key: 'r', label: 'Switch to Resources view'},
];

View File

@@ -1638,7 +1638,7 @@
box-shadow: inset 0 -1px 0 #bbb;
}
div.key {
width: 80px;
width: 60px;
display: inline-block;
}
div.label {