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
a49a9b3b
Commit
a49a9b3b
authored
Nov 11, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Panel: more work on panel links, #1041
parent
5da3da59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
11 deletions
+30
-11
src/app/components/panellinkeditor/linkSrv.js
+4
-4
src/app/directives/panelMenu.js
+17
-7
src/css/less/panel.less
+9
-0
No files found.
src/app/components/panellinkeditor/linkSrv.js
View file @
a49a9b3b
...
...
@@ -13,14 +13,14 @@ function (angular, kbn) {
var
info
=
{};
if
(
link
.
type
===
'absolute'
)
{
info
.
target
=
'_blank'
;
info
.
href
=
templateSrv
.
replace
(
link
.
url
);
info
.
title
=
templateSrv
.
replace
(
link
.
title
);
info
.
href
=
templateSrv
.
replace
(
link
.
url
||
''
);
info
.
title
=
templateSrv
.
replace
(
link
.
title
||
''
);
info
.
href
+=
'?'
;
}
else
{
info
.
title
=
templateSrv
.
replace
(
link
.
title
);
var
slug
=
kbn
.
slugifyForUrl
(
link
.
dashboard
);
info
.
title
=
templateSrv
.
replace
(
link
.
title
||
''
);
var
slug
=
kbn
.
slugifyForUrl
(
link
.
dashboard
||
''
);
info
.
href
=
'#dashboard/db/'
+
slug
+
'?'
;
}
...
...
src/app/directives/panelMenu.js
View file @
a49a9b3b
...
...
@@ -9,7 +9,11 @@ function (angular, $, _) {
angular
.
module
(
'grafana.directives'
)
.
directive
(
'panelMenu'
,
function
(
$compile
,
linkSrv
)
{
var
linkTemplate
=
'<span class="panel-title drag-handle pointer">{{panel.title | interpolateTemplateVars}}</span>'
;
var
linkTemplate
=
'<span class="panel-title drag-handle pointer">'
+
'<span class="panel-title-text">{{panel.title | interpolateTemplateVars}}</span>'
+
'<span class="panel-links-icon"></span>'
+
'</span>'
;
function
createMenuTemplate
(
$scope
)
{
var
template
=
'<div class="panel-menu small">'
;
...
...
@@ -39,13 +43,15 @@ function (angular, $, _) {
}
function
getExtendedMenu
(
$scope
)
{
var
menu
=
angular
.
copy
(
$scope
.
panelMeta
.
extendedMenu
);
if
(
!
$scope
.
panel
.
links
)
{
return
;
}
var
menu
=
angular
.
copy
(
$scope
.
panelMeta
.
extendedMenu
);
if
(
$scope
.
panel
.
links
)
{
_
.
each
(
$scope
.
panel
.
links
,
function
(
link
)
{
var
info
=
linkSrv
.
getPanelLinkAnchorInfo
(
link
);
menu
.
push
({
text
:
info
.
title
,
href
:
info
.
href
,
target
:
info
.
target
});
});
}
_
.
each
(
$scope
.
panel
.
links
,
function
(
link
)
{
var
info
=
linkSrv
.
getPanelLinkAnchorInfo
(
link
);
menu
.
push
({
text
:
info
.
title
,
href
:
info
.
href
,
target
:
info
.
target
});
});
return
menu
;
}
...
...
@@ -61,6 +67,10 @@ function (angular, $, _) {
elem
.
append
(
$link
);
$scope
.
$watchCollection
(
'panel.links'
,
function
(
newValue
)
{
$link
.
toggleClass
(
'has-panel-links'
,
newValue
?
newValue
.
length
>
0
:
false
);
});
function
dismiss
(
time
)
{
clearTimeout
(
timeout
);
timeout
=
null
;
...
...
src/css/less/panel.less
View file @
a49a9b3b
...
...
@@ -27,6 +27,15 @@
font-weight: bold;
position: relative;
cursor: context-menu;
&.has-panel-links {
.panel-title-text:after {
content: "\f0c1";
font-family:'FontAwesome';
font-size: 80%;
padding-left: 10px;
}
}
}
.panel-loading {
...
...
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