[% USE Whostmgr; USE CPGraph; USE CPMath; USE CPSort; USE JSON; SET barsize = 80; WRAPPER 'master_templates/master.tmpl' theme="yui" app_key = 'view_bandwidth_usage' stylesheets = ['/css/graphs.css'] canvas = 1 extrastyle = ' table { width: 100%; } .text-right { text-align: right; } .top-warning { margin-bottom: 1.5em; } '; SET months=[ '', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; IF data.month == 1; SET lastyear = data.year - 1; SET lastmonth = 12; SET nextyear = data.year; SET nextmonth = 2; ELSIF data.month == 12; SET lastyear = data.year; SET lastmonth = 11; SET nextyear = data.year + 1; SET nextmonth = 1; ELSE; SET lastyear = data.year; SET lastmonth = data.month - 1; SET nextyear = data.year; SET nextmonth = data.month + 1; END; #what to put in the links for sorting descending SET link_descs = { 'user' => 0, 'maindomain' => 0, 'totalbytes' => 0, }; IF data.month == data.current_month && data.year == data.current_year; SET current_view = 1; ELSE; SET current_view = 0; END; SET sorter = { 'field' => data.sortreq || 'user', }; IF data.sortreq == 'totalbytes'; #check for numeric sort SET sorter.num = 1; ELSE; #we want case-insensitive sorting SET sorter.case = 0; END; IF data.sort_desc; #check for descending sort SET sorter.desc = 1; ELSE; link_descs.${data.sortreq} = 1; END; -%] [% IF data.db_creation_in_progress %]
| Last Month ([% months.$lastmonth _ ' ' _ lastyear %]) | [% months.${data.month} _ ' ' _ data.year %] | [% IF data.current_month > data.month || data.current_year > data.year -%] Next Month ([% months.$nextmonth _ ' ' _ nextyear %]) [% ELSE -%] Next Month ([% months.$nextmonth _ ' ' _ nextyear %]) [% END -%] |
| [% locale.maketext('User') %] | [% locale.maketext('Domain') %] |
Xfer (Best Fit) |
Limit (Best Fit) |
[% locale.maketext('Usage') %] | |
[% acct.user -%]
[% IF data.showres == '' && acct.reseller && Whostmgr.hasroot() -%]
[% END -%]
|
[% acct.maindomain -%]
[% IF acct.deleted; ' (deleted)'; END %]
[% IF has_plus_domains -%]
[%# IMPORTANT: make space for the graph BEFORE it is rendered, or else
IE8 (maybe others) will draw it in a 0x0 with overflow: "hidden".
Alternatively, adjust the width/height of the inside the |
[%
SET megs_gigs_xfer = gethumanbw(acct.totalbytes);
IF acct.limit == 'N/A';
SET bwlimit = 'N/A';
SET meg = 'N/A';
ELSIF acct.limit == 0;
SET bwlimit = 'unlimited Meg';
SET meg = 'unlimited';
ELSE;
SET display_limits = gethumanbw( acct.limit );
SET bwlimit = display_limits.2;
SET meg = display_limits.0;
END;
-%]
[% megs_gigs_xfer.2 -%] | [% bwlimit %]
[% IF ! acct.deleted && Whostmgr.checkacl('limit-bandwidth') -%]
|
[% ELSE -%]
[% END -%]
|
[% IF acct.bwlimited -%]
[% END # acct.bwlimited -%]
|
![]() |
Show only accounts that belong to this reseller. | |
![]() |
Show the list of subdomains, addon domains, and parked domains that belong to the corresponding account. | |
![]() |
Adjust the bandwidth limit for the corresponding account. | |
![]() |
[% IF current_view -%]
The system is enforcing a bandwidth limit on the corresponding account. [% ELSE # NOT current_view -%] | Accounts are over their bandwidth limits for the displayed month. [% END # current_view -%] |
Accounts are under 70% of their bandwidth limits. |
||
Accounts reached 70% of their bandwidth limits. |
||
Accounts reached 85% of their bandwidth limits. |
||
| [% megs_gigs_xfer.2 %] |