Commit 605479df authored by Otto Jonassen Wittner's avatar Otto Jonassen Wittner
Browse files

Made conffile object global

parent fdb4e8da
Pipeline #49141 passed with stages
in 50 seconds
......@@ -220,6 +220,8 @@ var loads=0; // number of loaded point series
var duplines=[];
var points_cache=[];
var conffile=[]; //Config file loaded initially
function fill_select(select_id, types){
var select = $("#".select_id);
select.empty();
......@@ -1668,14 +1670,15 @@ $(document).ready ( function(){
// OJW 2021-12-09 BEGIN CONFIG FILE LOAD
// Fetch config info and initialize page
$.getJSON( "yaml-to-json.cgi?inputfile=mapconfig.yml", function(conffile) {
if (Object.keys(conffile).length > 0) {
console.log("Config file non-empty: " + conffile.msg);
$.getJSON( "yaml-to-json.cgi?inputfile=mapconfig.yml", function(read_conffile) {
if (Object.keys(read_conffile).length > 0) {
console.log("Config file non-empty: " + read_conffile.msg);
conffile = read_conffile.config;
// Remove default measurement variants from select list
$("#network").empty();
for (const mvar in conffile.config) {
for (const mvar in conffile) {
// Add option for measurement variant
$("#network").append("<option value=" + mvar + ">" + conffile.config[mvar].title + "</option>");
$("#network").append("<option value=" + mvar + ">" + conffile[mvar].title + "</option>");
}
//Select first measurement variant in list
$("#network option:eq(0)").prop("selected", true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment