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
a6fa01f8
Commit
a6fa01f8
authored
Sep 06, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POC of panel edit menu
parent
6c71754e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
33 deletions
+61
-33
src/app/directives/grafanaPanel.js
+44
-19
src/css/less/panel.less
+17
-14
No files found.
src/app/directives/grafanaPanel.js
View file @
a6fa01f8
...
@@ -8,6 +8,49 @@ function (angular, $) {
...
@@ -8,6 +8,49 @@ function (angular, $) {
angular
angular
.
module
(
'grafana.directives'
)
.
module
(
'grafana.directives'
)
.
directive
(
'panelTitle'
,
function
(
$compile
)
{
var
linkTemplate
=
'<a class="pointer panel-title">{{panel.title || interpolateTemplateVars}}</div>'
;
var
menuTemplate
=
'<div class="panel-menu">'
+
'<a class="pointer"><i class="icon-th-list"></i></a> '
+
'<a class="pointer"><i class="icon-eye-open"></i></a> '
+
'<a class="pointer"><i class="icon-cog"></i></a> '
+
'<a class="pointer"><i class="icon-resize-horizontal"></i></a> '
+
'<a class="pointer"><i class="icon-move"></i></a> '
+
'<a class="pointer"><i class="icon-copy"></i></a> '
+
'<a class="pointer"><i class="icon-share"></i></a>'
+
'<a class="pointer"><i class="icon-remove"></i></a> '
+
'</div>'
;
return
{
restrict
:
'A'
,
link
:
function
(
$scope
,
elem
)
{
var
$link
=
$
(
linkTemplate
);
elem
.
append
(
$link
);
$link
.
click
(
function
()
{
var
$menu
=
$
(
menuTemplate
);
var
menuScope
=
$scope
.
$new
();
elem
.
append
(
$menu
);
$compile
(
$menu
.
contents
())(
menuScope
);
setTimeout
(
function
()
{
$menu
.
remove
();
menuScope
.
$destroy
();
$link
.
show
();
},
8000
);
$link
.
hide
();
});
$compile
(
elem
.
contents
())(
$scope
);
}
};
});
angular
.
module
(
'grafana.directives'
)
.
directive
(
'grafanaPanel'
,
function
(
$compile
,
$parse
)
{
.
directive
(
'grafanaPanel'
,
function
(
$compile
,
$parse
)
{
var
container
=
'<div class="panel-container"></div>'
;
var
container
=
'<div class="panel-container"></div>'
;
...
@@ -15,8 +58,6 @@ function (angular, $) {
...
@@ -15,8 +58,6 @@ function (angular, $) {
var
panelHeader
=
var
panelHeader
=
'<div class="panel-header">'
+
'<div class="panel-header">'
+
'<div class="row-fluid panel-extra">'
+
'<div class="panel-extra-container">'
+
'<span class="alert-error panel-error small pointer"'
+
'<span class="alert-error panel-error small pointer"'
+
'config-modal="app/partials/inspector.html" ng-if="panelMeta.error">'
+
'config-modal="app/partials/inspector.html" ng-if="panelMeta.error">'
+
'<span data-placement="right" bs-tooltip="panelMeta.error">'
+
'<span data-placement="right" bs-tooltip="panelMeta.error">'
+
...
@@ -28,24 +69,8 @@ function (angular, $) {
...
@@ -28,24 +69,8 @@ function (angular, $) {
'<i class="icon-spinner icon-spin icon-large"></i>'
+
'<i class="icon-spinner icon-spin icon-large"></i>'
+
'</span>'
+
'</span>'
+
'<span class="dropdown">'
+
'<div panel-title></div>'
+
'<span class="panel-text panel-title pointer" gf-dropdown="panelMeta.menu" tabindex="1" '
+
'data-drag=true data-jqyoui-options="kbnJqUiDraggableOptions"'
+
' jqyoui-draggable="'
+
'{'
+
'animate:false,'
+
'mutate:false,'
+
'index:{{$index}},'
+
'onStart:
\'
panelMoveStart
\'
,'
+
'onStop:
\'
panelMoveStop
\'
'
+
'}" ng-model="panel" '
+
'>'
+
'{{panel.title | interpolateTemplateVars}}'
+
'</span>'
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>
\
n'
+
'</div>'
;
'</div>'
;
return
{
return
{
...
...
src/css/less/panel.less
View file @
a6fa01f8
...
@@ -28,23 +28,10 @@
...
@@ -28,23 +28,10 @@
z-index: 800;
z-index: 800;
}
}
.panel div.panel-extra div.panel-extra-container {
.panel-header {
margin-right: -10px;
margin-top: 3px;
text-align: center;
text-align: center;
ul {
text-align: left;
}
}
}
.panel div.panel-extra {
font-size: 0.9em;
margin-bottom: 0px;
}
.panel div.panel-extra .extra {
float:right !important;
}
.panel-error {
.panel-error {
color: @white;
color: @white;
...
@@ -69,3 +56,19 @@
...
@@ -69,3 +56,19 @@
bottom: 0;
bottom: 0;
}
}
.panel-menu {
display: inline-block;
vertical-align: top;
a {
font-size: 1.2em;
float: left;
padding: 2px 10px;
border-top: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
background: @grayDark;
}
a:first-child {
border-left: 1px solid black;
}
}
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