コード例 #1
0
ファイル: api.php プロジェクト: davidvuong/raspcontrol
function build_rbpi($response)
{
    $response['rbpi']['hostname'] = Rbpi::hostname(true);
    $response['rbpi']['distribution'] = Rbpi::distribution();
    $response['rbpi']['kernel'] = Rbpi::kernel();
    $response['rbpi']['firmware'] = Rbpi::firmware();
    $response['rbpi']['ip']['internal'] = Rbpi::internalIp();
    $response['rbpi']['ip']['external'] = Rbpi::externalIp();
    return $response;
}
コード例 #2
0
ファイル: details.php プロジェクト: racky1/raspcontrol
}
?>

        <tr id="check-network">
            <td class="check"><i class="icon-globe"></i> Network</td>
            <td class="icon"><?php 
echo icon_alert($net_connections['alert']);
?>
</td>
            <td class="infos">
                IP: <span class="text-info"><?php 
echo Rbpi::internalIp();
?>
</span> [internal] &middot;
                <span class="text-info"><?php 
echo Rbpi::externalIp();
?>
</span> [external]
                <br />received: <strong><?php 
echo $net_eth['down'];
?>
Mb</strong> &middot; sent: <strong><?php 
echo $net_eth['up'];
?>
Mb</strong> &middot; total: <?php 
echo $net_eth['total'];
?>
Mb
                <br />connections: <?php 
echo $net_connections['connections'];
?>
コード例 #3
0
ファイル: home.php プロジェクト: davidvuong/raspcontrol
$uptime = Uptime::uptime();
$ram = Memory::ram();
$swap = Memory::swap();
$cpu = CPU::cpu();
$cpu_heat = CPU::heat();
$hdd = Storage::hdd();
$hdd_alert = 'success';
for ($i = 0; $i < sizeof($hdd); $i++) {
    if ($hdd[$i]['alert'] == 'warning') {
        $hdd_alert = 'warning';
    }
}
$network = Network::connections();
$users = sizeof(Users::connected());
$temp = Temp::temp();
$external_ip = Rbpi::externalIp();
function icon_alert($alert)
{
    echo '<i class="icon-';
    switch ($alert) {
        case 'success':
            echo 'ok';
            break;
        case 'warning':
            echo 'warning-sign';
            break;
        default:
            echo 'exclamation-sign';
    }
    echo ' pull-right"></i>';
}