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
5152f728
Commit
5152f728
authored
Oct 07, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display vswap for openvz containers
parent
51688b17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
OpenVZ.pm
PVE/OpenVZ.pm
+4
-0
StatusView.js
www/manager/openvz/StatusView.js
+28
-4
No files found.
PVE/OpenVZ.pm
View file @
5152f728
...
...
@@ -129,6 +129,9 @@ sub vmstatus {
$d
->
{
mem
}
=
0
;
$d
->
{
maxmem
}
=
int
(((
$conf
->
{
physpages
}
->
{
lim
}
+
$conf
->
{
swappages
}
->
{
lim
})
*
4096
));
$d
->
{
swap
}
=
0
;
$d
->
{
maxswap
}
=
int
(((
$conf
->
{
swappages
}
->
{
lim
})
*
4096
));
$d
->
{
nproc
}
=
0
;
$d
->
{
failcnt
}
=
0
;
...
...
@@ -176,6 +179,7 @@ sub vmstatus {
$d
->
{
mem
}
+=
int
(
$held
*
4096
);
}
elsif
(
$name
eq
'
swappages
')
{
$d
->
{
mem
}
+=
int
(
$held
*
4096
);
$d
->
{
swap
}
+=
int
(
$held
*
4096
);
}
elsif
(
$name
eq
'
numproc
')
{
$d
->
{
nproc
}
=
$held
;
}
...
...
www/manager/openvz/StatusView.js
View file @
5152f728
...
...
@@ -32,26 +32,50 @@ Ext.define('PVE.openvz.StatusView', {
var
render_mem
=
function
(
value
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
)
{
var
maxmem
=
me
.
getObjectValue
(
'
maxmem
'
,
0
);
var
per
=
(
value
/
maxmem
)
*
100
;
var
text
=
"
<div>Total:
"
+
PVE
.
Utils
.
format_size
(
maxmem
)
+
"
</div>
"
+
var
maxswap
=
me
.
getObjectValue
(
'
maxswap
'
,
0
);
var
swap
=
me
.
getObjectValue
(
'
swap
'
,
0
);
var
max
=
maxmem
-
maxswap
;
var
used
=
value
-
swap
;
var
per
=
(
used
/
max
)
*
100
;
var
text
=
"
<div>Total:
"
+
PVE
.
Utils
.
format_size
(
max
)
+
"
</div>
"
+
"
<div>Used:
"
+
PVE
.
Utils
.
format_size
(
used
)
+
"
</div>
"
;
return
text
;
};
var
render_swap
=
function
(
value
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
)
{
var
maxswap
=
me
.
getObjectValue
(
'
maxswap
'
,
0
);
var
per
=
(
value
/
maxswap
)
*
100
;
var
text
=
"
<div>Total:
"
+
PVE
.
Utils
.
format_size
(
maxswap
)
+
"
</div>
"
+
"
<div>Used:
"
+
PVE
.
Utils
.
format_size
(
value
)
+
"
</div>
"
;
return
text
;
};
var
render_status
=
function
(
value
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
)
{
var
failcnt
=
me
.
getObjectValue
(
'
failcnt
'
,
0
);
if
(
failcnt
>
0
)
{
return
value
+
"
(failure count
"
+
failcnt
+
"
)
"
;
}
return
value
;
}
var
rows
=
{
name
:
{
header
:
'
Name
'
,
defaultValue
:
'
no name specified
'
},
status
:
{
header
:
'
Status
'
,
defaultValue
:
'
unknown
'
},
status
:
{
header
:
'
Status
'
,
defaultValue
:
'
unknown
'
,
renderer
:
render_status
},
failcnt
:
{
visible
:
false
},
cpu
:
{
header
:
'
CPU usage
'
,
required
:
true
,
renderer
:
render_cpu
},
cpus
:
{
visible
:
false
},
mem
:
{
header
:
'
Memory usage
'
,
required
:
true
,
renderer
:
render_mem
},
maxmem
:
{
visible
:
false
},
swap
:
{
header
:
'
VSwap usage
'
,
required
:
true
,
renderer
:
render_swap
},
maxswap
:
{
visible
:
false
},
uptime
:
{
header
:
'
Uptime
'
,
required
:
true
,
renderer
:
PVE
.
Utils
.
render_uptime
}
};
Ext
.
applyIf
(
me
,
{
url
:
"
/api2/json/nodes/
"
+
nodename
+
"
/openvz/
"
+
vmid
+
"
/status/current
"
,
cwidth1
:
150
,
height
:
1
45
,
height
:
1
79
,
interval
:
1000
,
rows
:
rows
});
...
...
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