mirror of
https://github.com/unraid/webgui.git
synced 2026-02-14 13:08:56 -06:00
Merge pull request #68 from bergware/master
Removed anchor symbol from archived notifications
This commit is contained in:
@@ -157,14 +157,15 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="button" value="History" onclick="openBox('/webGui/include/ParityHistory.php','Parity/Read-Check History',490,430,false)"></td>
|
||||
<td>Last check incomplete on <strong><?=my_time($var['sbSynced2']).day_count($var['sbSynced2'])?></strong>, finding <strong><?=$var['sbSyncErrs']?></strong> error<?=$var['sbSyncErrs']==1?'':'s'?>.
|
||||
<td>Last check incomplete on <strong><?=my_time($var['sbSynced2']).day_count($var['sbSynced2'])?></strong><?if ($var['sbSynced2']):?>, finding <strong><?=$var['sbSyncErrs']?></strong> error<?=$var['sbSyncErrs']==1?'':'s'?>.<?endif;?>
|
||||
<br><i class="fa fa-dot-circle-o icon"></i><small>Error code: <?=my_error($var['sbSyncExit'])?></small></td>
|
||||
</tr>
|
||||
<? elseif ($var['sbSynced']==0):?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><input type="button" value="History" onclick="openBox('/webGui/include/ParityHistory.php','Parity/Read-Check History',490,430,false)"></td>
|
||||
<td>Last checked on <strong><?=my_time(0).day_count(0)?></strong>
|
||||
<br><i class="fa fa-clock-o icon"></i><small>Duration: <?=my_check(0,0)?></small></td>
|
||||
</tr>
|
||||
<? elseif ($var['sbSynced2']==0):?>
|
||||
<tr>
|
||||
|
||||
@@ -437,6 +437,7 @@ SMART controller type:
|
||||
<?=mk_option($disk['smType'], "-1", "Use default")?>
|
||||
<?=mk_option($disk['smType'], "", "Automatic")?>
|
||||
<?=mk_option($disk['smType'], "-d ata", "ATA")?>
|
||||
<?=mk_option($disk['smType'], "-d sat", "SATA")?>
|
||||
<?=mk_option($disk['smType'], "-d scsi", "SCSI")?>
|
||||
<?=mk_option($disk['smType'], "-d 3ware", "3Ware")?>
|
||||
<?=mk_option($disk['smType'], "-d areca", "Areca")?>
|
||||
|
||||
@@ -241,6 +241,7 @@ Default SMART controller type:
|
||||
: <select name="smType" size="1" onchange="setIndex(this.form)">
|
||||
<?=mk_option($var['smType'], "", "Automatic")?>
|
||||
<?=mk_option($var['smType'], "-d ata", "ATA")?>
|
||||
<?=mk_option($var['smType'], "-d sat", "SATA")?>
|
||||
<?=mk_option($var['smType'], "-d scsi", "SCSI")?>
|
||||
<?=mk_option($var['smType'], "-d 3ware", "3Ware")?>
|
||||
<?=mk_option($var['smType'], "-d areca", "Areca")?>
|
||||
|
||||
@@ -143,7 +143,7 @@ function checkNetworkSettings(form,index) {
|
||||
var none = netmask.find('option[value="none"]');
|
||||
if (none.length) {netmask.val('255.255.255.0'); none.remove();}
|
||||
}
|
||||
if (form.GATEWAY !== undefined) {form.GATEWAY.disabled = disabled; form.GATEWAY.required = !disabled;}
|
||||
if (index==0 && form.GATEWAY !== undefined) {form.GATEWAY.disabled = disabled; form.GATEWAY.required = !disabled;}
|
||||
if (dns) {
|
||||
form.DHCP_KEEPRESOLV.value = 'yes';
|
||||
form.DHCP_KEEPRESOLV.disabled = !disabled;
|
||||
|
||||
@@ -33,7 +33,7 @@ function prepareNewConfig(form) {
|
||||
}
|
||||
}
|
||||
// set preset filter to populate slots
|
||||
$.post('/webGui/include/PrepareDisks.php',{preset:preset});
|
||||
$.post('/webGui/include/PrepareDisks.php',{preset:preset},function(){form.submit();});
|
||||
}
|
||||
<?if (file_exists('/var/tmp/disks.ini')):?>
|
||||
function assign(id,disk) {
|
||||
@@ -67,7 +67,8 @@ Use the *'Retain current configuration'* selection to populate the desired disk
|
||||
effect of making it ***impossible*** to rebuild an existing failed drive - you have been warned!
|
||||
|
||||
<hr>
|
||||
<form name="newConfig" method="POST" action="/update.htm" target="progressFrame" onsubmit="prepareNewConfig(this)">
|
||||
<form name="newConfig" method="POST" action="/update.htm" target="progressFrame">
|
||||
<input type="hidden" name="cmdInit" value="Apply">
|
||||
<span class="indent">Retain current configuration:</span>
|
||||
<select id="s1" name="preset" size="1" multiple="multiple" style="display:none">
|
||||
<option value=''>All</option>
|
||||
@@ -76,10 +77,10 @@ effect of making it ***impossible*** to rebuild an existing failed drive - you h
|
||||
<?=mk_option_check(0,'Cache','Cache slots')?>
|
||||
</select>
|
||||
<br>
|
||||
<span class="indent"><input type="submit" name="cmdInit" value=" Apply " disabled><input type="button" value=" Done " onclick="done()"></span>
|
||||
<span class="indent"><input type="button" name="apply" value=" Apply " onclick="prepareNewConfig(this.form)" disabled><input type="button" value=" Done " onclick="done()"></span>
|
||||
<?if ($disabled):?>
|
||||
<?=$newarray ? 'Array has been <b>RESET</b> (please configure)' : 'Array must be <b>STOPPED</b>'?>
|
||||
<?else:?>
|
||||
<input type="checkbox" onClick="cmdInit.disabled=!this.checked"><small>Yes I want to do this</small>
|
||||
<input type="checkbox" onClick="apply.disabled=!this.checked"><small>Yes I want to do this</small>
|
||||
<?endif;?>
|
||||
</form>
|
||||
|
||||
@@ -23,9 +23,15 @@ function clone_list($disk) {
|
||||
table.settings{width:83.3%;}
|
||||
table.settings tr td:first-child{width:40%;}
|
||||
</style>
|
||||
|
||||
> *Clone destinations* is used to copy the SMB security settings of the current selected share to one or more other existing shares.
|
||||
>
|
||||
> Select the desired destinations and press **Clone** to copy the SMB security settings to those shares.
|
||||
|
||||
<div style="float:right">
|
||||
<span style="display:block;font-weight:bold;margin-left:2px;margin-bottom:4px">Clone destinations</span>
|
||||
<select id="s4" name="smbClone" size="1" multiple="multiple" style="display:none">
|
||||
<option>All</option>
|
||||
<?
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name) echo mk_option("", $list['name'], my_disk($list['name']));
|
||||
@@ -34,9 +40,10 @@ if (isset($disks[$name])) {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div style="margin-top:10px;text-align:right"><input type="button" id="clonesmb" value="Clone" onclick="cloneSMB()" style="margin-right:0"></div>
|
||||
</div>
|
||||
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onchange="$('#clonesmb').prop('disabled',true)">
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onchange="$('#clonesmb').prop('disabled',true);$('#s4').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareName" value="<?=$name?>">
|
||||
|
||||
Share name:
|
||||
@@ -70,14 +77,20 @@ Security:
|
||||
> read-only access.
|
||||
|
||||
|
||||
: <input type="submit" name="changeShareSecurity" value="Apply"><input type="button" value="Done" onclick="done()"><input type="button" id="clonesmb" value="Clone" onclick="cloneSMB()">
|
||||
: <input type="submit" name="changeShareSecurity" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
</form>
|
||||
|
||||
<?if ($sec[$name]['security'] == 'secure'):?>
|
||||
<div id="title" class="nocontrol"><dt>User Access</dt><i>Guests have <b>read-only</b> access.</i></div>
|
||||
|
||||
> *Clone destinations* is used to copy the User access settings of the current share to one or more other existing shares.
|
||||
>
|
||||
> Select the desired destinations and press **Clone** to copy the User access settings to those shares.
|
||||
|
||||
<div style="float:right">
|
||||
<span style="display:block;font-weight:bold;margin-left:2px;margin-bottom:4px">Clone destinations</span>
|
||||
<select id="s5" name="smbClone" size="1" multiple="multiple" style="display:none">
|
||||
<option>All</option>
|
||||
<?
|
||||
if (isset($disks[$name])) {
|
||||
foreach ($disks as $list) if ($list['name']!=$name && ($list['type']=='Data' || $list['name']=='cache') && $sec[$list['name']]['security']=='secure') echo mk_option("", $list['name'], my_disk($list['name']));
|
||||
@@ -86,20 +99,28 @@ if (isset($disks[$name])) {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div style="margin-top:10px;text-align:right"><input type="button" id="cloneuser" value="Clone" onclick="cloneUser()" style="margin-right:0"></div>
|
||||
</div>
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onchange="$('#cloneuser').prop('disabled',true)">
|
||||
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onchange="$('#cloneuser').prop('disabled',true);$('#s5').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareName" value="<?=$name?>">
|
||||
<?input_secure_users($sec);?>
|
||||
|
||||
|
||||
: <input type="submit" name="changeShareAccess" value="Apply"><input type="button" value="Done" onclick="done()"><input type="button" id="cloneuser" value="Clone" onclick="cloneUser()">
|
||||
: <input type="submit" name="changeShareAccess" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
</form>
|
||||
|
||||
<?elseif ($sec[$name]['security'] == 'private'):?>
|
||||
<div id="title" class="nocontrol"><dt>User Access</dt><i>Guests have <b>no</b> access.</i></div>
|
||||
|
||||
> *Clone destinations* is used to copy the User access settings of the current share to one or more other existing shares.
|
||||
>
|
||||
> Select the desired destinations and press **Clone** to copy the User access settings to those shares.
|
||||
|
||||
<div style="float:right">
|
||||
<span style="display:block;font-weight:bold;margin-left:2px;margin-bottom:4px">Clone destinations</span>
|
||||
<select id="s5" name="smbClone" size="1" multiple="multiple" style="display:none">
|
||||
<option>All</option>
|
||||
<?
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name && $sec[$list['name']]['security']=='private') echo mk_option("", $list['name'], my_disk($list['name']));
|
||||
@@ -108,13 +129,14 @@ if (isset($disks[$name])) {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div style="margin-top:10px;text-align:right"><input type="button" id="cloneuser" value="Clone" onclick="cloneUser()" style="margin-right:0"></div>
|
||||
</div>
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onchange="$('#cloneuser').prop('disabled',true)">
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onchange="$('#cloneuser').prop('disabled',true);$('#s5').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareName" value="<?=$name?>">
|
||||
<?input_private_users($sec);?>
|
||||
|
||||
|
||||
: <input type="submit" name="changeShareAccess" value="Apply"><input type="button" value="Done" onclick="done()"><input type="button" id="cloneuser" value="Clone" onclick="cloneUser()">
|
||||
: <input type="submit" name="changeShareAccess" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
</form>
|
||||
<?endif;?>
|
||||
|
||||
@@ -133,17 +155,17 @@ function initDropdown2(reset) {
|
||||
$('#s4').dropdownchecklist('destroy');
|
||||
$('#s5').dropdownchecklist('destroy');
|
||||
}
|
||||
$("#s4").dropdownchecklist({emptyText:'None', width:150, explicitClose:'...close'});
|
||||
$("#s5").dropdownchecklist({emptyText:'None', width:150, explicitClose:'...close'});
|
||||
$("#s4").dropdownchecklist({firstItemChecksAll:true, emptyText:'please select...', width:150, explicitClose:'...close'});
|
||||
$("#s5").dropdownchecklist({firstItemChecksAll:true, emptyText:'please select...', width:150, explicitClose:'...close'});
|
||||
}
|
||||
function cloneSMB() {
|
||||
var data = {}, copied = false;
|
||||
data['shareExport'] = '<?=$sec[$name]['export']?>';
|
||||
data['shareSecurity'] = '<?=$sec[$name]['security']?>';
|
||||
data['changeShareSecurity'] = 'Apply';
|
||||
data.shareExport = '<?=$sec[$name]['export']?>';
|
||||
data.shareSecurity = '<?=$sec[$name]['security']?>';
|
||||
data.changeShareSecurity = 'Apply';
|
||||
$('select#s4 option').map(function() {
|
||||
if ($(this).prop('selected')==true) {
|
||||
data['shareName'] = $(this).val();
|
||||
data.shareName = $(this).val();
|
||||
$.post('/update.htm', data);
|
||||
copied = true;
|
||||
}
|
||||
@@ -168,10 +190,10 @@ function cloneUser() {
|
||||
if ($userAccess) echo " data['userAccess.$idx'] = '$userAccess';\n";
|
||||
}
|
||||
?>
|
||||
data['changeShareAccess'] = 'Apply';
|
||||
data.changeShareAccess = 'Apply';
|
||||
$('select#s5 option').map(function() {
|
||||
if ($(this).prop('selected')==true) {
|
||||
data['shareName'] = $(this).val();
|
||||
data.shareName = $(this).val();
|
||||
$.post('/update.htm', data);
|
||||
copied = true;
|
||||
}
|
||||
|
||||
@@ -54,29 +54,39 @@ $myDisks = array_filter(array_diff(array_keys($disks), explode(',',$var['shareUs
|
||||
> A *Share*, also called a *User Share*, is simply the name of a top-level directory that exists on one or more of your
|
||||
> storage devices (array and cache). Each share can be exported for network access. When browsing a share, we return the
|
||||
> composite view of all files and subdirectories for which that top-level directory exists on each storage device.
|
||||
>
|
||||
<?if (!$name):?>
|
||||
> *Clone source* is used to preset the settings of the new share with the settings of an existing share.
|
||||
> Select the desired share name and press **Clone** to copy the settings from that source.
|
||||
<?else:?>
|
||||
> *Clone destinations* is used to copy the settings of the current share to one or more other existing shares.
|
||||
> Select the desired destinations and press **Clone** to copy the settings to those shares.
|
||||
<?endif;?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
initDropdown1(false);
|
||||
initDropdown1(false,true);
|
||||
<?if ($tabbed):?>
|
||||
$('#tab1').bind({click:function(){initDropdown1(true);}});
|
||||
$('#tab1').bind({click:function(){initDropdown1(true,true);}});
|
||||
<?endif;?>
|
||||
setDiskList(document.share_edit.shareUseCache.value);
|
||||
presetSpace(document.share_edit.shareFloor);
|
||||
});
|
||||
function initDropdown1(reset) {
|
||||
if (reset) {
|
||||
function initDropdown1(remove,create) {
|
||||
if (remove) {
|
||||
$('#s1').dropdownchecklist('destroy');
|
||||
$('#s2').dropdownchecklist('destroy');
|
||||
<?if ($name):?>
|
||||
$('#s3').dropdownchecklist('destroy');
|
||||
<?endif;?>
|
||||
}
|
||||
$("#s1").dropdownchecklist({emptyText:'All', width:300, explicitClose:'...close'});
|
||||
$("#s2").dropdownchecklist({emptyText:'None', width:300, explicitClose:'...close'});
|
||||
if (create) {
|
||||
$("#s1").dropdownchecklist({emptyText:'All', width:300, explicitClose:'...close'});
|
||||
$("#s2").dropdownchecklist({emptyText:'None', width:300, explicitClose:'...close'});
|
||||
<?if ($name):?>
|
||||
$("#s3").dropdownchecklist({emptyText:'None', width:150, explicitClose:'...close'});
|
||||
$("#s3").dropdownchecklist({firstItemChecksAll:true, emptyText:'please select...', width:150, explicitClose:'...close'});
|
||||
<?endif;?>
|
||||
}
|
||||
}
|
||||
function setDiskList(cache) {
|
||||
var onOff = cache=='only' ? 'disable' : 'enable';
|
||||
@@ -138,35 +148,63 @@ function prepareEdit(form) {
|
||||
<?if ($name):?>
|
||||
function cloneShare() {
|
||||
var data = {}, copied = false;
|
||||
data['shareAllocator'] = '<?=$share['allocator']?>';
|
||||
data['shareFloor'] = '<?=$share['floor']?>';
|
||||
data['shareSplitLevel'] = '<?=$share['splitLevel']?>';
|
||||
data['shareInclude'] = '<?=$share['include']?>';
|
||||
data['shareExclude'] = '<?=$share['exclude']?>';
|
||||
data['shareUseCache'] = '<?=$share['useCache']?>';
|
||||
data['cmdEditShare'] = 'Apply';
|
||||
data.shareAllocator = '<?=$share['allocator']?>';
|
||||
data.shareFloor = '<?=$share['floor']?>';
|
||||
data.shareSplitLevel = '<?=$share['splitLevel']?>';
|
||||
data.shareInclude = '<?=$share['include']?>';
|
||||
data.shareExclude = '<?=$share['exclude']?>';
|
||||
data.shareUseCache = '<?=$share['useCache']?>';
|
||||
data.cmdEditShare = 'Apply';
|
||||
$('select#s3 option').map(function() {
|
||||
if ($(this).prop('selected')==true) {
|
||||
data['shareNameOrig'] = $(this).val();
|
||||
data['shareName'] = $(this).val();
|
||||
data.shareNameOrig = $(this).val();
|
||||
data.shareName = $(this).val();
|
||||
$.post('/update.htm', data);
|
||||
copied = true;
|
||||
}
|
||||
});
|
||||
if (copied) swal({title:'Clone complete',text:'Share settings are cloned to the selected shares',type:'success'},function(){refresh();});
|
||||
}
|
||||
<?else:?>
|
||||
function cloneShare() {
|
||||
var form = document.share_edit;
|
||||
var name = $('select[name="shareClone"]').val();
|
||||
initDropdown1(true,false);
|
||||
$.get('/webGui/include/ShareData.php',{name:name},function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
form.shareAllocator.value = data.allocator;
|
||||
form.shareFloor.value = data.floor;
|
||||
form.shareSplitLevel.value = data.splitLevel;
|
||||
form.shareInclude.value = data.include;
|
||||
form.shareExclude.value = data.exclude;
|
||||
form.shareUseCache.value = data.useCache;
|
||||
form.shareCOW.value = data.cow;
|
||||
for (var i=0,disk; disk=data.include.split(',')[i]; i++) for (var j=0,include; include=form.shareInclude.options[j]; j++) if (include.value==disk) include.selected=true;
|
||||
for (var i=0,disk; disk=data.exclude.split(',')[i]; i++) for (var j=0,exclude; exclude=form.shareExclude.options[j]; j++) if (exclude.value==disk) exclude.selected=true;
|
||||
initDropdown1(false,true);
|
||||
});
|
||||
}
|
||||
<?endif;?>
|
||||
</script>
|
||||
<?if ($name):?>
|
||||
<div style="float:right">
|
||||
<?if ($name):?>
|
||||
<span style="display:block;font-weight:bold;margin-left:2px;margin-bottom:4px">Clone destinations</span>
|
||||
<select id="s3" name="shareClone" size="1" multiple="multiple" style="display:none">
|
||||
<option>All</option>
|
||||
<?foreach ($shares as $list) if ($list['name']!=$name) echo mk_option("", $list['name'], $list['name']);?>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-top:10px;text-align:right"><input type="button" id="cloneshare" value="Clone" onclick="cloneShare()" style="margin-right:0"></div>
|
||||
<?else:?>
|
||||
<span style="display:block;font-weight:bold;margin-left:2px;margin-bottom:4px">Clone source</span>
|
||||
<select name="shareClone" size="1" onchange="$('#cloneshare').prop('disabled',false)">
|
||||
<option disabled selected>please select...</option>
|
||||
<?foreach ($shares as $list) echo mk_option("", $list['name'], $list['name']);?>
|
||||
</select>
|
||||
<div style="margin-top:10px"><input type="button" id="cloneshare" value="Clone" onclick="cloneShare()" disabled></div>
|
||||
<?endif;?>
|
||||
</div>
|
||||
|
||||
<form markdown="1" name="share_edit" method="POST" action="/update.htm" target="progressFrame" onsubmit="return prepareEdit(this)" onchange="$('#cloneshare').prop('disabled',true)">
|
||||
<form markdown="1" name="share_edit" method="POST" action="/update.htm" target="progressFrame" onsubmit="return prepareEdit(this)" onchange="$('#cloneshare').prop('disabled',true);$('#s3').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareNameOrig" value="<?=$share['nameOrig']?>">
|
||||
|
||||
Share name:
|
||||
@@ -321,7 +359,7 @@ Share status:
|
||||
> Share does *not* contain any data and may be deleted if not needed any longer.
|
||||
|
||||
Delete<input type="checkbox" name="confirmDelete" onchange="chkDelete(this.form, this.form.cmdEditShare);">
|
||||
: <input type="submit" name="cmdEditShare" value="Apply"><input type="button" value="Done" onclick="done()"><input type="button" id="cloneshare" value="Clone" onclick="cloneShare()">
|
||||
: <input type="submit" name="cmdEditShare" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
<?else:?>
|
||||
Share status:
|
||||
: <big>Share contains data</big>
|
||||
@@ -329,6 +367,6 @@ Share status:
|
||||
> Share can *not* be deleted as long as it contains data. Be aware that some data can be hidden. See also [SMB Settings](/Settings/SMB) -> Hide "dot" files.
|
||||
|
||||
|
||||
: <input type="submit" name="cmdEditShare" value="Apply"><input type="button" value="Done" onclick="done()"><input type="button" id="cloneshare" value="Clone" onclick="cloneShare()">
|
||||
: <input type="submit" name="cmdEditShare" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
<?endif;?>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright 2016, Bergware International.
|
||||
* Copyright 2016, Lime Technology
|
||||
/* Copyright 2005-2016, Lime Technology
|
||||
* Copyright 2012-2016, 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,
|
||||
|
||||
@@ -343,7 +343,7 @@ $(function() {
|
||||
<?if (strpos(file_get_contents('/proc/cmdline'),'unraidsafemode')!==false):?>
|
||||
showNotice('System running in <b>safe</b> mode');
|
||||
<?else:?>
|
||||
<?if ($version = plugin_update_available('unRAIDServer')):?>
|
||||
<?if ($version = plugin_update_available('unRAIDServer',true)):?>
|
||||
showNotice('unRAID OS v<?=$version?> is available. <a>Download Now</a>','unRAIDServer');
|
||||
<?elseif (preg_match("/^\*\*REBOOT REQUIRED\!\*\*/", @file_get_contents('/usr/local/emhttp/plugins/unRAIDServer/README.md'))):?>
|
||||
showNotice('Reboot required to apply unRAID OS update');
|
||||
|
||||
@@ -77,11 +77,11 @@ function assignment(&$disk) {
|
||||
$out .= "<select class=\"slot\" name=\"slotId.{$disk['idx']}\" onChange=\"{$disk['name']}Form.submit()\">";
|
||||
$empty = ($disk['idSb']!='' ? 'no device' : 'unassigned');
|
||||
if ($disk['id']!='') {
|
||||
$out .= "<option value=\"".my_id($disk['id'])."\" selected>".device_desc($disk)."</option>";
|
||||
$out .= "<option value=\"{$disk['id']}\" selected>".device_desc($disk)."</option>";
|
||||
$out .= "<option value=''>$empty</option>";
|
||||
} else
|
||||
$out .= "<option value='' selected>$empty</option>";
|
||||
foreach ($devs as $dev) {$out .= "<option value=\"".my_id($dev['id'])."\">".device_desc($dev)."</option>";}
|
||||
foreach ($devs as $dev) {$out .= "<option value=\"{$dev['id']}\">".device_desc($dev)."</option>";}
|
||||
return "$out</select></form>";
|
||||
}
|
||||
function fs_info(&$disk) {
|
||||
|
||||
@@ -40,7 +40,7 @@ function my_number($value) {
|
||||
function my_time($time, $fmt = NULL) {
|
||||
global $display;
|
||||
if (!$fmt) $fmt = $display['date'].($display['date']!='%c' ? ", {$display['time']}" : "");
|
||||
return $time ? strftime($fmt, $time) : "unset";
|
||||
return $time ? strftime($fmt, $time) : "unknown";
|
||||
}
|
||||
function my_temp($value) {
|
||||
global $display;
|
||||
@@ -128,6 +128,7 @@ function mk_option_check($name, $value, $text = "") {
|
||||
}
|
||||
function day_count($time) {
|
||||
global $var;
|
||||
if (!$time) return;
|
||||
$datetz = new DateTimeZone($var['timeZone']);
|
||||
$date = new DateTime("now", $datetz);
|
||||
$offset = $datetz->getOffset($date);
|
||||
@@ -136,7 +137,7 @@ function day_count($time) {
|
||||
$days = date_diff($last,$now)->format('%a');
|
||||
switch (true) {
|
||||
case ($days<0):
|
||||
return "";
|
||||
return;
|
||||
case ($days==0):
|
||||
return " (today)";
|
||||
case ($days==1):
|
||||
|
||||
@@ -22,9 +22,9 @@ foreach ($files as $file) {
|
||||
$fields = explode(PHP_EOL, file_get_contents($file));
|
||||
$archive = basename($file);
|
||||
if ($extra = count($fields)>6) {
|
||||
$td_ = "<td rowspan='3'><a href='#' onclick='openClose($row)'>"; $_td = "<i class='fa fa-anchor'></i></a></td>";
|
||||
$td_ = "<td rowspan='3'><a href='#' onclick='openClose($row)'>"; $_td = "</a></td>";
|
||||
} else {
|
||||
$td_ = "<td>"; $_td = "</td>";
|
||||
$td_ = "<td style='white-space:nowrap'>"; $_td = "</td>";
|
||||
}
|
||||
$c = 0;
|
||||
foreach ($fields as $field) {
|
||||
|
||||
16
plugins/dynamix/include/ShareData.php
Normal file
16
plugins/dynamix/include/ShareData.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?PHP
|
||||
/* Copyright 2005-2016, Lime Technology
|
||||
* Copyright 2012-2016, 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,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$shares = parse_ini_file('state/shares.ini',true);
|
||||
echo json_encode($shares[$_GET['name']]);
|
||||
?>
|
||||
@@ -33,10 +33,19 @@ function agent_fullname($agent, $state) {
|
||||
}
|
||||
}
|
||||
|
||||
function plugin_update_available($plugin) {
|
||||
$script = '/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin';
|
||||
$local = file_exists("/var/log/plugins/$plugin.plg") ? exec("$script version /var/log/plugins/$plugin.plg") : "";
|
||||
$remote = file_exists("/tmp/plugins/$plugin.plg") ? exec("$script version /tmp/plugins/$plugin.plg") : "";
|
||||
return strcmp($remote,$local)>0 ? $remote : "";
|
||||
function get_plugin_attr($attr, $file) {
|
||||
exec("/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin $attr $file", $result, $error);
|
||||
if ($error===0) return $result[0];
|
||||
}
|
||||
|
||||
function plugin_update_available($plugin, $os=false) {
|
||||
$local = get_plugin_attr('version', "/var/log/plugins/$plugin.plg");
|
||||
$remote = get_plugin_attr('version', "/tmp/plugins/$plugin.plg");
|
||||
if (strcmp($remote,$local)>0) {
|
||||
if ($os) return $remote;
|
||||
if (!$unraid = get_plugin_attr('unRAID', "/tmp/plugins/$plugin.plg")) return $remote;
|
||||
$server = get_plugin_attr('version', "/var/log/plugins/unRAIDServer.plg");
|
||||
if (version_compare($server, $unraid, '>=')) return $remote;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user