Commit 5f8358e5 by Torkel Ödegaard

moved back to to load icon, and reinstated load dashboard from file

parent 0f7e4c7d
...@@ -43,14 +43,24 @@ function (angular, _, config, $) { ...@@ -43,14 +43,24 @@ function (angular, _, config, $) {
}); });
}; };
$scope.toggleImport = function ($event) {
$event.stopPropagation();
$scope.showImport = !$scope.showImport;
};
$scope.elasticsearch_dblist = function(queryStr) { $scope.elasticsearch_dblist = function(queryStr) {
$scope.showImport = false;
queryStr = queryStr.toLowerCase(); queryStr = queryStr.toLowerCase();
if (queryStr.indexOf('d:') === 0) { if (queryStr.indexOf('m:') !== 0) {
$scope.elasticsearch_dashboards(queryStr.substring(2, queryStr.length)); $scope.elasticsearch_dashboards(queryStr);
return; return;
} }
queryStr = queryStr.substring(2, queryStr.length);
var words = queryStr.split(' '); var words = queryStr.split(' ');
var query = $scope.ejs.BoolQuery(); var query = $scope.ejs.BoolQuery();
var terms = _.map(words, function(word) { var terms = _.map(words, function(word) {
...@@ -78,6 +88,7 @@ function (angular, _, config, $) { ...@@ -78,6 +88,7 @@ function (angular, _, config, $) {
$scope.openSearch = function () { $scope.openSearch = function () {
$scope.giveSearchFocus = $scope.giveSearchFocus + 1; $scope.giveSearchFocus = $scope.giveSearchFocus + 1;
$scope.elasticsearch_dblist("");
}; };
$scope.addMetricToCurrentDashboard = function (metricId) { $scope.addMetricToCurrentDashboard = function (metricId) {
......
...@@ -432,11 +432,9 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -432,11 +432,9 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope.toggleSeries = function(info) { $scope.toggleSeries = function(info) {
if ($scope.hiddenSeries[info.alias]) { if ($scope.hiddenSeries[info.alias]) {
delete $scope.hiddenSeries[info.alias]; delete $scope.hiddenSeries[info.alias];
info.hidden = false;
} }
else { else {
$scope.hiddenSeries[info.alias] = true; $scope.hiddenSeries[info.alias] = true;
info.hidden = true;
} }
$scope.$emit('toggleLegend', info.alias); $scope.$emit('toggleLegend', info.alias);
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
</style> </style>
<li> <li>
<a class='small' ng-controller="ZoomCtrl" ng-click='zoom(2)'><i class='icon-zoom-out'></i> Zoom Out</a> <a class='small' ng-controller="ZoomCtrl" ng-click='zoom(2)'>
Zoom Out
</a>
</li> </li>
<li ng-repeat="pulldown in dashboard.current.nav" ng-controller="PulldownCtrl" ng-show="pulldown.enable"><kibana-simple-panel type="pulldown.type" ng-cloak></kibana-simple-panel></li> <li ng-repeat="pulldown in dashboard.current.nav" ng-controller="PulldownCtrl" ng-show="pulldown.enable"><kibana-simple-panel type="pulldown.type" ng-cloak></kibana-simple-panel></li>
...@@ -51,6 +53,11 @@ ...@@ -51,6 +53,11 @@
</ul> </ul>
</li> </li>
<li class="dropdown" ng-show="showDropdown('load')" ng-controller="SearchCtrl" ng-init="init()" ng-include="'app/partials/search.html'">
</li>
<li><a bs-tooltip="'Goto saved default'" data-placement="bottom" href='#/dashboard'><i class='icon-home'></i></a></li> <li><a bs-tooltip="'Goto saved default'" data-placement="bottom" href='#/dashboard'><i class='icon-home'></i></a></li>
<li ng-show="showDropdown('share')"><a bs-tooltip="'Share'" data-placement="bottom" ng-click="elasticsearch_save('temp',dashboard.current.loader.save_temp_ttl)" bs-modal="'app/partials/dashLoaderShare.html'"><i class='icon-share'></i></a></li> <li ng-show="showDropdown('share')"><a bs-tooltip="'Share'" data-placement="bottom" ng-click="elasticsearch_save('temp',dashboard.current.loader.save_temp_ttl)" bs-modal="'app/partials/dashLoaderShare.html'"><i class='icon-share'></i></a></li>
......
<style> <style>
.grafana-search { #grafana-search {
position: fixed; position: fixed;
right: 0; right: 0;
left: 0; left: 0;
...@@ -12,15 +12,19 @@ ...@@ -12,15 +12,19 @@
} }
</style> </style>
<li class="dropdown">
<a href="#" bs-tooltip="'Search'" data-placement="bottom" ng-click="openSearch()" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" bs-tooltip="'Search'" data-placement="bottom" ng-click="openSearch()" class="dropdown-toggle" data-toggle="dropdown">
<i class='icon-search'></i> <i class='icon-folder-open'></i>
</a> </a>
<ul class="dropdown-menu grafana-search">
<li>
<div class="grafana-search-panel">
<input type="text" placeholder="search dashboards, metrics, or graphs" xng-focus="giveSearchFocus" ng-keydown="keyDown($event)" ng-model="elasticsearch.query" ng-change="elasticsearch_dblist(elasticsearch.query)" />
<ul class="dropdown-menu" id="grafana-search">
<li ng-if="!showImport">
<div class="grafana-search-panel">
<input type="text"
placeholder="search dashboards, metrics, or graphs"
xng-focus="giveSearchFocus"
ng-keydown="keyDown($event)"
ng-model="elasticsearch.query"
ng-change="elasticsearch_dblist(elasticsearch.query)" />
<h6 ng-hide="search_results.dashboards.length || search_results.metrics.length">No dashboards or metrics matching your query found</h6> <h6 ng-hide="search_results.dashboards.length || search_results.metrics.length">No dashboards or metrics matching your query found</h6>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<tr bindonce ng-repeat="row in search_results.metrics" class="grafana-search-metric-result"> <tr bindonce ng-repeat="row in search_results.metrics" class="grafana-search-metric-result">
...@@ -43,5 +47,35 @@ ...@@ -43,5 +47,35 @@
</table> </table>
</div> </div>
</li> </li>
</ul>
</li> <li class="pull-right" style="margin: 5px;">
\ No newline at end of file <a ng-click="toggleImport($event)">Import</a>
</li>
<!-- ng-show="dashboard.current.loader.load_gist || dashboard.current.loader.load_local" -->
<li ng-if="showImport" style="margin: 20px;">
<div class="editor-row">
<div class="section">
<div class="editor-option">
<h5>Local File <tip>Load dashboard JSON layout from file</tip></h5>
<form>
<input type="file" id="dashupload" dash-upload /><br>
</form>
</div>
</div>
</div>
<div class="editor-row" ng-show='dashboard.current.loader.load_gist'>
<h5>Gist <tip>Enter a gist number or url</tip></h5>
<form>
<input type="text" ng-model="gist.url" placeholder="Gist number or URL"><br>
<button class="btn" ng-click="gist_dblist(dashboard.gist_id(gist.url))" ng-show="dashboard.is_gist(gist.url)"><i class="icon-github-alt"></i> Get gist:{{gist.url | gistid}}</button>
<h6 ng-show="gist.files.length">Dashboards in gist:{{gist.url | gistid}} <small>click to load</small></h6>
<h6 ng-hide="gist.files.length || !gist.url.length">No gist dashboards found</h6>
<table class="table table-condensed table-striped">
<tr ng-repeat="file in gist.files">
<td><a ng-click="dashboard.dash_load(file)">{{file.title}}</a></td>
</tr>
</table>
</form>
</div>
</li>
...@@ -70,6 +70,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -70,6 +70,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
// Store a reference to this // Store a reference to this
var self = this; var self = this;
var filterSrv; var filterSrv;
var graphiteSrv;
this.current = _.clone(_dash); this.current = _.clone(_dash);
this.last = {}; this.last = {};
...@@ -160,6 +161,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -160,6 +161,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
$timeout(function() { $timeout(function() {
// Ok, now that we've setup the current dashboard, we can inject our services // Ok, now that we've setup the current dashboard, we can inject our services
filterSrv = $injector.get('filterSrv'); filterSrv = $injector.get('filterSrv');
graphiteSrv = $injector.get('graphiteSrv');
filterSrv.init(); filterSrv.init();
},0).then(function() { },0).then(function() {
......
...@@ -34,10 +34,6 @@ ...@@ -34,10 +34,6 @@
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container-fluid"> <div class="container-fluid">
<span class="brand"><img src="img/small.png" bs-tooltip="'Kibana 3 milestone pre-5'" data-placement="bottom"> {{dashboard.current.title}}</span> <span class="brand"><img src="img/small.png" bs-tooltip="'Kibana 3 milestone pre-5'" data-placement="bottom"> {{dashboard.current.title}}</span>
<ul class="nav pull-left" ng-controller="SearchCtrl" ng-init="init()" ng-include="'app/partials/search.html'">
</ul>
<ul class="nav pull-right" ng-controller='dashLoader' ng-init="init()" ng-include="'app/partials/dashLoader.html'"> <ul class="nav pull-right" ng-controller='dashLoader' ng-init="init()" ng-include="'app/partials/dashLoader.html'">
</ul> </ul>
</div> </div>
......
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