automatic transformation
Costa Tsaousis (ktsaou) committed
Mar 26, 2014 at 01:08 UTC
029a9d9c296e72edb6b3342e19961e4f67d84c2a
1 file changed
+56
all.xsl
new
+56
@@ -0,0 +1,56 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
+
4
+<xsl:template match="/">
5
+<html>
6
+<style>
7
+ * {font-family:Arial}
8
+ div {float: left; margin: 0 0 0 0; }
9
+</style>
10
+
11
+<head>
12
+ <!--Load the AJAX API-->
13
+ <script type="text/javascript" src="https://www.google.com/jsapi"></script>
14
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
15
+ <script type="text/javascript" src="/file/netdata.js"></script>
16
+ <script type="text/javascript">
17
+
18
+ // Set a callback to run when the Google Visualization API is loaded.
19
+ google.setOnLoadCallback(drawCharts);
20
+
21
+ function drawCharts() {
22
+ <xsl:for-each select="catalog/graph">
23
+ addChart('<xsl:value-of select="name"/>', 'div_graph_<xsl:value-of select="position()"/>', 0, 0, "<xsl:value-of select="dataurl"/>/0/1/average", "<xsl:value-of select="title"/>", "<xsl:value-of select="vtitle"/>");
24
+ </xsl:for-each>
25
+ refreshCharts(999999);
26
+ }
27
+
28
+ var refreshCount = 0;
29
+ function myChartsRefresh() {
30
+ refreshCount += 2;
31
+ if(refreshCount > 500) location.reload();
32
+
33
+ // refresh up to 2 charts per second
34
+ refreshCharts(2);
35
+ }
36
+
37
+ setInterval(myChartsRefresh, 1000);
38
+
39
+ //window.onresize = function(event) {
40
+ // refreshCharts(999999);
41
+ //};
42
+
43
+ </script>
44
+</head>
45
+<body>
46
+ <xsl:for-each select="catalog/graph">
47
+ <div>
48
+ <div>
49
+ <xsl:attribute name="id">div_graph_<xsl:value-of select="position()"/></xsl:attribute>
50
+ </div>
51
+ </div>
52
+ </xsl:for-each>
53
+</body>
54
+</html>
55
+</xsl:template>
56
+</xsl:stylesheet>