From 1595f03568826a9f73ef82db6d1902b77a54b87c Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Thu, 27 Aug 2015 21:06:07 +0200 Subject: [PATCH] Cleanup and show an app-page with the corresponding device --- html/includes/application/proxmox.inc.php | 18 +++++++++++ html/includes/functions.inc.php | 23 ++++++++++++++ html/pages/device/apps/proxmox.inc.php | 38 +++++++++++++++++++++++ html/pages/proxmox.inc.php | 38 ++--------------------- html/pages/proxmox/vm.inc.php | 3 -- 5 files changed, 81 insertions(+), 39 deletions(-) create mode 100644 html/includes/application/proxmox.inc.php create mode 100644 html/pages/device/apps/proxmox.inc.php diff --git a/html/includes/application/proxmox.inc.php b/html/includes/application/proxmox.inc.php new file mode 100644 index 000000000..dcc28d954 --- /dev/null +++ b/html/includes/application/proxmox.inc.php @@ -0,0 +1,18 @@ + 'Traffic', +); + +foreach (proxmox_node_vms(var_get('device')) as $nvm) { + $vm = proxmox_vm_info($nvm['vmid'], $nvm['cluster']); + + foreach ($vm['ports'] as $port) { + foreach ($graphs as $key => $text) { + $graph_type = 'proxmox_traffic'; + + $graph_array['height'] = '100'; + $graph_array['width'] = '215'; + $graph_array['to'] = $config['time']['now']; + $graph_array['id'] = $vm['app_id']; + $graph_array['device_id'] = $vm['device_id']; + $graph_array['type'] = 'application_'.$key; + $graph_array['port'] = $port['port']; + $graph_array['vmid'] = $vm['vmid']; + $graph_array['cluster'] = $vm['cluster']; + $graph_array['hostname'] = $vm['description']; + + echo '

'.$text.' '.$port['port'].'@'.$vm['description'].'

'; + + echo ""; + + include 'includes/print-graphrow.inc.php'; + + echo ''; + } + } +} diff --git a/html/pages/proxmox.inc.php b/html/pages/proxmox.inc.php index fc04dac9f..9593992b0 100644 --- a/html/pages/proxmox.inc.php +++ b/html/pages/proxmox.inc.php @@ -1,40 +1,6 @@ '; foreach (proxmox_cluster_vms(var_get('cluster')) as $pmxvm) { - echo '
  • '.generate_link($pmxvm['vmid']." (".$pmxvm['description'].")", array('page' => 'proxmox', 'cluster' => $pmxc['app_instance'], 'vmid' => $pmxvm['vmid'])).'
  • '; + echo '
  • '.generate_link($pmxvm['vmid']." (".$pmxvm['description'].")", array('page' => 'proxmox', 'cluster' => var_get('cluster'), 'vmid' => $pmxvm['vmid'])).'
  • '; } echo ''; } else { diff --git a/html/pages/proxmox/vm.inc.php b/html/pages/proxmox/vm.inc.php index cb43e3c9f..2f9f14776 100644 --- a/html/pages/proxmox/vm.inc.php +++ b/html/pages/proxmox/vm.inc.php @@ -5,9 +5,6 @@ global $vars; $vm = proxmox_vm_info(var_get('vmid'), var_get('cluster')); -print '
    ';
    -var_dump($vm);
    -print '
    '; $graphs = array( 'proxmox_traffic' => 'Traffic', );