Permalink
Browse files

Handle auto add of avail disks for >= 12 and < 18

We still need to make it better for 16
  • Loading branch information...
1 parent 993e14a commit 48f58c6eb1ae11392f99a522a1b021d56415d1b4 @william-gr william-gr committed Jun 10, 2013
Showing with 20 additions and 1 deletion.
  1. +20 −1 gui/freeadmin/static/lib/js/freeadmin/VolumeManager.js
@@ -848,8 +848,27 @@ define([
for(var i=0,len=this.initialDisks.length;i<len;i++) {
this.initialDisks[0].addToRow(this, 0, i);
}
+ } else if(this.initialDisks.length < 18) {
+ //FIXME: We need to handle disks == 16 in a better way
+ var div2 = Math.floor(this.initialDisks.length / 2);
+ var mod2 = this.initialDisks.length % 2;
+
+ for(var i=0,len=this.initialDisks.length - mod2;i<len;i++) {
+ this.initialDisks[0].addToRow(this, ath.floor(i / div2), i % div2);
+ }
+
+ // Remaining disks are spare
+ if(this.initialDisks.length > 0) {
+ var diskgspare = this.manager.addVdev({
+ can_delete: true,
+ type: "spare",
+ initialDisks: this.initialDisks
+ });
+ diskgspare._disksCheck(true);
+ diskgspare.colorActive();
+ }
+
} else if(this.initialDisks.length < 99) {
- // FIXME: for >= 12 < 18
var chosen;
var div9 = Math.floor(this.initialDisks.length / 9);
var div10 = Math.floor(this.initialDisks.length / 10);

0 comments on commit 48f58c6

Please sign in to comment.