Files
webgui/plugins/dynamix/ShareList.page

55 lines
2.0 KiB
Plaintext

Menu="Shares:1"
Title="User Shares"
Tag="user-circle"
Cond="$var['fsState']!='Stopped' && $var['shareUser']=='e'"
---
<?PHP
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, 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');
$('#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')
$('#shareslist').html(data);
$('#compute-shares').prop('disabled',!data || data.indexOf('colspan=')!=-1);
});
}
$(function() {
displayShares('no');
});
</script>
<style>
table.share_status thead tr td:first-child{width:15%}
table.share_status thead tr td:nth-child(n+3){width:10%}
</style>
<table class="share_status">
<thead><tr><td>_(Name)_</td><td>_(Comment)_</td><td>_(SMB)_</td><td>_(NFS)_</td><td>_(Cache)_</td><td>_(Size)_</td><td>_(Free)_</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: