]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/ClamAVDatabase.js
bump version to 1.0-35
[pmg-gui.git] / js / ClamAVDatabase.js
index ebc07feb0b43efe4d51f15a12ee1d0eb279a5f02..005a593eeea38ba27d69d2178fe5f34dc0dce7a6 100644 (file)
@@ -1,3 +1,4 @@
+/*global Proxmox*/
 Ext.define('PMG.ClamAVDatabaseConfig', {
     extend: 'Proxmox.grid.ObjectGrid',
     alias: ['widget.pmgClamAVDatabaseConfig'],
@@ -10,15 +11,18 @@ Ext.define('PMG.ClamAVDatabaseConfig', {
        me.add_text_row('dbmirror', gettext('Database Mirror'),
                        { deleteEmpty: true, defaultValue: 'database.clamav.net' });
 
+       /*jslint confusion: true*/
+       /*defaultValue is a string above*/
        me.add_boolean_row('safebrowsing', gettext('Google Safe Browsing'),
                           { defaultValue: 1 });
+       /*jslint confusion: false*/
 
        var baseurl = '/config/clamav';
 
        Ext.apply(me, {
            url: '/api2/json' + baseurl,
            editorConfig: {
-               url: '/api2/extjs' + baseurl,
+               url: '/api2/extjs' + baseurl
            },
            interval: 5000,
            cwidth1: 200,
@@ -29,7 +33,7 @@ Ext.define('PMG.ClamAVDatabaseConfig', {
 
        me.callParent();
 
-       me.on('activate', me.rstore.stopUpdate);
+       me.on('activate', me.rstore.startUpdate);
        me.on('destroy', me.rstore.stopUpdate);
        me.on('deactivate', me.rstore.stopUpdate);
     }
@@ -69,8 +73,6 @@ Ext.define('PMG.ClamAVDatabaseStatus', {
            }
        });
 
-       Proxmox.Utils.monStoreErrors(me, me.store);
-
        Ext.apply(me, {
            viewConfig: {
                trackOver: false
@@ -99,12 +101,19 @@ Ext.define('PMG.ClamAVDatabaseStatus', {
                    flex: 1,
                    sortable: true,
                    dataIndex: 'nsigs'
-               },
-           ]
+               }
+           ],
+           listeners: {
+               activate: me.reload
+           }
        });
+
        me.callParent();
 
-       me.reload();
+       /*jslint confusion: true*/
+       /*monStoreErrors is a bool above*/
+       Proxmox.Utils.monStoreErrors(me.getView(), me.store, true);
+       /*jslint confusion: false*/
     }
 });
 
@@ -125,7 +134,8 @@ Ext.define('PMG.ClamAVDatabase', {
        });
 
        var statusPanel = Ext.create('PMG.ClamAVDatabaseStatus', {
-           border: false
+           border: false,
+           flex: 1
        });
 
        var update_command = function(){
@@ -142,7 +152,7 @@ Ext.define('PMG.ClamAVDatabase', {
                        upid: upid
                    });
                    win.show();
-                   me.mon(win, 'close', function() { statusPanel.reload() });
+                   me.mon(win, 'close', function() { statusPanel.reload(); });
                }
            });
        };
@@ -152,7 +162,7 @@ Ext.define('PMG.ClamAVDatabase', {
                text: gettext('Edit'),
                xtype: 'proxmoxButton',
                disabled: true,
-               handler: function() { editPanel.run_editor() },
+               handler: function() { editPanel.run_editor(); },
                selModel: selModel
             },
            {
@@ -165,5 +175,8 @@ Ext.define('PMG.ClamAVDatabase', {
 
        me.callParent();
 
+       editPanel.relayEvents(me, ['activate', 'deactivate', 'destroy']);
+       statusPanel.relayEvents(me, ['activate', 'deactivate', 'destroy']);
+
     }
 });