mirror of
https://github.com/unraid/webgui.git
synced 2026-05-18 04:10:03 -05:00
Merge pull request #526 from bergware/master
Added 'F1' key to toggle help text
This commit is contained in:
@@ -3,8 +3,8 @@ Title="Array Devices"
|
||||
Tag="database"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
/* Copyright 2005-2019, Lime Technology
|
||||
* Copyright 2012-2019, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -23,9 +23,9 @@ function toggle_state(device,name,action) {
|
||||
else if (name.match(/^cache/)!==null) event = 'cache_status';
|
||||
else if (name.match(/^flash/)!==null) event = 'boot_status';
|
||||
else event = 'open_status';
|
||||
$('#dev-'+name).removeClass('fa-sort-up fa-sort-down').addClass('fa-refresh fa-spin');
|
||||
$('#dev-'+name).removeClass('fa-circle fa-square fa-warning fa-times').addClass('fa-refresh fa-spin');
|
||||
} else if (device!='Clear') {
|
||||
$('[id^="dev-"]').removeClass('fa-sort-up fa-sort-down').addClass('fa-refresh fa-spin');
|
||||
$('[id^="dev-"]').removeClass('fa-circle fa-square fa-warning fa-times').addClass('fa-refresh fa-spin');
|
||||
button = '[id^=button-]';
|
||||
}
|
||||
pauseEvents(event);
|
||||
|
||||
@@ -61,7 +61,7 @@ function status_indicator() {
|
||||
case 'yellow-on': $orb = 'warning'; $color = 'yellow'; $help = 'Started, array unprotected'; break;
|
||||
case 'yellow-blink': $orb = 'warning'; $color = 'grey'; $help = 'Stopped'; break;
|
||||
}
|
||||
echo "<a class='info nohand' onclick='return false'><i class='fa fa-$orb orb $color-orb'></i><span>$help</span></a>";
|
||||
echo "<a class='info'><i class='fa fa-$orb orb $color-orb'></i><span>$help</span></a>";
|
||||
}
|
||||
function missing_cache() {
|
||||
global $disks;
|
||||
@@ -267,6 +267,11 @@ reload_page();
|
||||
<?endif;?>
|
||||
$('.tooltip_diskio').tooltipster({delay:100,trigger:'custom',triggerOpen:{mouseenter:true},triggerClose:{click:false,scroll:true,mouseleave:true}});
|
||||
toggle_diskio(true);
|
||||
<?
|
||||
$parity = $var['mdResync'] ? '<br><small>Disabled -- Parity operation is running</small>' : '';
|
||||
$mover = file_exists('/var/run/mover.pid') ? '<br><small>Disabled -- Mover is running</small>' : '';
|
||||
$btrfs = exec('pgrep -cf /sbin/btrfs') ? '<br><small>Disabled -- BTRFS operation is running</small>' : '';
|
||||
?>
|
||||
$(function(){
|
||||
var form = document.arrayOps;
|
||||
if (form.input !== undefined) selectInput(form);
|
||||
@@ -276,10 +281,7 @@ $(function(){
|
||||
<input type="hidden" name="startState" value="<?=htmlspecialchars($var['mdState'])?>">
|
||||
<input type="hidden" name="file" value="">
|
||||
<table class="array_status">
|
||||
<?$parity = $var['mdResync'] ? '<br><small>Disabled -- Parity operation is running</small>' : '';
|
||||
$mover = file_exists('/var/run/mover.pid') ? '<br><small>Disabled -- Mover is running</small>' : '';
|
||||
$btrfs = exec('pgrep -cf /sbin/btrfs') ? '<br><small>Disabled -- BTRFS operation is running</small>' : '';
|
||||
switch ($var['fsState']):
|
||||
<?switch ($var['fsState']):
|
||||
case "Started":?>
|
||||
<tr><td><?status_indicator()?><span class="strong">Started<?=(($var['startMode']=='Maintenance')?' - Maintenance Mode':'')?></span></td>
|
||||
<td><input type="button" value="Stop" onclick="stopArray(this.form)"<?if ($parity||$mover||$btrfs):?> disabled<?endif;?>></td>
|
||||
@@ -561,7 +563,6 @@ enable_stop();
|
||||
>
|
||||
> <i class='fa fa-warning orb grey-orb'></i>Array is Stopped, Parity is invalid.
|
||||
>
|
||||
|
||||
<?if ($var['fsState'] == "Stopped"):?>
|
||||
> #### Assigning Devices
|
||||
>
|
||||
|
||||
@@ -467,13 +467,13 @@ foreach ($users as $user) {
|
||||
$name = $user['name'];
|
||||
$list = "<a href=\"$path/UserEdit?name=".urlencode($name)."\" class=\"blue-text\" title=\"$name settings\">".truncate($name,20)."</a>";
|
||||
$desc = truncate($user['desc'],40);
|
||||
if ($list=='root') {
|
||||
if ($name=='root') {
|
||||
$write = '-'; $read = '-';
|
||||
} else {
|
||||
$write = 0; $read = 0;
|
||||
foreach ($shares as $share) {
|
||||
if (strpos($sec[$share['name']]['writeList'],$list)!==false) $write++;
|
||||
if (strpos($sec[$share['name']]['readList'],$list)!==false) $read++;
|
||||
if (strpos($sec[$share['name']]['writeList'],$name)!==false) $write++;
|
||||
if (strpos($sec[$share['name']]['readList'],$name)!==false) $read++;
|
||||
}
|
||||
}
|
||||
if ($user['passwd']!='yes') $list = str_replace('blue-text','orange-text',$list);
|
||||
@@ -487,13 +487,13 @@ foreach ($users as $user) {
|
||||
$name = $user['name'];
|
||||
$list = "<a href=\"$path/UserEdit?name=".urlencode($name)."\" class=\"blue-text\" title=\"$name settings\">".truncate($name,20)."</a>";
|
||||
$desc = truncate($user['desc'],40);
|
||||
if ($list=='root') {
|
||||
if ($name=='root') {
|
||||
$write = '-'; $read = '-';
|
||||
} else {
|
||||
$write = 0; $read = 0;
|
||||
foreach ($shares as $share) {
|
||||
if (strpos($sec_afp[$share['name']]['writeList'],$list)!==false) $write++;
|
||||
if (strpos($sec_afp[$share['name']]['readList'],$list)!==false) $read++;
|
||||
if (strpos($sec_afp[$share['name']]['writeList'],$name)!==false) $write++;
|
||||
if (strpos($sec_afp[$share['name']]['readList'],$name)!==false) $read++;
|
||||
}
|
||||
}
|
||||
if ($user['passwd']!='yes') $list = str_replace('blue-text','orange-text',$list);
|
||||
|
||||
@@ -607,6 +607,7 @@ $('.back_to_top').click(function(event) {
|
||||
return false;
|
||||
});
|
||||
$(function() {
|
||||
shortcut.add('F1',function(){HelpButton();});
|
||||
<?if ($var['regTy']=='unregistered'):?>
|
||||
$('#licensetype').addClass('orange-text');
|
||||
<?elseif (!in_array($var['regTy'],['Trial','Basic','Plus','Pro'])):?>
|
||||
|
||||
@@ -47,10 +47,6 @@ function device_info(&$disk,$online) {
|
||||
$fancyname = $disk['type']=='New' ? $name : my_disk($name);
|
||||
$type = $disk['type']=='Flash' || $disk['type']=='New' ? $disk['type'] : 'Device';
|
||||
$action = strpos($disk['color'],'blink')===false ? 'down' : 'up';
|
||||
if ($var['fsState']=='Started' && $type!='Flash' && strpos($disk['status'],'_NP')===false) {
|
||||
$ctrl = "<i id='dev-$name' class='fa fa-sort-$action fa-fw' style='cursor:pointer' title='Click to spin $action device' onclick=\"toggle_state('$type','$name','$action')\"></i>";
|
||||
} else
|
||||
$ctrl = "<i class='fa fa-sort-down fa-fw' style='visibility:hidden'></i>";
|
||||
switch ($disk['color']) {
|
||||
case 'green-on': $orb = 'circle'; $color = 'green'; $help = 'Normal operation, device is active'; break;
|
||||
case 'green-blink': $orb = 'circle'; $color = 'grey'; $help = 'Device is in standby mode (spun-down)'; break;
|
||||
@@ -62,7 +58,12 @@ function device_info(&$disk,$online) {
|
||||
case 'red-off': $orb = 'times'; $color = 'red'; $help = $disk['type']=='Parity' ? 'Parity device is missing' : 'Device is missing (disabled), contents emulated'; break;
|
||||
case 'grey-off': $orb = 'square'; $color = 'grey'; $help = 'Device not present'; break;
|
||||
}
|
||||
$status = "$ctrl<a class='info nohand' onclick='return false'><i class='fa fa-$orb orb $color-orb'></i><span>$help</span></a>";
|
||||
$ctrl = '';
|
||||
if ($var['fsState']=='Started' && $type!='Flash' && strpos($disk['status'],'_NP')===false) {
|
||||
$ctrl = " style='cursor:pointer' onclick=\"toggle_state('$type','$name','$action')\"";
|
||||
$help .= "<br>Click to spin $action device";
|
||||
}
|
||||
$status = "<a class='info'><i ".($ctrl?"id='dev-$name' ":"")."class='fa fa-$orb orb $color-orb'$ctrl></i><span>$help</span></a>";
|
||||
$link = ($disk['type']=='Parity' && strpos($disk['status'],'_NP')===false) ||
|
||||
($disk['type']=='Data' && $disk['status']!='DISK_NP') ||
|
||||
($disk['type']=='Cache' && $disk['status']!='DISK_NP') ||
|
||||
@@ -73,22 +74,22 @@ function device_info(&$disk,$online) {
|
||||
if (!vfs_luks($disk['fsType']))
|
||||
$luks = "<i class='nolock fa fa-lock'></i>";
|
||||
else
|
||||
$luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock orange-text'></i><span>Device to be encrypted</span></a>";
|
||||
$luks = "<a class='info'><i class='padlock fa fa-unlock orange-text'></i><span>Device to be encrypted</span></a>";
|
||||
break;
|
||||
case 1:
|
||||
if ($online) {
|
||||
$luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt green-text'></i><span>Device encrypted and unlocked</span></a>";
|
||||
$luks = "<a class='info'><i class='padlock fa fa-unlock-alt green-text'></i><span>Device encrypted and unlocked</span></a>";
|
||||
break;
|
||||
}
|
||||
/* fall thru */
|
||||
case 2:
|
||||
$luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock green-text'></i><span>Device encrypted</span></a>";
|
||||
$luks = "<a class='info'><i class='padlock fa fa-lock green-text'></i><span>Device encrypted</span></a>";
|
||||
break;
|
||||
case 3:
|
||||
$luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Device locked: wrong encryption key</span></a>";
|
||||
$luks = "<a class='info'><i class='padlock fa fa-lock red-text'></i><span>Device locked: wrong encryption key</span></a>";
|
||||
break;
|
||||
default:
|
||||
$luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Device locked: unknown error</span></a>";
|
||||
$luks = "<a class='info'><i class='padlock fa fa-lock red-text'></i><span>Device locked: unknown error</span></a>";
|
||||
break;
|
||||
} else $luks = '';
|
||||
return $status.$luks.$link;
|
||||
@@ -107,7 +108,7 @@ function device_desc(&$disk) {
|
||||
case 'Data' :
|
||||
case 'Cache' : $type = $disk['rotational'] ? ($disk['luksState'] ? 'disk-encrypted' : 'disk') : 'nvme'; break;
|
||||
}
|
||||
$log = $var['fsState']=='Started' ? "<a href=\"#\" title=\"Disk Log Information\" style=\"text-decoration:none\" onclick=\"openBox('/webGui/scripts/disk_log&arg1={$disk['device']}','Disk Log Information',600,900,false);return false\"><i class=\"icon-$type icon\"></i></a>" : "";
|
||||
$log = $var['fsState']=='Started' ? "<a class='info hand' onclick=\"openBox('/webGui/scripts/disk_log&arg1={$disk['device']}','Disk Log Information',600,900,false);return false\"><i class=\"icon-$type icon\"></i><span>Disk log information</span></a>" : "";
|
||||
return $log."<span style='font-family:bitstream'>".my_id($disk['id'])."</span> - $size $unit ({$disk['device']})";
|
||||
}
|
||||
function assignment(&$disk) {
|
||||
@@ -369,7 +370,7 @@ case 'flash':
|
||||
$disk['fsUsed'] = $disk['fsSize']-$disk['fsFree'];
|
||||
$flash = &$sec['flash']; $share = "";
|
||||
if ($var['shareSMBEnabled']=='yes' && $flash['export']=='e' && $flash['security']=='public')
|
||||
$share = "<a class='info nohand' onclick='return false'><i class='fa fa-warning fa-fw orange-text'></i><span>Flash device is set as public share<br>Please change share SMB security<br>Click on <b>FLASH</b> above this message</span></a>";
|
||||
$share = "<a class='info'><i class='fa fa-warning fa-fw orange-text'></i><span>Flash device is set as public share<br>Please change share SMB security<br>Click on <b>FLASH</b> above this message</span></a>";
|
||||
echo "<tr>";
|
||||
echo "<td>".$share.device_info($disk,true)."</td>";
|
||||
echo "<td>".device_desc($disk)."</td>";
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -15,6 +15,7 @@ a.info{position:relative}
|
||||
a.info span{display:none;white-space:nowrap;font-variant:small-caps;position:absolute;top:16px;left:12px;color:#4f4f4f;line-height:2rem;padding:5px 8px;border:1px solid #42453e;border-radius:3px;background-color:#edeaef}
|
||||
a.info:hover span{display:block;z-index:1}
|
||||
a.nohand{cursor:default}
|
||||
a.hand{cursor:pointer;text-decoration:none}
|
||||
i.spacing{margin-left:0;margin-right:10px}
|
||||
i.icon{font-size:1.6rem;margin-right:8px;vertical-align:middle}
|
||||
i.title{display:none}
|
||||
|
||||
@@ -15,6 +15,7 @@ a.info{position:relative}
|
||||
a.info span{display:none;white-space:nowrap;font-variant:small-caps;position:absolute;top:16px;left:12px;line-height:2rem;color:#f2f2f2;padding:5px 8px;border:1px solid rgba(255,255,255,0.25);border-radius:3px;background-color:rgba(25,25,25,0.95);box-shadow:0 0 3px #303030}
|
||||
a.info:hover span{display:block;z-index:1}
|
||||
a.nohand{cursor:default}
|
||||
a.hand{cursor:pointer;text-decoration:none}
|
||||
i.spacing{margin-left:-6px}
|
||||
i.icon{font-size:1.6rem;margin-right:8px;vertical-align:middle}
|
||||
i.title{margin-right:8px}
|
||||
|
||||
@@ -15,6 +15,7 @@ a.info{position:relative}
|
||||
a.info span{display:none;white-space:nowrap;font-variant:small-caps;position:absolute;top:16px;left:12px;color:#b0b0b0;line-height:2rem;padding:5px 8px;border:1px solid #82857e;border-radius:3px;background-color:#121510}
|
||||
a.info:hover span{display:block;z-index:1}
|
||||
a.nohand{cursor:default}
|
||||
a.hand{cursor:pointer;text-decoration:none}
|
||||
i.spacing{margin-left:0;margin-right:10px}
|
||||
i.icon{font-size:1.6rem;margin-right:8px;vertical-align:middle}
|
||||
i.title{display:none}
|
||||
|
||||
@@ -15,6 +15,7 @@ a.info{position:relative}
|
||||
a.info span{display:none;white-space:nowrap;font-variant:small-caps;position:absolute;top:16px;left:12px;line-height:2rem;color:#f2f2f2;padding:5px 8px;border:1px solid rgba(255,255,255,0.25);border-radius:3px;background-color:rgba(25,25,25,0.95);box-shadow:0 0 3px #303030}
|
||||
a.info:hover span{display:block;z-index:1}
|
||||
a.nohand{cursor:default}
|
||||
a.hand{cursor:pointer;text-decoration:none}
|
||||
i.spacing{margin-left:-6px}
|
||||
i.icon{font-size:1.6rem;margin-right:8px;vertical-align:middle}
|
||||
i.title{margin-right:8px}
|
||||
|
||||
Reference in New Issue
Block a user