mirror of
https://github.com/unraid/webgui.git
synced 2026-05-06 20:30:50 -05:00
PHP8 support
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Menu="Device:2 New:2"
|
||||
Title="Self-Test"
|
||||
Tag="wrench"
|
||||
Cond="strpos($disks[$name]['status']??'','_NP')===false"
|
||||
Cond="strpos(_var($disks[$name],'status'),'_NP')===false"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2023, Lime Technology
|
||||
@@ -17,9 +17,9 @@ Cond="strpos($disks[$name]['status']??'','_NP')===false"
|
||||
?>
|
||||
<?
|
||||
$date = date('Ymd-Hi');
|
||||
$file = $disk['id']."-$date.txt";
|
||||
$zip = str_replace(' ','_',strtolower($var['NAME']))."-smart-$date.zip";
|
||||
$long = isset($disks[$name]['spindownDelay']) && ($disks[$name]['spindownDelay']==0 || ($disks[$name]['spindownDelay']==-1 && $var['spindownDelay']==0));
|
||||
$file = _var($disk,'id','no-id')."-$date.txt";
|
||||
$zip = str_replace(' ','_',strtolower(_var($var,'NAME','tower')))."-smart-$date.zip";
|
||||
$long = _var($disks[$name],'spindownDelay')==0 || (_var($disks[$name],'spindownDelay')==-1 && _var($var,'spindownDelay')==0);
|
||||
?>
|
||||
_(Download SMART report)_:
|
||||
: <input type='button' value="_(Download)_" onclick='saveSMART()'>
|
||||
@@ -79,7 +79,7 @@ function testUpdate(init) {
|
||||
if ($('#smart_selftest').length) {
|
||||
$('#smart_selftest').html('<i class="fa fa-camera"></i> _(SMART self-test in progress)_...');
|
||||
}
|
||||
if (!init) timers.testUpdate = setTimeout(testUpdate, 3000);
|
||||
if (!init) timers.testUpdate = setTimeout(testUpdate,3000);
|
||||
} else {
|
||||
if ($('#smart_selftest').length) $('#smart_selftest').html('');
|
||||
$('#short_test').val("_(Start)_");
|
||||
|
||||
@@ -154,7 +154,7 @@ function geturls_certdetails($file, $hostname, $ip="") {
|
||||
// replace wildcard with hostname
|
||||
$cn = str_replace('*', $hostname, $cn);
|
||||
$cn_priv = $cn;
|
||||
if (strpos($data??'', "Self-signed") !== false){
|
||||
if (strpos($data, "Self-signed") !== false){
|
||||
$type = 'self-signed';
|
||||
} else {
|
||||
$type = 'user-provided';
|
||||
|
||||
@@ -23,7 +23,7 @@ $login_locale = _var($display,'locale');
|
||||
require_once "$docroot/webGui/include/Translations.php";
|
||||
|
||||
function dmidecode($key, $n, $all=true) {
|
||||
$entries = array_filter(explode($key,shell_exec("dmidecode -qt$n")??""));
|
||||
$entries = array_filter(explode($key,shell_exec("dmidecode -qt$n")?:''));
|
||||
$properties = [];
|
||||
foreach ($entries as $entry) {
|
||||
$property = [];
|
||||
@@ -152,8 +152,8 @@ $list[] = "<tr><td>$memory</td><td>$memory_installed $unit $memory_type $ecc("._
|
||||
|
||||
foreach ($memory_devices as $device) {
|
||||
if (empty($device['Type']) || $device['Type']=='Unknown') continue;
|
||||
$size = preg_replace('/( .)B$/','$1iB',$device['Size']??'0');
|
||||
$list[] = "<tr class='ram'><td></td><td>".$device['Locator'].": ".($device['Manufacturer']??'')." ".($device['Part Number']??'').", $size ".($device['Type']??'')." @ ".($device['Configured Memory Speed']??'')."</td></tr>";
|
||||
$size = preg_replace('/( .)B$/','$1iB',_var($device,'Size',0));
|
||||
$list[] = "<tr class='ram'><td></td><td>".$device['Locator'].": "._var($device,'Manufacturer')." "._var($device,'Part Number').", $size "._var($device,'Type')." @ "._var($device,'Configured Memory Speed')."</td></tr>";
|
||||
}
|
||||
|
||||
exec("ls --indicator-style=none /sys/class/net|grep -Po '^(bond|eth)\d+$'",$sPorts);
|
||||
|
||||
Reference in New Issue
Block a user