diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index c16fc93e1a..1047ec5a3d 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -290,6 +290,10 @@ public class ClassicPluginStrategy implements PluginStrategy { List urls = new ArrayList<>(); for (File path : paths) { + if (path.getName().startsWith("jenkins-test-harness")) { + throw new IllegalStateException("Refusing to load the Jenkins test harness in production (via " + + atts.getValue("Short-Name") + ")"); + } urls.add(path.toURI().toURL()); } URLClassLoader2 classLoader; diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 86d9e9c55d..b22f32c2a8 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2318,13 +2318,17 @@ public class Functions { double number = size; if (number >= 1024) { number = number / 1024; - measure = "KB"; + measure = "KiB"; if (number >= 1024) { number = number / 1024; - measure = "MB"; + measure = "MiB"; if (number >= 1024) { number = number / 1024; - measure = "GB"; + measure = "GiB"; + if (number >= 1024) { + number = number / 1024; + measure = "TiB"; + } } } } diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index 97571910f6..ae41c47d34 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -44,6 +44,8 @@ import hudson.model.Descriptor.FormException; import hudson.model.Queue.FlyweightTask; import hudson.model.labels.LabelAtom; import hudson.model.queue.WorkUnit; +import hudson.node_monitors.AbstractDiskSpaceMonitor; +import hudson.node_monitors.DiskSpaceMonitorNodeProperty; import hudson.node_monitors.NodeMonitor; import hudson.remoting.Channel; import hudson.remoting.VirtualChannel; @@ -1515,6 +1517,14 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces Node result = node.reconfigure(req, req.getSubmittedForm()); Jenkins.get().getNodesObject().replaceNode(this.getNode(), result); + if (result.getNodeProperty(DiskSpaceMonitorNodeProperty.class) != null) { + for (NodeMonitor monitor : NodeMonitor.getAll()) { + if (monitor instanceof AbstractDiskSpaceMonitor) { + monitor.data(this); + } + } + } + // take the user back to the agent top page. rsp.sendRedirect2("../" + result.getNodeName() + '/'); } diff --git a/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java b/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java index 8e46a37057..7645e7fe09 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java @@ -139,7 +139,7 @@ public abstract class AbstractAsyncNodeMonitorDescriptor extends AbstractNode /** * Result object for {@link AbstractAsyncNodeMonitorDescriptor#monitorDetailed()} to facilitate extending information * returned in the future. - * + *

* The {@link #getMonitoringData()} provides the results of the monitoring as {@link #monitor()} does. Note the value * in the map can be {@code null} for several reasons: *

* - * Clients can distinguishing among these states based on the additional data attached to this object. {@link #getSkipped()} - * returns computers that was not monitored as they ware either offline or monitor produced {@code null} {@link Callable}. + * Clients can distinguish among these states based on the additional data attached to this object. {@link #getSkipped()} + * returns computers that were not monitored as they were either offline or monitor produced {@code null} {@link Callable}. */ protected static final class Result { private static final long serialVersionUID = -7671448355804481216L; @@ -163,15 +163,15 @@ public abstract class AbstractAsyncNodeMonitorDescriptor extends AbstractNode this.skipped = new ArrayList<>(skipped); } - protected @NonNull Map getMonitoringData() { + public @NonNull Map getMonitoringData() { return data; } /** - * Computers that ware skipped during monitoring as they either do not have a a channel (offline) or the monitor - * have not produced the Callable. Computers that caused monitor to throw exception are not returned here. + * Computers that were skipped during monitoring as they either do not have a channel (offline) or the monitor + * has not produced the Callable. Computers that caused monitor to throw exception are not returned here. */ - protected @NonNull List getSkipped() { + public @NonNull List getSkipped() { return skipped; } } diff --git a/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java b/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java index 38230dd80f..f9f93b50a6 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java @@ -4,8 +4,9 @@ import hudson.model.Computer; import hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace; import java.text.ParseException; import java.util.logging.Logger; -import org.kohsuke.accmod.Restricted; -import org.kohsuke.accmod.restrictions.NoExternalUse; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.kohsuke.stapler.DataBoundSetter; /** * @author Kohsuke Kawaguchi @@ -17,6 +18,7 @@ public abstract class AbstractDiskSpaceMonitor extends NodeMonitor { * This is a human readable string representation as entered by the user, so that we can retain the original notation. */ public final String freeSpaceThreshold; + private String freeSpaceWarningThreshold; protected AbstractDiskSpaceMonitor(String threshold) throws ParseException { this.freeSpaceThreshold = threshold; @@ -24,12 +26,43 @@ public abstract class AbstractDiskSpaceMonitor extends NodeMonitor { } protected AbstractDiskSpaceMonitor() { - this.freeSpaceThreshold = "1GB"; + this.freeSpaceThreshold = "1GiB"; + this.freeSpaceWarningThreshold = "2GiB"; + } + + public Object readResolve() { + if (freeSpaceWarningThreshold == null) { + if (freeSpaceThreshold != null) { + Pattern p = Pattern.compile("(\\d+)(.*)"); + Matcher m = p.matcher(freeSpaceThreshold); + if (m.matches()) { + String digits = m.group(1); + String unit = m.group(2); + try { + int wt = Integer.parseInt(digits) * 2; + freeSpaceWarningThreshold = wt + unit; + } catch (NumberFormatException nfe) { + // unreachable + freeSpaceWarningThreshold = "2GiB"; + } + } + } else { + freeSpaceWarningThreshold = "2GiB"; + } + } + return this; + } + + @DataBoundSetter + public void setFreeSpaceWarningThreshold(String freeSpaceWarningThreshold) { + this.freeSpaceWarningThreshold = freeSpaceWarningThreshold; + } + + public String getFreeSpaceWarningThreshold() { + return freeSpaceWarningThreshold; } public long getThresholdBytes() { - if (freeSpaceThreshold == null) - return DEFAULT_THRESHOLD; // backward compatibility with the data format that didn't have 'freeSpaceThreshold' try { return DiskSpace.parse(freeSpaceThreshold).size; } catch (ParseException e) { @@ -37,34 +70,28 @@ public abstract class AbstractDiskSpaceMonitor extends NodeMonitor { } } - @Override - public Object data(Computer c) { - DiskSpace size = markNodeOfflineIfDiskspaceIsTooLow(c); - - // mark online (again), if free space is over threshold - if (size != null && size.size > getThresholdBytes() && c.isOffline() && c.getOfflineCause() instanceof DiskSpace) - if (this.getClass().equals(((DiskSpace) c.getOfflineCause()).getTrigger())) - if (getDescriptor().markOnline(c)) { - LOGGER.info(Messages.DiskSpaceMonitor_MarkedOnline(c.getDisplayName())); - } - return size; + protected long getThresholdBytes(Computer c) { + return getThresholdBytes(); } - /** - * Marks the given node as offline if free disk space is below the configured threshold. - * @param c the node - * @return the free space - * @since 1.521 - */ - @Restricted(NoExternalUse.class) - public DiskSpace markNodeOfflineIfDiskspaceIsTooLow(Computer c) { - DiskSpace size = (DiskSpace) super.data(c); - if (size != null && size.size < getThresholdBytes()) { - size.setTriggered(this.getClass(), true); - if (getDescriptor().markOffline(c, size)) { - LOGGER.warning(Messages.DiskSpaceMonitor_MarkedOffline(c.getDisplayName())); - } + protected long getWarningThresholdBytes() { + if (freeSpaceWarningThreshold == null) + return DEFAULT_THRESHOLD * 2; + try { + return DiskSpace.parse(freeSpaceWarningThreshold).size; + } catch (ParseException e) { + return DEFAULT_THRESHOLD * 2; } + } + + protected long getWarningThresholdBytes(Computer c) { + return getWarningThresholdBytes(); + } + + @Override + public Object data(Computer c) { + DiskSpace size = (DiskSpace) super.data(c); + ((DiskSpaceMonitorDescriptor) getDescriptor()).markNodeOfflineOrOnline(c, size, this); return size; } diff --git a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java index b8f7902a72..cd05cdde20 100644 --- a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java +++ b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitor.java @@ -53,6 +53,38 @@ public class DiskSpaceMonitor extends AbstractDiskSpaceMonitor { public DiskSpaceMonitor() {} + @Override + public long getThresholdBytes(Computer c) { + Node node = c.getNode(); + if (node != null) { + DiskSpaceMonitorNodeProperty nodeProperty = node.getNodeProperty(DiskSpaceMonitorNodeProperty.class); + if (nodeProperty != null) { + try { + return DiskSpace.parse(nodeProperty.getFreeDiskSpaceThreshold()).size; + } catch (ParseException e) { + return getThresholdBytes(); + } + } + } + return getThresholdBytes(); + } + + @Override + protected long getWarningThresholdBytes(Computer c) { + Node node = c.getNode(); + if (node != null) { + DiskSpaceMonitorNodeProperty nodeProperty = node.getNodeProperty(DiskSpaceMonitorNodeProperty.class); + if (nodeProperty != null) { + try { + return DiskSpace.parse(nodeProperty.getFreeDiskSpaceWarningThreshold()).size; + } catch (ParseException e) { + return getWarningThresholdBytes(); + } + } + } + return getWarningThresholdBytes(); + } + public DiskSpace getFreeSpace(Computer c) { return DESCRIPTOR.get(c); } diff --git a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorDescriptor.java b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorDescriptor.java index 076c2b281c..18bc935e36 100644 --- a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorDescriptor.java +++ b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorDescriptor.java @@ -25,7 +25,8 @@ package hudson.node_monitors; import hudson.Functions; -import hudson.Util; +import hudson.model.Computer; +import hudson.model.ComputerSet; import hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace; import hudson.remoting.VirtualChannel; import java.io.File; @@ -34,9 +35,12 @@ import java.io.Serializable; import java.math.BigDecimal; import java.text.ParseException; import java.util.Locale; +import java.util.Map; +import java.util.logging.Logger; import jenkins.MasterToSlaveFileCallable; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.DoNotUse; +import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; @@ -47,6 +51,54 @@ import org.kohsuke.stapler.export.ExportedBean; * @since 1.520 */ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonitorDescriptor { + + private static final Logger LOGGER = Logger.getLogger(DiskSpaceMonitorDescriptor.class.getName()); + + @Override + protected Map monitor() throws InterruptedException { + Result base = monitorDetailed(); + Map data = base.getMonitoringData(); + AbstractDiskSpaceMonitor monitor = (AbstractDiskSpaceMonitor) ComputerSet.getMonitors().get(this); + for (Map.Entry e : data.entrySet()) { + Computer c = e.getKey(); + DiskSpace d = e.getValue(); + if (base.getSkipped().contains(c)) { + assert d == null; + continue; + } + if (d == null) { + e.setValue(d = get(c)); + } + markNodeOfflineOrOnline(c, d, monitor); + } + return data; + } + + @Restricted(NoExternalUse.class) + public void markNodeOfflineOrOnline(Computer c, DiskSpace size, AbstractDiskSpaceMonitor monitor) { + if (size != null) { + long threshold = monitor.getThresholdBytes(c); + size.setThreshold(threshold); + long warningThreshold = monitor.getWarningThresholdBytes(c); + size.setWarningThreshold(warningThreshold); + if (size.size <= threshold) { + size.setTrigger(monitor.getClass()); + if (markOffline(c, size)) { + LOGGER.warning(Messages.DiskSpaceMonitor_MarkedOffline(c.getDisplayName())); + } + } + if (size.size > threshold) { + if (c.isOffline() && c.getOfflineCause() instanceof DiskSpace) { + if (monitor.getClass().equals(((DiskSpace) c.getOfflineCause()).getTrigger())) { + if (markOnline(c)) { + LOGGER.info(Messages.DiskSpaceMonitor_MarkedOnline(c.getDisplayName())); + } + } + } + } + } + } + /** * Value object that represents the disk space. */ @@ -56,8 +108,11 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito @Exported public final long size; - private boolean triggered; + private long totalSize; + private Class trigger; + private long threshold; + private long warningThreshold; /** * @param path @@ -68,12 +123,45 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito this.size = size; } + @Restricted(NoExternalUse.class) + public void setTotalSize(long totalSize) { + this.totalSize = totalSize; + } + + @Restricted(NoExternalUse.class) + @Exported + public long getTotalSize() { + return totalSize; + } + @Override public String toString() { - if (triggered) { - return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpaceTooLow(getGbLeft(), path); + if (isTriggered()) { + if (threshold >= 0) { + return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpaceTooLow( + Functions.humanReadableByteSize(size), + path, + Functions.humanReadableByteSize(threshold), + Functions.humanReadableByteSize(totalSize)); + } else { + return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpaceTooLow( + Functions.humanReadableByteSize(size), + path, + "unset", + Functions.humanReadableByteSize(totalSize)); + } } - return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpace(getGbLeft(), path); + if (isWarning()) { + return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpaceTooLow( + Functions.humanReadableByteSize(size), + path, + Functions.humanReadableByteSize(warningThreshold), + Functions.humanReadableByteSize(totalSize)); + } + return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpace( + Functions.humanReadableByteSize(size), + path, + Functions.humanReadableByteSize(totalSize)); } /** @@ -94,7 +182,12 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito /** * Gets GB left. + * + * @deprecated since TODO + * Directly use the size field or to get a human-readable value with units use + * {@link Functions#humanReadableByteSize(long)} */ + @Deprecated public String getGbLeft() { long space = size; space /= 1024L; // convert to KB @@ -107,27 +200,42 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito * Returns the HTML representation of the space. */ public String toHtml() { - String humanReadableSpace = Functions.humanReadableByteSize(size); - if (triggered) { - return Util.wrapToErrorSpan(humanReadableSpace); - } - return humanReadableSpace; + return Functions.humanReadableByteSize(size); + } + + @Restricted(NoExternalUse.class) + public boolean isTriggered() { + return size <= threshold; + } + + @Restricted(NoExternalUse.class) + public boolean isWarning() { + return size > threshold && size < warningThreshold; } /** - * Sets whether this disk space amount should be treated as outside - * the acceptable conditions or not. + * Sets the trigger class which made the decision */ - protected void setTriggered(boolean triggered) { - this.triggered = triggered; - } - - /** - * Same as {@link DiskSpace#setTriggered(boolean)}, also sets the trigger class which made the decision - */ - protected void setTriggered(Class trigger, boolean triggered) { + protected void setTrigger(Class trigger) { this.trigger = trigger; - this.triggered = triggered; + } + + public void setThreshold(long threshold) { + this.threshold = threshold; + } + + @Exported + public long getThreshold() { + return threshold; + } + + public void setWarningThreshold(long warningThreshold) { + this.warningThreshold = warningThreshold; + } + + @Exported + public long getWarningThreshold() { + return warningThreshold; } @Override @@ -136,14 +244,16 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito } /** - * Parses a human readable size description like "1GB", "0.5m", etc. into {@link DiskSpace} + * Parses a human readable size description like "1GB", "0.5m", "500KiB", etc. into {@link DiskSpace} * * @throws ParseException * If failed to parse. */ public static DiskSpace parse(String size) throws ParseException { size = size.toUpperCase(Locale.ENGLISH).trim(); - if (size.endsWith("B")) // cut off 'B' from KB, MB, etc. + if (size.endsWith("B")) // cut off 'B' from KB, MB, KiB, etc. + size = size.substring(0, size.length() - 1); + if (size.endsWith("I")) // cut off 'i' from KiB, MiB, etc. size = size.substring(0, size.length() - 1); long multiplier = 1; @@ -160,7 +270,11 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito } } - return new DiskSpace("", (long) (Double.parseDouble(size.trim()) * multiplier)); + try { + return new DiskSpace("", (long) (Double.parseDouble(size.trim()) * multiplier)); + } catch (NumberFormatException nfe) { + throw new ParseException(nfe.getLocalizedMessage(), 0); + } } private static final long serialVersionUID = 2L; @@ -171,9 +285,11 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito @Override public DiskSpace invoke(File f, VirtualChannel channel) throws IOException { - long s = f.getUsableSpace(); - if (s <= 0) return null; - return new DiskSpace(f.getCanonicalPath(), s); + long s = f.getUsableSpace(); + if (s <= 0) return null; + DiskSpace ds = new DiskSpace(f.getCanonicalPath(), s); + ds.setTotalSize(f.getTotalSpace()); + return ds; } private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorNodeProperty.java b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorNodeProperty.java new file mode 100644 index 0000000000..37cb8a56f6 --- /dev/null +++ b/core/src/main/java/hudson/node_monitors/DiskSpaceMonitorNodeProperty.java @@ -0,0 +1,59 @@ +package hudson.node_monitors; + +import edu.umd.cs.findbugs.annotations.NonNull; +import hudson.Extension; +import hudson.model.Node; +import hudson.slaves.NodeProperty; +import hudson.slaves.NodePropertyDescriptor; +import org.jenkinsci.Symbol; +import org.kohsuke.stapler.DataBoundConstructor; + +/** + * {@link NodeProperty} that allows users to set agent specific disk space thresholds. + * + * @since TODO + */ +public class DiskSpaceMonitorNodeProperty extends NodeProperty { + private final String freeDiskSpaceThreshold; + private final String freeTempSpaceThreshold; + + private final String freeDiskSpaceWarningThreshold; + private final String freeTempSpaceWarningThreshold; + + @DataBoundConstructor + public DiskSpaceMonitorNodeProperty(String freeDiskSpaceThreshold, String freeTempSpaceThreshold, + String freeDiskSpaceWarningThreshold, String freeTempSpaceWarningThreshold) { + this.freeDiskSpaceThreshold = freeDiskSpaceThreshold; + this.freeTempSpaceThreshold = freeTempSpaceThreshold; + this.freeDiskSpaceWarningThreshold = freeDiskSpaceWarningThreshold; + this.freeTempSpaceWarningThreshold = freeTempSpaceWarningThreshold; + } + + public String getFreeDiskSpaceThreshold() { + return freeDiskSpaceThreshold; + } + + public String getFreeTempSpaceThreshold() { + return freeTempSpaceThreshold; + } + + public String getFreeDiskSpaceWarningThreshold() { + return freeDiskSpaceWarningThreshold; + } + + public String getFreeTempSpaceWarningThreshold() { + return freeTempSpaceWarningThreshold; + } + + @Extension + @Symbol("diskSpaceMonitor") + public static class DescriptorImpl extends NodePropertyDescriptor { + + @NonNull + @Override + public String getDisplayName() { + return Messages.DiskSpaceMonitorNodeProperty_DisplayName(); + } + } + +} diff --git a/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java b/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java index d92341142a..976d35a236 100644 --- a/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java +++ b/core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java @@ -56,6 +56,38 @@ public class TemporarySpaceMonitor extends AbstractDiskSpaceMonitor { public TemporarySpaceMonitor() {} + @Override + public long getThresholdBytes(Computer c) { + Node node = c.getNode(); + if (node != null) { + DiskSpaceMonitorNodeProperty nodeProperty = node.getNodeProperty(DiskSpaceMonitorNodeProperty.class); + if (nodeProperty != null) { + try { + return DiskSpace.parse(nodeProperty.getFreeTempSpaceThreshold()).size; + } catch (ParseException e) { + return getThresholdBytes(); + } + } + } + return getThresholdBytes(); + } + + @Override + protected long getWarningThresholdBytes(Computer c) { + Node node = c.getNode(); + if (node != null) { + DiskSpaceMonitorNodeProperty nodeProperty = node.getNodeProperty(DiskSpaceMonitorNodeProperty.class); + if (nodeProperty != null) { + try { + return DiskSpace.parse(nodeProperty.getFreeTempSpaceWarningThreshold()).size; + } catch (ParseException e) { + return getWarningThresholdBytes(); + } + } + } + return getWarningThresholdBytes(); + } + public DiskSpace getFreeSpace(Computer c) { DiskSpaceMonitorDescriptor descriptor = (DiskSpaceMonitorDescriptor) Jenkins.get().getDescriptor(TemporarySpaceMonitor.class); return descriptor != null ? descriptor.get(c) : null; @@ -109,7 +141,9 @@ public class TemporarySpaceMonitor extends AbstractDiskSpaceMonitor { f = new File(System.getProperty("java.io.tmpdir")); long s = f.getUsableSpace(); if (s <= 0) return null; - return new DiskSpace(f.getCanonicalPath(), s); + DiskSpace ds = new DiskSpace(f.getCanonicalPath(), s); + ds.setTotalSize(f.getTotalSpace()); + return ds; } private static final long serialVersionUID = 1L; diff --git a/core/src/main/resources/hudson/model/ComputerSet/configure.jelly b/core/src/main/resources/hudson/model/ComputerSet/configure.jelly index e97bbc3148..4bbd52b4c4 100644 --- a/core/src/main/resources/hudson/model/ComputerSet/configure.jelly +++ b/core/src/main/resources/hudson/model/ComputerSet/configure.jelly @@ -29,9 +29,9 @@ THE SOFTWARE. - + - + diff --git a/core/src/main/resources/hudson/model/ComputerSet/index.jelly b/core/src/main/resources/hudson/model/ComputerSet/index.jelly index ff8a8e2880..ec4d2ab978 100644 --- a/core/src/main/resources/hudson/model/ComputerSet/index.jelly +++ b/core/src/main/resources/hudson/model/ComputerSet/index.jelly @@ -41,8 +41,8 @@ THE SOFTWARE. - - ${%Node Monitoring} + + ${%Configure Monitors} diff --git a/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config.jelly b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config.jelly index 642ef96d34..5bbd914f35 100644 --- a/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config.jelly +++ b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config.jelly @@ -26,4 +26,7 @@ THE SOFTWARE. - \ No newline at end of file + + + + diff --git a/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold.html b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold.html index 818a9e10ad..f48dbb6f29 100644 --- a/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold.html +++ b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold.html @@ -1,6 +1,11 @@
This option configures the amount of minimum amount of free disk space desired - for an agent's proper operation, such as "1.5GB", "100KB", etc. If an agent is - found to have less free disk space than this amount, it will be marked - offline. + for an agent's proper operation, such as "1.5GB", "100KiB", etc. If an agent + is found to have less free disk space than this amount, it will be marked + temporarily offline. The threshold can be configured individually for each + agent via a property. +

+ Set to 0 to disable this check except for agents that configure the + threshold explicitly. +

diff --git a/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceWarningThreshold.html b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceWarningThreshold.html new file mode 100644 index 0000000000..3c2691afe2 --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceWarningThreshold.html @@ -0,0 +1,5 @@ +
+ This option configures the warning threshold of free disk space. When free + space drops below this limit, a warning is shown for the corresponding agent + in the computer overview page, but the agent is not taken offline. +
diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/column.jelly b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/column.jelly index 81a19eb0a9..3d3ca8b23c 100644 --- a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/column.jelly +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/column.jelly @@ -29,7 +29,19 @@ THE SOFTWARE. N/A - + + + + ${data.toHtml()} + + + ${data.toHtml()} + + + ${data.toHtml()} + + + diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/help.html b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/help.html index ace250e874..5b46852df3 100644 --- a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/help.html +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/help.html @@ -1,8 +1,8 @@
This monitors the available disk space of $JENKINS_HOME - on each agent, and if it gets below a threshold, the agent will be marked - offline. + on the controller or the remote root directory on each agent, and if it gets + below a threshold, the agent will be marked temporarily offline.

This directory is where all your builds are performed, so if it fills up, diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config.jelly b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config.jelly new file mode 100644 index 0000000000..8c1afdef6b --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config.jelly @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config_de.properties b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config_de.properties new file mode 100644 index 0000000000..507903f0e7 --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config_de.properties @@ -0,0 +1,2 @@ +Free\ Disk\ Space\ Threshold=Schwellwert für freien Festplattenspeicherplatz +Free\ Temp\ Space\ Threshold=Schwellwert für freien temporären Speicherplatz diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceThreshold.html b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceThreshold.html new file mode 100644 index 0000000000..4e81303bcb --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceThreshold.html @@ -0,0 +1,8 @@ +

+ This option configures the amount of minimum amount of free disk space desired + for the agent's proper operation, such as "1.5GB", "100KiB", etc. If the agent + is found to have less free disk space than this amount, it will be marked + temporarily offline. +

Set to 0 to disable this check on this agent.

+

Set to empty to use the globally defined value.

+
diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceWarningThreshold.html b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceWarningThreshold.html new file mode 100644 index 0000000000..625b5525de --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceWarningThreshold.html @@ -0,0 +1,8 @@ +
+ This option configures the amount of minimum amount of free disk space desired + for the agent's proper operation, such as "1.5GB", "100KiB", etc. If the agent + is found to have less free disk space than this amount, a warning will be + shown for it on the computer overview page, but it will not be taken offline. +

Set to 0 to disable this warning on this agent.

+

Set to empty to use the globally defined value.

+
diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceThreshold.html b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceThreshold.html new file mode 100644 index 0000000000..56d8a35feb --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceThreshold.html @@ -0,0 +1,8 @@ +
+ This option configures the amount of minimum amount of free temp space desired + for the agent's proper operation, such as "1.5GB", "100KiB", etc. If the agent + is found to have less free temp space than this amount, it will be marked + temporarily offline. +

Set to 0 to disable this check on this agent.

+

Set to empty to use the globally defined value.

+
diff --git a/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceWarningThreshold.html b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceWarningThreshold.html new file mode 100644 index 0000000000..102843f441 --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceWarningThreshold.html @@ -0,0 +1,8 @@ +
+ This option configures the amount of minimum amount of free temp space desired + for the agent's proper operation, such as "1.5GB", "100KiB", etc. If the agent + is found to have less free temp space than this amount, a warning will be + shown for it on the computer overview page, but it will not be taken offline. +

Set to 0 to disable this warning on this agent.

+

Set to empty to use the globally defined value.

+
diff --git a/core/src/main/resources/hudson/node_monitors/Messages.properties b/core/src/main/resources/hudson/node_monitors/Messages.properties index 749b326d2a..75c656aa4f 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages.properties @@ -31,6 +31,7 @@ ResponseTimeMonitor.TimeOut=Timed out for last {0} attempts SwapSpaceMonitor.DisplayName=Free Swap Space TemporarySpaceMonitor.DisplayName=Free Temp Space AbstractNodeMonitorDescriptor.NoDataYet=Not yet -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Disk space is too low. Only {0}GB left on {1}. -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0}GB left on {1}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Disk space is below threshold of {2}. Only {0} out of {3} left on {1}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0} out of {2} left on {1}. MonitorMarkedNodeOffline.DisplayName=Node Marked Offline Due to Health Check +DiskSpaceMonitorNodeProperty.DisplayName=Disk Space Monitoring Thresholds diff --git a/core/src/main/resources/hudson/node_monitors/Messages_bg.properties b/core/src/main/resources/hudson/node_monitors/Messages_bg.properties index f7910a8de2..e6c3127b19 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_bg.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_bg.properties @@ -43,7 +43,7 @@ TemporarySpaceMonitor.DisplayName=\ AbstractNodeMonitorDescriptor.NoDataYet=\ Няма данни DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=\ - Дисковото пространство привършва. На {1} остават само {0} GB. + Дисковото пространство привършва. На {1} остават само {0} . MonitorMarkedNodeOffline.DisplayName=\ Компютърът е отбелязан като извън линия в резултат на проверката на\ състоянието му. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_cs.properties b/core/src/main/resources/hudson/node_monitors/Messages_cs.properties index 2010f4261c..68d3793c55 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_cs.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_cs.properties @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Málo místa na disku. Zbývá pouze {0}GB. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Málo místa na disku. Zbývá pouze {0}. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_da.properties b/core/src/main/resources/hudson/node_monitors/Messages_da.properties index 6a9940dfab..edb1eff194 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_da.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_da.properties @@ -29,4 +29,4 @@ SwapSpaceMonitor.DisplayName=Ledig Swap Plads ArchitectureMonitor.DisplayName=Arkitektur ResponseTimeMonitor.MarkedOffline=Tager {0} offline midlertidigt da den ikke svarer ResponseTimeMonitor.DisplayName=Respons Tid -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Disk plads for lav. Kun {0}GB tilbage. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Disk plads for lav. Kun {0} tilbage. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_de.properties b/core/src/main/resources/hudson/node_monitors/Messages_de.properties index cefa1860de..1d9b196fbb 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_de.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_de.properties @@ -28,8 +28,10 @@ ResponseTimeMonitor.DisplayName=Antwortzeit ResponseTimeMonitor.TimeOut= {0} mal keine Antwort SwapSpaceMonitor.DisplayName=Freier Swap Space TemporarySpaceMonitor.DisplayName=Freier TEMP-Platz -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Zu wenig Festplattenplatz: Nur noch {0}GB frei. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Festplattenplatz unterhalb der Schwelle von {2}. Nur noch {0} von {3} frei in {1}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0} von {2} verbleibend in {1}. DiskSpaceMonitor.MarkedOnline=Nehme {0} wieder online, da wieder genug Festplattenplatz verfügbar ist. MonitorMarkedNodeOffline.DisplayName=Knoten durch Health-Check-Prüfung offline ResponseTimeMonitor.MarkedOffline=Nehme {0} offline, da er nicht antwortet. AbstractNodeMonitorDescriptor.NoDataYet=Noch keine Daten +DiskSpaceMonitorNodeProperty.DisplayName=Schwellwerte für die Festplattenspeicherplatzüberwachung diff --git a/core/src/main/resources/hudson/node_monitors/Messages_es.properties b/core/src/main/resources/hudson/node_monitors/Messages_es.properties index 6ee2f1b6dd..a99d4a6f6b 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_es.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_es.properties @@ -29,4 +29,4 @@ ResponseTimeMonitor.MarkedOffline=Poniendo temporalmente {0} fuera de línea por ResponseTimeMonitor.TimeOut=Se sobrepasó el tiempo de espera en el último intento de {0} SwapSpaceMonitor.DisplayName=Espacio de intercambio libre TemporarySpaceMonitor.DisplayName=Espacio temporal libre -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=El espacio en disco es muy bajo, sólo quedan {0}GB. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=El espacio en disco es muy bajo, sólo quedan {0}. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_fr.properties b/core/src/main/resources/hudson/node_monitors/Messages_fr.properties index d8c2f6b458..df06f7fa0b 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_fr.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_fr.properties @@ -28,4 +28,4 @@ ResponseTimeMonitor.DisplayName=Temps de réponse ResponseTimeMonitor.MarkedOffline={0} est marqué comme déconnecté temporairement, parce qu''il ne répond pas ResponseTimeMonitor.TimeOut=Time out du dernier essai {0} SwapSpaceMonitor.DisplayName=Espace de swap disponible -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Espace disque insuffisant. Seulement {0} GB restant sur {1} +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Espace disque insuffisant. Seulement {0} restant sur {1} diff --git a/core/src/main/resources/hudson/node_monitors/Messages_it.properties b/core/src/main/resources/hudson/node_monitors/Messages_it.properties index 9a247da8b2..be608c38ab 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_it.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_it.properties @@ -24,9 +24,9 @@ AbstractNodeMonitorDescriptor.NoDataYet=Non ancora ArchitectureMonitor.DisplayName=Architettura ClockMonitor.DisplayName=Differenza di orario -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0} GB rimanenti su {1}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0} rimanenti su {1}. DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Lo spazio su disco \ - disponibile è troppo basso. Su {1} rimangono solo {0} GB. + disponibile è troppo basso. Su {1} rimangono solo {0}. DiskSpaceMonitor.DisplayName=Spazio su disco libero DiskSpaceMonitor.MarkedOffline=Metto temporaneamente {0} non in linea per \ mancanza di spazio su disco diff --git a/core/src/main/resources/hudson/node_monitors/Messages_ja.properties b/core/src/main/resources/hudson/node_monitors/Messages_ja.properties index 51d0e5287f..0c7f9114ed 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_ja.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_ja.properties @@ -31,4 +31,4 @@ ResponseTimeMonitor.TimeOut=タイムアウト(直近 {0}回) SwapSpaceMonitor.DisplayName=空きスワップ容量 TemporarySpaceMonitor.DisplayName=空きテンポラリ容量 AbstractNodeMonitorDescriptor.NoDataYet=データ未取得 -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=ディスク容量が少なすぎます。残り{0}GBです。 +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=ディスク容量が少なすぎます。残り{0}です。 diff --git a/core/src/main/resources/hudson/node_monitors/Messages_nl.properties b/core/src/main/resources/hudson/node_monitors/Messages_nl.properties index 4a0fecb3a3..bdffd29a2a 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_nl.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_nl.properties @@ -23,4 +23,4 @@ ArchitectureMonitor.DisplayName=Architectuur ClockMonitor.DisplayName=Tijdsverschil DiskSpaceMonitor.DisplayName=Beschikbare schijfruimte -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Er is te weinig vrije schijfruimte, nog maar {0} GB over. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Er is te weinig vrije schijfruimte, nog maar {0} over. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_pt_BR.properties b/core/src/main/resources/hudson/node_monitors/Messages_pt_BR.properties index 1d0ce852ed..bc6f788641 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_pt_BR.properties @@ -31,6 +31,6 @@ SwapSpaceMonitor.DisplayName=Espaço de troca livre ResponseTimeMonitor.MarkedOffline= Indisponível temporariamente por que não está respondendo AbstractNodeMonitorDescriptor.NoDataYet=Nada ainda DiskSpaceMonitor.MarkedOnline=Retornando {0} como ativo pois há espaço em disco suficiente novamente -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Pouco espaço em disco. Somente {0}GB disponível em {1}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Pouco espaço em disco. Somente {0} disponível em {1}. MonitorMarkedNodeOffline.DisplayName=Nó marcado como fora de serviço devido a verificação de saúde -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0}GB restantes em {1}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace={0} restantes em {1}. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_ru.properties b/core/src/main/resources/hudson/node_monitors/Messages_ru.properties index f6f714f97d..ad3e610e37 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_ru.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_ru.properties @@ -31,6 +31,6 @@ ResponseTimeMonitor.TimeOut=Последние {0} попыток заверши SwapSpaceMonitor.DisplayName=Свободное пространство подкачки TemporarySpaceMonitor.DisplayName=Свободное временное пространство AbstractNodeMonitorDescriptor.NoDataYet=Ещё нет -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Слишком мало дискового пространства. На {1} осталось всего {0} ГБ. -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace=На {1} осталось {0} ГБ. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Слишком мало дискового пространства. На {1} осталось всего {0}. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpace=На {1} осталось {0}. MonitorMarkedNodeOffline.DisplayName=Узлы, помеченные как отключённые проверками состояния diff --git a/core/src/main/resources/hudson/node_monitors/Messages_sr.properties b/core/src/main/resources/hudson/node_monitors/Messages_sr.properties index f65bf82f14..20175c5794 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_sr.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_sr.properties @@ -11,4 +11,4 @@ ResponseTimeMonitor.TimeOut=Изсткло време за последњи по SwapSpaceMonitor.DisplayName=Слободног простора за заменом простору TemporarySpaceMonitor.DisplayName=Слободног простора за привременом простору AbstractNodeMonitorDescriptor.NoDataYet=Нема података -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Нема довољно простора на диску. {1} остаје само {0}GB. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Нема довољно простора на диску. {1} остаје само {0}. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_sv_SE.properties b/core/src/main/resources/hudson/node_monitors/Messages_sv_SE.properties index 2a381f215c..866e0da49d 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_sv_SE.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_sv_SE.properties @@ -19,5 +19,4 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Diskutrymme lågt. Enbart {0}GB kvar. +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Diskutrymme lågt. Enbart {0} kvar. diff --git a/core/src/main/resources/hudson/node_monitors/Messages_zh_TW.properties b/core/src/main/resources/hudson/node_monitors/Messages_zh_TW.properties index 9b4a3dea59..48558c7728 100644 --- a/core/src/main/resources/hudson/node_monitors/Messages_zh_TW.properties +++ b/core/src/main/resources/hudson/node_monitors/Messages_zh_TW.properties @@ -30,4 +30,4 @@ ResponseTimeMonitor.MarkedOffline={0} 沒有回應,將其離線 ResponseTimeMonitor.TimeOut=最近 {0} 次連線都逾時 SwapSpaceMonitor.DisplayName=可用 Swap 空間 TemporarySpaceMonitor.DisplayName=可用暫存空間 -DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=磁碟空間太少。{1} 上只剩 {0}GB。 +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=磁碟空間太少。{1} 上只剩 {0}。 diff --git a/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/column.jelly b/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/column.jelly index 5c1a410d1b..8655fc2aad 100644 --- a/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/column.jelly +++ b/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/column.jelly @@ -29,7 +29,19 @@ THE SOFTWARE. N/A - + + + + ${data.toHtml()} + + + ${data.toHtml()} + + + ${data.toHtml()} + + + diff --git a/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/help.html b/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/help.html index ea237d75ae..2acf9a6f12 100644 --- a/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/help.html +++ b/core/src/main/resources/hudson/node_monitors/TemporarySpaceMonitor/help.html @@ -1,6 +1,6 @@
This monitors the available disk space of the temporary directory, and if it - gets below a certain threshold the node will be made offline. + gets below a certain threshold the agent will be marked temporarily offline.

Java tools and tests/builds often create files in the temporary directory, diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 0fe72c16de..95d5def0bb 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -321,12 +321,13 @@ public class FunctionsTest { Locale.setDefault(Locale.ENGLISH); assertEquals("0 B", Functions.humanReadableByteSize(0)); assertEquals("1023 B", Functions.humanReadableByteSize(1023)); - assertEquals("1.00 KB", Functions.humanReadableByteSize(1024)); - assertEquals("1.50 KB", Functions.humanReadableByteSize(1536)); - assertEquals("20.00 KB", Functions.humanReadableByteSize(20480)); - assertEquals("1023.00 KB", Functions.humanReadableByteSize(1047552)); - assertEquals("1.00 MB", Functions.humanReadableByteSize(1048576)); - assertEquals("1.50 GB", Functions.humanReadableByteSize(1610612700)); + assertEquals("1.00 KiB", Functions.humanReadableByteSize(1024)); + assertEquals("1.50 KiB", Functions.humanReadableByteSize(1536)); + assertEquals("20.00 KiB", Functions.humanReadableByteSize(20480)); + assertEquals("1023.00 KiB", Functions.humanReadableByteSize(1047552)); + assertEquals("1.00 MiB", Functions.humanReadableByteSize(1048576)); + assertEquals("1.50 GiB", Functions.humanReadableByteSize(1610612700)); + assertEquals("1.50 TiB", Functions.humanReadableByteSize(1649267441664L)); } finally { Locale.setDefault(defaultLocale); } diff --git a/pom.xml b/pom.xml index 9c2ac99d62..7abf74185f 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ THE SOFTWARE. - 2.433 + 2.434 -SNAPSHOT diff --git a/test/src/test/java/hudson/model/ComputerSetTest.java b/test/src/test/java/hudson/model/ComputerSetTest.java index cff8892c6f..f40cf3e00c 100644 --- a/test/src/test/java/hudson/model/ComputerSetTest.java +++ b/test/src/test/java/hudson/model/ComputerSetTest.java @@ -130,7 +130,7 @@ public class ComputerSetTest { assertEquals(HttpURLConnection.HTTP_OK, page.getWebResponse().getStatusCode()); responseContent = page.getWebResponse().getContentAsString(); // the "Node Monitoring" link in the app bar is visible - assertThat(responseContent, containsString("Node Monitoring")); + assertThat(responseContent, containsString("Configure Monitors")); page = wc.goTo("computer/configure"); assertEquals(HttpURLConnection.HTTP_OK, page.getWebResponse().getStatusCode()); // and the save button is visible diff --git a/test/src/test/java/hudson/node_monitors/DiskSpaceMonitorDescriptorTest.java b/test/src/test/java/hudson/node_monitors/DiskSpaceMonitorDescriptorTest.java index e897a8f300..e662f19094 100644 --- a/test/src/test/java/hudson/node_monitors/DiskSpaceMonitorDescriptorTest.java +++ b/test/src/test/java/hudson/node_monitors/DiskSpaceMonitorDescriptorTest.java @@ -45,7 +45,9 @@ public class DiskSpaceMonitorDescriptorTest { assertEquals(1024, DiskSpace.parse("1KB").size); assertEquals(1024, DiskSpace.parse("1K").size); assertEquals(1024, DiskSpace.parse("1kb").size); + assertEquals(1024, DiskSpace.parse("1kib").size); assertEquals(1024 * 1024, DiskSpace.parse("1MB").size); + assertEquals(1024 * 1024, DiskSpace.parse("1MIB").size); assertEquals(1024 * 1024 * 1024, DiskSpace.parse("1GB").size); assertEquals(512 * 1024 * 1024, DiskSpace.parse("0.5GB").size); } @@ -55,8 +57,10 @@ public class DiskSpaceMonitorDescriptorTest { @Issue("JENKINS-59383") public void string() { DiskSpace du = new DiskSpace("/tmp", 123 * 1024 * 1024); - assertEquals("0.123GB left on /tmp.", du.toString()); - du.setTriggered(true); - assertEquals("Disk space is too low. Only 0.123GB left on /tmp.", du.toString()); + du.setTotalSize(300 * 1024 * 1024); + du.setThreshold(100 * 1024 * 1024); + assertEquals("123.00 MiB out of 300.00 MiB left on /tmp.", du.toString()); + du.setThreshold(200 * 1024 * 1024); + assertEquals("Disk space is below threshold of 200.00 MiB. Only 123.00 MiB out of 300.00 MiB left on /tmp.", du.toString()); } } diff --git a/war/package.json b/war/package.json index 45b59e770d..8c0ea9634f 100644 --- a/war/package.json +++ b/war/package.json @@ -30,7 +30,7 @@ "clean-webpack-plugin": "4.0.0", "css-loader": "6.8.1", "css-minimizer-webpack-plugin": "5.0.1", - "eslint": "8.53.0", + "eslint": "8.54.0", "eslint-config-prettier": "9.0.0", "handlebars-loader": "1.7.3", "mini-css-extract-plugin": "2.7.6", diff --git a/war/src/main/js/components/dialogs/index.js b/war/src/main/js/components/dialogs/index.js index 3dc6ba4f9d..de8874fe74 100644 --- a/war/src/main/js/components/dialogs/index.js +++ b/war/src/main/js/components/dialogs/index.js @@ -139,7 +139,11 @@ Dialog.prototype.appendButtons = function () { }

`); - this.dialog.appendChild(buttons); + if (this.dialogType === "form") { + this.form.appendChild(buttons); + } else { + this.dialog.appendChild(buttons); + } this.ok = buttons.querySelector("[data-id=ok]"); this.cancel = buttons.querySelector("[data-id=cancel]"); @@ -172,25 +176,24 @@ Dialog.prototype.show = function () { if (this.input != null) { this.input.focus(); } - if (this.ok != null) { + if ( + this.ok != null && + (this.dialogType != "form" || !this.options.submitButton) + ) { this.ok.addEventListener( "click", (e) => { - if (this.dialogType === "form" && this.options.submitButton) { - this.form.submit(); - } else { - e.preventDefault(); + e.preventDefault(); - let value = true; - if (this.dialogType === "prompt") { - value = this.input.value; - } - if (this.dialogType === "form") { - value = new FormData(this.form); - } - this.dialog.remove(); - resolve(value); + let value = true; + if (this.dialogType === "prompt") { + value = this.input.value; } + if (this.dialogType === "form") { + value = new FormData(this.form); + } + this.dialog.remove(); + resolve(value); }, { once: true }, ); diff --git a/war/src/main/scss/base/_style.scss b/war/src/main/scss/base/_style.scss index e1957b7f01..ecda3df84a 100644 --- a/war/src/main/scss/base/_style.scss +++ b/war/src/main/scss/base/_style.scss @@ -459,7 +459,7 @@ div.listview-jobs { padding: 0; margin-top: 5px; white-space: normal; - opacity: 0.6; + color: var(--text-color-secondary); word-break: break-word; } diff --git a/war/yarn.lock b/war/yarn.lock index afcdf628f4..bd73a9944d 100644 --- a/war/yarn.lock +++ b/war/yarn.lock @@ -1802,10 +1802,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:8.53.0": - version: 8.53.0 - resolution: "@eslint/js@npm:8.53.0" - checksum: d29f6c207b2f6dc4ef174d16a3c07b0d3a17ca3d805680496ff267edd773e3bac41db4e7dcab622ca1970d892535bd19671e2a756d4eac75e96fd8c8dcdb619b +"@eslint/js@npm:8.54.0": + version: 8.54.0 + resolution: "@eslint/js@npm:8.54.0" + checksum: d61fb4a0be6af2d8cb290121c329697664a75d6255a29926d5454fb02aeb02b87112f67fdf218d10abac42f90c570ac366126751baefc5405d0e017ed0c946c5 languageName: node linkType: hard @@ -3553,14 +3553,14 @@ __metadata: languageName: node linkType: hard -"eslint@npm:8.53.0": - version: 8.53.0 - resolution: "eslint@npm:8.53.0" +"eslint@npm:8.54.0": + version: 8.54.0 + resolution: "eslint@npm:8.54.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.6.1" "@eslint/eslintrc": "npm:^2.1.3" - "@eslint/js": "npm:8.53.0" + "@eslint/js": "npm:8.54.0" "@humanwhocodes/config-array": "npm:^0.11.13" "@humanwhocodes/module-importer": "npm:^1.0.1" "@nodelib/fs.walk": "npm:^1.2.8" @@ -3597,7 +3597,7 @@ __metadata: text-table: "npm:^0.2.0" bin: eslint: bin/eslint.js - checksum: c5cd0049488c0463dab7d97466767ca5a1d0b3b59d0a223122683dc8039ecea30b27867fb9e38906b4c1ab9d09ece8a802a6c540d8905016f1cc4b4bb27329af + checksum: 4f205f832bdbd0218cde374b067791f4f76d7abe8de86b2dc849c273899051126d912ebf71531ee49b8eeaa22cad77febdc8f2876698dc2a76e84a8cb976af22 languageName: node linkType: hard @@ -4413,7 +4413,7 @@ __metadata: clean-webpack-plugin: "npm:4.0.0" css-loader: "npm:6.8.1" css-minimizer-webpack-plugin: "npm:5.0.1" - eslint: "npm:8.53.0" + eslint: "npm:8.54.0" eslint-config-prettier: "npm:9.0.0" handlebars: "npm:4.7.8" handlebars-loader: "npm:1.7.3"