Ejemplo n.º 1
0
function PrintStorageDeviceSelect()
{
    global $SUDO;
    # FIXME, this would be much simpler by parsing "lsblk -l"
    exec('lsblk -l | grep /boot | cut -f1 -d" " | sed -e "s/p[0-9]$//"', $output, $return_val);
    $bootDevice = $output[0];
    unset($output);
    exec('lsblk -l | grep " /$" | cut -f1 -d" "', $output, $return_val);
    $rootDevice = $output[0];
    unset($output);
    exec('grep "fpp/media" /etc/fstab | cut -f1 -d" " | sed -e "s/\\/dev\\///"', $output, $return_val);
    $storageDevice = $output[0];
    unset($output);
    $found = 0;
    $values = array();
    foreach (scandir("/dev/") as $fileName) {
        if (preg_match("/^sd[a-z][0-9]/", $fileName) || preg_match("/^mmcblk[0-9]p[0-9]/", $fileName)) {
            exec($SUDO . " sfdisk -s /dev/{$fileName}", $output, $return_val);
            $GB = intval($output[0]) / 1024.0 / 1024.0;
            unset($output);
            if ($GB <= 0.1) {
                continue;
            }
            $FreeGB = "Not Mounted";
            exec("df -k /dev/{$fileName} | grep {$fileName} | awk '{print \$4}'", $output, $return_val);
            if (count($output)) {
                $FreeGB = sprintf("%.1fGB Free", intval($output[0]) / 1024.0 / 1024.0);
                unset($output);
            } else {
                unset($output);
                if (preg_match("/^{$rootDevice}/", $fileName)) {
                    exec("df -k / | grep ' /\$' | awk '{print \$4}'", $output, $return_val);
                    if (count($output)) {
                        $FreeGB = sprintf("%.1fGB Free", intval($output[0]) / 1024.0 / 1024.0);
                    }
                    unset($output);
                }
            }
            $key = $fileName . " ";
            $type = "";
            if (preg_match("/^{$bootDevice}/", $fileName)) {
                $type .= " (boot device)";
            }
            if (preg_match("/^sd/", $fileName)) {
                $type .= " (USB)";
            }
            $key = sprintf("%s - %.1fGB (%s) %s", $fileName, $GB, $FreeGB, $type);
            $values[$key] = $fileName;
            if ($storageDevice == $fileName) {
                $found = 1;
            }
        }
    }
    if (!$found) {
        $arr = array_reverse($values, true);
        $arr["-- Select a Storage Device --"] = "/dev/sda1";
        $values = array_reverse($arr);
    }
    PrintSettingSelect('StorageDevice', 'storageDevice', 0, 1, $storageDevice, $values);
}
Ejemplo n.º 2
0
echo $pageTitle;
?>
</title>
</head>
<body>
<div id="bodyWrapper">
<?php 
include 'menu.inc';
?>
<br/>
<div id="global" class="settings">
	<fieldset>
	<legend>FPP Advanced Settings</legend>
	<table table width = "100%">
		<tr><td valign='top'><?php 
PrintSettingSelect("E1.31 Bridging Transmit Interval", "E131BridgingInterval", 1, 0, "50", array('10ms' => '10', '25ms' => '25', '40ms' => '40', '50ms' => '50', '100ms' => '100'));
?>
</td>
			<td valign='top'><b>E1.31 Bridge Mode Transmit Interval</b> - The
				default Transmit Interval in E1.31 Bridge Mode is 50ms.  This
				setting allows changing this to match the rate the player is
				outputting. <font color='#ff0000'><b>WARNING</b></font> - Some
				output devices such as the FPD do not support rates other than 50ms.</td>
		</tr>
		<tr><td colspan='2'><hr></td></tr>
		<tr><td valign='top'><?php 
PrintSettingCheckbox("E1.31 to E1.31 Bridging", "E131Bridging", 1, 0, "1", "0");
?>
</td>
			<td valign='top'><b>Enable E1.31 to E1.31 Bridging</b> - 
				<font color='#ff0000'><b>WARNING</b></font> -
Ejemplo n.º 3
0
function printLEDPanelSizeSelect()
{
    $values = array();
    $values["32x16"] = "32x16";
    $values["32x32"] = "32x32";
    PrintSettingSelect("Panel Size", "LEDPanelsSize", 1, 0, "32x16", $values, "", "LEDPanelLayoutChanged");
}