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
b506e7c2
Commit
b506e7c2
authored
Aug 25, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed submenu in fullscreen mode
parent
061d1262
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
175 deletions
+3
-175
src/app/directives/bodyClass.js
+2
-8
src/app/panels/filtering/module.js
+0
-57
src/css/less/submenu.less
+1
-110
No files found.
src/app/directives/bodyClass.js
View file @
b506e7c2
...
...
@@ -12,20 +12,14 @@ function (angular, app, _) {
return
{
link
:
function
(
$scope
,
elem
)
{
var
lastPulldownVal
;
var
lastHideControlsVal
;
$scope
.
$watch
Collection
(
'dashboard.pulldowns
'
,
function
()
{
$scope
.
$watch
(
'submenuEnabled
'
,
function
()
{
if
(
!
$scope
.
dashboard
)
{
return
;
}
var
panel
=
_
.
find
(
$scope
.
dashboard
.
pulldowns
,
function
(
pulldown
)
{
return
pulldown
.
enable
;
});
var
panelEnabled
=
panel
?
panel
.
enable
:
false
;
if
(
lastPulldownVal
!==
panelEnabled
)
{
elem
.
toggleClass
(
'submenu-controls-visible'
,
panelEnabled
);
lastPulldownVal
=
panelEnabled
;
}
elem
.
toggleClass
(
'submenu-controls-visible'
,
$scope
.
submenuEnabled
);
});
$scope
.
$watch
(
'dashboard.hideControls'
,
function
()
{
...
...
src/app/panels/filtering/module.js
View file @
b506e7c2
...
...
@@ -34,63 +34,6 @@ function (angular, app, _) {
$scope
.
filter
.
removeTemplateParameter
(
templateParameter
);
};
$scope
.
filterOptionSelected
=
function
(
templateParameter
,
option
,
recursive
)
{
templateParameter
.
current
=
option
;
$scope
.
filter
.
updateTemplateData
();
return
$scope
.
applyFilterToOtherFilters
(
templateParameter
)
.
then
(
function
()
{
// only refresh in the outermost call
if
(
!
recursive
)
{
$scope
.
dashboard
.
emit_refresh
();
}
});
};
$scope
.
applyFilterToOtherFilters
=
function
(
updatedTemplatedParam
)
{
var
promises
=
_
.
map
(
$scope
.
filter
.
templateParameters
,
function
(
templateParam
)
{
if
(
templateParam
===
updatedTemplatedParam
)
{
return
;
}
if
(
templateParam
.
query
.
indexOf
(
'[['
+
updatedTemplatedParam
.
name
+
']]'
)
!==
-
1
)
{
return
$scope
.
applyFilter
(
templateParam
);
}
});
return
$q
.
all
(
promises
);
};
$scope
.
applyFilter
=
function
(
templateParam
)
{
return
datasourceSrv
.
default
.
metricFindQuery
(
$scope
.
filter
,
templateParam
.
query
)
.
then
(
function
(
results
)
{
templateParam
.
editing
=
undefined
;
templateParam
.
options
=
_
.
map
(
results
,
function
(
node
)
{
return
{
text
:
node
.
text
,
value
:
node
.
text
};
});
if
(
templateParam
.
includeAll
)
{
var
allExpr
=
'{'
;
_
.
each
(
templateParam
.
options
,
function
(
option
)
{
allExpr
+=
option
.
text
+
','
;
});
allExpr
=
allExpr
.
substring
(
0
,
allExpr
.
length
-
1
)
+
'}'
;
templateParam
.
options
.
unshift
({
text
:
'All'
,
value
:
allExpr
});
}
// if parameter has current value
// if it exists in options array keep value
if
(
templateParam
.
current
)
{
var
currentExists
=
_
.
findWhere
(
templateParam
.
options
,
{
value
:
templateParam
.
current
.
value
});
if
(
currentExists
)
{
return
$scope
.
filterOptionSelected
(
templateParam
,
templateParam
.
current
,
true
);
}
}
return
$scope
.
filterOptionSelected
(
templateParam
,
templateParam
.
options
[
0
],
true
);
});
};
$scope
.
add
=
function
()
{
$scope
.
filter
.
addTemplateParameter
({
type
:
'filter'
,
...
...
src/css/less/submenu.less
View file @
b506e7c2
.submenu-controls {
background: @submenuBackground;
font-size: inherit;
label {
margin: 0;
padding-right: 4px;
display: inline;
}
input[type=checkbox] {
margin: 0;
}
}
.submenu-controls-visible:not(.hide-controls) {
.panel-fullscreen {
top: 82px;
}
}
.submenu-panel {
padding: 0 4px 0 8px;
border-right: 1px solid @submenuBorder;
float: left;
}
.submenu-panel:first-child {
padding-left: 17px;
}
.submenu-panel-title {
float: left;
text-transform: uppercase;
padding: 4px 10px 3px 0;
}
.submenu-panel-wrapper {
float: left;
}
.submenu-toggle {
padding: 4px 0 3px 8px;
float: left;
.annotation-color-icon {
position: relative;
top: 2px;
top: 90px;
}
}
.submenu-toggle:first-child {
padding-left: 0;
}
.submenu-control-edit {
padding: 4px 4px 3px 8px;
float: right;
border-left: 1px solid @submenuBorder;
margin-left: 8px;
}
.annotation-disabled, .annotation-disabled a {
color: darken(@textColor, 25%);
}
// Filter submenu
.filtering-container {
float: left;
}
.filtering-container label {
float: left;
}
.filtering-container input[type=checkbox] {
margin: 0;
}
.filter-panel-filter {
display:inline-block;
vertical-align: top;
padding: 4px 10px 3px 10px;
border-right: 1px solid @submenuBorder;
}
.filter-panel-filter:first-child {
padding-left: 0;
}
.filter-panel-filter ul {
margin-bottom: 0px;
}
.filter-deselected {
opacity: 0.5;
}
.filtering-container .filter-action {
float:right;
padding-right: 2px;
margin-bottom: 0px !important;
margin-left: 0px;
margin-top: 4px;
}
.add-filter-action {
padding: 3px 5px 0px 5px;
position: relative;
top: 4px;
}
.filter-mandate {
text-decoration: underline;
cursor: pointer;
}
.filter-apply {
float:right;
}
\ No newline at end of file
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