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
78dbf585
Commit
78dbf585
authored
Aug 30, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added clickable urls to table row details view
parent
d1495fbf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletions
+39
-1
js/filters.js
+37
-0
panels/table/module.html
+2
-1
No files found.
js/filters.js
View file @
78dbf585
...
...
@@ -32,4 +32,40 @@ angular.module('kibana.filters', [])
return
arr
.
toString
();
}
};
}).
filter
(
'noXml'
,
function
()
{
return
function
(
text
)
{
if
(
!
_
.
isString
(
text
))
{
return
text
;
}
return
text
.
replace
(
/&/g
,
'&'
).
replace
(
/</g
,
'<'
).
replace
(
/>/g
,
'>'
).
replace
(
/'/g
,
'''
).
replace
(
/"/g
,
'"'
);
};
}).
filter
(
'urlLink'
,
function
()
{
var
//URLs starting with http://, https://, or ftp://
r1
=
/
(\b(
https
?
|ftp
)
:
\/\/[
-A-Z0-9+&@#
\/
%?=~_|!:,.;
]
*
[
-A-Z0-9+&@#
\/
%=~_|
])
/gim
,
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
r2
=
/
(
^|
[^\/])(
www
\.[\S]
+
(\b
|$
))
/gim
,
//Change email addresses to mailto:: links.
r3
=
/
(\w
+@
[
a-zA-Z_
]
+
?\.[
a-zA-Z
]{2,6})
/gim
;
return
function
(
text
,
target
,
otherProp
)
{
if
(
!
_
.
isString
(
text
))
{
return
text
;
}
_
.
each
(
text
.
match
(
r1
),
function
(
url
)
{
text
=
text
.
replace
(
r1
,
"<a href=
\"
$1
\"
target=
\"
_blank
\"
>$1</a>"
);
});
_
.
each
(
text
.
match
(
r2
),
function
(
url
)
{
text
=
text
.
replace
(
r2
,
"$1<a href=
\"
http://$2
\"
target=
\"
_blank
\"
>$2</a>"
);
});
_
.
each
(
text
.
match
(
r3
),
function
(
url
)
{
text
=
text
.
replace
(
r3
,
"<a href=
\"
mailto:$1
\"
>$1</a>"
);
});
return
text
;
};
});
\ No newline at end of file
panels/table/module.html
View file @
78dbf585
...
...
@@ -74,7 +74,8 @@
<i
class=
'icon-search pointer'
ng-click=
"build_search(key,value)"
></i>
<i
class=
'icon-ban-circle pointer'
ng-click=
"build_search(key,value,true)"
></i>
</td>
<td
style=
"white-space:pre-wrap"
>
{{value}}
</td>
<!-- At some point we need to create a more efficient way of applying the filter pipeline -->
<td
style=
"white-space:pre-wrap"
ng-bind-html-unsafe=
"value|noXml|urlLink"
></td>
</tr>
</table>
</td>
...
...
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