Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
7356da6b
Commit
7356da6b
authored
6 years ago
by
David Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
rules views: updates for display and fixing security issue with comment
parent
d593d50c
No related branches found
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flowspy/.gitignore
+1
-0
1 addition, 0 deletions
flowspy/.gitignore
templates/user_routes.html
+95
-78
95 additions, 78 deletions
templates/user_routes.html
with
96 additions
and
78 deletions
flowspy/.gitignore
+
1
−
0
View file @
7356da6b
settings_local.py
settings_local.py
settings_local.py*
This diff is collapsed.
Click to expand it.
templates/user_routes.html
+
95
−
78
View file @
7356da6b
{% extends "base.html" %}
{% extends "base.html" %}
{% load i18n %}
{% load i18n %}
{% block extrahead %}
{% block extrahead %}
<link
href=
"{{STATIC_URL}}b3theme/css/plugins/dataTables/dataTables.bootstrap.css"
rel=
"stylesheet"
>
<link
href=
"{{STATIC_URL}}b3theme/css/plugins/dataTables/dataTables.bootstrap.css"
rel=
"stylesheet"
>
{% endblock %}
{% endblock %}
{% block pagejsbodttom %}
{% block pagejsbodttom %}
<script
type=
"text/javascript"
src=
"{{STATIC_URL}}js/jquery.dataTables.js"
></script>
<script
type=
"text/javascript"
src=
"{{STATIC_URL}}js/jquery.dataTables.js"
></script>
<script
type=
"text/javascript"
src=
"{{STATIC_URL}}js/datatables_bootstrap.js"
></script>
<script
type=
"text/javascript"
src=
"{{STATIC_URL}}js/datatables_bootstrap.js"
></script>
{% endblock %}
{% endblock %}
{% block title %}{% trans "My rules" %}{% endblock %}
{% block title %}{% trans "My rules" %}{% endblock %}
{% block contentplaceholder %}
{% block contentplaceholder %}
{% csrf_token %}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<h1
class=
"page-header"
>
{% trans "My rules" %}
</h1>
</div>
<!-- /.col-lg-12 -->
</div>
{% csrf_token %}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<h1
class=
"page-header"
>
{% trans "My rules" %}
</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-10"
>
<div
class=
"col-md-10"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-shield"
></i>
Firewall Rules
<div
class=
"panel-heading"
>
<i
class=
"fa fa-shield"
></i>
Firewall Rules
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-bordered"
id=
"routes_table"
>
<div
class=
"table-responsive"
>
<thead>
<table
class=
"table table-striped table-bordered"
id=
"routes_table"
>
<tr>
<thead>
<th>
Id
</th>
<tr>
<th
style=
"page-break: break-all;"
>
{% trans "Name" %}
</th>
<th>
Id
</th>
<th>
{% trans "Match" %}
</th>
<th>
{% trans "Name" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Then" %}
</th>
<th>
{% trans "Match" %}
</th>
<th
style=
"text-align: center; "
>
{% trans "Status" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Then" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Applier" %}
</th>
<th
style=
"text-align: center; "
>
{% trans "Status" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Expires" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Applier" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Response" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Expires" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Actions" %}
</th>
<th
style=
"text-align: center;"
>
{% trans "Response" %}
</th>
</tr>
<th
style=
"text-align: center;"
>
{% trans "Actions" %}
</th>
</thead>
</tr>
</thead>
<tbody>
</tbody>
<tbody>
</table>
</tbody>
</div>
</table>
</div>
</div></div>
</div>
</div></div>
<div
class=
"col-md-2"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-tags"
></i>
{% trans "Shortcuts" %}
</div>
<!-- /.panel-heading -->
<div
class=
"panel-body"
>
<a
class=
"btn btn-sm btn-outline btn-success"
id=
"routebutton"
href=
"{% url add-route %}"
><i
class=
"fa fa-plus-circle"
></i>
{% trans "Add Rule" %}
</a>
<a
class=
"btn btn-sm btn-outline btn-info"
href=
"{% url user-profile %}"
><i
class=
"fa fa-user"
></i>
{% trans "My Profile" %}
</a>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
<div
class=
"chat-panel panel panel-info"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-comment fa-fw"
></i>
Live status
</div>
<!-- /.panel-heading -->
<div
class=
"panel-body"
>
{% include "polldash.html" %}
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
</div>
</div>
<div
class=
"col-md-2"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-tags"
></i>
{% trans "Shortcuts" %}
</div>
<!-- /.panel-heading -->
<div
class=
"panel-body"
>
<a
class=
"btn btn-sm btn-outline btn-success"
id=
"routebutton"
href=
"{% url add-route %}"
><i
class=
"fa fa-plus-circle"
></i>
{% trans "Add Rule" %}
</a>
<a
class=
"btn btn-sm btn-outline btn-info"
href=
"{% url user-profile %}"
><i
class=
"fa fa-user"
></i>
{% trans "My Profile" %}
</a>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
<div
class=
"chat-panel panel panel-info"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-comment fa-fw"
></i>
Live status
</div>
<!-- /.panel-heading -->
<div
class=
"panel-body"
>
{% include "polldash.html" %}
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
{% endblock %}
{% endblock %}
{% block pagejsbottom %}
{% block pagejsbottom %}
...
@@ -233,17 +227,35 @@ $(document).ready( function(){
...
@@ -233,17 +227,35 @@ $(document).ready( function(){
},
},
"
aoColumns
"
:[
"
aoColumns
"
:[
{
"
mData
"
:
"
id
"
,
"
bSearchable
"
:
false
,
"
bSortable
"
:
false
,
"
bvisible
"
:
false
},
{
"
mData
"
:
"
id
"
,
"
bSearchable
"
:
false
,
"
bSortable
"
:
false
,
"
bvisible
"
:
false
},
{
"
mData
"
:
"
details
"
,
"
sClass
"
:
"
alignCenter
"
,
"
bSearchable
"
:
true
,
"
bSortable
"
:
true
,
{
"
mRender
"
:
function
(
data
,
type
,
full
)
{
"
mData
"
:
"
details
"
,
"
sClass
"
:
"
alignCenter
"
,
"
bSearchable
"
:
true
,
"
bSortable
"
:
true
,
if
(
full
.
comments
!==
null
)
{
"
mRender
"
:
function
(
data
,
type
,
full
)
{
if
(
!
full
.
comments
.
trim
())
{
if
(
full
.
comments
!==
null
)
{
return
'
<small>
'
+
data
+
'
</small>
'
;
if
(
!
full
.
comments
.
trim
())
{
}
return
'
<small>
'
+
data
+
'
</small>
'
;
return
'
<a rel="tooltip" href="#" data-toggle="tooltip" data-placement="top" title=
'
+
full
.
comments
+
'
><small>
'
+
data
+
'
</small>
'
}
}
else
{
var
comment_escaped
=
full
.
comments
;
return
'
No comments
'
comment_escaped
=
comment_escaped
.
replace
(
/&/g
,
"
&
"
);
}
comment_escaped
=
comment_escaped
.
replace
(
/</g
,
"
<
"
);
}
comment_escaped
=
comment_escaped
.
replace
(
/>/g
,
"
>
"
);
comment_escaped
=
comment_escaped
.
replace
(
/"/g
,
"
"
"
);
comment_escaped
=
comment_escaped
.
replace
(
/'/g
,
"
'
"
);
//alert("test"+comment_escaped)
//alert(data)
//var temp1 = $("
<
a
/>
"
).html(data);
//temp1.attr(
"
href
"
,
"
#
"
);
//temp1.attr(
"
rel
"
,
"
tooltip
"
);
//temp1.attr(
"
data
-
toggle
"
,
"
tooltip
"
);
//temp1.attr(
"
data
-
placement
"
,
"
top
"
);
//temp1.attr(
"
title
"
, comment_escaped);
//alert(temp1.attr(
"
href
"
))
//temp1.attr(
"
delay
"
,
"
3000
"
);
return '<a rel=
"
tooltip
"
data-toggle=
"
tooltip
"
data-placement=
"
top
"
title=
"'
+comment_escaped+
'"
/>'+
'<small>.'+data+'</small>'
} else {
return 'No comments'
}
}
},
},
{
"
mData
"
:
"
match
"
,
"
sClass
"
:
"
alignCenter
"
,
"
bSearchable
"
: true,
"
bSortable
"
: true,
{
"
mData
"
:
"
match
"
,
"
sClass
"
:
"
alignCenter
"
,
"
bSearchable
"
: true,
"
bSortable
"
: true,
"
mRender
"
: function (data, type, full) {
"
mRender
"
: function (data, type, full) {
...
@@ -388,13 +400,18 @@ var update_size = function() {
...
@@ -388,13 +400,18 @@ var update_size = function() {
oTable
.
fnAdjustColumnSizing
();
oTable
.
fnAdjustColumnSizing
();
}
}
$
(
"
body
"
).
tooltip
({
selector
:
'
[data-toggle="tooltip"]
'
});
$
(
"
body
"
).
tooltip
(
"
<pre/>
"
,
{
selector
:
'
[data-toggle="tooltip"]
'
,
show
:{
delay
:
5000
}
});
});
});
</script>
</script>
<style
type=
"text/css"
>
<style
type=
"text/css"
>
a
{
word-wrap
:
break-word
;
display
:
block
;
width
:
200px
;
}
.dl-horizontal
dt
{
.dl-horizontal
dt
{
width
:
70px
;
width
:
70px
;
}
}
.dl-horizontal
dd
{
.dl-horizontal
dd
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment