Commit 67582aae by Torkel Ödegaard

cleanup of 'loader' settings, removed loader.save_elasticsearch,…

cleanup of 'loader' settings, removed loader.save_elasticsearch, loader.load_elasticsearch. Save/Load is default enabled and will use any datasource marked with grafanaDB: true property
parent 8ebe2606
...@@ -27,24 +27,6 @@ function (angular, _, moment, config) { ...@@ -27,24 +27,6 @@ function (angular, _, moment, config) {
$scope.emitAppEvent('panel-fullscreen-exit'); $scope.emitAppEvent('panel-fullscreen-exit');
}; };
$scope.showDropdown = function(type) {
if(_.isUndefined($scope.dashboard)) {
return true;
}
var _l = $scope.dashboard.loader;
if(type === 'load') {
return (_l.load_elasticsearch);
}
if(type === 'save') {
return (_l.save_elasticsearch);
}
if(type === 'share') {
return (_l.save_temp);
}
return false;
};
$scope.set_default = function() { $scope.set_default = function() {
window.localStorage.grafanaDashboardDefault = $location.path(); window.localStorage.grafanaDashboardDefault = $location.path();
alertSrv.set('Home Set','This page has been set as your default dashboard','success',5000); alertSrv.set('Home Set','This page has been set as your default dashboard','success',5000);
......
...@@ -135,15 +135,9 @@ ...@@ -135,15 +135,9 @@
} }
], ],
"loader": { "loader": {
"save_gist": false,
"save_elasticsearch": true,
"save_default": true,
"save_temp": true, "save_temp": true,
"save_temp_ttl_enable": true, "save_temp_ttl_enable": true,
"save_temp_ttl": "30d", "save_temp_ttl": "30d",
"load_gist": false,
"load_elasticsearch": true,
"hide": false
}, },
"refresh": false "refresh": false
} }
...@@ -66,14 +66,9 @@ ...@@ -66,14 +66,9 @@
} }
], ],
"loader": { "loader": {
"save_elasticsearch": true,
"save_default": true,
"save_temp": true, "save_temp": true,
"save_temp_ttl_enable": true, "save_temp_ttl_enable": true,
"save_temp_ttl": "30d", "save_temp_ttl": "30d",
"load_elasticsearch": true,
"load_elasticsearch_size": 20,
"hide": false
}, },
"refresh": false "refresh": false
} }
...@@ -18,24 +18,24 @@ ...@@ -18,24 +18,24 @@
<li ng-repeat="pulldown in dashboard.nav" ng-controller="PulldownCtrl" ng-show="pulldown.enable"><grafana-simple-panel type="pulldown.type" ng-cloak></grafana-simple-panel></li> <li ng-repeat="pulldown in dashboard.nav" ng-controller="PulldownCtrl" ng-show="pulldown.enable"><grafana-simple-panel type="pulldown.type" ng-cloak></grafana-simple-panel></li>
<li class="dropdown grafana-menu-save" ng-show="showDropdown('save')"> <li class="dropdown grafana-menu-save">
<a href="#" bs-tooltip="'Save'" data-placement="bottom" class="dropdown-toggle" data-toggle="dropdown" ng-click="openSaveDropdown()"> <a href="#" bs-tooltip="'Save'" data-placement="bottom" class="dropdown-toggle" data-toggle="dropdown" ng-click="openSaveDropdown()">
<i class='icon-save'></i> <i class='icon-save'></i>
</a> </a>
<ul class="save-dashboard-dropdown dropdown-menu"> <ul class="save-dashboard-dropdown dropdown-menu">
<li ng-show="dashboard.loader.save_elasticsearch"> <li>
<form class="input-prepend nomargin save-dashboard-dropdown-save-form"> <form class="input-prepend nomargin save-dashboard-dropdown-save-form">
<input class='input-medium' ng-model="dashboard.title" type="text" /> <input class='input-medium' ng-model="dashboard.title" type="text" />
<button class="btn" ng-click="saveDashboard()"><i class="icon-save"></i></button> <button class="btn" ng-click="saveDashboard()"><i class="icon-save"></i></button>
</form> </form>
</li> </li>
<li ng-show="dashboard.loader.save_default"> <li>
<a class="link" ng-click="set_default()">Save as Home</a> <a class="link" ng-click="set_default()">Save as Home</a>
</li> </li>
<li ng-show="dashboard.loader.save_default"> <li>
<a class="link" ng-click="purge_default()">Reset Home</a> <a class="link" ng-click="purge_default()">Reset Home</a>
</li> </li>
<li ng-show="!isFavorite"> <li ng-show="!isFavorite">
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
<li ng-show="isFavorite"> <li ng-show="isFavorite">
<a class="link" ng-click="removeAsFavorite()">Remove as favorite</a> <a class="link" ng-click="removeAsFavorite()">Remove as favorite</a>
</li> </li>
<li ng-show="dashboard.loader.save_local"> <li>
<a class="link" ng-click="exportDashboard()">Export dashboard</a> <a class="link" ng-click="exportDashboard()">Export dashboard</a>
</li> </li>
<li ng-show="showDropdown('share')"> <li ng-show="dashboard.loader.save_temp">
<a bs-tooltip="'Share'" data-placement="bottom" ng-click="saveForSharing()" config-modal="app/partials/dashLoaderShare.html"> <a bs-tooltip="'Share'" data-placement="bottom" ng-click="saveForSharing()" config-modal="app/partials/dashLoaderShare.html">
Share temp copy Share temp copy
</a> </a>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</ul> </ul>
</li> </li>
<li class="dropdown grafana-menu-load" ng-show="showDropdown('load')" ng-controller="SearchCtrl" ng-init="init()" ng-include="'app/partials/search.html'"> <li class="dropdown grafana-menu-load" ng-controller="SearchCtrl" ng-init="init()" ng-include="'app/partials/search.html'">
</li> </li>
......
...@@ -70,46 +70,29 @@ ...@@ -70,46 +70,29 @@
<div ng-if="editor.index == 2" ng-controller="dashLoader"> <div ng-if="editor.index == 2" ng-controller="dashLoader">
<div class="editor-row"> <div class="editor-row">
<div class="section">
<h5>Feature toggles</h5>
<div class="editor-option" ng-repeat="pulldown in dashboard.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="editor-option" ng-repeat="pulldown in dashboard.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 class="section"> <div class="section">
<h5>Save to</h5> <h5>Sharing</h5>
<div class="editor-option"> <div class="editor-option" >
<label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.loader.save_elasticsearch" ng-checked="dashboard.loader.save_elasticsearch"> <label class="small">Allow Sharing <tip>Allow generating adhoc links to dashboards</tip></label><input type="checkbox" ng-model="dashboard.loader.save_temp" ng-checked="dashboard.loader.save_temp">
</div> </div>
</div> <div class="editor-option" ng-show="dashboard.loader.save_temp">
<div class="section"> <label class="small">TTL <tip>Expire temp urls</tip></label><input type="checkbox" ng-model="dashboard.loader.save_temp_ttl_enable">
<h5>Load from</h5> </div>
<div class="editor-option"> <div class="editor-option" ng-show="dashboard.loader.save_temp &amp;&amp; dashboard.loader.save_temp_ttl_enable">
<label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.loader.load_elasticsearch" ng-checked="dashboard.loader.load_elasticsearch"> <label class="small">TTL Duration <tip>Elasticsearch date math, eg: 1m,1d,1w,30d </tip></label><input class="input-small" type="text" ng-model="dashboard.loader.save_temp_ttl">
</div> </div>
</div> </div>
<div class="section"> </div>
<h5>Sharing</h5> </div>
<div class="editor-option" >
<label class="small">Allow Sharing <tip>Allow generating adhoc links to dashboards</tip></label><input type="checkbox" ng-model="dashboard.loader.save_temp" ng-checked="dashboard.loader.save_temp">
</div>
<div class="editor-option" ng-show="dashboard.loader.save_temp">
<label class="small">TTL <tip>Expire temp urls</tip></label><input type="checkbox" ng-model="dashboard.loader.save_temp_ttl_enable">
</div>
<div class="editor-option" ng-show="dashboard.loader.save_temp &amp;&amp; dashboard.loader.save_temp_ttl_enable">
<label class="small">TTL Duration <tip>Elasticsearch date math, eg: 1m,1d,1w,30d </tip></label><input class="input-small" type="text" ng-model="dashboard.loader.save_temp_ttl">
</div>
</div>
</div>
</div>
<div ng-if="editor.index == 2">
<div class="editor-row">
<div class="section">
<h5>Feature toggles</h5>
<div class="editor-option" ng-repeat="pulldown in dashboard.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="editor-option" ng-repeat="pulldown in dashboard.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>
<div ng-if="editor.index == 3"> <div ng-if="editor.index == 3">
<ng-include src="'app/partials/import.html'"></ng-include> <ng-include src="'app/partials/import.html'"></ng-include>
......
...@@ -29,13 +29,9 @@ function (angular, $, kbn, _) { ...@@ -29,13 +29,9 @@ function (angular, $, kbn, _) {
this.loader = data.loader || {}; this.loader = data.loader || {};
_.defaults(this.loader, { _.defaults(this.loader, {
save_elasticsearch: true,
save_default: true,
save_temp: true, save_temp: true,
save_temp_ttl_enable: true, save_temp_ttl_enable: true,
save_temp_ttl: '30d', save_temp_ttl: '30d',
load_elasticsearch: true,
hide: false
}); });
if (this.nav.length === 0) { if (this.nav.length === 0) {
......
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