Skip to content

Commit

Permalink
shell: Restricts bond input to 4 digits
Browse files Browse the repository at this point in the history
When adding a bond, the user is now restricted from typing in more than 4 digits in various input boxes. These input boxes include the Monotoring Interval, Link up, and Link down.

Reviewed-by: Patrick Uiterwijk
Closes: #878
Fixes: #843
  • Loading branch information
pdonlon authored and puiterwijk committed Jul 16, 2014
1 parent 740aca8 commit de1339d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/shell/cockpit-networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ PageNetworkBondSettings.prototype = {
$('<tr>').append(
$('<td>').text(_("Monitoring Interval")),
$('<td>').append(
interval_input = $('<input class="form-control">').
interval_input = $('<input class="form-control network-number-field" type="text" maxlength="4">').
val(options.miimon || options.arp_interval || "100").
change(change_monitoring))),
$('<tr>').append(
Expand All @@ -1934,13 +1934,13 @@ PageNetworkBondSettings.prototype = {
$('<tr>').append(
$('<td>').text(_("Link up delay")),
$('<td>').append(
updelay_input = $('<input class="form-control">').
updelay_input = $('<input class="form-control network-number-field" type="text" maxlength="4">').
val(options.updelay || "0").
change(change_monitoring))),
$('<tr>').append(
$('<td>').text(_("Link down delay")),
$('<td>').append(
downdelay_input = $('<input class="form-control">').
downdelay_input = $('<input class="form-control network-number-field" type="text" maxlength="4">').
val(options.downdelay || "0").
change(change_monitoring))));

Expand Down
6 changes: 6 additions & 0 deletions modules/shell/cockpit.css
Original file line number Diff line number Diff line change
Expand Up @@ -808,3 +808,9 @@ a {
.cockpit-modal-sm {
width: 300px;
}

/* networking */

.network-number-field {
width: 4em;
}

0 comments on commit de1339d

Please sign in to comment.