496410a336ecfbf3662a064d63d531f605293b5e
[freeside.git] / torrus / templates / default-rrd.html
1 [% PROCESS 'html-incblocks.txt' %]
2 [% INCLUDE setdate %]
3 [% parentComment = nodeParam(parent(token),'comment') %]
4 [% IF parentComment;
5      INCLUDE htmlstart title='Graphs for ' _ xmlnorm(parentComment);
6    ELSE;
7      INCLUDE htmlstart title='Graphs for ' _ path(token) printpath=1;
8    END;
9 %]
10
11
12  %]<H1>Graphs for [% xmlnorm(parentComment) %]</H1>[% END %]
13
14 [% INCLUDE variables %]
15
16 <P>[% xmlnorm(nodeParam(token,'comment')) %]</P>
17
18 [% INCLUDE legend %]
19
20 [% monitors = nodeParam(token,'monitor');
21    IF monitors != '';
22    moncount = monitors.split(',').size %]
23 <DIV CLASS="Monitors">
24 <DIV CLASS="MonitorsTitle">
25 <STRONG>Monitor[% (moncount > 1) ? 's' : '' %]:</STRONG>
26 [% (moncount > 1) ? moncount : '' %]
27 [% FOREACH monitor = monitors.split(',');
28      mondesc = param(monitor, 'comment') %]
29      <DIV CLASS="MonitorLine">
30      <SPAN CLASS="MonitorName">[% monitor %]</SPAN>
31      [% IF mondesc; %]<SPAN CLASS="MonitorDesc">([% mondesc %])</SPAN>[% END %]
32      </DIV>
33 [% END %]
34 </DIV>
35 </DIV>
36 [% END %]
37
38 [% IF nodeParam(token, 'ds-type') != 'rrd-multigraph' %]
39   [% dayValues = rrprint(token, 'rrd-print-daily') %]
40   [% lastValue = rrprint(token, 'rrd-print-last') %]
41
42   <P>Min: [% scale('%.1f', dayValues.0) %], &nbsp;
43   Avg: [% scale('%.1f', dayValues.1) %], &nbsp;
44   Max: <STRONG>[% scale('%.1f', dayValues.2) %]</STRONG>, &nbsp;
45   Last: [% scale('%.1f', lastValue) %]
46   </P>
47 [% END %]
48
49 [%
50   graphvars = [];
51   graphviews = nodeParam(token,'rrgraph-views').split(',');
52   dayView = graphviews.1;
53   weekView = graphviews.2;
54   monthView = graphviews.3;
55   yearView = graphviews.4;
56   IF   nodeParam(token, 'rrd-hwpredict') == 'enabled' and
57        ( param(view, 'rrd-hwpredict') == 'disabled' or variables.NOHW );
58     graphvars = ['NOHW', 1];
59   END;
60 %]
61
62 <DIV CLASS="Graph">
63 <H2>Last day graph</H2>
64 [% INCLUDE rrgraph view=dayView vars=graphvars %]
65 </DIV>
66
67 <DIV CLASS="Graph">
68 <H2>Last week graph</H2>
69 [% INCLUDE rrgraph view=weekView vars=graphvars %]
70 </DIV>
71
72 [% longterm = param(view, 'longterm') %]
73 [% IF longterm %]
74
75 <DIV CLASS="Graph">
76 <H2>Last month graph</H2>
77 [% INCLUDE rrgraph view=monthView %]
78 </DIV>
79
80 <DIV CLASS="Graph">
81 <H2>Last year graph</H2>
82 [% INCLUDE rrgraph view=yearView %]
83 </DIV>
84
85 [% END %]
86
87 <DIV CLASS="BottomShortcuts">
88 [%
89   IF longterm;
90     hwview='longterm-rrd-html';
91     termview='default-rrd-html';
92   ELSE;
93     hwview='default-rrd-html';
94     termview='longterm-rrd-html';
95   END;
96   hwvars = [];
97   termvars = [];
98   IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and
99      param(view, 'rrd-hwpredict') != 'disabled';
100     IF not variables.NOHW;
101       hwaction = 'Disable';
102       hwvars = ['NOHW', 1];
103       termvars = ['NOHW', ''];
104     ELSE;
105       hwaction = 'Enable';
106       hwvars = ['NOHW', ''];
107       termvars = ['NOHW', 1];
108     END;
109     INCLUDE shortcut url=url(token, hwview, hwvars)
110                      text=hwaction _ " Holt-Winters"
111                      title="Switch Holt-Winters prediction boundaries";
112   ELSE;
113     IF longterm;
114       termview='default-rrd-html';
115     ELSE;
116       termview='longterm-rrd-html';
117     END;
118   END;
119
120   IF longterm;
121     termstr='Short';
122     sctitle="View last day and last week graphs";
123   ELSE;
124     termstr='Long';
125     sctitle="View last day, week, month, and year graphs";
126   END;
127
128   INCLUDE shortcut url=url(token, termview, termvars)
129                   text=termstr _ "term view"
130                   title=sctitle;
131                   
132   INCLUDE shortcut url=plainURL _ 'explain-rrdgraph.html'
133                   text='Explain graph'
134                   title='Describe graph elements and values'
135                   newwindow=1;
136 %]
137 </DIV>
138
139 [% INCLUDE bottomline %]
140 [% INCLUDE htmlend %]