Menu="Shares:2"
Title="Disk Shares"
Tag="user-circle-o"
Cond="_var($var,'fsState')!='Stopped' && _var($var,'shareDisk')!='no'"
---
<?PHP
/* Copyright 2005-2023, Lime Technology
 * Copyright 2012-2023, 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.
 */
?>
<div class="TableContainer">
    <table class="unraid share_status">
        <thead>
            <tr>
                <td>_(Name)_</td>
                <td>_(Comment)_</td>
                <td>_(SMB)_</td>
                <td>_(NFS)_</td>
                <td>_(Type)_</td>
                <td>_(Size)_</td>
                <td>_(Free)_</td>
            </tr>
        </thead>
        <tbody id="disk_list"></tbody>
    </table>
</div>

<input id="compute-disks" type="button" value="_(Compute All)_" onclick="$(this).prop('disabled',true);diskList('',-1)">

:disk_list_help:

<script>
function diskList(name,all) {
  timers.diskList = setTimeout(function(){$('div.spinner.fixed').show();},500);
  $.post('/webGui/include/DiskList.php',{compute:name,path:"<?=rawurlencode($path)?>",all:all},function(data){
    clearTimeout(timers.diskList);
    $('div.spinner.fixed').hide();
    $('#disk_list').html(data);
    if (all!=1) $('#compute-disks').prop('disabled',!data||data.indexOf('colspan=')!=-1);
  });
}
function computeDisk(name,status) {
  status.html("<i class='fa fa-circle-o-notch fa-spin'></i> _(Please wait)_...");
  diskList(name,1);
}
$(diskList('',0));
</script>
