mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Exempt panels that are used in pulldowns or the nav
This commit is contained in:
parent
50370f2100
commit
f41fb5db53
@ -12,6 +12,7 @@ function (angular, app, _) {
|
||||
var _d = {
|
||||
collapse: false,
|
||||
notice: false,
|
||||
enable: true
|
||||
};
|
||||
|
||||
_.defaults($scope.pulldown,_d);
|
||||
|
@ -49,7 +49,7 @@
|
||||
],
|
||||
"type": "text",
|
||||
"mode": "markdown",
|
||||
"content": " \n\n##### Did you just upgrade? Not expecting this screen?\nIf you were using the old default page you might not be expecting this screen. I understand, change can be awkward. Let me explain. \n\n##### Setting a global default dashboard\nKibana has always shipped with an interface for Logstash, still does! You can access it [here](index.html#dashboard/file/logstash.json). However, if you want to make it your default again, all you you need to do is rename a file!\nIn your Kibana installation directory: \n\nRename *logstash.json* to *default.json* and refresh. Should be all set.\n\n##### But wait, there's more!\nIn fact, you can add any exported dashboard to that directory and access it as *http://YOUR-HOST -HERE/index.html#dashboard/file/YOUR-DASHBOARD.json*. Neat trick eh?",
|
||||
"content": " \n\n##### Did you just upgrade? Not expecting this screen?\nIf you were using the old default page you might not be expecting this screen. I understand, change can be awkward. Let me explain. \n\n##### Setting a global default dashboard\nKibana has always shipped with an interface for Logstash, still does! You can access it [here](index.html#dashboard/file/logstash.json). However, if you want to make it your default again, all you need to do is rename a file!\nIn your Kibana installation directory: \n\nRename *logstash.json* to *default.json* and refresh. Should be all set.\n\n##### But wait, there's more!\nIn fact, you can add any exported dashboard to that directory and access it as *http://YOUR-HOST -HERE/index.html#dashboard/file/YOUR-DASHBOARD.json*. Neat trick eh?",
|
||||
"style": {},
|
||||
"title": "",
|
||||
"status": "Stable"
|
||||
|
@ -4,7 +4,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<li ng-repeat="pulldown in dashboard.current.nav" ng-controller="PulldownCtrl"><kibana-simple-panel type="pulldown.type" panel="pulldown" 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" panel="pulldown" ng-cloak></kibana-simple-panel></li>
|
||||
|
||||
<li><a bs-tooltip="'Goto saved default'" data-placement="bottom" href='#/dashboard'><i class='icon-home'></i></a></li>
|
||||
<li class="dropdown" bs-tooltip="'Load'" data-placement="bottom" ng-show="showDropdown('load')" >
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- is there a better way to repeat without actually affecting the page? -->
|
||||
<nil ng-repeat="pulldown in dashboard.current.pulldowns" ng-controller="PulldownCtrl">
|
||||
<nil ng-repeat="pulldown in dashboard.current.pulldowns" ng-controller="PulldownCtrl" ng-show="pulldown.enable">
|
||||
<div class="top-row-open" ng-hide="pulldown.collapse">
|
||||
<kibana-simple-panel type="pulldown.type" ng-cloak></kibana-simple-panel>
|
||||
</div>
|
||||
|
@ -101,8 +101,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="editor.index == 3">
|
||||
<h5>Pulldowns</h5>
|
||||
<div class="row-fluid">
|
||||
<div class="span2" ng-repeat="pulldown in dashboard.current.pulldowns">
|
||||
<label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
|
||||
</div>
|
||||
<div class="span2" ng-repeat="pulldown in dashboard.current.nav">
|
||||
<label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="editor.index == 3" ng-controller="dashLoader">
|
||||
<h5>Allow saving to</h5>
|
||||
<h5>Save to</h5>
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
<label class="small">File</label><input type="checkbox" ng-model="dashboard.current.loader.save_local" ng-checked="dashboard.current.loader.save_local">
|
||||
@ -117,7 +129,7 @@
|
||||
<label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.current.loader.save_elasticsearch" ng-checked="dashboard.current.loader.save_elasticsearch">
|
||||
</div>
|
||||
</div>
|
||||
<h5>Allow loading from</h5>
|
||||
<h5>Load from</h5>
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
<label class="small">Local file</label><input type="checkbox" ng-model="dashboard.current.loader.load_local" ng-checked="dashboard.current.loader.load_local">
|
||||
@ -146,8 +158,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-repeat="pulldown in dashboard.current.nav" ng-controller="PulldownCtrl" ng-include="'./app/panels/'+pulldown.type+'/editor.html'" ng-show="editor.index == 4+$index">
|
||||
<div ng-repeat="pulldown in dashboard.current.nav|filter:{enable:true}" ng-controller="PulldownCtrl" ng-include="'./app/panels/'+pulldown.type+'/editor.html'" ng-show="editor.index == 4+$index">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
@ -48,7 +48,7 @@
|
||||
<div class="row-fluid" ng-show="editor.index == 2">
|
||||
<h4>Select Panel Type</h4>
|
||||
<form class="form-inline">
|
||||
<select class="input-medium" ng-model="panel.type" ng-options="panelType for panelType in config.panel_names|stringSort"></select>
|
||||
<select class="input-medium" ng-model="panel.type" ng-options="panelType for panelType in dashboard.availablePanels|stringSort"></select>
|
||||
<small ng-show="rowSpan(row) > 11">
|
||||
Note: This row is full, new panels will wrap to a new line. You should add another row.
|
||||
</small>
|
||||
|
@ -72,6 +72,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
|
||||
this.current = _.clone(_dash);
|
||||
this.last = {};
|
||||
this.availablePanels = [];
|
||||
|
||||
$rootScope.$on('$routeChangeSuccess',function(){
|
||||
// Clear the current dashboard to prevent reloading
|
||||
@ -200,6 +201,9 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
self.set_interval(dashboard.refresh);
|
||||
}
|
||||
|
||||
self.availablePanels = _.difference(config.panel_names,
|
||||
_.pluck(_.union(self.current.nav,self.current.pulldowns),'type'));
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user