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
ff0ca6b7
Commit
ff0ca6b7
authored
Aug 02, 2018
by
Patrick O'Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added two new classes for color, fixed so link has value color
parent
b03e3242
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
+26
-14
public/app/plugins/panel/table/renderer.ts
+12
-8
public/sass/components/_panel_table.scss
+14
-6
No files found.
public/app/plugins/panel/table/renderer.ts
View file @
ff0ca6b7
...
...
@@ -216,8 +216,8 @@ export class TableRenderer {
var
cellClass
=
''
;
if
(
this
.
colorState
.
cell
)
{
style
=
' style="background-color:'
+
this
.
colorState
.
cell
+
'
;color: white
"'
;
cellClasses
.
push
(
'
white
'
);
style
=
' style="background-color:'
+
this
.
colorState
.
cell
+
'"'
;
cellClasses
.
push
(
'
table-panel-color-cell
'
);
this
.
colorState
.
cell
=
null
;
}
else
if
(
this
.
colorState
.
value
)
{
style
=
' style="color:'
+
this
.
colorState
.
value
+
'"'
;
...
...
@@ -253,11 +253,8 @@ export class TableRenderer {
cellClasses
.
push
(
'table-panel-cell-link'
);
if
(
this
.
colorState
.
row
)
{
cellClasses
.
push
(
'white'
);
}
columnHtml
+=
`
<a href="
${
cellLink
}
" target="
${
cellTarget
}
" data-link-tooltip data-original-title="
${
cellLinkTooltip
}
" data-placement="right">
<a href="
${
cellLink
}
" target="
${
cellTarget
}
" data-link-tooltip data-original-title="
${
cellLinkTooltip
}
" data-placement="right"
${
style
}
>
${
value
}
</a>
`
;
...
...
@@ -291,6 +288,8 @@ export class TableRenderer {
let
startPos
=
page
*
pageSize
;
let
endPos
=
Math
.
min
(
startPos
+
pageSize
,
this
.
table
.
rows
.
length
);
var
html
=
''
;
let
rowClasses
=
[];
let
rowClass
=
''
;
for
(
var
y
=
startPos
;
y
<
endPos
;
y
++
)
{
let
row
=
this
.
table
.
rows
[
y
];
...
...
@@ -301,11 +300,16 @@ export class TableRenderer {
}
if
(
this
.
colorState
.
row
)
{
rowStyle
=
' style="background-color:'
+
this
.
colorState
.
row
+
';color: white"'
;
rowStyle
=
' style="background-color:'
+
this
.
colorState
.
row
+
'"'
;
rowClasses
.
push
(
'table-panel-color-row'
);
this
.
colorState
.
row
=
null
;
}
html
+=
'<tr '
+
rowStyle
+
'>'
+
cellHtml
+
'</tr>'
;
if
(
rowClasses
.
length
)
{
rowClass
=
' class="'
+
rowClasses
.
join
(
' '
)
+
'"'
;
}
html
+=
'<tr '
+
rowClass
+
rowStyle
+
'>'
+
cellHtml
+
'</tr>'
;
}
return
html
;
...
...
public/sass/components/_panel_table.scss
View file @
ff0ca6b7
...
...
@@ -87,12 +87,6 @@
height
:
100%
;
display
:
inline-block
;
}
&
.white
{
a
{
color
:
white
;
}
}
}
&
.cell-highlighted
:hover
{
...
...
@@ -139,3 +133,17 @@
height
:
0px
;
line-height
:
0px
;
}
.table-panel-color-cell
{
color
:
white
;
a
{
color
:
white
;
}
}
.table-panel-color-row
{
color
:
white
;
a
{
color
:
white
;
}
}
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