|
@@ -234,7 +234,7 @@
|
|
<button onclick="addDiskToArray();" title="Add new disk to this volume" class="circular small basic ui button">
|
|
<button onclick="addDiskToArray();" title="Add new disk to this volume" class="circular small basic ui button">
|
|
<i class="green add icon"></i> Add Disk
|
|
<i class="green add icon"></i> Add Disk
|
|
</button>
|
|
</button>
|
|
- <button onclick="" title="Expand volume to fit disks capacity" class="circular small basic ui button">
|
|
|
|
|
|
+ <button onclick="expandRAIDArray();" title="Expand volume to fit disks capacity" class="circular small basic ui button">
|
|
<i class="purple expand icon"></i> Expand Volume
|
|
<i class="purple expand icon"></i> Expand Volume
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
@@ -335,6 +335,7 @@
|
|
removePendingDisk: "",
|
|
removePendingDisk: "",
|
|
removePendingSourceVol: ""
|
|
removePendingSourceVol: ""
|
|
};
|
|
};
|
|
|
|
+ var raidInfoTicker = undefined;
|
|
|
|
|
|
/* Information Update Ticker */
|
|
/* Information Update Ticker */
|
|
function RAIDInfoUpdateTicker(){
|
|
function RAIDInfoUpdateTicker(){
|
|
@@ -381,16 +382,23 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //Update again in 3s
|
|
|
|
- setTimeout(RAIDInfoUpdateTicker, 5000);
|
|
|
|
|
|
+ //Update again later
|
|
|
|
+ raidInfoTicker = setTimeout(RAIDInfoUpdateTicker, 5000);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ }else{
|
|
|
|
+ //Release the ticker
|
|
|
|
+ console.log("RAID status ticker released");
|
|
|
|
+ raidInfoTicker = undefined;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//Set the ticker
|
|
//Set the ticker
|
|
- setTimeout(RAIDInfoUpdateTicker, 1000);
|
|
|
|
|
|
+ if (raidInfoTicker == undefined){
|
|
|
|
+ console.log("RAID status ticker started");
|
|
|
|
+ raidInfoTicker = setTimeout(RAIDInfoUpdateTicker, 1000);
|
|
|
|
+ }
|
|
|
|
|
|
/* RAID Create Functions */
|
|
/* RAID Create Functions */
|
|
function addNewRaidVolume(){
|
|
function addNewRaidVolume(){
|
|
@@ -411,7 +419,7 @@
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
reloadRAIDVolDetail();
|
|
reloadRAIDVolDetail();
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
- msgbox(data.error, false, 5000);
|
|
|
|
|
|
+ msgbox(capitalize(data.error), false, 5000);
|
|
}else{
|
|
}else{
|
|
msgbox("New RAID volume created");
|
|
msgbox("New RAID volume created");
|
|
}
|
|
}
|
|
@@ -458,7 +466,7 @@
|
|
window.handleRAIDRemoveCallback = function(data){
|
|
window.handleRAIDRemoveCallback = function(data){
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
//Something went wrong
|
|
//Something went wrong
|
|
- msgbox(data.error, false, 5000);
|
|
|
|
|
|
+ msgbox(capitalize(data.error), false, 5000);
|
|
}else{
|
|
}else{
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
//RAID volume not exist anymore. Reset everything
|
|
//RAID volume not exist anymore. Reset everything
|
|
@@ -494,6 +502,26 @@
|
|
}, 300);
|
|
}, 300);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* RAID Array Expand */
|
|
|
|
+ function expandRAIDArray(arrayName=raidManager.editingArray){
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "../../system/disk/raid/grow",
|
|
|
|
+ method: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ "raidDev": arrayName,
|
|
|
|
+ },
|
|
|
|
+ success: function(data){
|
|
|
|
+ if (data.error != undefined){
|
|
|
|
+ msgbox(capitalize(data.error), false);
|
|
|
|
+ }else{
|
|
|
|
+ msgbox("mdadm grow operation started");
|
|
|
|
+ reloadRAIDVolDetail();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Disk Remove Functions */
|
|
/* Disk Remove Functions */
|
|
function removeDisk(arrayName, diskPath){
|
|
function removeDisk(arrayName, diskPath){
|
|
console.log(arrayName, diskPath);
|
|
console.log(arrayName, diskPath);
|
|
@@ -576,11 +604,11 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- function loadRAIDVolDetail(deviceName){
|
|
|
|
- function capitalize(string) {
|
|
|
|
- return string.charAt(0).toUpperCase() + string.slice(1);
|
|
|
|
- }
|
|
|
|
|
|
+ function capitalize(string) {
|
|
|
|
+ return string.charAt(0).toUpperCase() + string.slice(1);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ function loadRAIDVolDetail(deviceName){
|
|
function bytesToSize(bytes) {
|
|
function bytesToSize(bytes) {
|
|
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
if (bytes == 0) return 'n/a';
|
|
if (bytes == 0) return 'n/a';
|
|
@@ -846,7 +874,7 @@
|
|
window.handleForceAssembleCallback = function(data){
|
|
window.handleForceAssembleCallback = function(data){
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
//Something went wrong
|
|
//Something went wrong
|
|
- msgbox(data.error, false, 5000);
|
|
|
|
|
|
+ msgbox(capitalize(data.error), false, 5000);
|
|
}else{
|
|
}else{
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
//Reload all RAID volumes
|
|
//Reload all RAID volumes
|