feat(upc): error for too many disks for key

This commit is contained in:
Zack Spear
2021-09-09 18:54:09 -07:00
parent 9dda51fba2
commit 347dcc339c
3 changed files with 21 additions and 5 deletions
@@ -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
+6 -2
View File
@@ -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);
?>
File diff suppressed because one or more lines are too long