Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.csanchez.jenkins.plugins.kubernetes;

import hudson.Extension;
import hudson.model.Action;
import hudson.model.Computer;
import java.util.Collection;
import java.util.List;
import jenkins.model.TransientActionFactory;
import org.jspecify.annotations.NonNull;

public class EventsAction implements Action {
private final Computer owner;

public EventsAction(Computer owner) {
this.owner = owner;
}

public Computer getOwner() {
return owner;
}

@Override
public String getIconFileName() {
return "symbol-list";
}

@Override
public String getDisplayName() {
return "Events";
}

@Override
public String getUrlName() {
return "events";
}

@Extension
public static final class EventsActionFactory extends TransientActionFactory<Computer> {

@Override
public Class<Computer> type() {
return Computer.class;
}

@Override
public @NonNull Collection<? extends Action> createFor(@NonNull Computer target) {
return List.of(new EventsAction(target));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.csanchez.jenkins.plugins.kubernetes;

import hudson.Extension;
import hudson.model.Action;
import hudson.model.Computer;
import java.util.Collection;
import java.util.List;
import jenkins.model.TransientActionFactory;
import org.jspecify.annotations.NonNull;

public class PodLogAction implements Action {
private final Computer owner;

public PodLogAction(Computer owner) {
this.owner = owner;
}

public Computer getOwner() {
return owner;
}

@Override
public String getIconFileName() {
return "symbol-terminal";
}

@Override
public String getDisplayName() {
return "Pod Log";
}

@Override
public String getUrlName() {
return "podLog";
}

@Extension
public static final class PodLogActionFactory extends TransientActionFactory<Computer> {

@Override
public Class<Computer> type() {
return Computer.class;
}

@Override
public @NonNull Collection<? extends Action> createFor(@NonNull Computer target) {
return List.of(new PodLogAction(target));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${it.displayName} log" permission="${app.MANAGE}">
<st:include page="sidepanel.jelly" />
<l:layout title="${it.owner.displayName} log" permission="${app.MANAGE}">
<st:include page="sidepanel.jelly" it="${it.owner}"/>
<l:main-panel>
<table class="sortable jenkins-table">
<thead>
Expand All @@ -36,7 +36,7 @@ THE SOFTWARE.
</thead>

<tbody>
<j:forEach var="v" items="${it.podEvents}">
<j:forEach var="v" items="${it.owner.podEvents}">
<tr>
<td>${v.type}</td>
<td>${v.reason}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<l:task icon="symbol-terminal icon-md" href="${rootURL}/${it.url}log" title="${%Log}" permission="${app.MANAGE}"/>
<l:task icon="symbol-terminal icon-md" href="${rootURL}/${it.url}podLog" title="${%Pod Log}" permission="${app.MANAGE}"/>
<l:task icon="symbol-list icon-md" href="${rootURL}/${it.url}events" title="${%Events}" permission="${app.MANAGE}"/>
<j:if test="${it.channel!=null}">
<l:task icon="symbol-computer icon-md" href="${rootURL}/${it.url}systemInfo" title="${%System Information}" permission="${app.MANAGE}"/>
</j:if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${it.displayName} log" permission="${app.MANAGE}">
<st:include page="sidepanel.jelly" />
<l:layout title="${it.owner.displayName} log" permission="${app.MANAGE}">
<st:include page="sidepanel.jelly" it="${it.owner}"/>
<l:main-panel>
<table class="sortable jenkins-table">
<thead>
Expand All @@ -35,9 +35,9 @@ THE SOFTWARE.
</thead>

<tbody>
<j:forEach var="v" items="${it.containers}">
<j:forEach var="v" items="${it.owner.containers}">
<tr>
<td><f:link href="container?name=${v.name}">${v.name}</f:link></td>
<td><f:link href="../container?name=${v.name}">${v.name}</f:link></td>
<td>${v.image}</td>
<td>${v.imagePullPolicy}</td>
<td>${v.workingDir}</td>
Expand Down
Loading