[*] небольшой рефакторинг SystemFunctions.class.php

[*] исправлен прогресс бар в диспетчере очереди (теперь показывает проценты корректно и меняет цвет в зависимости от нагрузки)
This commit is contained in:
rsgrinko committed 2023-10-08 00:42:36 +03:00
1 parent 9decebf051
commit cf50026ce5
10 files changed
+236 -230

No files matched your search

+13 -4
View File
@@ -196,12 +196,21 @@
<?php
$result['memory'] = ob_get_clean();
ob_start();
$memory = SystemFunctions::getHostMemoryInfo();
//$memory = SystemFunctions::getHostMemoryInfo();
$memory = SystemFunctions::getMemoryUse();
if ($memory->usedPercent < 30) {
$progressClass = 'progress-bar-success';
} elseif ($memory->usedPercent >= 50 && $memory->usedPercent < 80) {
$progressClass = 'progress-bar-warning';
} else {
$progressClass = 'progress-bar-danger';
}
?>
<div class="progress">
<div style="width: <?= round(($memory['free'] + $memory['swapFree']) / ($memory['total'] + $memory['swapTotal']) * 100, 2); ?>%" aria-valuemax="100" aria-valuemin="0"
aria-valuenow="40" role="progressbar" class="progress-bar progress-bar-warning">
<span class="sr-only">40% Complete (success)</span>
<div style="width: <?= round($memory->usedPercent, 2); ?>%" aria-valuemax="100" aria-valuemin="0"
aria-valuenow="<?= round($memory->usedPercent); ?>" role="progressbar" class="progress-bar <?= $progressClass; ?>">
<span><?= round($memory->usedPercent, 2); ?>%</span>
</div>
</div>
<?php
+2 -2
View File
@@ -19,7 +19,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
use Core\Helpers\SystemFunctions;
use Core\Helpers\Captcha;
use Core\Models\User;
use Core\CoreException;
@@ -27,7 +27,7 @@
$captchaCorrect = true;
if (USE_CAPTCHA) {
$captchaCorrect = isset($_REQUEST['captchaCode']) && SystemFunctions::isValidCaptcha($_REQUEST['captchaCode']);
$captchaCorrect = isset($_REQUEST['captchaCode']) && Captcha::isValidCaptcha($_REQUEST['captchaCode']);
}
if (User::isAuthorized()) {
+2 -2
View File
@@ -19,7 +19,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
use Core\Helpers\SystemFunctions;
use Core\Helpers\Captcha;
use Core\Models\User;
use Core\CoreException;
@@ -27,7 +27,7 @@
$captchaCorrect = true;
if (USE_CAPTCHA) {
$captchaCorrect = isset($_REQUEST['captchaCode']) && SystemFunctions::isValidCaptcha($_REQUEST['captchaCode']);
$captchaCorrect = isset($_REQUEST['captchaCode']) && Captcha::isValidCaptcha($_REQUEST['captchaCode']);
}
if (User::isAuthorized()) {
+1 -1
View File
@@ -726,7 +726,7 @@ h4, .h4 {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
height: 15px;
/*height: 15px;*/
margin-bottom: 15px;
}