Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
098c951a
Commit
098c951a
authored
May 23, 2014
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FirewallRules: show error messages in rules grid using tooltips.
parent
d52bd8b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
FirewallRules.js
www/manager/grid/FirewallRules.js
+41
-3
No files found.
www/manager/grid/FirewallRules.js
View file @
098c951a
...
...
@@ -552,6 +552,17 @@ Ext.define('PVE.FirewallRules', {
}
tbar
.
push
([
me
.
removeBtn
,
me
.
editBtn
]);
var
render_errors
=
function
(
name
,
value
,
metaData
,
record
)
{
var
errors
=
record
.
data
.
errors
;
if
(
errors
&&
errors
[
name
])
{
metaData
.
tdCls
=
'
x-form-invalid-field
'
;
var
html
=
'
<p>
'
+
Ext
.
htmlEncode
(
errors
[
name
])
+
'
</p>
'
;
metaData
.
tdAttr
=
'
data-qwidth=600 data-qtitle="ERROR" data-qtip="
'
+
html
.
replace
(
/
\"
/g
,
'
"
'
)
+
'
"
'
;
}
return
value
;
};
var
columns
=
[
{
// similar to xtype: 'rownumberer',
...
...
@@ -592,16 +603,25 @@ Ext.define('PVE.FirewallRules', {
{
header
:
gettext
(
'
Type
'
),
dataIndex
:
'
type
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
type
'
,
value
,
metaData
,
record
);
},
width
:
50
},
{
header
:
gettext
(
'
Action
'
),
dataIndex
:
'
action
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
action
'
,
value
,
metaData
,
record
);
},
width
:
80
},
{
header
:
gettext
(
'
Macro
'
),
dataIndex
:
'
macro
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
macro
'
,
value
,
metaData
,
record
);
},
width
:
80
}
];
...
...
@@ -610,6 +630,9 @@ Ext.define('PVE.FirewallRules', {
columns
.
push
({
header
:
gettext
(
'
Interface
'
),
dataIndex
:
'
iface
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
iface
'
,
value
,
metaData
,
record
);
},
width
:
80
});
}
...
...
@@ -618,34 +641,49 @@ Ext.define('PVE.FirewallRules', {
{
header
:
gettext
(
'
Source
'
),
dataIndex
:
'
source
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
source
'
,
value
,
metaData
,
record
);
},
width
:
100
},
{
header
:
gettext
(
'
Destination
'
),
dataIndex
:
'
dest
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
dest
'
,
value
,
metaData
,
record
);
},
width
:
100
},
{
header
:
gettext
(
'
Protocol
'
),
dataIndex
:
'
proto
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
proto
'
,
value
,
metaData
,
record
);
},
width
:
100
},
{
header
:
gettext
(
'
Dest. port
'
),
dataIndex
:
'
dport
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
dport
'
,
value
,
metaData
,
record
);
},
width
:
100
},
{
header
:
gettext
(
'
Source port
'
),
dataIndex
:
'
sport
'
,
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
sport
'
,
value
,
metaData
,
record
);
},
width
:
100
},
{
header
:
gettext
(
'
Comment
'
),
dataIndex
:
'
comment
'
,
flex
:
1
,
renderer
:
function
(
value
)
{
return
Ext
.
util
.
Format
.
htmlEncode
(
value
);
renderer
:
function
(
value
,
metaData
,
record
)
{
return
render_errors
(
'
comment
'
,
Ext
.
util
.
Format
.
htmlEncode
(
value
),
metaData
,
record
);
}
}
]);
...
...
@@ -694,7 +732,7 @@ Ext.define('PVE.FirewallRules', {
extend
:
'
Ext.data.Model
'
,
fields
:
[
{
name
:
'
enable
'
,
type
:
'
boolean
'
},
'
type
'
,
'
action
'
,
'
macro
'
,
'
source
'
,
'
dest
'
,
'
proto
'
,
'
iface
'
,
'
dport
'
,
'
sport
'
,
'
comment
'
,
'
pos
'
,
'
digest
'
],
'
dport
'
,
'
sport
'
,
'
comment
'
,
'
pos
'
,
'
digest
'
,
'
errors
'
],
idProperty
:
'
pos
'
});
...
...
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