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