Commit feab4fa0 authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug #137: API change! Return node name using 'node' property.

parent 5739a114
...@@ -857,6 +857,7 @@ use PVE::SafeSyslog; ...@@ -857,6 +857,7 @@ use PVE::SafeSyslog;
use PVE::Cluster; use PVE::Cluster;
use PVE::RESTHandler; use PVE::RESTHandler;
use PVE::RPCEnvironment; use PVE::RPCEnvironment;
use PVE::API2Tools;
use base qw(PVE::RESTHandler); use base qw(PVE::RESTHandler);
...@@ -881,7 +882,7 @@ __PACKAGE__->register_method ({ ...@@ -881,7 +882,7 @@ __PACKAGE__->register_method ({
type => "object", type => "object",
properties => {}, properties => {},
}, },
links => [ { rel => 'child', href => "{name}" } ], links => [ { rel => 'child', href => "{node}" } ],
}, },
code => sub { code => sub {
my ($param) = @_; my ($param) = @_;
...@@ -889,26 +890,12 @@ __PACKAGE__->register_method ({ ...@@ -889,26 +890,12 @@ __PACKAGE__->register_method ({
my $clinfo = PVE::Cluster::get_clinfo(); my $clinfo = PVE::Cluster::get_clinfo();
my $res = []; my $res = [];
my $nodename = PVE::INotify::nodename(); my $nodelist = PVE::Cluster::get_nodelist();
my $nodelist = $clinfo->{nodelist}; my $members = PVE::Cluster::get_members();
my $rrd = PVE::Cluster::rrd_dump(); my $rrd = PVE::Cluster::rrd_dump();
my @nodes = $nodelist ? (keys %$nodelist) : $nodename; foreach my $node (@$nodelist) {
my $entry = PVE::API2Tools::extract_node_stats($node, $members, $rrd);
foreach my $node (@nodes) {
my $entry = { name => $node };
if (my $d = $rrd->{"pve2-node/$node"}) {
$entry->{uptime} = $d->[0];
$entry->{maxcpu} = $d->[3];
$entry->{cpu} = $d->[4];
$entry->{maxmem} = $d->[6];
$entry->{mem} = $d->[7];
$entry->{maxdisk} = $d->[10];
$entry->{disk} = $d->[11];
}
push @$res, $entry; push @$res, $entry;
} }
......
...@@ -2,6 +2,8 @@ pve-manager (2.0-55) unstable; urgency=low ...@@ -2,6 +2,8 @@ pve-manager (2.0-55) unstable; urgency=low
* fix bug #135: allow single letter 'dns-name', allow to start names * fix bug #135: allow single letter 'dns-name', allow to start names
with numbers with numbers
* fix bug #137: API change! Return node name using 'node' property.
-- Proxmox Support Team <support@proxmox.com> Mon, 02 Apr 2012 12:13:33 +0200 -- Proxmox Support Team <support@proxmox.com> Mon, 02 Apr 2012 12:13:33 +0200
......
...@@ -9,7 +9,7 @@ Ext.define('PVE.form.NodeSelector', { ...@@ -9,7 +9,7 @@ Ext.define('PVE.form.NodeSelector', {
var me = this; var me = this;
var store = Ext.create('Ext.data.Store', { var store = Ext.create('Ext.data.Store', {
fields: [ 'name', 'cpu', 'maxcpu', 'mem', 'maxmem', 'uptime' ], fields: [ 'node', 'cpu', 'maxcpu', 'mem', 'maxmem', 'uptime' ],
autoLoad: true, autoLoad: true,
proxy: { proxy: {
type: 'pve', type: 'pve',
...@@ -22,7 +22,7 @@ Ext.define('PVE.form.NodeSelector', { ...@@ -22,7 +22,7 @@ Ext.define('PVE.form.NodeSelector', {
direction: 'DESC' direction: 'DESC'
}, },
{ {
property : 'name', property : 'node',
direction: 'ASC' direction: 'ASC'
} }
] ]
...@@ -30,13 +30,13 @@ Ext.define('PVE.form.NodeSelector', { ...@@ -30,13 +30,13 @@ Ext.define('PVE.form.NodeSelector', {
Ext.apply(me, { Ext.apply(me, {
store: store, store: store,
valueField: 'name', valueField: 'node',
displayField: 'name', displayField: 'node',
listConfig: { listConfig: {
columns: [ columns: [
{ {
header: 'Node', header: 'Node',
dataIndex: 'name', dataIndex: 'node',
hideable: false, hideable: false,
flex: 1 flex: 1
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment