@@ -306,6 +306,16 @@ function get_pool_data_metrics(?array $poolDisk, string $poolName='', array $dis
306306 ];
307307}
308308
309+ function resolve_boot_pool_mode (string $ poolName , array $ allDisks =[]): string
310+ {
311+ $ firstPoolDisk = ($ poolName !== '' && !empty ($ allDisks ))
312+ ? get_first_pool_disk_in_disks ($ poolName , $ allDisks )
313+ : null ;
314+ $ mode = strtolower (trim ((string )_var ($ firstPoolDisk ,'bootPool ' ,'' )));
315+ if (!in_array ($ mode ,['no ' ,'yes ' ,'dedicated ' ],true )) $ mode = 'no ' ;
316+ return $ mode ;
317+ }
318+
309319function pool_status_html (string $ poolName , array $ poolstatusData , array $ disks ): string
310320{
311321 if (!$ poolName || empty ($ poolstatusData ['pools ' ][$ poolName ])) return '' ;
@@ -328,7 +338,7 @@ function pool_status_html(string $poolName, array $poolstatusData, array $disks)
328338 return " <a href=' $ deviceUrl' title=' " ._ ('View pool details ' )."'>( $ displayText)</a> " ;
329339}
330340
331- function pool_function_row (string $ label , ?array $ poolDisk , ?array $ firstMember , array $ metrics , string $ poolName ='' , array $ poolstatusData =[], bool $ showSummary =false , array $ fsOverride =[], bool $ showPoolStatusInTitle =true , string $ statusPoolName ='' , string $ summaryDisplayName ='' , bool $ summaryShowView =true ): string
341+ function pool_function_row (string $ label , ?array $ poolDisk , ?array $ firstMember , array $ metrics , string $ poolName ='' , array $ poolstatusData =[], bool $ showSummary =false , array $ fsOverride =[], bool $ showPoolStatusInTitle =true , string $ statusPoolName ='' , string $ summaryDisplayName ='' , bool $ summaryShowView =true , string $ summaryRowId = '' ): string
332342{
333343 global $ disks ;
334344 $ disk = $ poolDisk ?: ($ firstMember ?? []);
@@ -359,7 +369,8 @@ function pool_function_row(string $label, ?array $poolDisk, ?array $firstMember,
359369 $ title .= pool_status_html ($ statusPool , $ poolstatusData , $ disks );
360370 }
361371 $ echo = [];
362- $ rowId = ($ showSummary && $ poolName !== '' ) ? " id='pool_ " .htmlspecialchars ($ poolName , ENT_QUOTES )."' " : '' ;
372+ $ anchorId = $ summaryRowId !== '' ? $ summaryRowId : ($ poolName !== '' ? 'pool_ ' .$ poolName : '' );
373+ $ rowId = ($ showSummary && $ anchorId !== '' ) ? " id=' " .htmlspecialchars ($ anchorId , ENT_QUOTES )."' " : '' ;
363374 $ echo [] = "<tr class='pool_header' {$ rowId }> " ;
364375 if ($ showSummary && $ poolName !== '' ) {
365376 $ echo [] = "<td> " .device_info ($ disk ,true ,$ poolName ,$ poolstatusData ,[
@@ -1051,13 +1062,9 @@ while (true) {
10511062 if ($ poolIndex === false && $ poolName !== '' ) {
10521063 $ poolIndex = array_search (prefix ($ poolName ), $ pools , true );
10531064 }
1054- if ($ poolIndex !== false ) {
1055- $ poolAnchor = "/Main#pool_device " .$ poolIndex ;
1056- } else {
1057- $ poolAnchor = $ poolName !== '' ? "/Main#pool_ " .$ poolName : '' ;
1058- }
1065+ $ poolAnchor = $ poolName !== '' ? "/Main#pool_boot_ " .$ poolName : '' ;
10591066 $ poolLink = $ poolAnchor !== ''
1060- ? "<a href= \"" .htmlspecialchars ($ poolAnchor , ENT_QUOTES )."\"> " . _ ($ poolLabel ,3 )."</a> "
1067+ ? "<a href= \"" .htmlspecialchars ($ poolAnchor , ENT_QUOTES )."\" title= \"" . htmlspecialchars ($ poolLabel , ENT_QUOTES )."\" ><i class='icon-disk icon'></i> </a> "
10611068 : '' ;
10621069 $ desc = $ poolLink !== ''
10631070 ? sprintf (_ ('%s -> %s ' ), _ ('Boot device ' ), $ poolLink )
@@ -1101,6 +1108,7 @@ while (true) {
11011108 $ off = false ;
11021109 $ poolDisk = $ Cache [$ pool ] ?? null ;
11031110 $ firstMember = get_pool_first_member ($ pool , $ Cache , $ devicePools );
1111+ $ bootPoolMode = resolve_boot_pool_mode ($ root , $ disks );
11041112 $ bootDisk = find_boot_disk_for_pool ($ pool , $ Boot , $ Cache );
11051113 $ bootPoolName = prefix (_var ($ bootDisk ,'name ' ,'' ));
11061114 $ bootMetrics = get_boot_pool_metrics ($ Boot , $ bootPoolName , $ bootDisk );
@@ -1114,13 +1122,13 @@ while (true) {
11141122 }
11151123 $ poolDeviceUrl = "/Main/Device?name= " .urlencode ($ pool );
11161124 $ poolLink = "<a href= \"$ poolDeviceUrl \"> " ._ ($ poolLabel ,3 )."</a> " ;
1117- $ summaryName = $ poolLink ;
1125+ $ dataSummaryName = $ poolLink ;
11181126 if (!empty ($ bootDisk )) {
11191127 $ bootPoolName = prefix (_var ($ bootDisk ,'name ' ,'' ));
1120- $ bootLabel = _ (" Internal Boot " );
1128+ $ bootLabel = _ ($ bootPoolMode === ' dedicated ' ? ' Internal Boot(Dedicated) ' : ' Internal Boot ' );
11211129 $ bootDeviceUrl = "/Main/Boot?name= " .urlencode ($ bootPoolName );
11221130 $ bootLink = "<a href= \"$ bootDeviceUrl \"> " ._ ($ bootLabel ,3 )."</a> " ;
1123- $ summaryName = $ poolLink . " / " . $ bootLink ;
1131+ $ bootSummaryName = $ bootLink ;
11241132 $ bootFsInfo = get_boot_pool_fs_info ($ Boot , $ bootPoolName );
11251133 $ bootFsType = _var ($ bootDisk ,'fsType ' ,'' ) ?: _var ($ bootFsInfo ,'fsType ' ,'' );
11261134 $ bootFsStatus = _var ($ bootDisk ,'fsStatus ' ,'' ) ?: _var ($ bootFsInfo ,'fsStatus ' ,'' );
@@ -1143,27 +1151,30 @@ while (true) {
11431151 ],
11441152 true ,
11451153 $ bootPoolName ,
1146- $ summaryName ,
1147- false
1154+ $ bootSummaryName ,
1155+ false ,
1156+ 'pool_boot_ ' .$ pool
11481157 );
11491158 if ($ bootRow !== '' ) $ echo [$ a ][] = $ bootRow ;
11501159 }
1151- $ dataLabel = isSubpool ($ pool ) ? _ ('ZFS subpool ' ) : _ ('Data Partition ' );
1152- $ dataRow = pool_function_row (
1153- '<i class="fa fa-bullseye title"></i> ' .$ dataLabel ,
1154- $ poolDisk ,
1155- $ firstMember ,
1156- $ dataMetrics ,
1157- $ pool ,
1158- $ poolstatus ,
1159- empty ($ bootDisk ),
1160- [],
1161- true ,
1162- '' ,
1163- empty ($ bootDisk ) ? $ summaryName : '' ,
1164- false
1165- );
1166- if ($ dataRow !== '' ) $ echo [$ a ][] = $ dataRow ;
1160+ if ($ bootPoolMode !== 'dedicated ' ) {
1161+ $ dataLabel = isSubpool ($ pool ) ? _ ('ZFS subpool ' ) : _ ('Data Partition ' );
1162+ $ dataRow = pool_function_row (
1163+ '<i class="fa fa-bullseye title"></i> ' .$ dataLabel ,
1164+ $ poolDisk ,
1165+ $ firstMember ,
1166+ $ dataMetrics ,
1167+ $ pool ,
1168+ $ poolstatus ,
1169+ empty ($ bootDisk ),
1170+ [],
1171+ true ,
1172+ '' ,
1173+ $ dataSummaryName ,
1174+ false
1175+ );
1176+ if ($ dataRow !== '' ) $ echo [$ a ][] = $ dataRow ;
1177+ }
11671178 $ memberIndex = 1 ;
11681179 foreach ($ Cache as $ disk ) if (prefix (_var ($ disk ,'name ' ))==$ pool ) {
11691180 $ memberDeviceUrl = "/Main/Device?name= " .urlencode (_var ($ disk ,'name ' ,$ pool ));
@@ -1232,13 +1243,14 @@ while (true) {
12321243 }
12331244 $ poolDisk = $ Cache [$ pool ] ?? null ;
12341245 $ firstMember = get_pool_first_member ($ pool , $ Cache , $ devicePools );
1246+ $ bootPoolMode = resolve_boot_pool_mode ($ root , $ disks );
12351247 $ bootDisk = find_boot_disk_for_pool ($ pool , $ Boot , $ Cache );
12361248 $ bootPoolName = prefix (_var ($ bootDisk ,'name ' ,'' ));
12371249 $ bootMetrics = get_boot_pool_metrics ($ Boot , $ bootPoolName , $ bootDisk );
12381250 $ dataMetrics = get_pool_data_metrics ($ poolDisk , $ pool , $ disks );
12391251 if (!empty ($ bootDisk )) {
12401252 $ bootPoolName = prefix (_var ($ bootDisk ,'name ' ,'' ));
1241- $ bootLabel = _ (" Internal Boot " );
1253+ $ bootLabel = _ ($ bootPoolMode === ' dedicated ' ? ' Internal Boot(Dedicated) ' : ' Internal Boot ' );
12421254 $ bootDeviceUrl = "/Main/Boot?name= " .urlencode ($ bootPoolName );
12431255 $ bootDir = _var ($ bootDisk ,'fsMountpoint ' ,'/boot ' );
12441256 $ bootBrowseUrl = $ bootDir !== '' ? "/Main/Browse?dir= " .htmlspecialchars ($ bootDir ) : $ bootDeviceUrl ;
@@ -1255,7 +1267,8 @@ while (true) {
12551267 : "<a class='view' href= \"$ poolBrowseUrl \"><i class= \"icon-u-tab \" title= \"" ._ ('Browse ' )." $ poolDir \"></i></a> " ;
12561268 $ poolLink = "<a href= \"$ poolDeviceUrl \"> " ._ ($ poolLabel ,3 )."</a> " ;
12571269 $ flashWarn = flash_smb_warning_html (_var ($ bootDisk ,'name ' ,'' ));
1258- $ summaryName = $ poolIcon .$ poolLink ." / " .$ bootIcon .$ bootLink .$ flashWarn ;
1270+ $ bootSummaryName = $ bootIcon .$ bootLink .$ flashWarn ;
1271+ $ dataSummaryName = $ poolLink ;
12591272 $ bootFsInfo = get_boot_pool_fs_info ($ Boot , $ bootPoolName );
12601273 $ bootFsType = _var ($ bootDisk ,'fsType ' ,'' ) ?: _var ($ bootFsInfo ,'fsType ' ,'' );
12611274 $ bootFsStatus = _var ($ bootDisk ,'fsStatus ' ,'' ) ?: _var ($ bootFsInfo ,'fsStatus ' ,'' );
@@ -1278,33 +1291,36 @@ while (true) {
12781291 ],
12791292 true ,
12801293 $ bootPoolName ,
1281- $ summaryName ,
1282- false
1294+ $ bootSummaryName ,
1295+ false ,
1296+ 'pool_boot_ ' .$ pool
12831297 );
12841298 if ($ bootRow !== '' ) $ echo [$ a ][] = $ bootRow ;
12851299 }
12861300 if (empty ($ bootDisk )) {
12871301 $ poolLabel = ucfirst ($ pool );
12881302 $ poolDeviceUrl = "/Main/Device?name= " .urlencode ($ pool );
12891303 $ poolLink = "<a href= \"$ poolDeviceUrl \"> " ._ ($ poolLabel ,3 )."</a> " ;
1290- $ summaryName = $ poolLink ;
1304+ $ dataSummaryName = $ poolLink ;
1305+ }
1306+ if ($ bootPoolMode !== 'dedicated ' ) {
1307+ $ dataLabel = isSubpool ($ pool ) ? _ ('ZFS subpool ' ) : _ ('Data Partition ' );
1308+ $ dataRow = pool_function_row (
1309+ '<i class="fa fa-bullseye title"></i> ' .$ dataLabel ,
1310+ $ poolDisk ,
1311+ $ firstMember ,
1312+ $ dataMetrics ,
1313+ $ pool ,
1314+ $ poolstatus ,
1315+ true ,
1316+ [],
1317+ true ,
1318+ '' ,
1319+ $ dataSummaryName ,
1320+ true
1321+ );
1322+ if ($ dataRow !== '' ) $ echo [$ a ][] = $ dataRow ;
12911323 }
1292- $ dataLabel = isSubpool ($ pool ) ? _ ('ZFS subpool ' ) : _ ('Data Partition ' );
1293- $ dataRow = pool_function_row (
1294- '<i class="fa fa-bullseye title"></i> ' .$ dataLabel ,
1295- $ poolDisk ,
1296- $ firstMember ,
1297- $ dataMetrics ,
1298- $ pool ,
1299- $ poolstatus ,
1300- empty ($ bootDisk ),
1301- [],
1302- true ,
1303- '' ,
1304- empty ($ bootDisk ) ? $ summaryName : '' ,
1305- true
1306- );
1307- if ($ dataRow !== '' ) $ echo [$ a ][] = $ dataRow ;
13081324 $ memberIndex = 1 ;
13091325 foreach ($ Cache as $ disk ) if (prefix (_var ($ disk ,'name ' ))==$ pool ) {
13101326 $ memberDeviceUrl = "/Main/Device?name= " .urlencode (_var ($ disk ,'name ' ,$ pool ));
0 commit comments