show the demo sites if the registry returns no URLs; update dashboard.js version for CDN
Costa Tsaousis (ktsaou) committed
May 12, 2016 at 16:17 UTC
9b1068a0f7dfbf83b79be448377eb19b0558723f
6 files changed
+43
-45
src/registry.c
+1
-1
@@ -1584,7 +1584,7 @@ int registry_init(void) {
1584
registry.save_registry_every_entries = config_get_number("registry", "registry save db every new entries", 1000000);
1585
registry.persons_expiration = config_get_number("registry", "registry expire idle persons days", 365) * 86400;
1586
registry.registry_domain = config_get("registry", "registry domain", "");
1587
- registry.registry_to_announce = config_get("registry", "registry to announce", "https://registry.netdata.online");
1587
+ registry.registry_to_announce = config_get("registry", "registry to announce", "https://registry.my-netdata.io");
1588
registry.hostname = config_get("registry", "registry hostname", config_get("global", "hostname", hostname));
1589
1590
registry.max_url_length = config_get_number("registry", "max URL length", 1024);
web/dashboard.html
+1
-1
@@ -646,4 +646,4 @@ So, to avoid flashing the charts, we destroy and re-create the charts on each up
646
<!-- <script> netdataServer = "http://box:19999"; </script> -->
647
648
<!-- load the dashboard manager - it will do the rest -->
649
- <script type="text/javascript" src="dashboard.js"></script>
649
+ <script type="text/javascript" src="dashboard.js?v35"></script>
web/demo.html
+1
-1
@@ -11,7 +11,7 @@
11
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
12
<meta name="author" content="costa@tsaousis.gr">
13
14
- <script type="text/javascript" src="dashboard.js"></script>
14
+ <script type="text/javascript" src="dashboard.js?v35"></script>
15
</head>
16
<body>
17
web/demosites.html
+1
-1
@@ -42,7 +42,7 @@
42
and that you have chown it to be owned by netdata:netdata
43
-->
44
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
45
- <script type="text/javascript" src="dashboard.js"></script>
45
+ <script type="text/javascript" src="dashboard.js?v35"></script>
46
47
<script>
48
// --- OPTIONS FOR THE CHARTS --
web/index.html
+38
-40
@@ -361,25 +361,30 @@
361
}
362
363
var netdataRegistryCallback = function(urls) {
364
- var el = '';
365
- var a1 = '';
366
-
367
- $.each(urls, function(i, u) {
368
- // if(u.guid === NETDATA.registry.machine_guid)
369
- el += '<li id="registry_server_' + u.guid + '"><a href="' + u.url + '">' + u.name + '</a></li>';
370
- 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>';
371
- });
372
-
373
- el += '<li role="separator" class="divider"></li>';
374
- a1 += '<li role="separator" class="divider"></li>';
375
-
376
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">How this works?</a></li>';
377
- a1 += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank"><i class="fa fa-question" aria-hidden="true" style="color: #999;"></i></a></li>'
378
-
379
- document.getElementById('mynetdata_servers').innerHTML = el;
380
- document.getElementById('mynetdata_actions1').innerHTML = a1;
381
-
382
- document.getElementById('mynetdata_servers2').innerHTML = el;
364
+ if(urls) {
365
+ var el = '';
366
+ var a1 = '';
367
+
368
+ $.each(urls, function(i, u) {
369
+ if(u.guid === NETDATA.registry.machine_guid)
370
+ el += '<li id="registry_server_' + u.guid + '" class="active"><a href="' + u.url + '">' + u.name + '</a></li>';
371
+ else
372
+ el += '<li id="registry_server_' + u.guid + '"><a href="' + u.url + '">' + u.name + '</a></li>';
373
+
374
+ 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>';
375
+ });
376
+
377
+ el += '<li role="separator" class="divider"></li>';
378
+ a1 += '<li role="separator" class="divider"></li>';
379
+
380
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
381
+ a1 += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank"><i class="fa fa-question" aria-hidden="true" style="color: #999;"></i></a></li>'
382
+
383
+ document.getElementById('mynetdata_servers').innerHTML = el;
384
+ document.getElementById('mynetdata_actions1').innerHTML = a1;
385
+
386
+ document.getElementById('mynetdata_servers2').innerHTML = el;
387
+ }
388
};
389
390
</script>
@@ -399,12 +404,12 @@
404
<div class="row">
405
<div class="col-sm-6" style="width: 85%; padding-right: 0;">
406
<ul id="mynetdata_servers" class="multi-column-dropdown">
402
- <li id="demo_eu"><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>
403
- <li id="demo_us"><a href="//atlanda.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>
404
- <li id="demo_gr"><a href="//athens.netdata.rocks/default.html">EU - Greece</a></li>
407
+ <li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>
408
+ <li><a href="//atlanda.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>
409
+ <li><a href="//athens.netdata.rocks/default.html">EU - Greece</a></li>
410
<li role="separator" class="divider"></li>
406
- <li id="demo_tv"><a href="tv.html">TV Dashboard for 2 servers</a></li>
407
- <li id="demosites"><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
411
+ <li><a href="tv.html">TV Dashboard for 2 servers</a></li>
412
+ <li><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
413
</ul>
414
</div>
415
<div class="col-sm-3 hidden-xs" style="width: 15%; padding-left: 0;">
@@ -442,6 +447,12 @@
447
<li class="dropdown hidden-sm hidden-md hidden-lg">
448
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
449
<ul id="mynetdata_servers2" class="dropdown-menu scrollable-menu inpagemenu" role="menu">
450
+ <li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>
451
+ <li><a href="//atlanda.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>
452
+ <li><a href="//athens.netdata.rocks/default.html">EU - Greece</a></li>
453
+ <li role="separator" class="divider"></li>
454
+ <li><a href="tv.html">TV Dashboard for 2 servers</a></li>
455
+ <li><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
456
</ul>
457
</li>
458
</ul>
@@ -898,25 +909,12 @@ function isdemo() {
909
910
try {
911
if(typeof document.location.hostname === 'string') {
901
- if(document.location.hostname.endsWith('.firehol.org') ||
912
+ if(document.location.hostname.endsWith('.my-netdata.io') ||
913
+ document.location.hostname.endsWith('.mynetdata.io') ||
914
document.location.hostname.endsWith('.netdata.rocks') ||
915
+ document.location.hostname.endsWith('.firehol.org') ||
916
document.location.hostname.endsWith('.netdata.online'))
917
this_is_demo = true;
905
-
906
- /*
907
- if(document.location.hostname === 'netdata.firehol.org' || document.location.hostname === 'netdata1.firehol.org') {
908
- document.getElementById("demo_eu").className = "active";
909
- this_is_demo = true;
910
- }
911
- else if(document.location.hostname === 'netdata2.firehol.org') {
912
- document.getElementById("demo_us").className = "active";
913
- this_is_demo = true;
914
- }
915
- else if(document.location.hostname === 'netdata3.firehol.org') {
916
- document.getElementById("demo_gr").className = "active";
917
- this_is_demo = true;
918
- }
919
- */
918
}
919
}
920
catch(error) {
web/tv.html
+1
-1
@@ -40,7 +40,7 @@
40
and that you have chown it to be owned by netdata:netdata
41
-->
42
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
43
- <script type="text/javascript" src="dashboard.js"></script>
43
+ <script type="text/javascript" src="dashboard.js?v35"></script>
44
45
<script>
46
// Set options for TV operation