Skip to content

Commit

Permalink
fix(computer): configure temporary read-only view in computer Config …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
hainenber committed Dec 22, 2024
1 parent 76d0f9e commit 0e63457
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/main/java/io/hainenber/jenkins/multipass/MultipassAgent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.hainenber.jenkins.multipass;

import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.TaskListener;
import hudson.slaves.AbstractCloudComputer;
Expand Down Expand Up @@ -114,4 +115,15 @@ public String toString() {
public ProvisioningActivity.Id getId() {
return id;
}


@Extension
@SuppressWarnings("unused") // used by jelly
public static final class DescriptorImpl extends SlaveDescriptor {
@Nonnull
@Override
public String getDisplayName() {
return "Multipass VM";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import hudson.model.Queue;
import hudson.slaves.AbstractCloudComputer;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import java.util.Objects;
import java.util.StringJoiner;
import java.util.concurrent.Future;
import javax.annotation.Nullable;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.jenkinsci.plugins.cloudstats.ProvisioningActivity;
import org.jenkinsci.plugins.cloudstats.TrackedItem;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:l="/lib/layout">
<l:layout norefresh="true" permission="${app.ADMINISTER}" title="${it.name} Configuration">
<st:include page="sidepanel.jelly"/>
<l:main-panel>
<h3>This is a read-only view. Click <a href="${rootURL}/manage/cloud"> here</a> to configure your instances.</h3>
<f:form method="post" action="configSubmit" name="config">
<j:set var="instance" value="${it.node}" />
<f:invisibleEntry>
<input type="hidden" name="name" value="${it.name}" />
</f:invisibleEntry>
<f:entry title="${%# of executors}" field="numExecutors">
<f:readOnlyTextbox/>
</f:entry>
<f:entry title="${%Remote FS root}" field="remoteFS">
<f:readOnlyTextbox/>
</f:entry>
<f:entry title="${%Labels}" field="labelString">
<f:readOnlyTextbox/>
</f:entry>
</f:form>
</l:main-panel>
</l:layout>
</j:jelly>

0 comments on commit 0e63457

Please sign in to comment.