]> git.datanom.net - omvzfs.git/blobdiff - gui/js/omv/module/admin/storage/zfs/Overview.js
Another attempt to integrate with OMV shared folders.
[omvzfs.git] / gui / js / omv / module / admin / storage / zfs / Overview.js
index 832b5e0c8c27828495509c7d77a87b189cefef1e..2a3fe1509a4bbf565d4ecefa98cdd9192ec87bc9 100644 (file)
@@ -3,6 +3,38 @@
 // require("js/omv/workspace/window/Grid.js")
 // require("js/omv/form/field/CheckboxGrid.js")
 
+Ext.define("OMV.module.admin.storage.zfs.ShowDetails", {
+       extend: "OMV.workspace.window.Form",
+       requires: [
+               "OMV.data.Store",
+               "OMV.data.Model",
+               "OMV.data.proxy.Rpc",
+       ],
+
+       rpcService: "ZFS",
+       title: _("Object details"),
+       autoLoadData: true,
+       hideResetButton: true,
+       hideCancelButton: true,
+       width: 550,
+       height: 350,
+       layout: 'fit',
+       okButtonText: _("Ok"),
+
+       getFormItems: function() {
+               var me = this;
+               
+               return [{
+                       xtype: "textareafield",
+                       name: "details",
+                       grow: true,
+                       anchor: '100%',
+                       readOnly: true
+               }];
+
+       }
+});
+
 Ext.define("OMV.module.admin.storage.zfs.AddPool", {
        extend: "OMV.workspace.window.Form",
        requires: [
@@ -18,7 +50,7 @@ Ext.define("OMV.module.admin.storage.zfs.AddPool", {
        autoLoadData: false,
        hideResetButton: true,
        width: 550,
-       height: 260,
+       height: 350,
 
        getFormItems: function() {
                var me = this;
@@ -52,22 +84,22 @@ Ext.define("OMV.module.admin.storage.zfs.AddPool", {
                                change: function(combo, value) {
                                        var devicesField = this.findField("devices");
                                        switch(value) {
-                                       case "basic":
-                                               devicesField.minSelections = 1;
-                                       break;
-                                       case "mirror":
-                                               devicesField.minSelections = 2;
+                                               case "basic":
+                                                       devicesField.minSelections = 1;
+                                               break;
+                                               case "mirror":
+                                                       devicesField.minSelections = 2;
                                                break;
-                                       case "raidz1":
-                                               devicesField.minSelections = 3;
+                                               case "raidz1":
+                                                       devicesField.minSelections = 3;
                                                break;
-                                       case "raidz2":
-                                               devicesField.minSelections = 4;
-                                       case "raidz3":
-                                               devicesField.minSelections = 5;
+                                               case "raidz2":
+                                                       devicesField.minSelections = 4;
+                                               case "raidz3":
+                                                       devicesField.minSelections = 5;
                                                break;
-                                       default:
-                                               devicesField.minSelections = 2;
+                                               default:
+                                                       devicesField.minSelections = 2;
                                                break;
                                        }
                                        devicesField.validate();
@@ -136,6 +168,23 @@ Ext.define("OMV.module.admin.storage.zfs.AddPool", {
                                        flex: 1
                                }]
                        }
+               },{
+                       xtype: "textfield",
+                       name: "mountpoint",
+                       fieldLabel: _("Mountpoint"),
+                       plugins: [{
+                               ptype: "fieldinfo",
+                               text: _("Optional mountpoint for the pool. Default is to use pool name.")
+                       }]
+               },{
+                       xtype: "checkbox",
+                       name: "force",
+                       fieldLabel: _("Force creation"),
+                       checked: false,
+                       plugins: [{
+                               ptype: "fieldinfo",
+                               text: _("Forces the creation of the pool even if errors are reported. Use with extreme caution!")
+                       }]
                }];
        },
 
@@ -259,10 +308,7 @@ Ext.define("OMV.module.admin.storage.zfs.EditProperties", {
                                        e.record.set("modified", "true");
                                },
                                beforeedit: function(editor, e, eOpts) {
-                                       if (e.record.get("property") === "mountpoint") {
-                                               e.grid.getPlugin('rowEditing').editor.form.findField("value").disable();
-                                               e.grid.getPlugin('rowEditing').editor.form.findField("property").disable();
-                                       } else if (e.record.get("newproperty") === "false") {
+                                       if (e.record.get("newproperty") === "false") {
                                                e.grid.getPlugin('rowEditing').editor.form.findField("value").enable();
                                                e.grid.getPlugin('rowEditing').editor.form.findField("property").disable();
                                        } else {
@@ -449,8 +495,8 @@ Ext.define("OMV.module.admin.storage.zfs.CreateShare", {
                        xtype: "textfield",
                        name: "mountpoint",
                        fieldLabel: _("Path"),
-                       allowBlank: false,
-                       readOnly: true
+                       allowBlank: true,
+                       readOnly: false
                },{
                        xtype: "combo",
                        name: "mode",
@@ -525,6 +571,30 @@ Ext.define("OMV.module.admin.storage.zfs.Overview", {
                sortable: true,
                flex: 1,
                stateId: 'type'
+       },{
+               text: _("Size"),
+               dataIndex: 'size',
+               sortable: true,
+               flex: 1,
+               stateId: 'size'
+       },{
+               text: _("Used"),
+               dataIndex: 'used',
+               sortable: true,
+               flex: 1,
+               stateId: 'used'
+       },{
+               text: _("Available"),
+               dataIndex: 'available',
+               sortable: true,
+               flex: 1,
+               stateId: 'available'
+       },{
+               text: _("Mountpoint"),
+               dataIndex: 'mountpoint',
+               sortable: true,
+               flex: 1,
+               stateId: 'mountpoint'
        },{
                text: _("Share"),
                xtype: 'actioncolumn',
@@ -550,14 +620,23 @@ Ext.define("OMV.module.admin.storage.zfs.Overview", {
                                return true;
                        }
                }
-
-
        },{
                text: _("Details"),
                xtype: 'actioncolumn',
                tooltip: 'Details',
                align: 'center',
-               icon: 'images/zfs_mag.png'
+               icon: 'images/search.png',
+               handler: function(view, rowIndex, colIndex, item, e, record, row) {
+                       var me = this;
+                       Ext.create("OMV.module.admin.storage.zfs.ShowDetails", {
+                               title: _("Object details"),
+                               rpcGetMethod: "getObjectDetails",
+                               rpcGetParams: {
+                                       name: record.get('path'),
+                                       type: record.get('type')
+                               }
+                       }).show();
+               }
        },{
                text: _("Shared"),
                dataIndex: 'shared',
@@ -576,6 +655,10 @@ Ext.define("OMV.module.admin.storage.zfs.Overview", {
                                        fields: [
                                                { name: "name", type: "string" },
                                                { name: "type", type: "string" },
+                                               { name: "size", type: "string" },
+                                               { name: "used", type: "string" },
+                                               { name: "available", type: "string" },
+                                               { name: "mountpoint", type: "string" },
                                                { name: "id", type: "string" },
                                                { name: "path", type: "string" },
                                                { name: "origin", type: "string", defaultValue: "none" },
@@ -595,7 +678,7 @@ Ext.define("OMV.module.admin.storage.zfs.Overview", {
                me.callParent(arguments);
        },
 
-       onAddButton: function() {
+       onAddButton: function() {
                var me = this;
                Ext.create("OMV.module.admin.storage.zfs.AddPool", {
                        listeners: {
This page took 0.041501 seconds and 5 git commands to generate.