Commit 39ffb04b by Torkel Ödegaard

Merge branch 'revert-dashboard-search-nav'

parents e9c8881d 056c57d5
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<i class="fa fa-chevron-left"></i> <i class="fa fa-chevron-left"></i>
</a> </a>
<a class="navbar-page-btn navbar-page-btn--search" ng-click="ctrl.showSearch()"> <!-- <a class="navbar&#45;page&#45;btn navbar&#45;page&#45;btn&#45;&#45;search" ng&#45;click="ctrl.showSearch()"> -->
<i class="fa fa-search"></i> <!-- <i class="fa fa&#45;search"></i> -->
</a> <!-- </a> -->
<div ng-if="::!ctrl.hasMenu"> <div ng-if="::!ctrl.hasMenu">
<a href="{{::ctrl.section.url}}" class="navbar-page-btn"> <a href="{{::ctrl.section.url}}" class="navbar-page-btn">
......
<navbar model="ctrl.navModel"> <div class="navbar">
<div class="navbar-inner">
<a class="navbar-brand-btn pointer" ng-click="ctrl.toggleSideMenu()">
<span class="navbar-brand-btn-background">
<img src="public/img/grafana_icon.svg"></img>
</span>
<i class="icon-gf icon-gf-grafana_wordmark"></i>
<i class="fa fa-caret-down"></i>
<i class="fa fa-chevron-left"></i>
</a>
<ul class="nav dash-playlist-actions" ng-if="ctrl.playlistSrv.isPlaying"> <div class="navbar-section-wrapper">
<li> <a class="navbar-page-btn" ng-click="ctrl.showSearch()">
<a ng-click="ctrl.playlistSrv.prev()"><i class="fa fa-step-backward"></i></a> <i class="icon-gf icon-gf-dashboard"></i>
</li> {{ctrl.dashboard.title}}
<li> <i class="fa fa-caret-down"></i>
<a ng-click="ctrl.playlistSrv.stop()"><i class="fa fa-stop"></i></a> </a>
</li> </div>
<li>
<a ng-click="ctrl.playlistSrv.next()"><i class="fa fa-step-forward"></i></a>
</li>
</ul>
<ul class="nav pull-left dashnav-action-icons"> <ul class="nav dash-playlist-actions" ng-if="ctrl.playlistSrv.isPlaying">
<li ng-show="::ctrl.dashboard.meta.canStar">
<a class="pointer" ng-click="ctrl.starDashboard()">
<i class="fa" ng-class="{'fa-star-o': !ctrl.dashboard.meta.isStarred, 'fa-star': ctrl.dashboard.meta.isStarred}" style="color: orange;"></i>
</a>
</li>
<li ng-show="::ctrl.dashboard.meta.canShare" class="dropdown">
<a class="pointer" ng-click="ctrl.hideTooltip($event)" bs-tooltip="'Share dashboard'" data-placement="bottom" data-toggle="dropdown"><i class="fa fa-share-square-o"></i></a>
<ul class="dropdown-menu">
<li> <li>
<a class="pointer" ng-click="ctrl.shareDashboard(0)"> <a ng-click="ctrl.playlistSrv.prev()"><i class="fa fa-step-backward"></i></a>
<i class="fa fa-link"></i> Link to Dashboard
<div class="dropdown-desc">Share an internal link to the current dashboard. Some configuration options available.</div>
</a>
</li> </li>
<li> <li>
<a class="pointer" ng-click="ctrl.shareDashboard(1)"> <a ng-click="ctrl.playlistSrv.stop()"><i class="fa fa-stop"></i></a>
<i class="icon-gf icon-gf-snapshot"></i>Snapshot
<div class="dropdown-desc">Interactive, publically accessible dashboard. Sensitive data is stripped out.</div>
</a>
</li> </li>
<li> <li>
<a class="pointer" ng-click="ctrl.shareDashboard(2)"> <a ng-click="ctrl.playlistSrv.next()"><i class="fa fa-step-forward"></i></a>
<i class="fa fa-cloud-upload"></i>Export </li>
<div class="dropdown-desc">Export the dashboard to a JSON file for others and to share on Grafana.com</div> </ul>
<ul class="nav pull-left dashnav-action-icons">
<li ng-show="::ctrl.dashboard.meta.canStar">
<a class="pointer" ng-click="ctrl.starDashboard()">
<i class="fa" ng-class="{'fa-star-o': !ctrl.dashboard.meta.isStarred, 'fa-star': ctrl.dashboard.meta.isStarred}" style="color: orange;"></i>
</a>
</li>
<li ng-show="::ctrl.dashboard.meta.canShare" class="dropdown">
<a class="pointer" ng-click="ctrl.hideTooltip($event)" bs-tooltip="'Share dashboard'" data-placement="bottom" data-toggle="dropdown"><i class="fa fa-share-square-o"></i></a>
<ul class="dropdown-menu">
<li>
<a class="pointer" ng-click="ctrl.shareDashboard(0)">
<i class="fa fa-link"></i> Link to Dashboard
<div class="dropdown-desc">Share an internal link to the current dashboard. Some configuration options available.</div>
</a>
</li>
<li>
<a class="pointer" ng-click="ctrl.shareDashboard(1)">
<i class="icon-gf icon-gf-snapshot"></i>Snapshot
<div class="dropdown-desc">Interactive, publically accessible dashboard. Sensitive data is stripped out.</div>
</a>
</li>
<li>
<a class="pointer" ng-click="ctrl.shareDashboard(2)">
<i class="fa fa-cloud-upload"></i>Export
<div class="dropdown-desc">Export the dashboard to a JSON file for others and to share on Grafana.com</div>
</a>
</li>
</ul>
</li>
<li ng-show="::ctrl.dashboard.meta.canSave">
<a ng-click="ctrl.saveDashboard()" bs-tooltip="'Save dashboard <br> CTRL+S'" data-placement="bottom"><i class="fa fa-save"></i></a>
</li>
<li ng-if="::ctrl.dashboard.snapshot.originalUrl">
<a ng-href="{{ctrl.dashboard.snapshot.originalUrl}}" bs-tooltip="'Open original dashboard'" data-placement="bottom"><i class="fa fa-link"></i></a>
</li>
<li class="dropdown">
<a class="pointer" data-toggle="dropdown">
<i class="fa fa-cog"></i>
</a> </a>
<ul class="dropdown-menu dropdown-menu--navbar">
<li ng-repeat="navItem in ::ctrl.navModel.menu" ng-class="{active: navItem.active}">
<a class="pointer" ng-href="{{::navItem.url}}" ng-click="ctrl.navItemClicked(navItem, $event)">
<i class="{{::navItem.icon}}" ng-show="::navItem.icon"></i>
{{::navItem.title}}
</a>
</li>
</ul>
</li> </li>
</ul> </ul>
</li>
<li ng-show="::ctrl.dashboard.meta.canSave">
<a ng-click="ctrl.saveDashboard()" bs-tooltip="'Save dashboard <br> CTRL+S'" data-placement="bottom"><i class="fa fa-save"></i></a>
</li>
<li ng-if="::ctrl.dashboard.snapshot.originalUrl">
<a ng-href="{{ctrl.dashboard.snapshot.originalUrl}}" bs-tooltip="'Open original dashboard'" data-placement="bottom"><i class="fa fa-link"></i></a>
</li>
</ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li ng-show="ctrl.dashboard.meta.fullscreen" class="dashnav-back-to-dashboard"> <li ng-show="ctrl.dashboard.meta.fullscreen" class="dashnav-back-to-dashboard">
<a ng-click="ctrl.exitFullscreen()"> <a ng-click="ctrl.exitFullscreen()">
Back to dashboard Back to dashboard
</a> </a>
</li> </li>
<li> <li>
<gf-time-picker dashboard="ctrl.dashboard"></gf-time-picker> <gf-time-picker dashboard="ctrl.dashboard"></gf-time-picker>
</li> </li>
</ul> </ul>
</div>
</div>
</navbar> <dashboard-search></dashboard-search>
...@@ -22,8 +22,8 @@ export class DashNavCtrl { ...@@ -22,8 +22,8 @@ export class DashNavCtrl {
private backendSrv, private backendSrv,
private $timeout, private $timeout,
private datasourceSrv, private datasourceSrv,
private navModelSrv) { private navModelSrv,
private contextSrv) {
this.navModel = navModelSrv.getDashboardNav(this.dashboard, this); this.navModel = navModelSrv.getDashboardNav(this.dashboard, this);
appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope); appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope);
...@@ -38,6 +38,10 @@ export class DashNavCtrl { ...@@ -38,6 +38,10 @@ export class DashNavCtrl {
} }
} }
toggleSideMenu() {
this.contextSrv.toggleSideMenu();
}
openEditView(editview) { openEditView(editview) {
var search = _.extend(this.$location.search(), {editview: editview}); var search = _.extend(this.$location.search(), {editview: editview});
this.$location.search(search); this.$location.search(search);
...@@ -135,6 +139,17 @@ export class DashNavCtrl { ...@@ -135,6 +139,17 @@ export class DashNavCtrl {
var uri = "data:application/json;charset=utf-8," + encodeURIComponent(html); var uri = "data:application/json;charset=utf-8," + encodeURIComponent(html);
var newWindow = window.open(uri); var newWindow = window.open(uri);
} }
showSearch() {
this.$rootScope.appEvent('show-dash-search');
}
navItemClicked(navItem, evt) {
if (navItem.clickHandler) {
navItem.clickHandler();
evt.preventDefault();
}
}
} }
export function dashNavDirective() { export function dashNavDirective() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment