configuration updates

max
Max 5 years ago
parent c9bfc96ed0
commit 31e11e999d
  1. 22
      op25/gr-op25_repeater/www/www-static/index.html
  2. 58
      op25/gr-op25_repeater/www/www-static/main.js

@ -116,6 +116,7 @@
<br>
<input type="button" name="load" value="Edit" onclick="javascript:f_load();"></input> - Open configuration editor (any previous unsaved work will be lost)<br>
<input type="button" name="start" value="Start" onclick="javascript:f_start();"></input> - Run flowgraph using selected configuration<br>
<input type="button" name="stop" value="Stop" onclick="javascript:f_stop();"></input> - End running flowgraph<br>
<br>
<div id="answer_area">
</div>
@ -260,7 +261,7 @@
<td colspan=3>&nbsp;</td>
<td colspan=6>
<div>
<table border=1>
<table class="trtable" border=1>
<tr>
<th colspan=2 class="boxtitle-th"><span class="boxtitle">Trunking Info</span></th>
<th>NAC</th>
@ -277,7 +278,24 @@
<td><input type="text" name="cclist" value="0"></td>
<td><input type="text" name="whitelist" value="None"></td>
<td><input type="text" name="blacklist" value="None"></td>
<td><input type="button" name="tgid-tags" value="Show"></input></td>
<td><input type="button" name="tgid-tags" value="Show" onclick="javascript:f_tags(this);"></input></td>
</tr>
</table>
<table class="tgtable" border=1 style="display: none">
<tr>
<th colspan=2 class="boxtitle-th"><span class="boxtitle">Tags</span></th>
<th>TG ID</th>
<th>TG Text</th>
<th>Priority</th>
<th colspan=2>&nbsp</th>
<th><input type=button name="add_tag" value="New" onclick="javascript:f_command(this, &quot;new&quot;);"</th>
</tr>
<tr class="tgrow" style="display: none">
<td colspan=2>&nbsp;</td>
<td><input type="text" name="tg_id" value="None"></input></td>
<td><input type="text" name="tg_tag" value=""> </td>
<td><input type="text" name="tg_priority" value=""> </td>
<td colspan=3>&nbsp</td>
</tr>
</table>
</div>

@ -172,24 +172,29 @@ function amend_d(myrow, mytbl, command) {
} else if (command == "new") {
var newrow = null;
var parent = null;
var pfx = "id_";
if (mytbl.id == "chtable") {
newrow = document.getElementById("chrow").cloneNode(true);
parent = document.getElementById("chrow").parentNode;
} else if (mytbl.id == "devtable") {
newrow = document.getElementById("devrow").cloneNode(true);
parent = document.getElementById("devrow").parentNode;
} else if (mytbl.className == "tgtable") {
newrow = mytbl.querySelector(".tgrow").cloneNode(true);
parent = mytbl.querySelector(".tgrow").parentNode;
pfx = "tg_";
} else {
return null;
}
newrow.style['display'] = '';
newrow.id = find_free_id("id_");
newrow.id = find_free_id(pfx);
parent.appendChild(newrow);
if (mytbl.id == "chtable") {
var newrow2 = document.getElementById("trrow").cloneNode(true);
newrow2.id = "tr_" + newrow.id.substring(3);
parent.appendChild(newrow2);
}
return newrow.id;
return newrow;
}
}
@ -372,9 +377,9 @@ function config_data(d) {
var chrow = document.getElementById("chrow");
var devrow = document.getElementById("devrow");
for (var device in cfg['devices'])
rollup_row("dev", document.getElementById(amend_d(devrow, devtable, "new")), cfg['devices'][device]);
rollup_row("dev", amend_d(devrow, devtable, "new"), cfg['devices'][device]);
for (var channel in cfg['channels'])
rollup_row("ch", document.getElementById(amend_d(chrow, chtable, "new")), cfg['channels'][channel]);
rollup_row("ch", amend_d(chrow, chtable, "new"), cfg['channels'][channel]);
rollup_rx_rows(cfg['backend-rx']);
}
@ -588,15 +593,37 @@ function rollup_row(which, row, def) {
var elements = Array.from(row.querySelectorAll("input,select"));
if (which == "ch") {
var trrow = document.getElementById("tr_" + row.id.substring(3));
elements = elements.concat(Array.from(trrow.querySelectorAll("input,select")));
var trtable = trrow.querySelector("table.trtable");
elements = elements.concat(Array.from(trtable.querySelectorAll("input,select")));
if (def)
trrow.style["display"] = (def["trunked"]) ? "" : "none";
}
else if (which == "rx") {
var advrow = document.getElementById("rx_2");
elements = elements.concat(Array.from(advrow.querySelectorAll("input,select")));
}
if (def && which == "ch")
trrow.style["display"] = (def["trunked"]) ? "" : "none";
var result = read_write(elements, def);
if (which == "ch") {
var tgtable = trrow.querySelector("table.tgtable");
var tgrow = trrow.querySelector("tr.tgrow");
if (def) {
for (var i=0; i<def["tgids"].length; i++) {
var newrow = amend_d(tgrow, tgtable, "new");
var inputs = newrow.querySelectorAll("input");
read_write(inputs, def["tgids"][i]);
}
} else {
var tgids = [];
var rows = tgtable.querySelectorAll("tr.tgrow");
for (var i=0; i<rows.length; i++) {
if (rows[i].id == null || rows[i].id.substring(0,3) != "tg_")
continue;
var inputs = rows[i].querySelectorAll("input");
tgids.push(read_write(inputs, null));
}
result['tgids'] = tgids;
}
}
if (!def)
return result;
}
@ -608,7 +635,7 @@ function rollup(which, def) {
for (var e in elements) {
var row = elements[e];
if (row.id != null && row.id.substring(0,3) == "id_")
result.push(rollup_row(which, row));
result.push(rollup_row(which, row, def));
}
if (!def)
return result;
@ -682,11 +709,22 @@ function f_load() {
function show_advanced(o) {
var tbl = find_parent(o, "TABLE");
var row = tbl.querySelector(".advrow");
toggle_show_hide(o, row);
}
function toggle_show_hide(o, ele) {
if (o.value == "Show") {
o.value = "Hide";
row.style["display"] = "";
ele.style["display"] = "";
} else {
o.value = "Show";
row.style["display"] = "none";
ele.style["display"] = "none";
}
}
function f_tags(o) {
var mydiv = find_parent(o, "DIV");
var tbl = mydiv.querySelector(".tgtable");
toggle_show_hide(o, tbl);
}

Loading…
Cancel
Save