echo "<table>\n \t <tr>\n \t <th>Disk storage</th>\n\t <th>{$spaces} Storage driver type {$spaces}</th>\n \t <th>{$spaces} Domain device {$spaces}</th>\n \t <th>{$spaces} Disk capacity {$spaces}</th>\n\t\t\t\t<th>{$spaces} Disk allocation {$spaces}</th>\n\t\t\t\t<th>{$spaces} Physical disk size {$spaces}</th>\n\t\t\t\t<th>{$spaces} Actions {$spaces}</th>\n\t\t\t </tr>"; for ($i = 0; $i < sizeof($tmp); $i++) { $capacity = $lv->format_size($tmp[$i]['capacity'], 2); $allocation = $lv->format_size($tmp[$i]['allocation'], 2); $physical = $lv->format_size($tmp[$i]['physical'], 2); $dev = array_key_exists('file', $tmp[$i]) ? $tmp[$i]['file'] : $tmp[$i]['partition']; echo "<tr>\n \t <td>{$spaces}" . basename($dev) . "{$spaces}</td>\n\t <td align=\"center\">{$spaces}{$tmp[$i]['type']}{$spaces}</td>\n \t <td align=\"center\">{$spaces}{$tmp[$i]['device']}{$spaces}</td>\n \t <td align=\"center\">{$spaces}{$capacity}{$spaces}</td>\n \t <td align=\"center\">{$spaces}{$allocation}{$spaces}</td>\n\t <td align=\"center\">{$spaces}{$physical}{$spaces}</td>\n\t\t\t\t\t\t\t <td align=\"center\">{$spaces}\n\t\t\t\t\t\t\t\t\t<a href=\"?action={$action}&uuid={$_GET['uuid']}&subaction=disk-remove&dev={$tmp[$i]['device']}\">\n\t\t\t\t\t\t\t\t\t\tRemove disk device</a>\n\t\t\t\t\t\t\t{$spaces}</td>\n \t </tr>"; } echo "</table>"; } else { echo "Domain doesn't have any disk devices"; } echo "<br />{$spaces}<a href=\"?action={$action}&uuid={$_GET['uuid']}&subaction=disk-add\">Add new disk</a>"; /* Network interface information */ echo "<h3>Network devices</h3>"; $tmp = $lv->get_nic_info($domName); if (!empty($tmp)) { $anets = $lv->get_networks(VIR_NETWORKS_ACTIVE); echo "<table>\n \t <tr>\n\t <th>MAC Address</th>\n \t <th>{$spaces} NIC Type{$spaces}</th>\n \t <th>{$spaces} Network{$spaces}</th>\n \t <th>{$spaces} Network active{$spaces}</th>\n\t\t\t\t<th>{$spaces} Actions {$spaces}</th>\n\t </tr>"; for ($i = 0; $i < sizeof($tmp); $i++) { if (in_array($tmp[$i]['network'], $anets)) { $netUp = 'Yes'; } else { $netUp = 'No <a href="?action=virtual-networks&subaction=start&name=' . $tmp[$i]['network'] . '">[Start]</a>'; } echo "<tr>\n \t <td>{$spaces}{$tmp[$i]['mac']}{$spaces}</td>\n \t <td align=\"center\">{$spaces}{$tmp[$i]['nic_type']}{$spaces}</td>\n\t <td align=\"center\">{$spaces}{$tmp[$i]['network']}{$spaces}</td>\n \t <td align=\"center\">{$spaces}{$netUp}{$spaces}</td>\n\t\t\t\t\t\t\t <td align=\"center\">{$spaces}\n\t\t\t\t\t\t\t\t\t<a href=\"?action={$action}&uuid={$_GET['uuid']}&subaction=nic-remove&mac={$tmp[$i]['mac']}\">\n\t\t\t\t\t\t\t\t\t\tRemove network card</a>\n\t\t\t\t\t\t\t{$spaces}</td> \t \n \t </tr>"; } echo "</table>"; echo "<br />{$spaces}<a href=\"?action={$action}&uuid={$_GET['uuid']}&subaction=nic-add\">Add new network card</a>"; } else { echo 'Domain doesn\'t have any network devices';