Discussion:
Adding Custom Properties to Device Overview
Gus N
2012-08-20 15:27:46 UTC
Permalink
Gus N [http://community.zenoss.org/people/dg1101] created the discussion

"Re: Adding Custom Properties to Device Overview"

To view the discussion, visit: http://community.zenoss.org/message/68015#68015

--------------------------------------------------------------
Apologies for resurrecting an old thread - but did you find a solution to this?

Thanks,
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/68015#68015]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jshank
2012-08-20 15:40:20 UTC
Permalink
jshank [http://community.zenoss.org/people/jshank] created the discussion

"Re: Adding Custom Properties to Device Overview"

To view the discussion, visit: http://community.zenoss.org/message/68028#68028

--------------------------------------------------------------
I never did, sorry. We have since moved on to a different product.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/68028#68028]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
gio caracoglia
2012-08-20 16:23:40 UTC
Permalink
gio caracoglia [http://community.zenoss.org/people/giocar] created the discussion

"Re: Adding Custom Properties to Device Overview"

To view the discussion, visit: http://community.zenoss.org/message/68029#68029

--------------------------------------------------------------
Hello,

I may have a solution. I give you the code to change (i.e. removinf 2 field and adding a new one with my own values) the first (from left) panel, where uptime is.
Depending from your Zenoss version, you have to restart the some daemons to see the UI changes.
If you need to change other panels, you must find the ID and declare it, as I did for DEVICE_OVERVIEW_ID = ....
I hope this will help.

Steps:
- Add a file in the js directory (in my example: browser/resources/js/devicedetails.js). The code is below.
- use it in browser/configure.zcml adding the following code:
<viewlet
        name="js-mydet"
        paths="/++resource++<your resourceDirectory name>/js/devicedetails.js"
        weight="9"
        for="..MyDevice.MyDevice"
        manager="Products.ZenUI3.browser.interfaces.IJavaScriptSrcManager"
        class="Products.ZenUI3.browser.javascript.JavaScriptSrcBundleViewlet"
        permission="zope2.Public"
        />

==== js file ====

Ext.onReady(function() {

    DEVICE_OVERVIEW_ID = 'deviceoverviewpanel_summary';

    // first from left panel part: overview: my changes
    var modifyDeviceOverview = function(overview) {
        overview = Ext.getCmp(DEVICE_OVERVIEW_ID);
        overview.removeField('locking');
        overview.removeField('memory');
        overview.addField({
            name:'mytotalMemory',
            fieldLabel: _t('TotalMemory'),
            setRawValue: function(mytotalMemory) {
                var v = 'None';
                if (mytotalMemory) {
                    v = Zenoss.render.memory(mytotalMemory)
                }
                Zenoss.DisplayField.superclass.setRawValue.call(this, v);
            }
        });
    };
    Ext.ComponentMgr.onAvailable(DEVICE_OVERVIEW_ID, modifyDeviceOverview)
});
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/68029#68029]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...