|
@@ -1 +1,63 @@
|
|
|
-<p>Admin Settings</p>
|
|
|
+<h3>Samba Share Lists</h3>
|
|
|
+<p>A list of SMB shares currently written into smb.conf</p>
|
|
|
+<div id="sharelist">
|
|
|
+
|
|
|
+</div>
|
|
|
+<div class="ui divider"></div>
|
|
|
+<h3>Add Samba Share</h3>
|
|
|
+<p>Create a new SMB share folder from local disk</p>
|
|
|
+<script>
|
|
|
+
|
|
|
+ function initShareListTable(){
|
|
|
+ $.get("../../system/storage/samba/list", function(data){
|
|
|
+ if (data.error){
|
|
|
+ msgbox(data.error, false);
|
|
|
+ }else{
|
|
|
+ generateTable(data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ initShareListTable();
|
|
|
+ function generateTable(data) {
|
|
|
+ // Start the table
|
|
|
+ let table = `
|
|
|
+ <table class="ui basic celled unstackable table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Name</th>
|
|
|
+ <th>Path</th>
|
|
|
+ <th>Valid Users</th>
|
|
|
+ <th>Read Only</th>
|
|
|
+ <th>Browseable</th>
|
|
|
+ <th>Guest Ok</th>
|
|
|
+ <th>Actions</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ `;
|
|
|
+
|
|
|
+ // Populate the table rows
|
|
|
+ data.forEach(item => {
|
|
|
+ table += `
|
|
|
+ <tr>
|
|
|
+ <td><i class="ui yellow folder icon"></i> ${item.Name}</td>
|
|
|
+ <td><i class="ui grey hdd icon"></i> ${item.Path}</td>
|
|
|
+ <td>${item.ValidUsers.join(", ")}</td>
|
|
|
+ <td>${item.ReadOnly?'<i class="ui green check icon"></i>':'<i class="ui red times icon"></i>'}</td>
|
|
|
+ <td>${item.Browseable?'<i class="ui green check icon"></i>':'<i class="ui red times icon"></i>'}</td>
|
|
|
+ <td>${item.GuestOk?'<i class="ui green check icon"></i>':'<i class="ui red times icon"></i>'}</td>
|
|
|
+ <td><button class="ui basic circular mini red icon button"><i class="ui trash icon"></i> Remove</button></td>
|
|
|
+ </tr>
|
|
|
+ `;
|
|
|
+ });
|
|
|
+
|
|
|
+ // Close the table
|
|
|
+ table += `
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ `;
|
|
|
+
|
|
|
+ // Insert the table into the div
|
|
|
+ $("#sharelist").html(table);
|
|
|
+ }
|
|
|
+</script>
|