]> arthur.barton.de Git - netdata.git/blob - web/registry.html
Merge pull request #2021 from ktsaou/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://cloud.githubusercontent.com/assets/2662304/22945737/e98cd0c6-f2fd-11e6-96f1-5501934b0955.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     <style>
23         .registry-container {
24             margin-left: 50px;
25             max-width: 400px;
26             min-width: 200px;
27             border: 1px solid #555;
28             max-height: 80vh;
29             height: auto;
30             overflow-x: hidden;
31             /* background-color: #3a3f44; */
32             text-align: center;
33         }
34         .registry-server-container {
35             width: 100%;
36             height: auto;
37             overflow-x: hidden;
38             font-size: 10px;
39             padding-left: 10px;
40             padding-right: 10px;
41         }
42         .registry-server-container:hover {
43             color: #f5f5f5;
44             background-color: #262626;
45         }
46         .registry-server-name {
47             display: block;
48             text-decoration: none !important;
49             clear: both;
50             font-size: 16px;
51             font-weight: bold;
52             white-space: normal;
53             padding-top: 10px;
54         }
55     </style>
56 </head>
57 <script>
58 // this section has to appear before loading dashboard.js
59
60 // Select a theme.
61 // uncomment on of the two themes:
62
63 // var netdataTheme = 'default'; // this is white
64 var netdataTheme = 'slate'; // this is dark
65
66
67 // Set the default netdata server.
68 // on charts without a 'data-host', this one will be used.
69 // the default is the server that dashboard.js is downloaded from.
70
71 // var netdataServer = 'http://my.server:19999/';
72
73 function registryGotoServer(guid) {
74     console.log('goto server: ' + guid);
75 }
76
77 function registryAddServer(u) {
78     return '<div id="registry_server_' + u.guid + '" class="registry-server-container" onClick="registryGotoServer(\'' + u.guid + '\'); return false;">'
79             + '<div class="registry-server-name">' + u.name + '</div>'
80             + '<div data-netdata="system.cpu"'
81             + ' data-host="' + u.url + '"'
82             + ' data-chart-library="sparkline"'
83             + ' data-sparkline-chartrangemin="0"'
84             + ' data-sparkline-chartrangemax="100"'
85             + ' data-sparkline-chartrangeclip="true"'
86             + ' data-sparkline-disabletooltips="true"'
87             + ' data-sparkline-disableinteraction="true"'
88             + ' data-sparkline-disablehighlight="true"'
89             + ' data-sparkline-linecolor="#444"'
90             + ' data-sparkline-spotcolor="disable"'
91             + ' data-sparkline-minspotcolor="disable"'
92             + ' data-sparkline-maxspotcolor="disable"'
93             + ' data-width="100%"'
94             + ' data-height="20px"'
95             + ' data-after="-200"'
96             + '></div>'
97             + '</div>';
98 }
99
100 var netdataRegistryCallback = function(machines_array) {
101     var el = '';
102     var a1 = '';
103     var found = 0;
104
105     if(machines_array) {
106         function name_comparator_desc(a, b) {
107             if (a.name > b.name) return -1;
108             if (a.name < b.name) return 1;
109             return 0;
110         }
111
112         var machines = machines_array.sort(name_comparator_desc);
113         var len = machines.length;
114         while(len--) {
115             var u = machines[len];
116
117             var status = "enabled";
118             found++;
119
120             if(u.guid === NETDATA.registry.machine_guid)
121                 status = "disabled"
122
123             el += registryAddServer(u);
124             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>';
125         }
126     }
127
128     if(!found) {
129         if(machines)
130             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>';
131         else
132             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>';
133
134         a1 += '<li><a href="#">&nbsp;</a></li>';
135
136         el += '<li role="separator" class="divider"></li>' +
137                 '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
138                 '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
139                 '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
140         a1 += '<li role="separator" class="divider"></li>' +
141                 '<li><a href="#">&nbsp;</a></li>' +
142                 '<li><a href="#">&nbsp;</a></li>'+
143                 '<li><a href="#">&nbsp;</a></li>';
144     }
145
146     el += '<li role="separator" class="divider"></li>';
147     a1 += '<li role="separator" class="divider"></li>';
148
149     el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
150     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>'
151
152     document.getElementById('mynetdata_servers').innerHTML = el;
153     //document.getElementById('mynetdata_servers2').innerHTML = el;
154     //document.getElementById('mynetdata_actions1').innerHTML = a1;
155     NETDATA.updatedDom();
156 };
157 </script>
158
159 <!--
160     Load dashboard.js
161
162     to host this HTML file on your web server,
163     you have to load dashboard.js from the netdata server.
164
165     So, pick one the two below
166     If you pick the first, set the server name/IP.
167
168     The second assumes you host this file on /usr/share/netdata/web
169     and that you have chown it to be owned by netdata:netdata
170 -->
171 <!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
172 <script type="text/javascript" src="dashboard.js?v20170105-7"></script>
173
174 <script>
175 // Set options for TV operation
176 // This has to be done, after dashboard.js is loaded
177
178 // destroy charts not shown (lowers memory on the browser)
179 NETDATA.options.current.destroy_on_hide = true;
180
181 // set this to false, to always show all dimensions
182 NETDATA.options.current.eliminate_zero_dimensions = true;
183
184 // lower the pressure on this browser
185 NETDATA.options.current.concurrent_refreshes = true;
186
187 // if the tv browser is too slow (a pi?)
188 // set this to false
189 NETDATA.options.current.parallel_refresher = true;
190
191 // always update the charts, even if focus is lost
192 // NETDATA.options.current.stop_updates_when_focus_is_lost = false;
193 </script>
194 <body>
195 &nbsp;
196 <div id="mynetdata_servers" class="registry-container" onscroll="NETDATA.onscroll();">
197
198     Loading....
199
200 </div> <!-- registry-container -->
201 </body>
202 </html>