about.js (1681B)
1 mrf_noscript = document.getElementById("mrf_noscript"); 2 federation_list = document.getElementById("federation_list"); 3 4 var config_doc_url = '/doc/config.html'; 5 6 var render_mrf_settings = function(name, settings, id_name) { 7 if(name && settings) { 8 if(id_name) { 9 html = "<li><a href='"+config_doc_url+"#"+id_name+"'>"+name+"</a>:<ul>"; 10 } else { 11 html = "<li>"+name+":<ul>"; 12 } 13 14 for(const [key, values] of Object.entries(settings)) { 15 html += "<li><code class='mrf_setting-key'>"+key+"</code>: <code class='mrf_settings-values'>"+values.join(", ")+"</code></li>" 16 } 17 18 html += "</ul></li>"; 19 20 return html; 21 } else { 22 return ""; 23 } 24 }; 25 26 request = new XMLHttpRequest(); 27 request.onload = function() 28 { 29 res = JSON.parse(request.response); 30 federation_metadata = res.metadata.federation; 31 federation_html = ""; 32 33 if(federation_metadata.mrf_policies) { 34 federation_html += "<li>MRF Policies: <code class='mrf_settings-values'>"; 35 federation_html += federation_metadata.mrf_policies.join(", "); 36 federation_html += "</code></li>"; 37 } 38 39 federation_html += render_mrf_settings("MRF Simple", federation_metadata.mrf_simple, "mrf_simple"); 40 federation_html += render_mrf_settings("MRF Keywords", federation_metadata.mrf_keyword, "mrf_keyword"); 41 42 if(federation_metadata.quarantined_instances) { 43 federation_html += "<li><a href='"+config_doc_url+"#instance'>Quarantined</a>: <code class='mrf_settings-values'>"; 44 federation_html += federation_metadata.quarantined_instances.join(", "); 45 federation_html += "</code></li>"; 46 } 47 48 federation_list.innerHTML = federation_html; 49 }; 50 51 mrf_noscript.hidden = true; 52 53 request.open('GET', "/nodeinfo/2.0.json", true); 54 request.send();