]> arthur.barton.de Git - netdata.git/commitdiff
show the demo sites if the registry returns no URLs; update dashboard.js version...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 12 May 2016 13:17:07 +0000 (16:17 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 12 May 2016 13:17:07 +0000 (16:17 +0300)
src/registry.c
web/dashboard.html
web/demo.html
web/demosites.html
web/index.html
web/tv.html

index eeaa7c5771eff8c5cc26ef6db9d4ae5f6698a229..91747a5b1af46fcb54ea4bbe01deee645e49312a 100644 (file)
@@ -1584,7 +1584,7 @@ int registry_init(void) {
        registry.save_registry_every_entries = config_get_number("registry", "registry save db every new entries", 1000000);
        registry.persons_expiration = config_get_number("registry", "registry expire idle persons days", 365) * 86400;
        registry.registry_domain = config_get("registry", "registry domain", "");
-       registry.registry_to_announce = config_get("registry", "registry to announce", "https://registry.netdata.online");
+       registry.registry_to_announce = config_get("registry", "registry to announce", "https://registry.my-netdata.io");
        registry.hostname = config_get("registry", "registry hostname", config_get("global", "hostname", hostname));
 
        registry.max_url_length = config_get_number("registry", "max URL length", 1024);
index fd505078d8b54b5d16f7105c20016add559d6848..41bd4cbd9812518ee8ae7c3304820160dadc10a0 100644 (file)
@@ -646,4 +646,4 @@ So, to avoid flashing the charts, we destroy and re-create the charts on each up
        <!-- <script> netdataServer = "http://box:19999"; </script> -->
 
        <!-- load the dashboard manager - it will do the rest -->
-       <script type="text/javascript" src="dashboard.js"></script>
+       <script type="text/javascript" src="dashboard.js?v35"></script>
index 8a6c0c12954cad3ec4aff04326eed15fe3fcedb7..341156b26949592bc3cabef5b74577739549bcfd 100644 (file)
@@ -11,7 +11,7 @@
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">\r
        <meta name="author" content="costa@tsaousis.gr">\r
 \r
-       <script type="text/javascript" src="dashboard.js"></script>\r
+       <script type="text/javascript" src="dashboard.js?v35"></script>\r
 </head>\r
 <body>\r
 \r
index caad81b20935b2a49f6f639f50c535c2f07e45eb..f9d32062e27cb3c7e79c7c573be3628323554f4e 100644 (file)
@@ -42,7 +42,7 @@
                and that you have chown it to be owned by netdata:netdata
        -->
        <!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
-       <script type="text/javascript" src="dashboard.js"></script>
+       <script type="text/javascript" src="dashboard.js?v35"></script>
 
        <script>
        // --- OPTIONS FOR THE CHARTS --
index 1ec0f68a014d0accba59b010062dc9c21c81511d..126f31a419862417088707a66f74396325c7a55b 100644 (file)
                }
 
                var netdataRegistryCallback = function(urls) {
-                       var el = '';
-                       var a1 = '';
-
-                       $.each(urls, function(i, u) {
-                               // if(u.guid === NETDATA.registry.machine_guid)
-                               el += '<li id="registry_server_' + u.guid + '"><a href="' + u.url + '">' + u.name + '</a></li>';
-                               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>';
-                       });
-
-                       el += '<li role="separator" class="divider"></li>';
-                       a1 += '<li role="separator" class="divider"></li>';
-
-                       el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">How this works?</a></li>';
-                       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>'
-
-                       document.getElementById('mynetdata_servers').innerHTML = el;
-                       document.getElementById('mynetdata_actions1').innerHTML = a1;
-
-                       document.getElementById('mynetdata_servers2').innerHTML = el;
+                       if(urls) {
+                               var el = '';
+                               var a1 = '';
+       
+                               $.each(urls, function(i, u) {
+                                       if(u.guid === NETDATA.registry.machine_guid)
+                                               el += '<li id="registry_server_' + u.guid + '" class="active"><a href="' + u.url + '">' + u.name + '</a></li>';
+                                       else
+                                               el += '<li id="registry_server_' + u.guid + '"><a href="' + u.url + '">' + u.name + '</a></li>';
+       
+                                       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>';
+                               });
+               
+                               el += '<li role="separator" class="divider"></li>';
+                               a1 += '<li role="separator" class="divider"></li>';
+       
+                               el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
+                               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>'
+       
+                               document.getElementById('mynetdata_servers').innerHTML = el;
+                               document.getElementById('mynetdata_actions1').innerHTML = a1;
+       
+                               document.getElementById('mynetdata_servers2').innerHTML = el;
+                       }
                };
 
        </script>
                                                        <div class="row">
                                                                <div class="col-sm-6" style="width: 85%; padding-right: 0;">
                                                                        <ul id="mynetdata_servers" class="multi-column-dropdown">
-                                                                               <li id="demo_eu"><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>
-                                                                               <li id="demo_us"><a href="//atlanda.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>
-                                                                               <li id="demo_gr"><a href="//athens.netdata.rocks/default.html">EU - Greece</a></li>
+                                                                               <li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>
+                                                                               <li><a href="//atlanda.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>
+                                                                               <li><a href="//athens.netdata.rocks/default.html">EU - Greece</a></li>
                                                                                <li role="separator" class="divider"></li>
-                                                                               <li id="demo_tv"><a href="tv.html">TV Dashboard for 2 servers</a></li>
-                                                                               <li id="demosites"><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
+                                                                               <li><a href="tv.html">TV Dashboard for 2 servers</a></li>
+                                                                               <li><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
                                                                        </ul>
                                                                </div>
                                                                <div class="col-sm-3 hidden-xs" style="width: 15%; padding-left: 0;">
                                        <li class="dropdown hidden-sm hidden-md hidden-lg">
                                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
                                                <ul id="mynetdata_servers2" class="dropdown-menu scrollable-menu inpagemenu" role="menu">
+                                                       <li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>
+                                                       <li><a href="//atlanda.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>
+                                                       <li><a href="//athens.netdata.rocks/default.html">EU - Greece</a></li>
+                                                       <li role="separator" class="divider"></li>
+                                                       <li><a href="tv.html">TV Dashboard for 2 servers</a></li>
+                                                       <li><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
                                                </ul>
                                        </li>
                                </ul>
@@ -898,25 +909,12 @@ function isdemo() {
 
        try {
                if(typeof document.location.hostname === 'string') {
-                       if(document.location.hostname.endsWith('.firehol.org') ||
+                       if(document.location.hostname.endsWith('.my-netdata.io') ||
+                                       document.location.hostname.endsWith('.mynetdata.io') ||
                                        document.location.hostname.endsWith('.netdata.rocks') ||
+                                       document.location.hostname.endsWith('.firehol.org') ||
                                        document.location.hostname.endsWith('.netdata.online'))
                                        this_is_demo = true;
-
-                       /*
-                       if(document.location.hostname === 'netdata.firehol.org' || document.location.hostname === 'netdata1.firehol.org') {
-                               document.getElementById("demo_eu").className = "active";
-                               this_is_demo = true;
-                       }
-                       else if(document.location.hostname === 'netdata2.firehol.org') {
-                               document.getElementById("demo_us").className = "active";
-                               this_is_demo = true;
-                       }
-                       else if(document.location.hostname === 'netdata3.firehol.org') {
-                               document.getElementById("demo_gr").className = "active";
-                               this_is_demo = true;
-                       }
-                       */
                }
        }
        catch(error) {
index 1588dd302c9929689c33ac508de09033b2c52b59..2dd42654e0c9e3a8a9f79b5331ecfdb1f28cd56f 100644 (file)
@@ -40,7 +40,7 @@
                and that you have chown it to be owned by netdata:netdata
        -->
        <!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
-       <script type="text/javascript" src="dashboard.js"></script>
+       <script type="text/javascript" src="dashboard.js?v35"></script>
 
        <script>
        // Set options for TV operation