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
da9c792c
Commit
da9c792c
authored
Nov 03, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tablepanel): minor progress
parent
8171cd51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
public/app/panels/table/module.ts
+18
-2
public/less/panel_table.less
+4
-0
No files found.
public/app/panels/table/module.ts
View file @
da9c792c
...
...
@@ -58,6 +58,15 @@ export function tablePanelDirective() {
link
:
function
(
scope
,
elem
)
{
var
data
;
function
getTableHeight
()
{
var
panelHeight
=
scope
.
height
||
scope
.
panel
.
height
||
scope
.
row
.
height
;
if
(
_
.
isString
(
panelHeight
))
{
panelHeight
=
parseInt
(
panelHeight
.
replace
(
'px'
,
''
),
10
);
}
return
(
panelHeight
-
40
)
+
'px'
;
}
function
renderPanel
()
{
var
rootDiv
=
elem
.
find
(
'.table-panel-container'
);
var
tableDiv
=
$
(
'<table class="gf-table-panel"></table>'
);
...
...
@@ -70,8 +79,10 @@ export function tablePanelDirective() {
rowElem
.
append
(
colElem
);
}
tableDiv
.
append
(
rowElem
);
var
headElem
=
$
(
'<thead></thead>'
);
headElem
.
append
(
rowElem
);
var
tbodyElem
=
$
(
'<tbody></tbody>'
);
for
(
y
=
0
;
y
<
data
.
rows
.
length
;
y
++
)
{
row
=
data
.
rows
[
y
];
rowElem
=
$
(
'<tr></tr>'
);
...
...
@@ -79,9 +90,14 @@ export function tablePanelDirective() {
colElem
=
$
(
'<td>'
+
row
[
i
]
+
'</td>'
);
rowElem
.
append
(
colElem
);
}
t
ableDiv
.
append
(
rowElem
);
t
bodyElem
.
append
(
rowElem
);
}
tableDiv
.
append
(
headElem
);
tableDiv
.
append
(
tbodyElem
);
rootDiv
.
css
({
'max-height'
:
getTableHeight
()});
rootDiv
.
empty
();
rootDiv
.
append
(
tableDiv
);
}
...
...
public/less/panel_table.less
View file @
da9c792c
...
...
@@ -7,6 +7,10 @@
}
}
.table-panel-container {
overflow: auto;
}
.gf-table-panel* {
box-sizing: border-box;
}
...
...
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