mirror of
https://github.com/librenms/librenms.git
synced 2024-09-28 22:06:25 +00:00
Fix some if-else-codeblocks according to codingstyle
This commit is contained in:
parent
34abb859df
commit
8543ca3d46
@ -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;
|
||||||
|
@ -15,7 +15,9 @@ echo "<span style='font-weight: bold;'>Proxmox</span> » ";
|
|||||||
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'>";
|
||||||
|
@ -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',
|
||||||
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user