1
0

ajout en cours d'une fonctiondeleteDevice

This commit is contained in:
2022-06-21 08:57:58 +02:00
parent b3f7171421
commit 566fc0e40c
3 changed files with 33 additions and 1 deletions

View File

@ -29,6 +29,7 @@ function apiDashboard($socket, $n="Général")
{
logger(DEBUG, _("Write Access OK ") . ($propertyObject["access"] & 2), __FILE__ . ":" . __LINE__);
$response .= "     " . displayChoice($device, $property, $value);
$response .= "   " . displayMethod($device, $property);
}
if(($propertyObject["access"] & 4))
{
@ -124,9 +125,16 @@ function displayChoice($device, $propertyName, $value)
default:
logger(DEBUG, "type of property not recognized:" . $propertyObject["type"] , __FILE__ . ":" . __LINE__);
}
return $formHTML;
}
function displayMethod($device, $property)
{
$html = '<input type="button" id="' . $device->topic ."/" . $device->friendlyName . "/" . $propertyName . "/" . strtolower($value) . '" method="' . IDLE . "\" onmouseup=\"setPropertyMethod('" . $device->topic . "', '" . $device->friendlyName . "', '" . IDLE . "', '" . $propertyName . "')\">";
$html = '<input type="button" id="' . $device->topic ."/" . $device->friendlyName . "/" . $propertyName . "/" . strtolower($value) . '" method="' . AUTO . "\" onmouseup=\"setPropertyMethod('" . $device->topic . "', '" . $device->friendlyName . "', '" . AUTO . "', '" . $propertyName . "')\">";
$html = '<input type="button" id="' . $device->topic ."/" . $device->friendlyName . "/" . $propertyName . "/" . strtolower($value) . '" method="' . MANUAL . "\" onmouseup=\"setPropertyMethod('" . $device->topic . "', '" . $device->friendlyName . "', '" . MANUAL . "', '" . $propertyName . "')\">";
}
function mkHTML($device, $propertyName, $choice)
{
$html = "";
@ -184,6 +192,7 @@ function apiBrowse($socket, $argList, $page="/browse")
{
require_once "apiserver/javascript.php";
$response .= insertJavascript();
foreach($device->properties as $key => $value)
{
$response = displayProperty($device, $key, $value, $response);
@ -527,7 +536,13 @@ function apiHookActive($argList, $status)
{
return _("Hook does not exists");
}
}
function deleteDevice($argList)
{
global $indexFriendlyNames;
logger(DEBUG, _("removing ") . $indexFriendlyNames[$argList["fn"]]->friendlyname , __FILE__ . ":" . __LINE__);
//unset($indexFriendlyNames[$argList["fn"]]);
}
/*
function apiDisplayByType($argList)