Skip to content

Commit

Permalink
cleanup TCP ip
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Nov 6, 2021
1 parent ac1b096 commit b051f4f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ l.layout(norefresh:true, permission:app.SYSTEM_READ, title:my.displayName) {
}
}
l.main_panel {
h1 {
l.icon(class: 'icon-health-40to59 icon-xlg')
// TODO more appropriate icon
text(my.displayName)
div(class: "jenkins-app-bar") {
div(class: "jenkins-app-bar__content") {
h1 {
text(my.displayName)
}
}
}
def clouds = Cloud.all()
if (!clouds.isEmpty()) {
Expand Down
14 changes: 9 additions & 5 deletions core/src/main/resources/lib/form/radio.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ THE SOFTWARE.
toggles the radio.
</st:attribute>
</st:documentation>
<input type="radio" name="${attrs.name}" onclick="${attrs.onclick}" id="${attrs.id}" value="${attrs.value}"
checked="${attrs.checked?'true':null}" disabled="${readOnlyMode?'true':null}" />
<j:if test="${attrs.title!=null}">
<label class="attach-previous">${attrs.title}</label>
</j:if>
<div class="jenkins-radio">
<input class="jenkins-radio__input" type="radio" name="${attrs.name}" onclick="${attrs.onclick}"
id="${attrs.id}" value="${attrs.value}" checked="${attrs.checked?'true':null}"
disabled="${readOnlyMode?'true':null}" />
<label class="jenkins-radio__label" for="${attrs.id}">${attrs.title}</label>
<div class="jenkins-radio__children">
<d:invokeBody />
</div>
</div>
</j:jelly>
36 changes: 9 additions & 27 deletions core/src/main/resources/lib/form/serverTcpPort.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,20 @@ package lib.form
* port number. The getter method should just expose the port number integer.
*/

int port = instance ? instance[field] : 0

int port = instance?instance[field]:0

def f=namespace(lib.FormTagLib)
def f = namespace(lib.FormTagLib)

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

div(name:field) {
label {
f.radio(name: type, value:"fixed",
checked:port>0, onclick:"\$('${id}').disabled=false")
text(_("Fixed"))
text(" : ")
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"),
value: port > 0 ? port : null, min: 0, max: 65535, step: 1)
}
input(type:"number", "class":"number", name:"value", id:id,
value: port>0 ? port : null, disabled: port>0 ? null : "true",
min:0, max:65535, step:1)

raw("&nbsp;") ////////////////////////////

label {
f.radio(name:type, value:"random",
checked:port==0, onclick:"\$('${id}').disabled=true")
text(_("Random"))
}
f.radio(name: type, value: "random", title: _("Random"), id: "radio-tcp-random", checked: port == 0)

raw("&nbsp;") ////////////////////////////

label {
f.radio(name:type, value:"disable",
checked:port==-1, onclick:"\$('${id}').disabled=true")
text(_("Disable"))
}
f.radio(name: type, value: "disable", title: _("Disable"), id: "radio-tcp-disable", checked: port == -1)
}
16 changes: 16 additions & 0 deletions war/src/main/less/modules/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -612,3 +612,19 @@
}
}
}

.jenkins-server-tcp-port {
background: red;
display: flex;
align-items: center;

.jenkins-radio {
margin-bottom: 0;
margin-right: 1rem;
}

.jenkins-input {
max-width: 300px;
margin-right: 1rem;
}
}

0 comments on commit b051f4f

Please sign in to comment.