Fix some if-else-codeblocks according to codingstyle

This commit is contained in:
Mark Schouten 2015-08-29 21:26:29 +02:00
parent 34abb859df
commit 8543ca3d46
4 changed files with 11 additions and 5 deletions

View File

@ -6,7 +6,8 @@ if (is_numeric($vars['id']) && ($auth || application_permitted($vars['id']))) {
if ($app['app_type'] != 'proxmox') { if ($app['app_type'] != 'proxmox') {
$title = generate_device_link($device); $title = generate_device_link($device);
$title .= $graph_subtype; $title .= $graph_subtype;
} else { }
else {
$title = $vars['port'].'@'.$vars['hostname'].' on '.generate_device_link($device); $title = $vars['port'].'@'.$vars['hostname'].' on '.generate_device_link($device);
} }
$auth = true; $auth = true;

View File

@ -15,7 +15,9 @@ echo "<span style='font-weight: bold;'>Proxmox</span> &#187; ";
unset($sep); unset($sep);
foreach ($pmxcl as $pmxc) { foreach ($pmxcl as $pmxc) {
if (isset($sep)) { echo $sep; }; if (isset($sep)) {
echo $sep;
};
if (var_eq('instance', $pmxc['app_instance'])) { if (var_eq('instance', $pmxc['app_instance'])) {
echo "<span class='pagemenu-selected'>"; echo "<span class='pagemenu-selected'>";

View File

@ -22,7 +22,8 @@ global $config;
if (!isset($config['enable_proxmox']) || !$config['enable_proxmox']) { if (!isset($config['enable_proxmox']) || !$config['enable_proxmox']) {
print_error('Proxmox agent was discovered on this host. Please enable Proxmox in your config.'); print_error('Proxmox agent was discovered on this host. Please enable Proxmox in your config.');
} else { }
else {
$graphs = array( $graphs = array(
'proxmox_traffic' => 'Traffic', 'proxmox_traffic' => 'Traffic',

View File

@ -57,13 +57,15 @@ if (count($pmxlines) > 2) {
rrdtool_update($rrd_filename, 'N:'.$vmpin.':'.$vmpout); rrdtool_update($rrd_filename, 'N:'.$vmpin.':'.$vmpout);
if (proxmox_vm_exists($vmid, $pmxcluster, $pmxcache) === true) { if (proxmox_vm_exists($vmid, $pmxcluster, $pmxcache) === true) {
dbUpdate(array('device_id' => $device['device_id'], 'last_seen' => array('NOW()'), 'description' => $vmdesc), 'proxmox', '`vmid` = ? AND `cluster` = ?', array($vmid, $pmxcluster)); dbUpdate(array('device_id' => $device['device_id'], 'last_seen' => array('NOW()'), 'description' => $vmdesc), 'proxmox', '`vmid` = ? AND `cluster` = ?', array($vmid, $pmxcluster));
} else { }
else {
$pmxcache[$pmxcluster][$vmid] = dbInsert(array('cluster' => $pmxcluster, 'vmid' => $vmid, 'description' => $vmdesc, 'device_id' => $device['device_id']), 'proxmox'); $pmxcache[$pmxcluster][$vmid] = dbInsert(array('cluster' => $pmxcluster, 'vmid' => $vmid, 'description' => $vmdesc, 'device_id' => $device['device_id']), 'proxmox');
} }
if ($portid = proxmox_port_exists($vmid, $pmxcluster, $vmport) !== false) { if ($portid = proxmox_port_exists($vmid, $pmxcluster, $vmport) !== false) {
dbUpdate(array('last_seen' => array('NOW()')), 'proxmox_ports', '`vm_id` = ? AND `port` = ?', array($pmxcache[$pmxcluster][$vmid], $vmport)); dbUpdate(array('last_seen' => array('NOW()')), 'proxmox_ports', '`vm_id` = ? AND `port` = ?', array($pmxcache[$pmxcluster][$vmid], $vmport));
} else { }
else {
dbInsert(array('vm_id' => $pmxcache[$pmxcluster][$vmid], 'port' => $vmport), 'proxmox_ports'); dbInsert(array('vm_id' => $pmxcache[$pmxcluster][$vmid], 'port' => $vmport), 'proxmox_ports');
} }