Files
webgui/plugins/dynamix/ShareList.page
2020-05-09 09:15:03 +02:00

50 lines
2.1 KiB
Plaintext

Menu="Shares:1"
Title="User Shares"
Tag="user-circle"
Cond="$var['fsState']!='Stopped' && $var['shareUser']=='e'"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, 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.
*/
?>
<script>
function displayShares(all) {
if (all == 'yes') {
$.cookie('ssz','ssz',{path:'/'});
$('#shareslist').html("<tr><td colspan='8'><div class='spinner'></div></td></tr>");
$('div.spinner').html(unraid_logo);
}
$.get('/webGui/include/ShareList.php',{compute:all,path:'<?=addslashes(htmlspecialchars($path))?>',scale:'<?=$display['scale']?>',number:'<?=$display['number']?>',raw:'<?=$display['raw']?>',fill:$.cookie('ssz')},function(data){
$.removeCookie('ssz',{path:'/'})
$('#shareslist').html(data);
$('#compute-shares').prop('disabled',!data || data.indexOf('colspan=')!=-1);
});
}
$(function() {
displayShares('no');
});
</script>
<table class="share_status share">
<thead><tr><td style="width:15%">_(Name)_</td><td style="width:30%">_(Comment)_</td><td style="width:8%">_(SMB)_</td><td style="width:8%">_(NFS)_</td><td style="width:14%">_(Cache)_</td><td style="width:10%">_(Size)_</td><td style="width:10%">_(Free)_</td><td style="width:5%">_(View)_</td></tr></thead>
<tbody id="shareslist"></tbody>
</table>
<p><form name="share_form" method="POST" action="<?=htmlspecialchars($path)?>/Share?name=">
<input id="compute-shares" type="button" value="_(Compute All)_" onclick="$(this).prop('disabled',true);displayShares('yes')">
<?if ($var['startMode']=='Normal'):?>
<input type="submit" value="_(Add Share)_"<?=$var['shareUser']=='e'?'>':' disabled>User shares must be <strong>enabled</strong> to add shares.'?>
<?else:?>
<input type="submit" value="_(Add Share)_" disabled>
<?endif;?>
</form></p>
:share_list_help: