ux(dashboard): minor tweaks and polish, added g a shortcut for go to alerting list

This commit is contained in:
Torkel Ödegaard 2016-11-02 22:08:17 +01:00
parent cdea420285
commit e23f898418
5 changed files with 20 additions and 19 deletions

View File

@ -27,17 +27,13 @@
</div> </div>
<div class="search-results-container" ng-if="ctrl.tagsMode"> <div class="search-results-container" ng-if="ctrl.tagsMode">
<div class="row"> <div ng-repeat="tag in ctrl.results" class="pointer" style="width: 180px; float: left;"
<div class="span6 offset1"> ng-class="{'selected': $index === ctrl.selectedIndex }"
<div ng-repeat="tag in ctrl.results" class="pointer" style="width: 180px; float: left;" ng-click="ctrl.filterByTag(tag.term, $event)">
ng-class="{'selected': $index === ctrl.selectedIndex }" <a class="search-result-tag label label-tag" tag-color-from-name="tag.term">
ng-click="ctrl.filterByTag(tag.term, $event)"> <i class="fa fa-tag"></i>
<a class="search-result-tag label label-tag" tag-color-from-name="tag.term"> <span>{{tag.term}} &nbsp;({{tag.count}})</span>
<i class="fa fa-tag"></i> </a>
<span>{{tag.term}} &nbsp;({{tag.count}})</span>
</a>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -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() {

View File

@ -155,7 +155,7 @@ export class PanelCtrl {
if (this.fullscreen) { if (this.fullscreen) {
var docHeight = $(window).height(); var docHeight = $(window).height();
var editHeight = Math.floor(docHeight * 0.4); var editHeight = Math.floor(docHeight * 0.4);
var fullscreenHeight = Math.floor(docHeight * 0.6); var fullscreenHeight = Math.floor(docHeight * 0.8);
this.containerHeight = this.editMode ? editHeight : fullscreenHeight; this.containerHeight = this.editMode ? editHeight : fullscreenHeight;
} else { } else {
this.containerHeight = this.panel.height || this.row.height; this.containerHeight = this.panel.height || this.row.height;

View File

@ -133,11 +133,11 @@ module.directive('grafanaPanel', function($rootScope) {
} }
}, scope); }, scope);
panelContainer.on('mouseenter', mouseEnter); elem.on('mouseenter', mouseEnter);
panelContainer.on('mouseleave', mouseLeave); elem.on('mouseleave', mouseLeave);
scope.$on('$destroy', function() { scope.$on('$destroy', function() {
panelContainer.off(); elem.off();
}); });
} }
}; };

View File

@ -156,7 +156,7 @@ div.flot-text {
} }
.panel-hover-highlight { .panel-hover-highlight {
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 1px rgba(82,168,236,10.8) box-shadow: inset 0 1px 1px rgba(0,0,0,0.025), 0 0 1px rgba(82,168,236,0.5)
} }
.on-drag-hover { .on-drag-hover {