mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Closes #62, there is now a New button in the open / search dashboard view.
This commit is contained in:
parent
8816e18027
commit
0032f934c9
@ -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');
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "New Dashboard",
|
||||
"title": "Welcome to Grafana!",
|
||||
"services": {
|
||||
"filter": {
|
||||
"list": [],
|
||||
|
83
src/app/dashboards/empty.json
Normal file
83
src/app/dashboards/empty.json
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -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">
|
||||
|
2
src/css/bootstrap.dark.min.css
vendored
2
src/css/bootstrap.dark.min.css
vendored
File diff suppressed because one or more lines are too long
2
src/css/bootstrap.light.min.css
vendored
2
src/css/bootstrap.light.min.css
vendored
File diff suppressed because one or more lines are too long
17
src/vendor/bootstrap/less/grafana.less
vendored
17
src/vendor/bootstrap/less/grafana.less
vendored
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user