|
@@ -11,7 +11,7 @@ export class KeybindingSrv {
|
|
|
helpModal: boolean;
|
|
helpModal: boolean;
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
/** @ngInject */
|
|
|
- constructor(private $rootScope, private $modal, private $location) {
|
|
|
|
|
|
|
+ constructor(private $rootScope, private $modal, private $location, private contextSrv) {
|
|
|
// clear out all shortcuts on route change
|
|
// clear out all shortcuts on route change
|
|
|
$rootScope.$on('$routeChangeSuccess', () => {
|
|
$rootScope.$on('$routeChangeSuccess', () => {
|
|
|
Mousetrap.reset();
|
|
Mousetrap.reset();
|
|
@@ -26,6 +26,7 @@ export class KeybindingSrv {
|
|
|
setupGlobal() {
|
|
setupGlobal() {
|
|
|
this.bind("?", this.showHelpModal);
|
|
this.bind("?", this.showHelpModal);
|
|
|
this.bind("g h", this.goToHome);
|
|
this.bind("g h", this.goToHome);
|
|
|
|
|
+ this.bind("g a", this.openAlerting);
|
|
|
this.bind("g p", this.goToProfile);
|
|
this.bind("g p", this.goToProfile);
|
|
|
this.bind("s s", this.openSearchStarred);
|
|
this.bind("s s", this.openSearchStarred);
|
|
|
this.bind(['f'], this.openSearch);
|
|
this.bind(['f'], this.openSearch);
|
|
@@ -39,12 +40,16 @@ export class KeybindingSrv {
|
|
|
this.$rootScope.appEvent('show-dash-search');
|
|
this.$rootScope.appEvent('show-dash-search');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ openAlerting() {
|
|
|
|
|
+ this.$location.url("/alerting");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
goToHome() {
|
|
goToHome() {
|
|
|
- this.$location.path("/");
|
|
|
|
|
|
|
+ this.$location.url("/");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
goToProfile() {
|
|
goToProfile() {
|
|
|
- this.$location.path("/profile");
|
|
|
|
|
|
|
+ this.$location.url("/profile");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
showHelpModal() {
|
|
showHelpModal() {
|