+Ext.define("OMV.module.admin.storage.zfs.ExpandPool", {
+ extend: "OMV.workspace.window.Form",
+ uses: [
+ "OMV.data.Store",
+ "OMV.data.Model",
+ "OMV.data.proxy.Rpc",
+ "OMV.data.reader.RpcArray"
+ ],
+
+ rpcService: "ZFS",
+ rpcSetMethod: "expandPool",
+ width: 550,
+ height: 350,
+ autoLoadData: true,
+
+ getFormItems: function() {
+ var me = this;
+ return [{
+ xtype: "textfield",
+ name: "name",
+ fieldLabel: _("Name"),
+ allowBlank: false,
+ readOnly: true,
+ value: me.name
+ },{
+ xtype: "textfield",
+ name: "pool_type",
+ fieldLabel: _("Pool type"),
+ allowBlank: false,
+ readOnly: true,
+ value: me.pool_type
+ },{
+ xtype: "checkboxgridfield",
+ name: "devices",
+ fieldLabel: _("Devices"),
+ valueField: "devicefile",
+ listeners: {
+ scope: me,
+ change: function(e, eOpts) {
+ var deviceField = this.findField("devices");
+ if (me.pool_type == "Basic") {
+ deviceField.minSelections = 1;
+ } else {
+ deviceField.minSelections = me.nr_disks;
+ deviceField.maxSelections = me.nr_disks;
+ }
+ }
+ },
+ useStringValue: true,
+ height: 130,
+ store: Ext.create("OMV.data.Store", {
+ autoLoad: true,
+ model: OMV.data.Model.createImplicit({
+ idProperty: "devicefile",
+ fields: [
+ { name: "devicefile", type: "string" },
+ { name: "size", type: "string" },
+ { name: "vendor", type: "string" },
+ { name: "serialnumber", type: "string" }
+ ]
+ }),
+ proxy: {
+ type: "rpc",
+ appendSortParams: false,
+ rpcData: {
+ service: "RaidMgmt",
+ method: "getCandidates"
+ }
+ },
+ sorters: [{
+ direction: "ASC",
+ property: "devicefile"
+ }]
+ }),
+ gridConfig: {
+ stateful: true,
+ stateId: "04942d40-4ee3-11e4-916c-0800200c9a66",
+ columns: [{
+ text: _("Device"),
+ sortable: true,
+ dataIndex: "devicefile",
+ stateId: "devicefile",
+ flex: 1
+ },{
+ xtype: "binaryunitcolumn",
+ text: _("Capacity"),
+ sortable: true,
+ dataIndex: "size",
+ stateId: "size",
+ width: 50,
+ flex: 1
+ },{
+ text: _("Vendor"),
+ sortable: true,
+ dataIndex: "vendor",
+ stateId: "vendor",
+ flex: 1
+ },{
+ text: _("Serial Number"),
+ sortable: true,
+ dataIndex: "serialnumber",
+ stateId: "serialnumber",
+ flex: 1
+ }]
+ }
+ }];
+ }
+});