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
751eb2c8
Commit
751eb2c8
authored
Jan 25, 2020
by
Tobias Skarhed
Committed by
Torkel Ödegaard
Jan 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TablePabel: Sanitize column link (#21735)
parent
089162b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
public/app/plugins/panel/table/renderer.ts
+4
-1
No files found.
public/app/plugins/panel/table/renderer.ts
View file @
751eb2c8
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
import
{
TemplateSrv
}
from
'app/features/templating/template_srv'
;
import
{
TemplateSrv
}
from
'app/features/templating/template_srv'
;
import
{
ColumnRender
,
TableRenderModel
,
ColumnStyle
}
from
'./types'
;
import
{
ColumnRender
,
TableRenderModel
,
ColumnStyle
}
from
'./types'
;
import
{
ColumnOptionsCtrl
}
from
'./column_options'
;
import
{
ColumnOptionsCtrl
}
from
'./column_options'
;
import
{
sanitizeUrl
}
from
'app/core/utils/text'
;
export
class
TableRenderer
{
export
class
TableRenderer
{
formatters
:
any
[];
formatters
:
any
[];
...
@@ -297,13 +298,15 @@ export class TableRenderer {
...
@@ -297,13 +298,15 @@ export class TableRenderer {
scopedVars
[
'__cell'
]
=
{
value
:
value
,
text
:
value
?
value
.
toString
()
:
''
};
scopedVars
[
'__cell'
]
=
{
value
:
value
,
text
:
value
?
value
.
toString
()
:
''
};
const
cellLink
=
this
.
templateSrv
.
replace
(
column
.
style
.
linkUrl
,
scopedVars
,
encodeURIComponent
);
const
cellLink
=
this
.
templateSrv
.
replace
(
column
.
style
.
linkUrl
,
scopedVars
,
encodeURIComponent
);
const
sanitizedCellLink
=
sanitizeUrl
(
cellLink
);
const
cellLinkTooltip
=
this
.
templateSrv
.
replace
(
column
.
style
.
linkTooltip
,
scopedVars
);
const
cellLinkTooltip
=
this
.
templateSrv
.
replace
(
column
.
style
.
linkTooltip
,
scopedVars
);
const
cellTarget
=
column
.
style
.
linkTargetBlank
?
'_blank'
:
''
;
const
cellTarget
=
column
.
style
.
linkTargetBlank
?
'_blank'
:
''
;
cellClasses
.
push
(
'table-panel-cell-link'
);
cellClasses
.
push
(
'table-panel-cell-link'
);
columnHtml
+=
`
columnHtml
+=
`
<a href="
${
c
ellLink
}
" target="
${
cellTarget
}
" data-link-tooltip data-original-title="
${
cellLinkTooltip
}
" data-placement="right"
${
cellStyle
}
>
<a href="
${
sanitizedC
ellLink
}
" target="
${
cellTarget
}
" data-link-tooltip data-original-title="
${
cellLinkTooltip
}
" data-placement="right"
${
cellStyle
}
>
${
value
}
${
value
}
</a>
</a>
`
;
`
;
...
...
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