]> arthur.barton.de Git - netdata.git/blob - web/registry.html
Merge remote-tracking branch 'firehol/master'
[netdata.git] / web / registry.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4     <title>NetData Registry Dashboard</title>
5     <meta name="application-name" content="netdata">
6
7     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8     <meta charset="utf-8">
9     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10     <meta name="viewport" content="width=device-width, initial-scale=1">
11     <meta name="apple-mobile-web-app-capable" content="yes">
12     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
14     <meta property="og:locale" content="en_US" />
15     <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16     <meta property="og:url" content="http://my-netdata.io/"/>
17     <meta property="og:type" content="website"/>
18     <meta property="og:site_name" content="netdata"/>
19     <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20     <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
21     
22     <script>
23     // this section has to appear before loading dashboard.js
24
25     // Select a theme.
26     // uncomment on of the two themes:
27
28     // var netdataTheme = 'default'; // this is white
29     var netdataTheme = 'slate'; // this is dark
30
31
32     // Set the default netdata server.
33     // on charts without a 'data-host', this one will be used.
34     // the default is the server that dashboard.js is downloaded from.
35
36     // var netdataServer = 'http://my.server:19999/';
37
38     function registryGotoServer(guid) {
39         console.log('goto server: ' + guid);
40     }
41
42     function registryAddServer(u) {
43         return '<div id="registry_server_' + u.guid + '" class="registry-server-container" onClick="registryGotoServer(\'' + u.guid + '\'); return false;">'
44                 + '<div class="registry-server-name">' + u.name + '</div>'
45                 + '<div data-netdata="system.cpu"'
46                 + ' data-host="' + u.url + '"'
47                 + ' data-chart-library="sparkline"'
48                 + ' data-sparkline-chartrangemin="0"'
49                 + ' data-sparkline-chartrangemax="100"'
50                 + ' data-sparkline-chartrangeclip="true"'
51                 + ' data-sparkline-disabletooltips="true"'
52                 + ' data-sparkline-disableinteraction="true"'
53                 + ' data-sparkline-disablehighlight="true"'
54                 + ' data-sparkline-linecolor="#444"'
55                 + ' data-sparkline-spotcolor="disable"'
56                 + ' data-sparkline-minspotcolor="disable"'
57                 + ' data-sparkline-maxspotcolor="disable"'
58                 + ' data-width="100%"'
59                 + ' data-height="20px"'
60                 + ' data-after="-200"'
61                 + '></div>'
62                 + '</div>';
63     }
64
65     var netdataRegistryCallback = function(machines_array) {
66         var el = '';
67         var a1 = '';
68         var found = 0;
69
70         if(machines_array) {
71             function name_comparator_desc(a, b) {
72                 if (a.name > b.name) return -1;
73                 if (a.name < b.name) return 1;
74                 return 0;
75             }
76
77             var machines = machines_array.sort(name_comparator_desc);
78             var len = machines.length;
79             while(len--) {
80                 var u = machines[len];
81
82                 var status = "enabled";
83                 found++;
84
85                 if(u.guid === NETDATA.registry.machine_guid)
86                     status = "disabled"
87
88                 el += registryAddServer(u);
89                 a1 += '<li id="registry_action_' + u.guid + '"><a href="#" onclick="deleteRegistryModalHandler(\'' + u.guid + '\',\'' + u.name + '\',\'' + u.url + '\'); return false;"><i class="fa fa-trash-o" aria-hidden="true" style="color: #999;"></i></a></li>';
90             }
91         }
92
93         if(!found) {
94             if(machines)
95                 el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">your netdata server list is empty...</a></li>';
96             else
97                 el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">failed to contact the registry...</a></li>';
98
99             a1 += '<li><a href="#">&nbsp;</a></li>';
100
101             el += '<li role="separator" class="divider"></li>' +
102                     '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
103                     '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
104                     '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
105             a1 += '<li role="separator" class="divider"></li>' +
106                     '<li><a href="#">&nbsp;</a></li>' +
107                     '<li><a href="#">&nbsp;</a></li>'+
108                     '<li><a href="#">&nbsp;</a></li>';
109         }
110
111         el += '<li role="separator" class="divider"></li>';
112         a1 += '<li role="separator" class="divider"></li>';
113
114         el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
115         a1 += '<li><a href="#" style="color: #999;" onclick="switchRegistryModalHandler(); return false;"><i class="fa fa-cog" aria-hidden="true" style="color: #999;"></i></a></li>'
116
117         document.getElementById('mynetdata_servers').innerHTML = el;
118         //document.getElementById('mynetdata_servers2').innerHTML = el;
119         //document.getElementById('mynetdata_actions1').innerHTML = a1;
120         NETDATA.updatedDom();
121     };
122     </script>
123
124     <!--
125         Load dashboard.js
126
127         to host this HTML file on your web server,
128         you have to load dashboard.js from the netdata server.
129
130         So, pick one the two below
131         If you pick the first, set the server name/IP.
132
133         The second assumes you host this file on /usr/share/netdata/web
134         and that you have chown it to be owned by netdata:netdata
135     -->
136     <!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
137     <script type="text/javascript" src="dashboard.js?v40"></script>
138
139     <script>
140     // Set options for TV operation
141     // This has to be done, after dashboard.js is loaded
142
143     // destroy charts not shown (lowers memory on the browser)
144     NETDATA.options.current.destroy_on_hide = true;
145     
146     // set this to false, to always show all dimensions
147     NETDATA.options.current.eliminate_zero_dimensions = true;
148     
149     // lower the pressure on this browser
150     NETDATA.options.current.concurrent_refreshes = true;
151
152     // if the tv browser is too slow (a pi?)
153     // set this to false
154     NETDATA.options.current.parallel_refresher = true;
155
156     // always update the charts, even if focus is lost
157     // NETDATA.options.current.stop_updates_when_focus_is_lost = false;
158     </script>
159
160     <style>
161         .registry-container {
162             margin-left: 50px;
163             max-width: 400px;
164             min-width: 200px;
165             border: 1px solid #555;
166             max-height: 80vh;
167             height: auto;
168             overflow-x: hidden;
169             /* background-color: #3a3f44; */
170             text-align: center;
171         }
172         .registry-server-container {
173             width: 100%;
174             height: auto;
175             overflow-x: hidden;
176             font-size: 10px;
177             padding-left: 10px;
178             padding-right: 10px;
179         }
180         .registry-server-container:hover {
181             color: #f5f5f5;
182             background-color: #262626;
183         }
184         .registry-server-name {
185             display: block;
186             text-decoration: none !important;
187             clear: both;
188             font-size: 16px;
189             font-weight: bold;
190             white-space: normal;
191             padding-top: 10px;
192         }
193     </style>
194 </head>
195 <body>
196 &nbsp;
197 <div id="mynetdata_servers" class="registry-container" onscroll="NETDATA.onscroll();">
198
199     Loading....
200
201 </div> <!-- registry-container -->
202 </body>
203 </html>