mirror of
https://github.com/unraid/webgui.git
synced 2026-04-28 13:59:21 -05:00
WG updates using Nchan
This commit is contained in:
@@ -12,20 +12,9 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
function curl_socket($socket, $url, $postdata = NULL) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $socket);
|
||||
if ($postdata !== NULL) {
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
function publish($endpoint, $message) {
|
||||
curl_socket("/var/run/nginx.socket", "http://localhost/pub/$endpoint?buffer_length=1", $message);
|
||||
}
|
||||
$docroot = '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/publish.php";
|
||||
|
||||
function my_scale($value, &$unit) {
|
||||
$units = [' ','Ki','Mi','Gi','Ti','Pi','Ei','Zi','Yi'];
|
||||
$size = count($units);
|
||||
|
||||
Reference in New Issue
Block a user