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
bd3bae3a
Commit
bd3bae3a
authored
Sep 23, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another attempt at improving panel edit menu
parent
139791b0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
15 deletions
+123
-15
'
+79
-0
src/app/controllers/row.js
+5
-0
src/app/directives/grafanaPanel.js
+25
-14
src/app/partials/dashboard.html
+9
-0
src/css/less/panel.less
+5
-1
No files found.
'
0 → 100644
View file @
bd3bae3a
.panel {
display: inline-block;
float: left;
vertical-align: top;
}
.panel-container {
padding: 0px 0px 0px 0px;
background: @grafanaPanelBackground;
margin: 5px;
position: relative;
}
.panel-content {
padding: 0px 10px 5px 10px;
}
.panel-title {
border: 0px;
font-weight: bold;
position: relative;
}
.panel-loading {
position:absolute;
top: 0px;
right: 4px;
z-index: 800;
}
.panel-header {
text-align: center;
}
.panel-error {
color: @white;
position: absolute;
left: 0;
padding: 0px 17px 6px 5px;
top: 0;
i {
position: relative;
top: -2px;
}
}
.panel-error-arrow {
width: 0;
height: 0;
position: absolute;
border-left: 31px solid transparent;
border-right: 30px solid transparent;
border-bottom: 27px solid @grafanaPanelBackground;
left: 0;
bottom: 0;
}
.panel-menu {
display: inline-block;
vertical-align: top;
a {
font-size: 1.2em;
float: left;
padding: 7px 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;
}
}
.panel-highlight {
border: 1px solid @blue;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
}
src/app/controllers/row.js
View file @
bd3bae3a
...
...
@@ -22,6 +22,11 @@ function (angular, app, _) {
$scope
.
reset_panel
();
};
$scope
.
togglePanelMenu
=
function
(
posX
)
{
$scope
.
showPanelMenu
=
!
$scope
.
showPanelMenu
;
$scope
.
panelMenuPos
=
posX
;
};
$scope
.
toggle_row
=
function
(
row
)
{
row
.
collapse
=
row
.
collapse
?
false
:
true
;
if
(
!
row
.
collapse
)
{
...
...
src/app/directives/grafanaPanel.js
View file @
bd3bae3a
...
...
@@ -27,20 +27,31 @@ function (angular, $) {
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
();
$link
.
click
(
function
(
e
)
{
var
menuWidth
=
452
;
var
windowWidth
=
$
(
window
).
width
();
var
maxPos
=
windowWidth
-
menuWidth
-
20
;
var
leftPos
=
e
.
screenX
-
(
menuWidth
/
2
);
leftPos
=
Math
.
min
(
leftPos
,
maxPos
);
$scope
.
$apply
(
function
()
{
$scope
.
togglePanelMenu
(
leftPos
);
});
elem
.
parents
(
".panel-container"
).
toggleClass
(
'panel-highlight'
);
console
.
log
(
e
);
// 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
);
...
...
src/app/partials/dashboard.html
View file @
bd3bae3a
...
...
@@ -74,6 +74,15 @@
</div>
</div>
<div
class=
"panel-menu small"
ng-show=
"showPanelMenu"
ng-style=
"{'margin-left': panelMenuPos}"
>
<a
class=
"pointer"
><i
class=
"icon-eye-open"
></i>
<span>
view
</span></a>
<a
class=
"pointer"
><i
class=
"icon-cog"
></i>
<span>
edit
</span></a>
<a
class=
"pointer"
><i
class=
"icon-resize-horizontal"
></i>
<span>
span
</span></a>
<a
class=
"pointer"
><i
class=
"icon-copy"
></i>
<span>
duplicate
</span></a>
<a
class=
"pointer"
><i
class=
"icon-share"
></i>
<span>
share
</span></a>
<a
class=
"pointer"
><i
class=
"icon-remove"
></i>
<span>
remove
</span></a>
</div>
<div
style=
"padding-top:0px"
ng-if=
"!row.collapse"
>
<div
class=
"row-text pointer"
ng-click=
"toggle_row(row)"
ng-if=
"row.showTitle"
ng-bind=
"row.title"
>
</div>
...
...
src/css/less/panel.less
View file @
bd3bae3a
...
...
@@ -62,7 +62,7 @@
a {
font-size: 1.2em;
float: left;
padding:
2
px 10px;
padding:
7
px 10px;
border-top: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
...
...
@@ -72,3 +72,7 @@
border-left: 1px solid black;
}
}
.panel-highlight {
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236, 0.9)");
}
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