Add configurable display of WWN in device ID

This commit is contained in:
bergware
2016-09-03 14:35:14 +02:00
parent f7d8ebca4d
commit cc97a81002
5 changed files with 27 additions and 13 deletions
+6
View File
@@ -54,6 +54,12 @@ function my_disk($name) {
function my_disks($disk) {
return strpos($disk['status'],'_NP')===false;
}
function my_id($id) {
global $display;
$len = strlen($id);
$wwn = substr($id,-18);
return ($display['wwn'] || substr($wwn,0,2)!='_3' || preg_match('/.[_-]/',$wwn)) ? $id : substr($id,0,$len-18);
}
function my_word($num) {
$words = array('zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty');
return $num<count($words) ? $words[$num] : $num;