Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
853cd163
Commit
853cd163
authored
Feb 05, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(search); fixes to dashboard search (using keyboard), and fix for singlestat in snapshot view
parent
0fab210a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
84 deletions
+47
-84
public/app/core/components/grafana_app.ts
+6
-2
public/app/core/components/search/search.html
+4
-3
public/app/core/components/search/search.ts
+23
-7
public/app/features/dashboard/all.js
+0
-1
public/app/features/dashboard/directives/dashSearchView.js
+0
-54
public/app/partials/dashboard.html
+1
-1
public/app/plugins/panel/singlestat/module.ts
+7
-15
public/less/grafana.less
+5
-0
public/views/index.html
+1
-1
No files found.
public/app/core/components/grafana_app.ts
View file @
853cd163
...
...
@@ -187,13 +187,17 @@ export function grafanaAppDirective(playlistSrv) {
// hide search
if
(
elem
.
find
(
'.search-container'
).
length
>
0
)
{
if
(
target
.
parents
(
'.search-container'
).
length
===
0
)
{
scope
.
appEvent
(
'hide-dash-search'
);
scope
.
$apply
(
function
()
{
scope
.
appEvent
(
'hide-dash-search'
);
});
}
}
// hide sidemenu
if
(
!
ignoreSideMenuHide
&&
!
scope
.
contextSrv
.
pinned
&&
elem
.
find
(
'.sidemenu'
).
length
>
0
)
{
if
(
target
.
parents
(
'.sidemenu'
).
length
===
0
)
{
scope
.
$apply
(()
=>
scope
.
contextSrv
.
toggleSideMenu
());
scope
.
$apply
(
function
()
{
scope
.
contextSrv
.
toggleSideMenu
();
});
}
}
...
...
public/app/core/components/search/search.html
View file @
853cd163
<div
class=
"search-container"
ng-if=
"ctrl.isOpen"
>
<div
class=
"search-field-wrapper"
>
<span
style=
"position: relative;"
>
<input
type=
"text"
placeholder=
"Find dashboards by name"
give-focus=
"ctrl.giveSearchFocus"
tabindex=
"1"
...
...
@@ -29,7 +30,7 @@
<div
class=
"row"
>
<div
class=
"span6 offset1"
>
<div
ng-repeat=
"tag in ctrl.results"
class=
"pointer"
style=
"width: 180px; float: left;"
ng-class=
"{'selected': $index === selectedIndex }"
ng-class=
"{'selected': $index ===
ctrl.
selectedIndex }"
ng-click=
"ctrl.filterByTag(tag.term, $event)"
>
<a
class=
"search-result-tag label label-tag"
tag-color-from-name=
"tag.term"
>
<i
class=
"fa fa-tag"
></i>
...
...
@@ -44,7 +45,7 @@
<h6
ng-hide=
"ctrl.results.length"
>
No dashboards matching your query were found.
</h6>
<a
class=
"search-item pointer search-item-{{row.type}}"
bindonce
ng-repeat=
"row in ctrl.results"
ng-class=
"{'selected': $index == selectedIndex}"
ng-href=
"{{row.url}}"
>
ng-class=
"{'selected': $index ==
ctrl.
selectedIndex}"
ng-href=
"{{row.url}}"
>
<span
class=
"search-result-tags"
>
<span
ng-click=
"ctrl.filterByTag(tag, $event)"
ng-repeat=
"tag in row.tags"
tag-color-from-name=
"tag"
class=
"label label-tag"
>
...
...
@@ -71,4 +72,4 @@
</a>
<div
class=
"clearfix"
></div>
</div>
</div>
public/app/core/components/search/search.ts
View file @
853cd163
...
...
@@ -7,6 +7,7 @@ import $ from 'jquery';
import
coreModule
from
'../../core_module'
;
export
class
SearchCtrl
{
isOpen
:
boolean
;
query
:
any
;
giveSearchFocus
:
number
;
selectedIndex
:
number
;
...
...
@@ -15,16 +16,34 @@ export class SearchCtrl {
tagsMode
:
boolean
;
showImport
:
boolean
;
dismiss
:
any
;
ignoreClose
:
any
;
/** @ngInject */
constructor
(
private
$scope
,
private
$location
,
private
$timeout
,
private
backendSrv
,
private
contextSrv
)
{
constructor
(
private
$scope
,
private
$location
,
private
$timeout
,
private
backendSrv
,
private
contextSrv
,
private
$rootScope
)
{
$rootScope
.
onAppEvent
(
'show-dash-search'
,
this
.
openSearch
.
bind
(
this
),
$scope
);
$rootScope
.
onAppEvent
(
'hide-dash-search'
,
this
.
closeSearch
.
bind
(
this
),
$scope
);
}
closeSearch
()
{
this
.
isOpen
=
this
.
ignoreClose
;
}
openSearch
()
{
if
(
this
.
isOpen
)
{
this
.
isOpen
=
false
;
return
;
}
this
.
isOpen
=
true
;
this
.
giveSearchFocus
=
0
;
this
.
selectedIndex
=
-
1
;
this
.
results
=
[];
this
.
query
=
{
query
:
''
,
tag
:
[],
starred
:
false
};
this
.
currentSearchId
=
0
;
this
.
ignoreClose
=
true
;
$timeout
(()
=>
{
this
.
$timeout
(()
=>
{
this
.
ignoreClose
=
false
;
this
.
giveSearchFocus
=
this
.
giveSearchFocus
+
1
;
this
.
query
.
query
=
''
;
this
.
search
();
...
...
@@ -33,7 +52,7 @@ export class SearchCtrl {
keyDown
(
evt
)
{
if
(
evt
.
keyCode
===
27
)
{
this
.
dismiss
();
this
.
closeSearch
();
}
if
(
evt
.
keyCode
===
40
)
{
this
.
moveSelection
(
1
);
...
...
@@ -141,10 +160,7 @@ export function searchDirective() {
controller
:
SearchCtrl
,
bindToController
:
true
,
controllerAs
:
'ctrl'
,
scope
:
{
dismiss
:
'&'
},
};
}
coreModule
.
directive
(
'
s
earch'
,
searchDirective
);
coreModule
.
directive
(
'
dashboardS
earch'
,
searchDirective
);
public/app/features/dashboard/all.js
View file @
853cd163
...
...
@@ -12,7 +12,6 @@ define([
'./viewStateSrv'
,
'./timeSrv'
,
'./unsavedChangesSrv'
,
'./directives/dashSearchView'
,
'./timepicker/timepicker'
,
'./graphiteImportCtrl'
,
'./dynamicDashboardSrv'
,
...
...
public/app/features/dashboard/directives/dashSearchView.js
deleted
100644 → 0
View file @
0fab210a
define
([
'angular'
,
'jquery'
],
function
(
angular
,
$
)
{
'use strict'
;
angular
.
module
(
'grafana.directives'
)
.
directive
(
'dashSearchView'
,
function
(
$compile
)
{
return
{
restrict
:
'A'
,
link
:
function
(
scope
,
elem
)
{
var
editorScope
;
var
ignoreHide
;
function
showSearch
()
{
if
(
editorScope
)
{
editorScope
.
dismiss
();
return
;
}
ignoreHide
=
true
;
editorScope
=
scope
.
$new
();
editorScope
.
dismiss
=
function
()
{
editorScope
.
$destroy
();
elem
.
empty
();
elem
.
unbind
();
editorScope
=
null
;
};
var
view
=
$
(
'<search class="search-container" dismiss="dismiss()"></search>'
);
elem
.
append
(
view
);
$compile
(
elem
.
contents
())(
editorScope
);
setTimeout
(
function
()
{
ignoreHide
=
false
;
},
300
);
}
function
hideSearch
()
{
if
(
editorScope
&&
!
ignoreHide
)
{
editorScope
.
dismiss
();
}
}
scope
.
onAppEvent
(
'show-dash-search'
,
showSearch
);
scope
.
onAppEvent
(
'hide-dash-search'
,
hideSearch
);
}
};
});
});
public/app/partials/dashboard.html
View file @
853cd163
...
...
@@ -4,7 +4,7 @@
<div
class=
"main-view-container"
>
<div
dash-editor-view
></div>
<d
iv
dash-search-view
></div
>
<d
ashboard-search></dashboard-search
>
<div
class=
"clearfix"
></div>
<dashboard-submenu
ng-if=
"submenuEnabled"
dashboard=
"dashboard"
></dashboard-submenu>
...
...
public/app/plugins/panel/singlestat/module.ts
View file @
853cd163
...
...
@@ -79,7 +79,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
}
loadSnapshot
(
snapshotData
)
{
this
.
dataHandler
(
snapshotData
);
// give element time to get attached and get dimensions
this
.
$timeout
(()
=>
this
.
dataHandler
(
snapshotData
),
50
);
}
dataHandler
(
results
)
{
...
...
@@ -239,22 +240,13 @@ class SingleStatCtrl extends MetricsPanelCtrl {
var
$timeout
=
this
.
$timeout
;
var
panel
=
ctrl
.
panel
;
var
templateSrv
=
this
.
templateSrv
;
var
data
,
linkInfo
,
$panelContainer
;
var
firstRender
=
true
;
var
data
,
linkInfo
;
var
$panelContainer
=
elem
.
parents
(
'.panel-container'
);
// change elem to singlestat panel
elem
=
elem
.
find
(
'.singlestat-panel'
);
hookupDrilldownLinkTooltip
();
scope
.
$on
(
'render'
,
function
()
{
if
(
firstRender
)
{
var
inner
=
elem
.
find
(
'.singlestat-panel'
);
if
(
inner
.
length
)
{
elem
=
inner
;
$panelContainer
=
elem
.
parents
(
'.panel-container'
);
firstRender
=
false
;
hookupDrilldownLinkTooltip
();
}
else
{
return
;
}
}
render
();
ctrl
.
renderingCompleted
();
});
...
...
public/less/grafana.less
View file @
853cd163
...
...
@@ -70,6 +70,11 @@
top: 20%;
}
.grafana-app {
display: block;
min-height: 100%;
}
.histogram-chart {
position:relative;
}
...
...
public/views/index.html
View file @
853cd163
...
...
@@ -26,7 +26,7 @@
</head>
<body
ng-cloak
>
<grafana-app>
<grafana-app
class=
"grafana-app"
>
<aside
class=
"sidemenu-wrapper"
>
<sidemenu
ng-if=
"contextSrv.sidemenu"
></sidemenu>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment