Esempio n. 1
0
?>
    
    <div id="templatemo_main">
    	<div class="col_fw">
        	<div class="templatemo_megacontent">
            	<h2>Hosts</h2>
				 <a href="index.php">Back to normal view</a>				 
                <div class="cleaner h20"></div>

<?php 
$result = $dbh->query("SELECT * FROM hosts ORDER BY name ASC");
if ($result) {
    echo "<table id='rounded-corner' summary='Hostsummary'>";
    echo create_host_header();
    while ($host_data = $result->fetch(PDO::FETCH_ASSOC)) {
        $host_alive = get_host_status($host_data);
        echo get_host_summary($host_data);
        if ($host_alive) {
            $privileged = get_privileged_status($host_data);
            echo "<tr><td colspan='16'>";
            echo "<table id='rounded-corner' summary='PoolSummary' align='center'>";
            echo create_pool_header();
            echo process_pools_disp($host_data);
            echo "</table>";
            echo "<table id='rounded-corner' summary='DevsSummary' align='center'>";
            echo create_devs_header();
            echo process_devs_disp($host_data);
            echo "</table>";
            echo "</td></tr>";
        }
    }
Esempio n. 2
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once "modules/backuppc/includes/xmlrpc.php";
// Getting request
if (isset($_GET['q'])) {
    $q = $_GET['q'];
} else {
    return;
}
// =========== GET HOST CURRENT STATE =============================================
if ($q == 'GET_STATUS' && isset($_GET['host'])) {
    $response = get_host_status($_GET['host']);
    if (isXMLRPCError() || $response['err']) {
        print '<span style="color:red">' . _T("Error while retrieving status.", 'backuppc') . '</span>';
    }
    $status_strings = array('no ping' => '<span style="color:red">' . _T('No ping response', 'backuppc') . '</span>', 'backup failed' => '<span style="color:red">' . _T('Backup failed', 'backuppc') . '</span>', 'restore failed' => '<span style="color:red">' . _T('Restore failed', 'backuppc') . '</span>', 'backup_done' => '<span style="color:green">' . _T('Backup up to date', 'backuppc') . '</span>', 'restore done' => '<span style="color:green">' . _T('Restore done', 'backuppc') . '</span>', 'nothing' => '<span style="color:red">' . _T('This computer has never been backed up', 'backuppc') . '</span>', 'idle' => '<span style="color:black">' . _T('Idle', 'backuppc') . '</span>', 'canceled' => '<span style="color:black">' . _T('Cancelled by user', 'backuppc') . '</span>', 'in progress' => '<img src="modules/msc/graph/images/status/inprogress.gif" width="14" alt="" />  <span style="color:orange">' . _T('Backup in progress') . '</span>');
    foreach ($response['status'] as $line) {
        print $status_strings[$line] . '<br/>';
    }
}
Esempio n. 3
0
include 'header.inc.php';
?>
    
    <div id="templatemo_main">
    	<div class="col_fw">
        	<div class="templatemo_megacontent">
            	<h2>Add host</h2>

                <div class="cleaner h20"></div>
<?php 
if (isset($id)) {
    if ($host_data) {
        echo "<b>Host has been added !</b><BR>";
        echo "<table id='rounded-corner' summary='HostSummary' align='center'>";
        echo create_host_header();
        echo get_host_status($host_data);
        echo "</table>";
        echo "<table id='rounded-corner' summary='PoolSummary' align='center'>";
        echo create_pool_header();
        echo process_pools_disp($host_data);
        echo "</table>";
        echo "<table id='rounded-corner' summary='DevsSummary' align='center'>";
        echo create_devs_header();
        echo process_devs_disp($host_data);
        echo "</table>";
    }
}
?>

<form name=save action="addhost.php" method="post">
Esempio n. 4
0
if (get_backupserver_for_computer($uuid) != '') {
    if (!host_exists($uuid)) {
        printf(_T("Backup is not set for this computer.", 'backuppc'));
        // Propose to set
        $f = new PopupForm("");
        $hidden = new HiddenTpl("host");
        $f->add($hidden, array("value" => $uuid, "hide" => True));
        $f->addButton("setBackup", _T("Configure", 'backuppc'));
        $f->display();
        return;
    }
} else {
    printf(_T("There is no backup server assigned for the computer entity.", 'backuppc'));
    return;
}
$response = get_host_status($uuid);
// Check if error occured
if ($response['err']) {
    new NotifyWidgetFailure(nl2br($response['errtext']));
    return;
}
// ==========================================================
// Status lines
// ==========================================================
$status_strings = array('no ping' => '<span style="color:red">' . _T('No ping response', 'backuppc') . '</span>', 'backup failed' => '<span style="color:red">' . _T('Backup failed', 'backuppc') . '</span>', 'restore failed' => '<span style="color:red">' . _T('Restore failed', 'backuppc') . '</span>', 'backup_done' => '<span style="color:green">' . _T('Backup up to date', 'backuppc') . '</span>', 'restore done' => '<span style="color:green">' . _T('Restore done', 'backuppc') . '</span>', 'nothing' => '<span style="color:red">' . _T('This computer has never been backed up', 'backuppc') . '</span>', 'idle' => '<span style="color:black">' . _T('Idle', 'backuppc') . '</span>', 'canceled' => '<span style="color:black">' . _T('Cancelled by user', 'backuppc') . '</span>', 'in progress' => '<img src="modules/msc/graph/images/status/inprogress.gif" width="14" alt="" /> <span style="color:orange">' . _T('Backup in progress') . '</span>');
print '<table><tr><td width="130" valign="top">' . _T('Current state: ', 'backuppc') . '</td><td><b id="statustext">';
foreach ($response['status'] as $line) {
    print $status_strings[$line] . '<br/>';
}
if ($line == 'nothing') {
    $nerverbackuped = 1;