The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Customising CPanel interface Statsbar.pm

Discussion in 'User Experience' started by failvalue, May 21, 2012.

  1. failvalue

    failvalue Registered

    Joined:
    Sep 7, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I am trying to make some small modifications the the Stats Panel on the cpanel main menu. (The expandable box that contains Lastlogin, disk usage, number of email accounts etc)

    Looking around I found the file /usr/local/cpanel/Cpanel/StatsBar.pm which seems to be what I am looking for. I have added an entry for the number of Inods for a particualr user but no changes are appearing in the actual cpanel account when I log in.

    Am I editing the right file? Is there something else I should be doing?

    Any advise would be appricated.

    Regards,
    Colin
     
  2. iakela

    iakela Member

    Joined:
    Oct 18, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Colin,

    If you added new function to StatsBar.pm file you need to use the function in the theme:

    /usr/local/cpanel/base/frontend/x3/branding/index.html (cPanel's guys suggest using Branding Editor)

    Find this code:
    Code:
                    <?cp StatsBar::stat(
                            [tr class="row-%"]
                                    [td class="stats_left"]%[/td]
                                    [td class="stats_right"]
                                            % / %[br /]
                                            [div class="stats_progress_bar"]
                                                    [div class="cpanel_widget_progress_bar_percent" style="display\{colon}none"]%[/div]
                                            [/div]
                                    [/td]
                            [/tr]
                    ,rowtype,item,count,max,percent) display=lvecpu|lvemem|lvemep|diskusage|bandwidthusage,infinitylang=true,rowcounter=mainstats ?>
    and add your custom function, something like this:
    Code:
    display=lvecpu|lvemem|lvemep|diskusage|inodes|bandwidthusage,infinitylang=true,rowcounter=mainstats ?>
    
    Don't forget that StatsBar.pm file can be replaced after upcp, as well as index.html file if you changed it via CLI.
     
Loading...

Share This Page