Skip to content

Commit

Permalink
Fix port control
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 27, 2022
1 parent dc2e683 commit fa263e7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/main/resources/lib/form/serverTcpPort.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ int port = instance ? instance[field] : 0
def f = namespace(lib.FormTagLib)

def type = "${field}.type"
def id = "${field}Id" // TODO: get rid of this

div(name: field) {
f.radio(name: type, value: "fixed", title: _("Fixed"), id: "radio-tcp-fixed", checked: port > 0) {
input(type: "number", class: "jenkins-input", name: "value", id: id, placeholder: _("Port"),
f.radio(name: type, value: "fixed", title: _("Fixed"), id: "radio-${field}-fixed", checked: port > 0) {
input(type: "number", class: "jenkins-input", name: "value", id: "${field}Id", placeholder: _("Port"),
value: port > 0 ? port : null, min: 0, max: 65535, step: 1)
}

f.radio(name: type, value: "random", title: _("Random"), id: "radio-tcp-random", checked: port == 0)
f.radio(name: type, value: "random", title: _("Random"), id: "radio-${field}-random", checked: port == 0)

f.radio(name: type, value: "disable", title: _("Disable"), id: "radio-tcp-disable", checked: port == -1)
f.radio(name: type, value: "disable", title: _("Disable"), id: "radio-${field}-disable", checked: port == -1)
}

0 comments on commit fa263e7

Please sign in to comment.