Commit 0032f934 by Torkel Ödegaard

Closes #62, there is now a New button in the open / search dashboard view.

parent 8816e180
......@@ -51,12 +51,6 @@ function (angular, _, config, $) {
});
};
$scope.toggleImport = function ($event) {
$event.stopPropagation();
$scope.showImport = !$scope.showImport;
};
$scope.elasticsearch_dblist = function(queryStr) {
$scope.showImport = false;
$scope.selectedIndex = -1;
......@@ -120,6 +114,15 @@ function (angular, _, config, $) {
});
};
$scope.toggleImport = function ($event) {
$event.stopPropagation();
$scope.showImport = !$scope.showImport;
};
$scope.newDashboard = function() {
$location.url('/dashboard/file/empty.json');
};
});
......
{
"title": "New Dashboard",
"title": "Welcome to Grafana!",
"services": {
"filter": {
"list": [],
......
{
"title": "New Dashboard",
"services": {
"filter": {
"list": [],
"time": {
"from": "now-6h",
"to": "now"
}
}
},
"rows": [
{
"title": "Row1",
"height": "250px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [],
"notice": false
}
],
"editable": true,
"failover": false,
"panel_hints": true,
"style": "dark",
"pulldowns": [
{
"type": "filtering",
"collapse": false,
"notice": false,
"enable": false
}
],
"nav": [
{
"type": "timepicker",
"collapse": false,
"notice": false,
"enable": true,
"status": "Stable",
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
],
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"now": true
}
],
"loader": {
"save_gist": false,
"save_elasticsearch": true,
"save_local": true,
"save_default": true,
"save_temp": true,
"save_temp_ttl_enable": true,
"save_temp_ttl": "30d",
"load_gist": false,
"load_elasticsearch": true,
"load_elasticsearch_size": 20,
"load_local": false,
"hide": false
},
"refresh": false
}
\ No newline at end of file
......@@ -19,12 +19,24 @@
<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)" />
<div class="search-field-wrapper">
<button class="btn btn-success pull-right" ng-click="toggleImport($event)">
<i class="icon-download-alt"></i>
Import
</button>
<button class="btn btn-success pull-right" ng-click="newDashboard()">
<i class="icon-th-large"></i>
New
</button>
<span>
<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)" />
</span>
</div>
<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">
<tr bindonce ng-repeat="row in search_results.metrics"
......@@ -52,9 +64,6 @@
</div>
</li>
<li class="pull-right" style="margin: 5px;">
<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">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,10 +12,19 @@
.grafana-search-panel {
padding: 6px 10px;
input {
width: 100%;
.box-sizing(border-box);
padding: 15px;
.search-field-wrapper {
input {
width: 100%;
}
button {
margin: 0 2px 0 0;
}
> span {
display: block;
overflow: hidden;
padding-right: 25px;
}
}
.selected td, tr.selected:nth-child(odd)>td {
......
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