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;
use PVE::Cluster;
use PVE::RESTHandler;
use PVE::RPCEnvironment;
use PVE::API2Tools;
use base qw(PVE::RESTHandler);
......@@ -881,7 +882,7 @@ __PACKAGE__->register_method ({
type => "object",
properties => {},
},
links => [ { rel => 'child', href => "{name}" } ],
links => [ { rel => 'child', href => "{node}" } ],
},
code => sub {
my ($param) = @_;
......@@ -889,26 +890,12 @@ __PACKAGE__->register_method ({
my $clinfo = PVE::Cluster::get_clinfo();
my $res = [];
my $nodename = PVE::INotify::nodename();
my $nodelist = $clinfo->{nodelist};
my $nodelist = PVE::Cluster::get_nodelist();
my $members = PVE::Cluster::get_members();
my $rrd = PVE::Cluster::rrd_dump();
my @nodes = $nodelist ? (keys %$nodelist) : $nodename;
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];
}
foreach my $node (@$nodelist) {
my $entry = PVE::API2Tools::extract_node_stats($node, $members, $rrd);
push @$res, $entry;
}
......
......@@ -2,6 +2,8 @@ pve-manager (2.0-55) unstable; urgency=low
* fix bug #135: allow single letter 'dns-name', allow to start names
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
......
......@@ -9,7 +9,7 @@ Ext.define('PVE.form.NodeSelector', {
var me = this;
var store = Ext.create('Ext.data.Store', {
fields: [ 'name', 'cpu', 'maxcpu', 'mem', 'maxmem', 'uptime' ],
fields: [ 'node', 'cpu', 'maxcpu', 'mem', 'maxmem', 'uptime' ],
autoLoad: true,
proxy: {
type: 'pve',
......@@ -22,7 +22,7 @@ Ext.define('PVE.form.NodeSelector', {
direction: 'DESC'
},
{
property : 'name',
property : 'node',
direction: 'ASC'
}
]
......@@ -30,13 +30,13 @@ Ext.define('PVE.form.NodeSelector', {
Ext.apply(me, {
store: store,
valueField: 'name',
displayField: 'name',
valueField: 'node',
displayField: 'node',
listConfig: {
columns: [
{
header: 'Node',
dataIndex: 'name',
dataIndex: 'node',
hideable: false,
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