mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 16:29:45 -05:00
Support selective emhttpd state update.
This commit is contained in:
@@ -66,6 +66,7 @@ foreach ($custom as $network) {
|
||||
|
||||
<form markdown="1" id="settingsForm" method="POST" action="/update.php" target="progressFrame">
|
||||
<input type="hidden" name="#file" value="<?=$docker_cfgfile;?>">
|
||||
<input type="hidden" name="#command" value="/plugins/dynamix/scripts/refresh_emhttp_state" />
|
||||
Enable Docker:
|
||||
: <select id="DOCKER_ENABLED" name="DOCKER_ENABLED" class="narrow">
|
||||
<?= mk_option($dockercfg['DOCKER_ENABLED'], 'no', 'No'); ?>
|
||||
|
||||
@@ -104,6 +104,7 @@ foreach ($arrSyslinuxCfg as &$strSyslinuxCfg) {
|
||||
<?endif;?>
|
||||
<form id="settingsForm" method="POST" action="/update.php" target="progressFrame">
|
||||
<input type="hidden" name="#file" value="<?=htmlspecialchars($domain_cfgfile)?>" />
|
||||
<input type="hidden" name="#command" value="/plugins/dynamix/scripts/refresh_emhttp_state" />
|
||||
|
||||
<dl>
|
||||
<dt>Enable VMs:</dt>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
Menu="Tasks:1"
|
||||
Type="xmenu"
|
||||
Tabs="false"
|
||||
Tabs="false"
|
||||
---
|
||||
<?PHP
|
||||
refresh_emhttp_state();
|
||||
?>
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
Menu="Tasks:1"
|
||||
Type="xmenu"
|
||||
Type="xmenu"
|
||||
---
|
||||
<?PHP
|
||||
refresh_emhttp_state();
|
||||
?>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?PHP
|
||||
// The cpuload.ini file is generated by emhttpd just before the 'heartbeat' event callout.
|
||||
// todo: having emhttpd directly publish json would be more efficient
|
||||
require_once "/usr/local/emhttp/webGui/include/publish.php";
|
||||
$data = @parse_ini_file("/var/local/emhttp/cpuload.ini", true);
|
||||
if ($data !== FALSE) {
|
||||
publish("cpuload", json_encode($data, JSON_NUMERIC_CHECK));
|
||||
}
|
||||
?>
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/php -q
|
||||
<?PHP
|
||||
/* Copyright 2005-2016, Lime Technology
|
||||
* Copyright 2012-2016, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/publish.php";
|
||||
refresh_emhttp_state();
|
||||
?>
|
||||
@@ -22,7 +22,6 @@ require_once "$docroot/webGui/include/publish.php";
|
||||
extract(parse_plugin_cfg('dynamix',true));
|
||||
|
||||
// Read emhttp status
|
||||
refresh_emhttp_state();
|
||||
$var = parse_ini_file('state/var.ini');
|
||||
$sec = parse_ini_file('state/sec.ini',true);
|
||||
$devs = parse_ini_file('state/devs.ini',true);
|
||||
@@ -60,7 +59,7 @@ $myPage = $site[basename($path)];
|
||||
$pageroot = $docroot.'/'.dirname($myPage['file']);
|
||||
$update = true; // set for legacy
|
||||
|
||||
// Maybe delete stale share size files
|
||||
// hack: maybe delete stale share size files
|
||||
if ($myPage['name'] != 'Shares')
|
||||
foreach(glob('/var/local/emhttp/*.ssz*', GLOB_NOSORT) as $sszfile) @unlink($sszfile);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user