From 74e058c8a010ef6feb539248a550d0bb169c1e94 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 27 Dec 2010 00:04:44 +0000 Subject: import torrus 1.0.9 --- torrus/templates/aclexport.xml | 40 ++++ torrus/templates/adminfo.html | 38 +++ torrus/templates/default-chooser.html | 37 +++ torrus/templates/default-dir.html | 74 ++++++ torrus/templates/default-helptext.html | 39 ++++ torrus/templates/default-login.html | 59 +++++ torrus/templates/default-recursivedir.html | 52 +++++ torrus/templates/default-rrd.html | 134 +++++++++++ torrus/templates/default-tset.html | 56 +++++ torrus/templates/email-alarm.txt | 27 +++ torrus/templates/expanded-dir.html | 52 +++++ torrus/templates/globalsearch.html | 43 ++++ torrus/templates/html-incblocks.txt | 356 +++++++++++++++++++++++++++++ torrus/templates/overview-subleaves.html | 47 ++++ torrus/templates/report-index.html | 29 +++ torrus/templates/report-monthly.html | 132 +++++++++++ torrus/templates/report-serviceid.html | 147 ++++++++++++ torrus/templates/report-yearly.html | 31 +++ torrus/templates/search.html | 43 ++++ torrus/templates/tset-list.html | 38 +++ 20 files changed, 1474 insertions(+) create mode 100644 torrus/templates/aclexport.xml create mode 100644 torrus/templates/adminfo.html create mode 100644 torrus/templates/default-chooser.html create mode 100644 torrus/templates/default-dir.html create mode 100644 torrus/templates/default-helptext.html create mode 100644 torrus/templates/default-login.html create mode 100644 torrus/templates/default-recursivedir.html create mode 100644 torrus/templates/default-rrd.html create mode 100644 torrus/templates/default-tset.html create mode 100644 torrus/templates/email-alarm.txt create mode 100644 torrus/templates/expanded-dir.html create mode 100644 torrus/templates/globalsearch.html create mode 100644 torrus/templates/html-incblocks.txt create mode 100644 torrus/templates/overview-subleaves.html create mode 100644 torrus/templates/report-index.html create mode 100644 torrus/templates/report-monthly.html create mode 100644 torrus/templates/report-serviceid.html create mode 100644 torrus/templates/report-yearly.html create mode 100644 torrus/templates/search.html create mode 100644 torrus/templates/tset-list.html (limited to 'torrus/templates') diff --git a/torrus/templates/aclexport.xml b/torrus/templates/aclexport.xml new file mode 100644 index 000000000..b27b4d373 --- /dev/null +++ b/torrus/templates/aclexport.xml @@ -0,0 +1,40 @@ + + + + + + + 1.1 + + + + [% FOREACH group = groups() %] + + [% privhash = privileges(group); + FOREACH object = privhash.keys.sort; + FOREACH priv = privhash.$object.keys.sort %] + + [% END; + END; + FOREACH attr = gattrlist(group); %] + + [% END; %] + + [% END %] + + + + [% FOREACH uid = users() %] + + [% FOREACH group = memberof(uid) %] + + [% END; + FOREACH attr = uattrlist(uid); + IF attr != 'uid' %] + + [% END; + END %] + + [% END %] + + diff --git a/torrus/templates/adminfo.html b/torrus/templates/adminfo.html new file mode 100644 index 000000000..a041e0033 --- /dev/null +++ b/torrus/templates/adminfo.html @@ -0,0 +1,38 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title='Administrative information: ' _ path(token) + contentClass="SingleColumnContent" + noTopMenu=1 %] + +

Administrative information

+[% INCLUDE treename %] +

Path: [% path(token) %]

+ +[% +FOREACH category = adminfo.keys.sort; +%] +

[% category %]

+
+[% + counter = 0; + evenRow = 0; + + FOREACH pname = adminfo.$category.keys.sort; + counter = counter + 1; + IF counter % 2 == 0; + evenRow = 1; + ELSE; + evenRow = 0; + END; +%] +
+ [% pname %] + [% adminfo.$category.$pname %] + +
+[% END %] +
+[% +END %] + +[% INCLUDE htmlend %] diff --git a/torrus/templates/default-chooser.html b/torrus/templates/default-chooser.html new file mode 100644 index 000000000..f49b7899f --- /dev/null +++ b/torrus/templates/default-chooser.html @@ -0,0 +1,37 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Torrus Top: " _ companyName + contentClass="SingleColumnContent" + noTopMenu=1 %] + +

Choose the datasource tree

+ +
+[% counter = 0; + evenRow = 0; + + FOREACH tree = treeNames(); + + IF not userAuth or mayDisplayTree(tree); + counter = counter + 1; + + IF counter % 2 == 0; + evenRow = 1; + ELSE; + evenRow = 0; + END; +%] + +
+ [% tree %] + [% xmlnorm(treeDescr(tree)) %] +
+ [% END %] +[% END %] +
+ +[% global.contentFinished = 1 %] +
+[% INCLUDE globalsearchdialog %] +
+[% INCLUDE htmlend %] diff --git a/torrus/templates/default-dir.html b/torrus/templates/default-dir.html new file mode 100644 index 000000000..ef6358d1e --- /dev/null +++ b/torrus/templates/default-dir.html @@ -0,0 +1,74 @@ +[% PROCESS 'html-incblocks.txt' %] +[% thepath=path(token) %] +[% INCLUDE htmlstart title=thepath printpath=1 %] + +

[% xmlnorm(nodeParam(token,'comment')) %]

+ +[% INCLUDE legend %] + +

Directories you can jump to:

+
+[% hasLeaves = 0; hasSubtrees = 0; + childCounter = 0; + evenRow = 0; + FOREACH child = sortTokens(children(token)); + hidden = 0; + IF nodeParam(child,'hidden') == 'yes'; + hidden = 1; + END; + comment = nodeParam(child,'comment',1); + IF not hidden or variables.SHOWHIDDEN; + childCounter = childCounter + 1; + evenRow = childCounter % 2 == 0; + IF isLeaf(child); + hasLeaves = hasLeaves + 1; + ELSE; + IF isAlias(child); + thisIsAlias = 1; + urlTitle=' TITLE="Symbolic link to ' _ path(isAlias(child)) _'"'; + IF isLeaf(isAlias(child)); + hasLeaves = hasLeaves + 1; + END; + ELSE; + hasSubtrees = 1; + urlTitle = ''; + END; + END; +%] +
+ + [% thisIsAlias ? '':''; + hidden ? '':'' %] + [% nodeName(child) %] + [% hidden ? '':''; + thisIsAlias ? '':''; %] + + [% IF comment %] + + [% hidden ? '':'' %] + [% xmlnorm(comment) %] + [% hidden ? '':'' %] + + [% END %] +
+ [% END %] + [% END %] +
+ +
+[% IF hasLeaves > 1; + INCLUDE shortcut url=url(token, 'expanded-dir-html') + text="Expand leaves" + title="Show all leaf graphs in one page"; + END; + IF hasSubtrees and nodeParam(token,'show-recursive',1) == 'yes'; + INCLUDE shortcut url=url(token, 'recursive-dir-html') + text="Recursive view" + title="Show all subtrees and leaves in one page"; + + END; + INCLUDE overviewShortcuts %] +
+ +[% INCLUDE bottomline %] +[% INCLUDE htmlend %] diff --git a/torrus/templates/default-helptext.html b/torrus/templates/default-helptext.html new file mode 100644 index 000000000..3f9cb15bd --- /dev/null +++ b/torrus/templates/default-helptext.html @@ -0,0 +1,39 @@ +[%# #### We don't need the standard header and footer ####### %] +[% PROCESS 'html-incblocks.txt' %] +[% thepath=path(token) %] + + + + +Help: [%thepath%] + + + + +
+ +
+Torrus Help +
+ +
+[% thepath %] +
+ +[% helptext=nodeParam(token, 'help-text', 1); %] +
+[% markup( helptext ) %] +
+ + +
+ + diff --git a/torrus/templates/default-login.html b/torrus/templates/default-login.html new file mode 100644 index 000000000..47dc61070 --- /dev/null +++ b/torrus/templates/default-login.html @@ -0,0 +1,59 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Torrus Login: " _ companyName + contentClass="SingleColumnContent" + noTopMenu=1 %] + +[% IF authFailed %] +

Incorrect username or password.

+[% END %] + +

Please authenticate yourself

+ +
+ [% IF urlPassParams.token.defined AND urlPassParams.token.length > 0 %] + + [% ELSE; + IF urlPassParams.path.defined AND urlPassParams.path.length > 0 %] + + [% ELSE; + IF urlPassParams.nodeid.defined AND urlPassParams.nodeid.length > 0 %] + + [% END; + END; + END %] + [% IF urlPassParams.view.defined AND urlPassParams.view.length > 0 %] + + [% END %] +
+ Username: + + + +
+
+ Password: + + + +
+
+ +   + + + + remember me + +
+
+ +
+
+[% IF lostPasswordURL %] +
+ Lost password? +
+[% END %] + +[% INCLUDE htmlend %] diff --git a/torrus/templates/default-recursivedir.html b/torrus/templates/default-recursivedir.html new file mode 100644 index 000000000..eed649322 --- /dev/null +++ b/torrus/templates/default-recursivedir.html @@ -0,0 +1,52 @@ +[% PROCESS 'html-incblocks.txt' %] +[% thepath=path(token) %] +[% INCLUDE htmlstart title=thepath printpath=1 %] + +

[% xmlnorm(nodeParam(token,'comment')) %]

+ +[% INCLUDE legend %] + +[%# ########### Recursively print the children ################ %] + +[% BLOCK recursiveChildren; + FOREACH child = sortTokens(children(token)); + hidden = 0; + IF nodeParam(child,'hidden') == 'yes'; + hidden = 1; + END; + IF isAlias(child); + thisIsAlias = 1; + urlTitle = 'Symbolic link to ' _ path(isAlias(child)); + ELSE; + urlTitle = nodeParam(child,'comment',1); + END; + IF not hidden or variables.SHOWHIDDEN; %] +
+ + [% thisIsAlias ? '':''; + hidden ? '':'' %] + [% nodeName(child) %] + [% hidden ? '':''; thisIsAlias ? '':''; %] + + [% INCLUDE recursiveChildren token=child %] +
+ [% END; + END; + END %] + + +

Directories you can jump to:

+
+[% INCLUDE recursiveChildren token=token %] +
+ +
+[% INCLUDE shortcut url=url(token) text="Default view" + title="Restore default subtree view"; + INCLUDE overviewShortcuts +%] +
+ +[% INCLUDE bottomline %] +[% INCLUDE htmlend %] diff --git a/torrus/templates/default-rrd.html b/torrus/templates/default-rrd.html new file mode 100644 index 000000000..cfbdbce8d --- /dev/null +++ b/torrus/templates/default-rrd.html @@ -0,0 +1,134 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE setdate %] +[% INCLUDE htmlstart title='Graphs for ' _ path(token) printpath=1 %] + +[% parentComment = nodeParam(parent(token),'comment') %] +[% IF parentComment %]

Graphs for [% xmlnorm(parentComment) %]

[% END %] + +[% INCLUDE variables %] + +

[% xmlnorm(nodeParam(token,'comment')) %]

+ +[% INCLUDE legend %] + +[% monitors = nodeParam(token,'monitor'); + IF monitors != ''; + moncount = monitors.split(',').size %] +
+
+Monitor[% (moncount > 1) ? 's' : '' %]: +[% (moncount > 1) ? moncount : '' %] +[% FOREACH monitor = monitors.split(','); + mondesc = param(monitor, 'comment') %] +
+ [% monitor %] + [% IF mondesc; %]([% mondesc %])[% END %] +
+[% END %] +
+
+[% END %] + +[% IF nodeParam(token, 'ds-type') != 'rrd-multigraph' %] + [% dayValues = rrprint(token, 'rrd-print-daily') %] + [% lastValue = rrprint(token, 'rrd-print-last') %] + +

Min: [% scale('%.1f', dayValues.0) %],   + Avg: [% scale('%.1f', dayValues.1) %],   + Max: [% scale('%.1f', dayValues.2) %],   + Last: [% scale('%.1f', lastValue) %] +

+[% END %] + +[% + graphvars = []; + graphviews = nodeParam(token,'rrgraph-views').split(','); + dayView = graphviews.1; + weekView = graphviews.2; + monthView = graphviews.3; + yearView = graphviews.4; + IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and + ( param(view, 'rrd-hwpredict') == 'disabled' or variables.NOHW ); + graphvars = ['NOHW', 1]; + END; +%] + +
+

Last day graph

+[% INCLUDE rrgraph view=dayView vars=graphvars %] +
+ +
+

Last week graph

+[% INCLUDE rrgraph view=weekView vars=graphvars %] +
+ +[% longterm = param(view, 'longterm') %] +[% IF longterm %] + +
+

Last month graph

+[% INCLUDE rrgraph view=monthView %] +
+ +
+

Last year graph

+[% INCLUDE rrgraph view=yearView %] +
+ +[% END %] + +
+[% + IF longterm; + hwview='longterm-rrd-html'; + termview='default-rrd-html'; + ELSE; + hwview='default-rrd-html'; + termview='longterm-rrd-html'; + END; + hwvars = []; + termvars = []; + IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and + param(view, 'rrd-hwpredict') != 'disabled'; + IF not variables.NOHW; + hwaction = 'Disable'; + hwvars = ['NOHW', 1]; + termvars = ['NOHW', '']; + ELSE; + hwaction = 'Enable'; + hwvars = ['NOHW', '']; + termvars = ['NOHW', 1]; + END; + INCLUDE shortcut url=url(token, hwview, hwvars) + text=hwaction _ " Holt-Winters" + title="Switch Holt-Winters prediction boundaries"; + ELSE; + IF longterm; + termview='default-rrd-html'; + ELSE; + termview='longterm-rrd-html'; + END; + END; + + IF longterm; + termstr='Short'; + sctitle="View last day and last week graphs"; + ELSE; + termstr='Long'; + sctitle="View last day, week, month, and year graphs"; + END; + + INCLUDE shortcut url=url(token, termview, termvars) + text=termstr _ "term view" + title=sctitle; + + INCLUDE shortcut url=plainURL _ 'explain-rrdgraph.html' + text='Explain graph' + title='Describe graph elements and values' + newwindow=1; +%] +
+ +[% INCLUDE bottomline %] +[% INCLUDE htmlend %] diff --git a/torrus/templates/default-tset.html b/torrus/templates/default-tset.html new file mode 100644 index 000000000..6cf79111a --- /dev/null +++ b/torrus/templates/default-tset.html @@ -0,0 +1,56 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE setdate %] +[% comment = xmlnorm(param(token, 'comment')) %] +[% INCLUDE htmlstart title=comment contentClass="SingleColumnContent" %] + +

[% comment %]

+ +[% INCLUDE treename %] + +[% INCLUDE variables %] + +[% SET pos = 1; SET global.hwpredict = 0 %] +[% FOREACH node = sortTokens(tsetMembers(token)) %] + [% IF pos == 1 %] +
+ [% ELSE %] +
+ [% END %] + [% nodename=nodeParam(node,'descriptive-nickname'); + IF nodename==''; + nodename=path(node); + END; + INCLUDE shortgraph + token=node + nodename=nodename + comment=nodeParam(parent(node),'comment',1) + %] +
+ [% IF pos == 1 %] + [% SET pos = 2 %] + [% ELSE %] + [% SET pos = 1 %] + [% END %] +[% END %] + +
+[% + IF global.hwpredict; + IF variables.NOHW; + INCLUDE shortcut url=url(token, view, 'NOHW', '') + text="Enable Holt-Winters" + title="Switch Holt-Winters prediction boundaries"; + ELSE; + INCLUDE shortcut url=url(token, view, 'NOHW', 1) + text="Disable Holt-Winters" + title="Switch Holt-Winters prediction boundaries"; + END; + END +%] + +[% INCLUDE shortcut url=url('SS') text="Back to tokensets list" + title="List of non-empty tokensets"%] +
+ +[% INCLUDE tsetbottomline %] +[% INCLUDE htmlend %] diff --git a/torrus/templates/email-alarm.txt b/torrus/templates/email-alarm.txt new file mode 100644 index 000000000..59c603688 --- /dev/null +++ b/torrus/templates/email-alarm.txt @@ -0,0 +1,27 @@ +Subject: Monitor event: [%event%], [% nickname %] + +This is automatic Torrus event notification. + +Event timestamp: [% timestamp %] + +Tree name: [% tree %] +Node path: [% path %] +Node description: [% npcomment %] +Monitor name: [% monitor %] +Monitor description: [% mcomment %] + +Event type: [% event %] + +You can browse the node up-to-date graphs at this URL: + [% url %] + + + +Event types description: + set Alarm condition is met first time + repeat Alarm condition repeats + clear Alarm condition is no longer met + forget Information about this alarm has expired + +Torrus home page and documentation: + http://torrus.sourceforge.net \ No newline at end of file diff --git a/torrus/templates/expanded-dir.html b/torrus/templates/expanded-dir.html new file mode 100644 index 000000000..844a2c37c --- /dev/null +++ b/torrus/templates/expanded-dir.html @@ -0,0 +1,52 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE setdate %] +[% thepath=path(token) %] +[% INCLUDE htmlstart title=thepath printpath=1 %] + +

[% xmlnorm(nodeParam(token,'comment')) %]

+ +[% INCLUDE variables %] + +[% INCLUDE legend %] + +

Leaf nodes:

+[% + FOREACH child = sortTokens(children(token)); + IF isLeaf(child); + INCLUDE shortgraph + token=child + nodename=nodeName(child) + comment=nodeParam(child,'comment',1); + ELSIF isAlias(child); + atoken=isAlias(child); + IF isLeaf(atoken); + INCLUDE shortgraph + token=atoken + nodename=nodeName(atoken) + comment=path(atoken); + END; + END; + END; +%] + +
+[% + IF global.hwpredict; + IF variables.NOHW; + INCLUDE shortcut url=url(token, view, 'NOHW', '') + text="Enable Holt-Winters" + title="Switch Holt-Winters prediction boundaries"; + ELSE; + INCLUDE shortcut url=url(token, view, 'NOHW', 1) + text="Disable Holt-Winters" + title="Switch Holt-Winters prediction boundaries"; + END; + END +%] + +[% INCLUDE shortcut url=url(token) text="Default view" + title="Restore default subtree view" %] +
+ +[% INCLUDE bottomline %] +[% INCLUDE htmlend %] diff --git a/torrus/templates/globalsearch.html b/torrus/templates/globalsearch.html new file mode 100644 index 000000000..c01c3d4ed --- /dev/null +++ b/torrus/templates/globalsearch.html @@ -0,0 +1,43 @@ +[% PROCESS 'html-incblocks.txt' %] +[% global.SearchString = variables.SEARCH; clearVar('SEARCH') %] +[% INCLUDE htmlstart + title='Global Search results: ' _ global.SearchString + contentClass="SingleColumnContent" + noTopMenu=1 %] + +
+[% INCLUDE shortcut url=url() text="Top" + title="Choose from the list of trees"%] +
+ +

Global Search results: [% global.SearchString %]

+
+[% results = searchResults( global.SearchString ); + counter = 0; + + FOREACH entry = results; + + counter = counter + 1; + IF counter % 2 == 0; + evenRow = 1; + ELSE; + evenRow = 0; + END; + +%] +
+ [%entry.0%]: + + [% entry.1 %] + +
+[% END %] +
+ + +
[% global.contentFinished = 1 %] +
+[% INCLUDE globalsearchdialog %] +
+ +[% INCLUDE htmlend %] diff --git a/torrus/templates/html-incblocks.txt b/torrus/templates/html-incblocks.txt new file mode 100644 index 000000000..ca5540e69 --- /dev/null +++ b/torrus/templates/html-incblocks.txt @@ -0,0 +1,356 @@ +[%# + $Id: html-incblocks.txt,v 1.1 2010-12-27 00:04:03 ivan Exp $ + All BLOCK statements are defined here +%] + +[%# ########### Initialize globals ################ %] +[% global.setDateDialog = 0; %] + + +[%# ########### Print the starting HTML blahblah ################ %] + +[% BLOCK htmlstart; + IF ! contentClass; contentClass="Content"; END %] + + + + + +[% title %] + +[% IF expires %][% END %] + + + + +
+ + +[% IF companyLogo %][% ELSE; companyName; END %] + + +[% IF siteInfo %] + +[% siteInfo %] + +[% END %] + +[% IF treeName and treeInfo %] + +[% treeInfo %] + +[% END %] + +[% IF userAuth and uid; + commonname = userAttr('cn'); + IF commonname == ''; commonname = uid; END; %] +
+[% commonname %] +Logout +
+[% END %] +
+
[% timestamp %]
+[% IF printpath %] +
+ [% INCLUDE treename %] +
+ Current path: + [% splitUrls(token) %] +
+
+[% END %] +[% IF not noTopMenu %] +
+[% INCLUDE shortcut url=topURL text="Top" + title="Choose from the list of trees"%] +[% theParent=parent(token); + IF theParent and theParent != token; + INCLUDE shortcut url=url(theParent) text="Up" + title="Climb up the tree"; + END %] +[% INCLUDE helpshortcut %] +[% IF mayDisplayAdmInfo(token); + INCLUDE shortcut url=url(token,'adminfo') + text="AdmInfo" + title="Administrative details" + newwindow=1; + END +%] + +
+[% END %] +
+[% global.contentFinished = 0 %] +[% IF global.printError %] +
[% global.printError %]
+[% global.printError = '' %] +[% END %] +[% END %] + +[%# ########### Print the legend ################ %] + +[% BLOCK legend %] +[% legend = nodeParam(token, 'legend') %] +[% IF legend.length > 0 %] +
+[% FOREACH legpairstring = legend.split(';') %] +[% SET legpair = legpairstring.split(':') %] +
+ [% xmlnorm(legpair.0) %]: + [% xmlnorm(legpair.1) %] +
+[% END %] +
+[% END %] +[% END %] + +[%# ########### Print the TZ and NOW variables ################ %] + +[% BLOCK variables %] +[% IF variables.TZ or variables.NOW %] +

+[% IF variables.TZ %] + Timezone: + [% variables.TZ %]. +[% END %] +[% IF variables.NOW %] + Report date: + [% variables.NOW %]. +[% END %] +

+[% END %] +[% END %] + + +[%# ########### Print the current tree name ################ %] + +[% BLOCK treename %] +
+ Tree: + [% treeName %] +
+[% END %] + +[%# ########### Print the shortcut ################ %] + +[% BLOCK shortcut %] + + [ [%text%] ] + +[% END %] + +[%# ########### Print the Help shortcut ################ %] +[% BLOCK helpshortcut; + IF nodeParam(token, 'help-text', 1); + INCLUDE shortcut + url="javascript:helpwindow()" + text="Help" + title="Open a help window for this page"; + END; + END %] + +[%# ########### Print the common bottomline ################ %] + +[% BLOCK bottomline %] +
[% global.contentFinished = 1 %] +
+[% INCLUDE shortcut url=persistentUrl(token,view,global.bookmarkVars) + text="Bookmark" + title="Permanent link to this page"%] +[% INCLUDE shortcut url=url('SS') text="Tokensets" + title="List of non-empty tokensets"%] +[% INCLUDE shortcut url=url(token,view,'MEDIA','printer','OVS',ovs) + text="Printable view" + title="Prepare this page for printing" + newwindow=1%] +[% IF mayDisplayReports(); + INCLUDE shortcut url=reportsUrl + text="Reports" + title="Show reports page" + newwindow=1; + END %] +[% IF global.setDateDialog; INCLUDE enterdate; END %] +[% INCLUDE searchdialog %] +
+[% END %] + +[%# ########### Print the Tokensets bottomline ################ %] + +[% BLOCK tsetbottomline %] +[% global.contentFinished = 1 %] +
+[% INCLUDE shortcut url=url(pathToken('/')) text="Datasources tree" + title="Back to the datasources tree" %] +[% INCLUDE shortcut url=url(token,view,'MEDIA','printer') + text="Printable view" + title="Prepare this page for printing" + newwindow=1%] +[% INCLUDE helpshortcut %] +[% INCLUDE searchdialog %] +
+[% END %] + + +[%# ########### Print the ending HTML blahblah ################ %] + +[% BLOCK htmlend %] +[% IF ! global.contentFinished %][% END %] + + + +[% END %] + +[%# ######## Print the RRD graph image ####### %] + +[% BLOCK rrgraph %] +
+[% param(view, 'description') %] +
+[% END %] + + +[%# ######## Print the short-term RRD graph image ####### %] + +[% BLOCK shortgraph %] +[% + hidden = 0; + IF nodeParam(token,'hidden') == 'yes'; + hidden = 1; + END; + IF not hidden or variables.SHOWHIDDEN +%] +
+ [% IF not urltoken; urltoken = token; END %] + [% hidden ? '':'' %] + + [%IF comment%]
[%xmlnorm(comment)%]
[%END%] + [% hidden ? '
':'' %] + + [% + shortView = nodeParam(token,'rrgraph-views').split(',').0; + shortvars = []; + IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and + param(view, 'rrd-hwpredict') != 'disabled'; + global.hwpredict = 1; + IF variables.NOHW; + shortvars = ['NOHW', 1]; + ELSE; + shortvars = ['NOHW', '']; + END; + END + %] +
+ + [% param(shortView, 'description') %] + +
+
+ [% END %] +[% END %] + + +[%# ######## Print the overview shortcuts ####### %] +[% BLOCK overviewShortcuts %] +[% + IF nodeParam(token, 'has-overview-shortcuts', 1) == 'yes'; + FOREACH ovs = nodeParam(token,'overview-shortcuts').split('\s*,\s*'); + p1 = 'overview-shortcut-text-' _ ovs; + p2 = 'overview-shortcut-title-' _ ovs; + INCLUDE shortcut + url=url(token, 'overview-subleaves-html', 'OVS', ovs) + text=nodeParam(token, p1, 1) + title=nodeParam(token, p2, 1); + END; + END %] +[% END %] + + +[%# ######## Set the date variable ####### %] +[% BLOCK setdate %] +[% IF variables.SETDATE == 1; + thedate = verifyDate( variables.SETDATEV ); + IF thedate.length == 0; + global.printError = 'Incorrect date format'; + clearVar('SETDATE'); + ELSE; + variables.NOW = thedate; + END; + ELSE; + clearVar('NOW'); + clearVar('SETDATE'); + clearVar('SETDATEV'); + END; + global.setDateDialog = 1; +%] +[% END %] + + +[%# ######## Print the date selection elements ####### %] +[% BLOCK enterdate %] + +
+ + +[% IF ovs %][% END %] + + + +
+
+[% END %] + + +[%# ######## Print the searchform HTML ####### %] +[% BLOCK searchdialog %] +[% IF searchEnabled %] + +
+ + + + + +
+
+[% END %] +[% END %] + +[%# ######## Print the Global searchform HTML ####### %] +[% BLOCK globalsearchdialog %] +[% IF mayGlobalSearch() %] + +
+ + + +
+
+[% END %] +[% END %] diff --git a/torrus/templates/overview-subleaves.html b/torrus/templates/overview-subleaves.html new file mode 100644 index 000000000..345e06fd9 --- /dev/null +++ b/torrus/templates/overview-subleaves.html @@ -0,0 +1,47 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE setdate %] +[% ovs=variables.OVS; clearVar('OVS'); global.bookmarkVars=['OVS',ovs]; + thepath=path(token) %] +[% INCLUDE htmlstart title=thepath printpath=1 %] + +

[% p = 'overview-page-title-' _ ovs; nodeParam(token, p, 1) %]

+ +[% INCLUDE variables %] + +[% INCLUDE legend %] + +[% + FOREACH child = sortTokens(children(token)); + childpath = path(child); + p = 'overview-subleave-name-' _ ovs; + FOREACH childname = nodeParam(token, p,1).split('\s*,\s*'); + ovwpath = childpath _ childname; + IF nodeExists(ovwpath); + ovwtoken = pathToken(ovwpath); + + urltoken = ovwtoken; + p = 'overview-direct-link-' _ ovs; + IF nodeParam(token, p, 1) == 'yes'; + urltoken = child; + p = 'overview-direct-link-view-' _ ovs; + urlview = nodeParam(token, p, 1); + END; + + INCLUDE shortgraph + token=ovwtoken + urltoken=urltoken + urlview=urlview + nodename=nodeName(child) + comment=nodeParam(child,'comment',1); + END; + END; + END +%] + +
+[% INCLUDE shortcut url=url(token) text="Default view" + title="Restore default subtree view" %] +
+ +[% INCLUDE bottomline %] +[% INCLUDE htmlend %] diff --git a/torrus/templates/report-index.html b/torrus/templates/report-index.html new file mode 100644 index 000000000..7bc41a66d --- /dev/null +++ b/torrus/templates/report-index.html @@ -0,0 +1,29 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Torrus Reports" + contentClass="SingleColumnContent" + noTopMenu=1 %] + +

Torrus reports

+ +[% INCLUDE treename %] + + + + + + +[% rowCount = 0; + FOREACH yr = data.keys.sort; + rowCount = rowCount + 1; + IF rowCount % 2 %] + +[% ELSE %] + +[% END %] + + +[% END %] +
Year
[% yr %]
+ +[% INCLUDE htmlend %] diff --git a/torrus/templates/report-monthly.html b/torrus/templates/report-monthly.html new file mode 100644 index 000000000..c302f932d --- /dev/null +++ b/torrus/templates/report-monthly.html @@ -0,0 +1,132 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Torrus Reports: " _ year + contentClass="SingleColumnContent" + noTopMenu=1 %] + +

Torrus report: [% monthName(month) %] +[% year %]

+ +[% INCLUDE treename %] + +[% FOREACH reportname = data.keys.sort; + fieldshash = data.$reportname; + IF reportname == 'MonthlyUsage' %] + + + + + + + + + + + +[% rowCount = 0; + FOREACH serviceid = fieldshash.keys.sort; + rowCount = rowCount + 1; + IF rowCount % 2 %] + +[% ELSE %] + +[% END %] + +[% FOREACH varname = ['AVG', '95TH_PERCENTILE', 'MAX', + 'UNAVAIL', 'VOLUME'] %] + +[% END %] + +[% END %] +
Monthly usage
Service IDAverage95th
Percentile
MaximumUnavailable
samples
Volume
+[% serviceid %] + +[% formatValue( fieldshash.$serviceid.$varname ) %] +
+ +[% ELSE %] + + + + + + + + +[% rowCount = 0; + FOREACH serviceid = fieldshash.keys.sort; + FOREACH varname = fieldshash.$serviceid.keys.sort; + rowCount = rowCount + 1; + IF rowCount % 2 %] + +[% ELSE %] + +[% END %] + + + + +[% END; + END %] +
[% reportname %]
Service IDFieldValue
+[% serviceid %] + +[% varname %] + +[% formatValue( fieldshash.$serviceid.$varname ) %] +
+ +[% END; + END %] + +
+ +
+ +Average: + + +the monthly average of 5-minute samples. + +
+ +
+ +95th percentile: + + +95% of the time, the usage is at or below this amount. + +
+ +
+ +Maximum: + + +the maximum value among 5-minute samples. + +
+ +
+ +Unavailable samples: + + +how many 5-minute samples were missed from the measurements. + +
+ +
+ +Volume: + + +for traffic usage, this is the absolut volume of data in avaiable 5-minute +samples. + +
+ +
+ +[% INCLUDE htmlend %] diff --git a/torrus/templates/report-serviceid.html b/torrus/templates/report-serviceid.html new file mode 100644 index 000000000..bd392ca01 --- /dev/null +++ b/torrus/templates/report-serviceid.html @@ -0,0 +1,147 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Torrus Reports: " _ year + contentClass="SingleColumnContent" + noTopMenu=1 %] + +

Torrus report: [% year %], +[% serviceid %]

+ +[% INCLUDE treename %] + +[% FOREACH reportname = data.keys.sort; + fieldshash = data.$reportname; + IF reportname == 'MonthlyUsage' %] + + + + + + + + + + + + +[% rowCount = 0; + FOREACH mth = fieldshash.keys.sort; + rowCount = rowCount + 1; + IF rowCount % 2 %] + +[% ELSE %] + +[% END %] + +[% FOREACH varname = ['AVG', '95TH_PERCENTILE', 'MAX', + 'UNAVAIL', 'VOLUME'] %] + +[% END %] + + +[% END %] +
Monthly usage
MonthAverage95th
Percentile
MaximumUnavailable
samples
VolumeExtrapolated
volume
+[% monthName(mth) %] + +[% formatValue( fieldshash.$mth.$varname ) %] + +[% extr.value = fieldshash.$mth.VOLUME.value * 100 / + ( 100 - fieldshash.$mth.UNAVAIL.value ); + extr.units = fieldshash.$mth.VOLUME.units; + formatValue( extr ) %] +
+ +[% ELSE %] + + + + + + + + +[% rowCount = 0; + FOREACH mth = fieldshash.keys.sort; + FOREACH varname = fieldshash.$mth.keys.sort; + rowCount = rowCount + 1; + IF rowCount % 2 %] + +[% ELSE %] + +[% END %] + + + + +[% END; + END %] +
[% reportname %]
MonthFieldValue
+[% monthName(mth) %] + +[% varname %] + +[% formatValue( fieldshash.$mth.$varname ) %] +
+[% END; + END %] + +
+ +
+ +Average: + + +the monthly average of 5-minute samples. + +
+ +
+ +95th percentile: + + +95% of the time, the usage is at or below this amount. + +
+ +
+ +Maximum: + + +the maximum value among 5-minute samples. + +
+ +
+ +Unavailable samples: + + +how many 5-minute samples were missed from the measurements. + +
+ +
+ +Volume: + + +for traffic usage, this is the absolut volume of data in avaiable 5-minute +samples. + +
+ +
+ +Extrapolated volume: + + +for traffic usage, this is the volume of data extrapolated to the whole +time range. + +
+
+ +[% INCLUDE htmlend %] diff --git a/torrus/templates/report-yearly.html b/torrus/templates/report-yearly.html new file mode 100644 index 000000000..6f9078db2 --- /dev/null +++ b/torrus/templates/report-yearly.html @@ -0,0 +1,31 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Torrus Reports: " _ year + contentClass="SingleColumnContent" + noTopMenu=1 %] + +

Torrus reports: [% year %]

+ +[% INCLUDE treename %] + + + + + + +[% rowCount = 0; + FOREACH mth = data.months; + rowCount = rowCount + 1; + IF rowCount % 2 %] + +[% ELSE %] + +[% END %] + + +[% END %] +
Monthly reports
Month
+[% monthName(mth) _ ' ' _ year %] +
+ +[% INCLUDE htmlend %] diff --git a/torrus/templates/search.html b/torrus/templates/search.html new file mode 100644 index 000000000..b5ce5857e --- /dev/null +++ b/torrus/templates/search.html @@ -0,0 +1,43 @@ +[% PROCESS 'html-incblocks.txt' %] +[% global.SearchString = variables.SEARCH; clearVar('SEARCH') %] +[% INCLUDE htmlstart + title='Search results: ' _ global.SearchString + contentClass="SingleColumnContent" %] + +

Search results: [% global.SearchString %]

+[% INCLUDE treename %] +
+[% results = searchResults(global.SearchString); + counter = 0; + + FOREACH entry = results; + + counter = counter + 1; + IF counter % 2 == 0; + evenRow = 1; + ELSE; + evenRow = 0; + END; + + etoken = pathToken(entry.0); +%] +
+ + [% entry.0 %] + + [% IF entry.1; entry.1 _ ': ' _ xmlnorm(nodeParam(etoken, entry.1)); + END %] + +
+[% END %] +
+ + +[% global.contentFinished = 1 %] +
+[% INCLUDE shortcut url=url(pathToken('/')) text="Datasources tree" + title="Back to the datasources tree" %] +[% INCLUDE searchdialog %] +
+ +[% INCLUDE htmlend %] diff --git a/torrus/templates/tset-list.html b/torrus/templates/tset-list.html new file mode 100644 index 000000000..a3785785b --- /dev/null +++ b/torrus/templates/tset-list.html @@ -0,0 +1,38 @@ +[% PROCESS 'html-incblocks.txt' %] +[% INCLUDE htmlstart + title="Non-empty tokensets" + contentClass="SingleColumnContent" %] + +

Non-empty tokensets

+ +[% INCLUDE treename %] + +
+[% counter = 0; + evenRow = 0; + + FOREACH tset = tsetList(); + sz = tsetMembers(tset).size; + + IF sz.length > 0 AND sz > 0; + + counter = counter + 1; + + IF counter % 2 == 0; + evenRow = 1; + ELSE; + evenRow = 0; + END; +%] + + [% END %] + [% END %] +
+ +[% INCLUDE tsetbottomline %] +[% INCLUDE htmlend %] -- cgit v1.2.1