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
5f7ad9dd
Commit
5f7ad9dd
authored
Dec 14, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'help-text' of
https://github.com/utkarshcmu/grafana
into utkarshcmu-help-text
parents
7425c635
6b26a0f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletions
+35
-1
public/app/features/panel/panel_menu.js
+19
-1
public/app/partials/panelgeneral.html
+6
-0
public/sass/components/_gf-form.scss
+5
-0
public/sass/pages/_dashboard.scss
+5
-0
No files found.
public/app/features/panel/panel_menu.js
View file @
5f7ad9dd
...
@@ -9,15 +9,26 @@ function (angular, $, _, Tether) {
...
@@ -9,15 +9,26 @@ function (angular, $, _, Tether) {
angular
angular
.
module
(
'grafana.directives'
)
.
module
(
'grafana.directives'
)
.
directive
(
'panelMenu'
,
function
(
$compile
,
linkSrv
)
{
.
directive
(
'panelMenu'
,
function
(
$
sanitize
,
$
compile
,
linkSrv
)
{
var
linkTemplate
=
var
linkTemplate
=
'<span class="panel-title drag-handle pointer">'
+
'<span class="panel-title drag-handle pointer">'
+
'<span class="icon-gf panel-alert-icon"></span>'
+
'<span class="icon-gf panel-alert-icon"></span>'
+
'<span class="panel-title-text drag-handle">{{ctrl.panel.title | interpolateTemplateVars:this}}</span>'
+
'<span class="panel-title-text drag-handle">{{ctrl.panel.title | interpolateTemplateVars:this}}</span>'
+
'<span class="panel-help-text"><info-popover mode="bold">{{ctrl.panel.helpText}}</info-popover></span>'
+
'<span class="panel-links-btn"><i class="fa fa-external-link"></i></span>'
+
'<span class="panel-links-btn"><i class="fa fa-external-link"></i></span>'
+
'<span class="panel-time-info" ng-show="ctrl.timeInfo"><i class="fa fa-clock-o"></i> {{ctrl.timeInfo}}</span>'
+
'<span class="panel-time-info" ng-show="ctrl.timeInfo"><i class="fa fa-clock-o"></i> {{ctrl.timeInfo}}</span>'
+
'</span>'
;
'</span>'
;
function
sanitizeString
(
str
)
{
try
{
return
$sanitize
(
str
);
}
catch
(
err
)
{
console
.
log
(
'Could not sanitize annotation string, html escaping instead'
);
return
_
.
escape
(
str
);
}
}
function
createExternalLinkMenu
(
ctrl
)
{
function
createExternalLinkMenu
(
ctrl
)
{
var
template
=
'<div class="panel-menu small">'
;
var
template
=
'<div class="panel-menu small">'
;
template
+=
'<div class="panel-menu-row">'
;
template
+=
'<div class="panel-menu-row">'
;
...
@@ -78,6 +89,7 @@ function (angular, $, _, Tether) {
...
@@ -78,6 +89,7 @@ function (angular, $, _, Tether) {
var
$link
=
$
(
linkTemplate
);
var
$link
=
$
(
linkTemplate
);
var
$panelLinksBtn
=
$link
.
find
(
".panel-links-btn"
);
var
$panelLinksBtn
=
$link
.
find
(
".panel-links-btn"
);
var
$panelContainer
=
elem
.
parents
(
".panel-container"
);
var
$panelContainer
=
elem
.
parents
(
".panel-container"
);
var
$panelHelpDrop
=
$link
.
find
(
".panel-help-text"
);
var
menuScope
=
null
;
var
menuScope
=
null
;
var
ctrl
=
$scope
.
ctrl
;
var
ctrl
=
$scope
.
ctrl
;
var
timeout
=
null
;
var
timeout
=
null
;
...
@@ -92,6 +104,12 @@ function (angular, $, _, Tether) {
...
@@ -92,6 +104,12 @@ function (angular, $, _, Tether) {
$panelLinksBtn
.
css
({
display
:
showIcon
?
'inline'
:
'none'
});
$panelLinksBtn
.
css
({
display
:
showIcon
?
'inline'
:
'none'
});
});
});
$scope
.
$watch
(
'ctrl.panel.helpText'
,
function
(
helpText
)
{
helpText
=
sanitizeString
(
helpText
);
var
showIcon
=
(
helpText
?
helpText
.
length
>
0
:
false
)
&&
ctrl
.
panel
.
title
!==
''
;
$panelHelpDrop
.
css
({
display
:
showIcon
?
'inline'
:
'none'
});
});
function
dismiss
(
time
,
force
)
{
function
dismiss
(
time
,
force
)
{
clearTimeout
(
timeout
);
clearTimeout
(
timeout
);
timeout
=
null
;
timeout
=
null
;
...
...
public/app/partials/panelgeneral.html
View file @
5f7ad9dd
...
@@ -27,6 +27,12 @@
...
@@ -27,6 +27,12 @@
</select>
</select>
</div>
</div>
</div>
</div>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form max-width-42"
>
<span
class=
"gf-form-label width-8"
>
Help Text
</span>
<input
type=
"text"
class=
"gf-form-input width-30"
ng-model=
'ctrl.panel.helpText'
></input>
</div>
</div>
</div>
</div>
<panel-links-editor
panel=
"ctrl.panel"
></panel-links-editor>
<panel-links-editor
panel=
"ctrl.panel"
></panel-links-editor>
...
...
public/sass/components/_gf-form.scss
View file @
5f7ad9dd
...
@@ -244,6 +244,11 @@ $gf-form-margin: 0.25rem;
...
@@ -244,6 +244,11 @@ $gf-form-margin: 0.25rem;
padding-left
:
$spacer
;
padding-left
:
$spacer
;
color
:
$text-color-weak
;
color
:
$text-color-weak
;
&
--bold
{
color
:
$text-color-emphasis
;
padding-left
:
0
;
}
&
--right-absolute
{
&
--right-absolute
{
position
:
absolute
;
position
:
absolute
;
right
:
$spacer
;
right
:
$spacer
;
...
...
public/sass/pages/_dashboard.scss
View file @
5f7ad9dd
...
@@ -73,6 +73,11 @@ div.flot-text {
...
@@ -73,6 +73,11 @@ div.flot-text {
display
:
none
;
display
:
none
;
}
}
.panel-help-text
{
margin-left
:
10px
;
display
:
none
;
}
.panel-loading
{
.panel-loading
{
position
:absolute
;
position
:absolute
;
top
:
-3px
;
top
:
-3px
;
...
...
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