Commit 4824dc14 authored by Mihai Patrascoiu's avatar Mihai Patrascoiu
Browse files

FTS-1682: Introduce no_delegation variable in LinkConfig model.

Also, modify the config/links page to allow setting this variable via the UI.
parent 738d4040
Pipeline #2110348 passed with stage
in 2 minutes and 19 seconds
...@@ -46,10 +46,10 @@ class LinkConfig(Base): ...@@ -46,10 +46,10 @@ class LinkConfig(Base):
symbolicname = Column(String(255), unique=True, name='symbolic_name') symbolicname = Column(String(255), unique=True, name='symbolic_name')
min_active = Column(Integer) min_active = Column(Integer)
max_active = Column(Integer) max_active = Column(Integer)
optimizer_mode = Column (Integer) optimizer_mode = Column(Integer)
tcp_buffer_size = Column(Integer) tcp_buffer_size = Column(Integer)
nostreams = Column(Integer) nostreams = Column(Integer)
no_delegation = Column(Flag(negative='off', positive='on'), default='off')
def __str__(self): def __str__(self):
return "%s => %s" % (self.source, self.destination) return "%s => %s" % (self.source, self.destination)
......
...@@ -53,7 +53,7 @@ function refreshLinks() ...@@ -53,7 +53,7 @@ function refreshLinks()
}); });
}); });
var updateBtn = $("<button class='btn btn-link' type='button'></button>") var updateBtn = $("<button class='btn btn-link' type='button'></button>")
.append("<i class='glyphicon glyphicon-floppy-disk'></i>"); .append("<i class='glyphicon glyphicon-floppy-disk'></i>");
tr.append($("<td></td>").append(deleteBtn).append(updateBtn)) tr.append($("<td></td>").append(deleteBtn).append(updateBtn))
...@@ -72,11 +72,16 @@ function refreshLinks() ...@@ -72,11 +72,16 @@ function refreshLinks()
.append($("<td></td>") .append($("<td></td>")
.append($("<input type='number' name='optimizer_mode_"+link.symbolicname+"' min='0' max='3' class='form-control'/>").val(link.optimizer_mode))) .append($("<input type='number' name='optimizer_mode_"+link.symbolicname+"' min='0' max='3' class='form-control'/>").val(link.optimizer_mode)))
.append($("<td></td>") .append($("<td></td>")
.append($("<input type='number' name='tcp_buffer_size_"+link.symbolicname+"' class='form-control'/>").val(link.tcp_buffer_size))); .append($("<input type='number' name='tcp_buffer_size_"+link.symbolicname+"' class='form-control'/>").val(link.tcp_buffer_size)))
tbody.append(tr); .append($("<td></td>")
.append($("<select name='no_delegation_"+link.symbolicname+"' class='form-control'>" +
"<option value='true'>Yes</option>" +
"<option value='false'>No</option>>" +
"</select>").val(link.no_delegation.toString())));
tbody.append(tr);
updateBtn.click(function() { updateBtn.click(function() {
// tr.css("background", "#3CB371"); // tr.css("background", "#3CB371");
var saveload = { var saveload = {
symbolicname: tr.find("input[name='symbolicname_"+link.symbolicname+"']").val(), symbolicname: tr.find("input[name='symbolicname_"+link.symbolicname+"']").val(),
source: tr.find("input[name='source_"+link.symbolicname+"']").val(), source: tr.find("input[name='source_"+link.symbolicname+"']").val(),
...@@ -85,7 +90,8 @@ function refreshLinks() ...@@ -85,7 +90,8 @@ function refreshLinks()
min_active: tr.find("input[name='min_active_"+link.symbolicname+"']").val(), min_active: tr.find("input[name='min_active_"+link.symbolicname+"']").val(),
max_active: tr.find("input[name='max_active_"+link.symbolicname+"']").val(), max_active: tr.find("input[name='max_active_"+link.symbolicname+"']").val(),
optimizer_mode: tr.find("input[name='optimizer_mode_"+link.symbolicname+"']").val(), optimizer_mode: tr.find("input[name='optimizer_mode_"+link.symbolicname+"']").val(),
tcp_buffer_size: tr.find("input[name='tcp_buffer_size_"+link.symbolicname+"']").val() tcp_buffer_size: tr.find("input[name='tcp_buffer_size_"+link.symbolicname+"']").val(),
no_delegation: tr.find("select[name='no_delegation_"+link.symbolicname+"']").val()
}; };
console.log(saveload); console.log(saveload);
$.ajax({ $.ajax({
...@@ -271,6 +277,7 @@ function setupLinks() ...@@ -271,6 +277,7 @@ function setupLinks()
max_active: addFrm.find("[name=max_active]").val(), max_active: addFrm.find("[name=max_active]").val(),
optimizer_mode: addFrm.find("[name=optimizer_mode]").val(), optimizer_mode: addFrm.find("[name=optimizer_mode]").val(),
tcp_buffer_size: addFrm.find("[name=tcp_buffer_size]").val(), tcp_buffer_size: addFrm.find("[name=tcp_buffer_size]").val(),
no_delegation: addFrm.find("[name=no_delegation]").val(),
}; };
console.log(payload); console.log(payload);
...@@ -287,7 +294,7 @@ function setupLinks() ...@@ -287,7 +294,7 @@ function setupLinks()
$("#link-config-add-frm").trigger("reset"); $("#link-config-add-frm").trigger("reset");
}) })
.fail(function(jqXHR) { .fail(function(jqXHR) {
errorMessage(jqXHR); errorMessage(jqXHR);
}) })
.always(function() { .always(function() {
$("#link-config-add-frm input").prop("disabled", false); $("#link-config-add-frm input").prop("disabled", false);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<th>Max Actives</th> <th>Max Actives</th>
<th>Optimizer Mode</th> <th>Optimizer Mode</th>
<th>TCP buffer size</th> <th>TCP buffer size</th>
<th>Disable delegation</th>
</tr> </tr>
</thead> </thead>
<tbody id="link-config-list"> <tbody id="link-config-list">
...@@ -63,7 +64,12 @@ ...@@ -63,7 +64,12 @@
<input class="form-control" type="number" placeholder="TCP buffer size" name="tcp_buffer_size" <input class="form-control" type="number" placeholder="TCP buffer size" name="tcp_buffer_size"
min="0" max="999999" value="0"/> min="0" max="999999" value="0"/>
</td> </td>
<td>
<select class="form-control" name="no_delegation">
<option value="true">Yes</option>
<option value="false" selected>No</option>
</select>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
Markdown is supported
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