Module: nagvis Branch: master Commit: d7b602ed0dc8c1f4560f8f54bfaf1d0d7c25dca2 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=d7b602ed0dc8c1f4560f8f54bfaf1d0d7c25dca2
Author: Roman Kyrylych <[email protected]> Date: Wed Jul 29 18:32:04 2009 +0300 gmap: Update classes for Nagios objects Signed-off-by: Roman Kyrylych <[email protected]> --- share/netmap/Database.php | 8 ++++---- share/netmap/Host.php | 6 +++--- share/netmap/HostGroup.php | 4 +--- share/netmap/Location.php | 17 +++++++---------- share/netmap/Service.php | 4 +--- share/netmap/ServiceGroup.php | 4 +--- uifx/src/modules/gmap/DialogLocation.mxml | 4 ++-- uifx/src/modules/gmap/Host.as | 2 +- uifx/src/modules/gmap/HostGroup.as | 1 - uifx/src/modules/gmap/Service.as | 1 - uifx/src/modules/gmap/ServiceGroup.as | 1 - 11 files changed, 20 insertions(+), 32 deletions(-) diff --git a/share/netmap/Database.php b/share/netmap/Database.php index 2ad1bdd..d68a3ef 100644 --- a/share/netmap/Database.php +++ b/share/netmap/Database.php @@ -66,7 +66,7 @@ class Database $objects = $this->backend->getObjectsEx('host'); foreach ($objects as $object) - $hosts[] = new Host($object['id'], $object['name'], $object['address']); + $hosts[] = new Host($object['name'], $object['address'], $object['alias']); return $hosts; } @@ -80,7 +80,7 @@ class Database $objects = $this->backend->getObjectsEx('service'); foreach ($objects as $object) - $services[] = new Service($object['id'], $object['host'], $object['description']); + $services[] = new Service($object['host'], $object['description']); return $services; } @@ -94,7 +94,7 @@ class Database $objects = $this->backend->getObjectsEx('hostgroup'); foreach ($objects as $object) - $hostgroups[] = new HostGroup($object['id'], $object['name'], $object['alias']); + $hostgroups[] = new HostGroup($object['name'], $object['alias']); return $hostgroups; } @@ -108,7 +108,7 @@ class Database $objects = $this->backend->getObjectsEx('servicegroup'); foreach ($objects as $object) - $servicegroups[] = new ServiceGroup($object['id'], $object['name'], $object['alias']); + $servicegroups[] = new ServiceGroup($object['name'], $object['alias']); return $servicegroups; } diff --git a/share/netmap/Host.php b/share/netmap/Host.php index 547c93b..1adc837 100644 --- a/share/netmap/Host.php +++ b/share/netmap/Host.php @@ -23,15 +23,15 @@ class Host { - public $id; public $name; public $address; + public $alias; - public function __construct($id, $name, $address) + public function __construct($name, $address, $alias = '') { - $this->id = $id; $this->name = $name; $this->address = $address; + $this->alias = $alias; } } diff --git a/share/netmap/HostGroup.php b/share/netmap/HostGroup.php index b4e4760..4dbc663 100644 --- a/share/netmap/HostGroup.php +++ b/share/netmap/HostGroup.php @@ -23,13 +23,11 @@ class HostGroup { - public $id; public $name; public $alias; - public function __construct($id, $name, $alias = '') + public function __construct($name, $alias = '') { - $this->id = $id; $this->name = $name; $this->alias = $alias; } diff --git a/share/netmap/Location.php b/share/netmap/Location.php index fae272d..3947dd8 100644 --- a/share/netmap/Location.php +++ b/share/netmap/Location.php @@ -64,26 +64,23 @@ class Location switch ($object_type) { case 'host': - $object = new Host((string)$object_node['id'], - (string)$object_node['name'], - (string)$object_node['address']); + $object = new Host((string)$object_node['name'], + (string)$object_node['address'], + (string)$object_node['alias']); break; case 'hostgroup': - $object = new HostGroup((string)$object_node['id'], - (string)$object_node['name'], + $object = new HostGroup((string)$object_node['name'], (string)$object_node['alias']); break; case 'service': - $object = new Service((string)$object_node['id'], - (string)$object_node['description'], - (string)$object_node['host']); + $object = new Service((string)$object_node['host'], + (string)$object_node['description']); break; case 'servicegroup': - $object = new ServiceGroup((string)$object_node['id'], - (string)$object_node['name'], + $object = new ServiceGroup((string)$object_node['name'], (string)$object_node['alias']); break; diff --git a/share/netmap/Service.php b/share/netmap/Service.php index 7cf55b0..f5e9c3c 100644 --- a/share/netmap/Service.php +++ b/share/netmap/Service.php @@ -23,13 +23,11 @@ class Service { - public $id; public $host; public $description; - public function __construct($id, $description, $host) + public function __construct($host, $description) { - $this->id = $id; $this->host = $host; $this->description= $description; } diff --git a/share/netmap/ServiceGroup.php b/share/netmap/ServiceGroup.php index 7eff9df..e7e2905 100644 --- a/share/netmap/ServiceGroup.php +++ b/share/netmap/ServiceGroup.php @@ -23,13 +23,11 @@ class ServiceGroup { - public $id; public $name; public $alias; - public function __construct($id, $name, $alias = '') + public function __construct($name, $alias = '') { - $this->id = $id; $this->name = $name; $this->alias = $alias; } diff --git a/uifx/src/modules/gmap/DialogLocation.mxml b/uifx/src/modules/gmap/DialogLocation.mxml index 5ed9143..aff9f50 100644 --- a/uifx/src/modules/gmap/DialogLocation.mxml +++ b/uifx/src/modules/gmap/DialogLocation.mxml @@ -87,7 +87,7 @@ public function hostLabelFunction(item : Object) : String { - return item.name + ' ' + item.address; + return item.name + ' ' + item.address + ' ' + item.alias; } public function serviceLabelFunction(item : Object) : String @@ -108,7 +108,7 @@ { case 0: objects = hosts; - locNObject.browserFields = ["name", "address"]; + locNObject.browserFields = ["name", "address", "alias"]; locNObject.labelFunction = hostLabelFunction; break; case 1: diff --git a/uifx/src/modules/gmap/Host.as b/uifx/src/modules/gmap/Host.as index 53060c7..ef60a6a 100644 --- a/uifx/src/modules/gmap/Host.as +++ b/uifx/src/modules/gmap/Host.as @@ -25,8 +25,8 @@ package modules.gmap [RemoteClass(alias="Host")] public class Host { - public var id : String; public var name : String; public var address : String; + public var alias : String; } } diff --git a/uifx/src/modules/gmap/HostGroup.as b/uifx/src/modules/gmap/HostGroup.as index 0769347..fe0ee2b 100644 --- a/uifx/src/modules/gmap/HostGroup.as +++ b/uifx/src/modules/gmap/HostGroup.as @@ -25,7 +25,6 @@ package modules.gmap [RemoteClass(alias="HostGroup")] public class HostGroup { - public var id : String; public var name : String; public var alias : String; } diff --git a/uifx/src/modules/gmap/Service.as b/uifx/src/modules/gmap/Service.as index 9cf0002..eaa1f90 100644 --- a/uifx/src/modules/gmap/Service.as +++ b/uifx/src/modules/gmap/Service.as @@ -25,7 +25,6 @@ package modules.gmap [RemoteClass(alias="Service")] public class Service { - public var id : String; public var host : String; public var description : String; } diff --git a/uifx/src/modules/gmap/ServiceGroup.as b/uifx/src/modules/gmap/ServiceGroup.as index 3e288a4..04989c6 100644 --- a/uifx/src/modules/gmap/ServiceGroup.as +++ b/uifx/src/modules/gmap/ServiceGroup.as @@ -25,7 +25,6 @@ package modules.gmap [RemoteClass(alias="ServiceGroup")] public class ServiceGroup { - public var id : String; public var name : String; public var alias : String; } ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
