mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(help): began work on new help modal
This commit is contained in:
parent
3e712178cc
commit
82592f0c13
70
public/app/core/components/help/help.html
Normal file
70
public/app/core/components/help/help.html
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<div class="modal-body">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h2 class="modal-header-title">
|
||||||
|
<i class="fa fa-question-circle"></i>
|
||||||
|
<span class="p-l-1">Help</span>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<ul class="gf-tabs">
|
||||||
|
<li class="gf-tabs-item" ng-repeat="tab in ['Shortcuts']">
|
||||||
|
<a class="gf-tabs-link" ng-click="ctrl.tabindex = $index" ng-class="{active: ctrl.tabindex === $index}">
|
||||||
|
{{::tab}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<a class="modal-header-close" ng-click="dismiss();">
|
||||||
|
<i class="fa fa-remove"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-content">
|
||||||
|
<table class="shortcut-table">
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th style="text-align: left;">Dashboard wide shortcuts</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: right;"><span class="label label-info">ESC</span></td>
|
||||||
|
<td>Exit fullscreen edit/view mode, close search or any editor view</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">F</span></td>
|
||||||
|
<td>Open dashboard search view (also contains import/playlist controls)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">R</span></td>
|
||||||
|
<td>Refresh (Fetches new data and rerenders panels)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">left arrow key</span></td>
|
||||||
|
<td>Shift time backward</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">right arrow key</span></td>
|
||||||
|
<td>Shift time forward</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">CTRL+S</span></td>
|
||||||
|
<td>Save dashboard</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">CTRL+H</span></td>
|
||||||
|
<td>Hide row controls</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">CTRL+Z</span></td>
|
||||||
|
<td>Zoom out</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">CTRL+I</span></td>
|
||||||
|
<td>Quick snapshot</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="label label-info">CTRL+O</span></td>
|
||||||
|
<td>Enable/Disable shared graph crosshair</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
31
public/app/core/components/help/help.ts
Normal file
31
public/app/core/components/help/help.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
///<reference path="../../../headers/common.d.ts" />
|
||||||
|
|
||||||
|
import coreModule from '../../core_module';
|
||||||
|
|
||||||
|
export class HelpCtrl {
|
||||||
|
tabIndex: any;
|
||||||
|
shortcuts: any;
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
constructor(private $scope) {
|
||||||
|
this.tabIndex = 0;
|
||||||
|
this.shortcuts = {
|
||||||
|
'Global': [
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function helpModal() {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
templateUrl: 'public/app/core/components/help/help.html',
|
||||||
|
controller: HelpCtrl,
|
||||||
|
bindToController: true,
|
||||||
|
transclude: true,
|
||||||
|
controllerAs: 'ctrl',
|
||||||
|
scope: {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
coreModule.directive('helpModal', helpModal);
|
@ -45,6 +45,7 @@ import colors from './utils/colors';
|
|||||||
import {assignModelProperties} from './utils/model_utils';
|
import {assignModelProperties} from './utils/model_utils';
|
||||||
import {contextSrv} from './services/context_srv';
|
import {contextSrv} from './services/context_srv';
|
||||||
import {KeybindingSrv} from './services/keybindingSrv';
|
import {KeybindingSrv} from './services/keybindingSrv';
|
||||||
|
import {helpModal} from './components/help/help';
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@ -68,4 +69,5 @@ export {
|
|||||||
assignModelProperties,
|
assignModelProperties,
|
||||||
contextSrv,
|
contextSrv,
|
||||||
KeybindingSrv,
|
KeybindingSrv,
|
||||||
|
helpModal,
|
||||||
};
|
};
|
||||||
|
@ -59,10 +59,7 @@ export class KeybindingSrv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showHelpModal() {
|
showHelpModal() {
|
||||||
appEvents.emit('show-modal', {
|
appEvents.emit('show-modal', {templateHtml: '<help-modal></help-modal>'});
|
||||||
src: 'public/app/partials/help_modal.html',
|
|
||||||
model: {}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bind(keyArg, fn) {
|
bind(keyArg, fn) {
|
||||||
|
@ -23,13 +23,13 @@ export class UtilSrv {
|
|||||||
this.modalScope.dismiss();
|
this.modalScope.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.model) {
|
if (options.model || !options.scope) {
|
||||||
options.scope = this.modalScope = this.$rootScope.$new();
|
options.scope = this.modalScope = this.$rootScope.$new();
|
||||||
options.scope.model = options.model;
|
options.scope.model = options.model;
|
||||||
} else {
|
|
||||||
this.modalScope = options.scope;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.modalScope = options.scope;
|
||||||
|
|
||||||
var modal = this.$modal({
|
var modal = this.$modal({
|
||||||
modalClass: options.modalClass,
|
modalClass: options.modalClass,
|
||||||
template: options.src,
|
template: options.src,
|
||||||
|
@ -34,10 +34,7 @@ export class DashNavCtrl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.showHelpModal = function() {
|
$scope.showHelpModal = function() {
|
||||||
$scope.appEvent('show-modal', {
|
$scope.appEvent('show-modal', {templateHtml: '<help-modal></help-modal>'});
|
||||||
src: 'public/app/partials/help_modal.html',
|
|
||||||
model: {}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.starDashboard = function() {
|
$scope.starDashboard = function() {
|
||||||
|
@ -29,7 +29,7 @@ function (angular, _, require, config) {
|
|||||||
$scope.tabs.push({title: 'Snapshot', src: 'shareSnapshot.html'});
|
$scope.tabs.push({title: 'Snapshot', src: 'shareSnapshot.html'});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$scope.dashboard.meta.isSnapshot) {
|
if (!$scope.dashboard.meta.isSnapshot && !$scope.modeSharePanel) {
|
||||||
$scope.tabs.push({title: 'Export', src: 'shareExport.html'});
|
$scope.tabs.push({title: 'Export', src: 'shareExport.html'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,17 @@
|
|||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h2 class="modal-header-title">
|
<h2 class="modal-header-title">
|
||||||
<i class="fa fa-keyboard-o"></i>
|
<i class="fa fa-keyboard-o"></i>
|
||||||
<span class="p-l-1">Keyboard shortcuts</span>
|
<span class="p-l-1">Help</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
<ul class="gf-tabs">
|
||||||
|
<li class="gf-tabs-item" ng-repeat="tab in ['Shortcuts', 'Tips', 'Docs']">
|
||||||
|
<a class="gf-tabs-link" ng-click="editor.index = $index" ng-class="{active: editor.index === $index}">
|
||||||
|
{{::tab}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<a class="modal-header-close" ng-click="dismiss();">
|
<a class="modal-header-close" ng-click="dismiss();">
|
||||||
<i class="fa fa-remove"></i>
|
<i class="fa fa-remove"></i>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user