mirror of
https://github.com/unraid/webgui.git
synced 2026-05-21 05:39:37 -05:00
feat(upc): error for too many disks for key
This commit is contained in:
@@ -445,6 +445,12 @@
|
||||
],
|
||||
],
|
||||
];
|
||||
$configErrorEnum = [ // used to map $var['configValid'] value to mimic unraid-api's `configError` ENUM
|
||||
"error" => 'UNKNOWN_ERROR',
|
||||
"invalid" => 'INVALID',
|
||||
"nokeyserver" => 'NO_KEY_SERVER',
|
||||
"withdrawn" => 'WITHDRAWN',
|
||||
];
|
||||
// feeds server vars to Vuex store in a slightly different array than state.php
|
||||
$serverstate = [
|
||||
"anonMode" => $remote['anonMode'] === 'true',
|
||||
@@ -467,6 +473,10 @@
|
||||
"state" => strtoupper(empty($var['regCheck']) ? $var['regTy'] : $var['regCheck']),
|
||||
"ts" => time(),
|
||||
"username" => $remote['username'],
|
||||
'configValid' => $var['configValid'] === 'yes',
|
||||
'configError' => $var['configValid'] !== 'yes'
|
||||
? (array_key_exists($var['configValid'], $configErrorEnum) ? $configErrorEnum[$var['configValid']] : 'UNKNOWN_ERROR')
|
||||
: null,
|
||||
];
|
||||
?>
|
||||
<unraid-user-profile
|
||||
|
||||
@@ -47,7 +47,9 @@ $arr['keyfile'] = $key_contents;
|
||||
$arr['reggen'] = $var['regGen'];
|
||||
$arr['flashproduct'] = $var['flashProduct'];
|
||||
$arr['flashvendor'] = $var['flashVendor'];
|
||||
$arr['anonMode'] = $remote['anonMode'] === 'true';
|
||||
$arr['servername'] = $var['NAME'];
|
||||
$arr['serverdesc'] = $var['COMMENT'];
|
||||
$arr['internalip'] = $_SERVER['SERVER_ADDR'];
|
||||
$arr['internalport'] = $_SERVER['SERVER_PORT'];
|
||||
$arr['plgVersion'] = 'base-'.$var['version'];
|
||||
@@ -55,8 +57,10 @@ $arr['protocol'] = $_SERVER['REQUEST_SCHEME'];
|
||||
$arr['locale'] = $_SESSION['locale'] ? $_SESSION['locale'] : 'en_US';
|
||||
$arr['expiretime']=1000*($var['regTy']=='Trial'||strstr($var['regTy'],'expired')?$var['regTm2']:0);
|
||||
$arr['uptime']=1000*(time() - round(strtok(exec("cat /proc/uptime"),' ')));
|
||||
$arr['serverdesc'] = $_SERVER['COMMENT'];
|
||||
$arr['anonMode'] = $remote['anonMode'] === 'true';
|
||||
$arr['configValid'] = $var['configValid'] === 'yes';
|
||||
$arr['configError'] = !$arr['configValid']
|
||||
? (array_key_exists($var['configValid'], $configErrorEnum) ? $configErrorEnum[$var['configValid']] : 'UNKNOWN_ERROR')
|
||||
: null;
|
||||
|
||||
echo json_encode($arr);
|
||||
?>
|
||||
|
||||
+5
-3
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user