Browse Source

Added more UI

aroz 1 year ago
parent
commit
8641a3d682
1 changed files with 35 additions and 26 deletions
  1. 35 26
      web/SystemAO/disk/raid/index.html

+ 35 - 26
web/SystemAO/disk/raid/index.html

@@ -125,8 +125,8 @@
                             <h3 class="ui header">
                             <h3 class="ui header">
                                 <i class="ui green check circle icon"></i>
                                 <i class="ui green check circle icon"></i>
                                 <div class="content">
                                 <div class="content">
-                                    <span>/dev/md0</span>
-                                    <div class="sub header">10c0a9d9:763e326a:7d825b41:e1dc0536 | clean</div>
+                                    <span id="RAIDOverviewDiskpath">/dev/md0</span>
+                                    <div class="sub header" id="RAIDOverviewDetails">10c0a9d9:763e326a:7d825b41:e1dc0536 | clean</div>
                                 </div>
                                 </div>
                             </h3>
                             </h3>
                             <div class="ui divider"></div>
                             <div class="ui divider"></div>
@@ -171,8 +171,11 @@
                                 </div>
                                 </div>
                             </div>
                             </div>
                         </div>
                         </div>
+                        <br>
                         <div id="raidDiskList">
                         <div id="raidDiskList">
-                            
+                            <div class="ui basic segment">
+
+                            </div>
                         </div>
                         </div>
                         <div class="ui divider"></div>
                         <div class="ui divider"></div>
                         <div class="dangerzone">
                         <div class="dangerzone">
@@ -182,28 +185,28 @@
                             <table class="ui very basic compact celled table" style="padding-left: 1em; padding-right: 1em;">
                             <table class="ui very basic compact celled table" style="padding-left: 1em; padding-right: 1em;">
                                 <tbody>
                                 <tbody>
                                     <tr>
                                     <tr>
-                                    <td>
-                                        <h4>Unlink RAID Volume</h4>
-                                        <p>Unmount and remove the RAID volume from runtime but keep the mdadm config file. <br>
-                                            The RAID volume will get remounted after system reboot. This is suitable for temporary manual maintenance.</p>
-                                    </td>
-                                    <td>
-                                        <button onclick="" class="circular basic ui button">
-                                            <i class="orange unlink icon"></i> Unlink Volume
-                                        </button>
-                                    </td>
+                                        <td>
+                                            <h4>Stop RAID Volume</h4>
+                                            <p>This will unmount the volume (if mounted) and stop the RAID volume with <code>mdadm --stop /dev/mdX</code>. You will not be able to mount it again until mdadm reloads.<br>
+                                            If you only want to unmount the RAID volume, use the Disk Management Tool instead.</p>
+                                        </td>
+                                        <td>
+                                            <button onclick="" class="circular basic red ui button">
+                                                <i class="red trash icon"></i> Stop RAID Volume
+                                            </button>
+                                        </td>
                                     </tr>
                                     </tr>
                                     <tr>
                                     <tr>
-                                    <td>
-                                        <h4>Remove RAID Volume</h4>
-                                        <p>Remove the RAID volume from runtime AND the mdadm config file. This should only be done when you are trying to rebuild the RAID volume on a new machine. <br>
-                                            Data in the disks will not be wiped but a full backup is recommended before removing the RAID volume from this system.</p>
-                                    </td>
-                                    <td>
-                                        <button onclick="" class="circular basic red ui button">
-                                            <i class="red trash icon"></i> Remove Volume
-                                        </button>
-                                    </td>
+                                        <td>
+                                            <h4>Remove RAID Volume</h4>
+                                            <p>Remove the RAID volume from runtime AND the mdadm config file. This should only be done when you are trying to rebuild the RAID volume on a new machine. <br>
+                                                Data in the disks will not be wiped but a full backup is recommended before removing the RAID volume from this system.</p>
+                                        </td>
+                                        <td>
+                                            <button onclick="" class="circular red ui button">
+                                                <i class="trash icon"></i> Remove Volume
+                                            </button>
+                                        </td>
                                     </tr>
                                     </tr>
                                 </tbody>
                                 </tbody>
                             </table> 
                             </table> 
@@ -258,7 +261,6 @@
                 }
                 }
 
 
                 //Get the information of the device
                 //Get the information of the device
-                $("#raidDiskList").html("");
                 $.get("../../system/disk/raid/detail?devName=" + deviceName, function(data){
                 $.get("../../system/disk/raid/detail?devName=" + deviceName, function(data){
                     if (data.error != undefined){
                     if (data.error != undefined){
                         $("#raidDiskList").html(`<h3 class="ui header">
                         $("#raidDiskList").html(`<h3 class="ui header">
@@ -272,15 +274,22 @@
                         return;
                         return;
                     }
                     }
 
 
-                    //Render the disk list
-                    $("#raidDiskList").html("");
+                   
 
 
                     //Update the active disks info
                     //Update the active disks info
+                    $("#RAIDOverviewDiskpath").text(data.DevicePath + `(${data.RaidLevel})`);
+                    $("#RAIDOverviewDetails").text(data.UUID + " | State: " + capitalize(data.State));
                     $("#RAIDActiveDevices").text(data.ActiveDevices);
                     $("#RAIDActiveDevices").text(data.ActiveDevices);
                     $("#RAIDWorkingDevices").text(data.WorkingDevices);
                     $("#RAIDWorkingDevices").text(data.WorkingDevices);
                     $("#RAIDFailedDevices").text(data.FailedDevices);
                     $("#RAIDFailedDevices").text(data.FailedDevices);
                     $("#RAIDSpareDevices").text(data.SpareDevices);
                     $("#RAIDSpareDevices").text(data.SpareDevices);
 
 
+                     //Render the disk list
+                     //$("#raidDiskList").html("");
+                    for (var i = 0; i < data.DeviceInfo.length; i++){
+                        let thisDeviceInfo = data.DeviceInfo[i];
+                        $("#raidDiskList").append(``);
+                    }
 
 
                 });
                 });
             }
             }