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
7a2318f2
Commit
7a2318f2
authored
Apr 20, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement parseLxcNetwork, fix printLxcNetwork
parent
48260e00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
Parser.js
www/manager/Parser.js
+23
-12
No files found.
www/manager/Parser.js
View file @
7a2318f2
...
@@ -223,24 +223,35 @@ Ext.define('PVE.Parser', { statics: {
...
@@ -223,24 +223,35 @@ Ext.define('PVE.Parser', { statics: {
return
netarray
.
join
(
'
;
'
);
return
netarray
.
join
(
'
;
'
);
},
},
printLxcNetwork
:
function
(
data
)
{
parseLxcNetwork
:
function
(
value
)
{
var
tmparray
=
[];
if
(
!
value
)
{
Ext
.
Array
.
each
([
'
link
'
,
'
hwaddr
'
,
'
mtu
'
,
'
name
'
,
'
ipv4
'
,
return
;
'
ipv4.gateway
'
,
'
ipv6
'
,
'
ipv6.gateway
'
,
'
firewall
'
],
function
(
key
)
{
var
value
=
data
[
key
];
if
(
key
===
'
bridge
'
){
if
(
data
[
'
tag
'
]){
value
=
value
+
'
v
'
+
data
[
'
tag
'
];
}
}
if
(
data
[
'
firewall
'
]){
value
=
value
+
'
f
'
;
var
data
=
{};
Ext
.
Array
.
each
(
value
.
split
(
'
,
'
),
function
(
p
)
{
if
(
!
p
||
p
.
match
(
/^
\s
*$/
))
{
return
;
// continue
}
}
var
match_res
=
p
.
match
(
/^
(
link|hwaddr|mtu|name|ip|ip6|gw|gw6
)
=
(\S
+
)
$/
);
if
(
!
match_res
)
{
// todo: simply ignore errors ?
return
;
// continue
}
}
data
[
match_res
[
1
]]
=
match_res
[
2
];
});
return
data
;
},
printLxcNetwork
:
function
(
data
)
{
var
tmparray
=
[];
Ext
.
Array
.
each
([
'
link
'
,
'
hwaddr
'
,
'
mtu
'
,
'
name
'
,
'
ip
'
,
'
gw
'
,
'
ip6
'
,
'
gw6
'
],
function
(
key
)
{
var
value
=
data
[
key
];
if
(
value
)
{
if
(
value
)
{
tmparray
.
push
(
key
+
'
=
'
+
value
);
tmparray
.
push
(
key
+
'
=
'
+
value
);
}
}
});
});
return
tmparray
.
join
(
'
,
'
);
return
tmparray
.
join
(
'
,
'
);
...
...
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