Permalink
Browse files

Add a button to add available disks as group

  • Loading branch information...
1 parent 7820aa3 commit 1e4d3810c28f497f386ecedf5931c3c811bb92cc @william-gr william-gr committed Jun 6, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 gui/freeadmin/static/lib/js/freeadmin/VolumeManager.js
@@ -190,7 +190,7 @@ define([
});
var DisksAvail = declare("freeadmin.DisksAvail", [ _Widget, _Templated ], {
- templateString: '<div data-dojo-attach-point="dapRow"><span data-dojo-attach-point="dapIndex"></span> - <span data-dojo-attach-point="dapSize"></span> (<span data-dojo-attach-point="dapNum"></span>)</div>',
+ templateString: '<div data-dojo-attach-point="dapRow"><div data-dojo-attach-point="dapAdd"></div><span data-dojo-attach-point="dapIndex"></span> - <span data-dojo-attach-point="dapSize"></span> (<span data-dojo-attach-point="dapNum"></span>)</div>',
disks: [],
size: "",
sizeBytes: 0,
@@ -204,10 +204,13 @@ define([
for(var i in this.disks) {
this.disks[i].disksAvail = this;
}
+ this.dapAdd = new Button({
+ label: "+"
+ }, this.dapAdd);
this.dapIndex.innerHTML = this.index + 1;
this.dapSize.innerHTML = this.size;
this.update();
- on(this.dapRow, "click", function() {
+ on(this.dapAdd, "click", function() {
for(var i=0;i<me.manager._layout.length;i++) {
var diskg = me.manager._layout[i];
/*
@@ -259,6 +262,7 @@ define([
},
update: function() {
if(this.disks.length > 0) {
+ this.dapAdd.set('disabled', false);
if(this.disks.length > 1) {
this.dapNum.innerHTML = sprintf("%d drives, ", this.disks.length);
} else {
@@ -273,6 +277,7 @@ define([
me.hide();
});
} else {
+ this.dapAdd.set('disabled', true);
this.dapNum.innerHTML = "no more drives";
}
},

0 comments on commit 1e4d381

Please sign in to comment.