]> arthur.barton.de Git - netdata.git/commitdiff
Merge pull request #337 from ktsaou/master
authorCosta Tsaousis <costa@tsaousis.gr>
Fri, 29 Apr 2016 02:18:20 +0000 (05:18 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Fri, 29 Apr 2016 02:18:20 +0000 (05:18 +0300)
fixed the commented code in mountinfo; minor fixes for the demo sites

src/proc_self_mountinfo.c
src/proc_self_mountinfo.h
web/index.html

index ee29e20a26c9ee08bc272d2b3d90cf127f41d9e1..fa4079671612456f91af2739939bd71f514f7027 100644 (file)
@@ -56,11 +56,10 @@ void mountinfo_free(struct mountinfo *mi) {
        if(mi->optional_fields_count) {
                int i;
                for(i = 0; i < mi->optional_fields_count ; i++)
-                       free(mi->optional_fields[i]);
+                       free(*mi->optional_fields[i]);
        }
        free(mi->optional_fields);
 */
-
        free(mi->filesystem);
        free(mi->mount_source);
        free(mi->super_options);
@@ -147,7 +146,7 @@ struct mountinfo *mountinfo_read() {
 
                        int i;
                        for(i = 0; i < mi->optional_fields_count ; i++) {
-                               mi->optional_fields[wo] = strdup(procfile_lineword(ff, l, w));
+                               *mi->optional_fields[wo] = strdup(procfile_lineword(ff, l, w));
                                if(!mi->optional_fields[wo]) fatal("Cannot allocate memory");
                                wo++;
                        }
index d1056095ace365d111572de003e46f6c63f2711e..8c21274969c5885f698de7438c7925e7f025e012 100644 (file)
@@ -19,9 +19,8 @@ struct mountinfo {
 
        int optional_fields_count;
 /*
-       char *(*optional_fields); // optional fields: zero or more fields of the form "tag[:value]".
+       char ***optional_fields; // optional fields: zero or more fields of the form "tag[:value]".
 */
-
        char *filesystem;       // filesystem type: name of filesystem in the form "type[.subtype]".
        uint32_t filesystem_hash;
 
index d5e0b27db20a4d6464e9149c142d6dc3d3803474..17b4fca0c2f1e41111ca2018bc5a081443652a18 100644 (file)
                                        <li class="dropdown">
                                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">demo sites <strong class="caret"></strong></a>
                                                <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
-                                                       <li id="demo_eu"><a href="//netdata.firehol.org?nowelcome">EU - London (DigitalOcean.com)</a></li>
+                                                       <li id="demo_eu"><a href="//netdata1.firehol.org?nowelcome">EU - London (DigitalOcean.com)</a></li>
                                                        <li id="demo_us"><a href="//netdata2.firehol.org?nowelcome">US - Atlanta (CDN77.com)</a></li>
+                                                       <li id="demo_gr"><a href="//netdata3.firehol.org?nowelcome">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>
@@ -798,7 +799,7 @@ function isdemo() {
 
        try {
                if(typeof document.location.hostname === 'string') {
-                       if(document.location.hostname === 'netdata.firehol.org') {
+                       if(document.location.hostname === 'netdata.firehol.org' || document.location.hostname === 'netdata1.firehol.org') {
                                document.getElementById("demo_eu").className = "active";
                                this_is_demo = true;
                        }
@@ -806,6 +807,10 @@ function isdemo() {
                                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;
+                       }
                }
 
                if(!this_is_demo)