hudson.Util.wrapToErrorSpan()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中hudson.Util.wrapToErrorSpan()方法的一些代码示例,展示了Util.wrapToErrorSpan()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.wrapToErrorSpan()方法的具体详情如下:
包路径:hudson.Util
类名称:Util
方法名:wrapToErrorSpan

Util.wrapToErrorSpan介绍

[英]Wraps with the error icon and the CSS class to render error message.
[中]使用错误图标和CSS类包装以呈现错误消息。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns the HTML representation of the space.
 */
public String toHtml() {
  String humanReadableSpace = Functions.humanReadableByteSize(size);
  if(triggered) {
    return Util.wrapToErrorSpan(humanReadableSpace);
  }
  return humanReadableSpace;
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns the HTML representation of the space.
 */
public String toHtml(MemoryUsage usage) {
  if(usage.availableSwapSpace==-1)
    return "N/A";
  String humanReadableSpace = Functions.humanReadableByteSize(usage.availableSwapSpace);
    long free = usage.availableSwapSpace;
  free/=1024L;   // convert to KB
  free/=1024L;   // convert to MB
  if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
    return humanReadableSpace; // if we have more than 256MB free or less than 80% filled up, it's OK
  // Otherwise considered dangerously low.
  return Util.wrapToErrorSpan(humanReadableSpace);
}

代码示例来源:origin: jenkinsci/jenkins

public String toHtml() {
  String s = toString();
  if(isDangerous())
    s = Util.wrapToErrorSpan(s);
  return s;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml(MemoryUsage usage) {
  if(usage.availableSwapSpace==-1)
    return "N/A";
  long free = usage.availableSwapSpace;
  free/=1024L;   // convert to KB
  free/=1024L;   // convert to MB
  if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
    return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  // Otherwise considered dangerously low.
  return Util.wrapToErrorSpan(free+"MB");
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Returns the HTML representation of the space.
 */
public String toHtml(MemoryUsage usage) {
  if(usage.availableSwapSpace==-1)
    return "N/A";
  long free = usage.availableSwapSpace;
  free/=1024L;   // convert to KB
  free/=1024L;   // convert to MB
  if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
    return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  // Otherwise considered dangerously low.
  return Util.wrapToErrorSpan(free+"MB");
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml() {
  String humanReadableSpace = Functions.humanReadableByteSize(size);
  if(triggered) {
    return Util.wrapToErrorSpan(humanReadableSpace);
  }
  return humanReadableSpace;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml() {
  long space = size;
  space/=1024L;   // convert to KB
  space/=1024L;   // convert to MB
  if(triggered) {
    // less than a GB
    return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString()+"GB");
  }
  return space/1024+"GB";
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml() {
  long space = size;
  space /= 1024L;   // convert to KB
  space /= 1024L;   // convert to MB
  if (triggered) {
    // less than a GB
    return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString() + "GB");
  }
  return space / 1024 + "GB";
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml() {
  long space = size;
  space/=1024L;   // convert to KB
  space/=1024L;   // convert to MB
  if(triggered) {
    // less than a GB
    return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString()+"GB");
  }
  return space/1024+"GB";
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Returns the HTML representation of the space.
 */
public String toHtml() {
  long space = size;
  space/=1024L;   // convert to KB
  space/=1024L;   // convert to MB
  if(triggered) {
    // less than a GB
    return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString()+"GB");
  }
  return space/1024+"GB";
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml(MemoryUsage usage) {
  if(usage.availableSwapSpace==-1)
    return "N/A";
  String humanReadableSpace = Functions.humanReadableByteSize(usage.availableSwapSpace);
    long free = usage.availableSwapSpace;
  free/=1024L;   // convert to KB
  free/=1024L;   // convert to MB
  if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
    return humanReadableSpace; // if we have more than 256MB free or less than 80% filled up, it's OK
  // Otherwise considered dangerously low.
  return Util.wrapToErrorSpan(humanReadableSpace);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public String toHtml() {
  String s = toString();
  if(isDangerous())
    s = Util.wrapToErrorSpan(s);
  return s;
}

代码示例来源:origin: hudson/hudson-2.x

public String toHtml() {
  String s = toString();
  if(isDangerous())
    s = Util.wrapToErrorSpan(s);
  return s;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public String toHtml() {
  String s = toString();
  if(isDangerous())
    s = Util.wrapToErrorSpan(s);
  return s;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public String toHtml() {
  String s = toString();
  if (isDangerous()) {
    s = Util.wrapToErrorSpan(s);
  }
  return s;
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public String toHtml() {
  String s = toString();
  if(isDangerous())
    s = Util.wrapToErrorSpan(s);
  return s;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
     * HTML rendering of the data
     */
    @Override
    public String toString() {
//            StringBuilder buf = new StringBuilder();
//            for (long l : past5) {
//                if(buf.length()>0)  buf.append(',');
//                buf.append(l);
//            }
//            return buf.toString();
      int fc = failureCount();
      if (fc > 0) {
        return Util.wrapToErrorSpan(Messages.ResponseTimeMonitor_TimeOut(fc));
      }
      return getAverage() + "ms";
    }
  }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
     * HTML rendering of the data
     */
    @Override
    public String toString() {
//            StringBuilder buf = new StringBuilder();
//            for (long l : past5) {
//                if(buf.length()>0)  buf.append(',');
//                buf.append(l);
//            }
//            return buf.toString();
      int fc = failureCount();
      if(fc>0)
        return Util.wrapToErrorSpan(Messages.ResponseTimeMonitor_TimeOut(fc));
      return getAverage()+"ms";
    }
  }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml(NativeSystemMemory usage) {
  if(usage.getAvailableSwapSpace() == -1)
    return "N/A";
  long free = usage.getAvailableSwapSpace();
  free/=1024L;   // convert to KB
  free/=1024L;   // convert to MB
  if(free>256 || usage.getTotalSwapSpace() < usage.getAvailableSwapSpace() * 5)
    return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  // Otherwise considered dangerously low.
  return Util.wrapToErrorSpan(free+"MB");
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns the HTML representation of the space.
 */
public String toHtml(NativeSystemMemory usage) {
  if (usage.getAvailableSwapSpace() == -1) {
    return "N/A";
  }
  long free = usage.getAvailableSwapSpace();
  free /= 1024L;   // convert to KB
  free /= 1024L;   // convert to MB
  if (free > 256 || usage.getTotalSwapSpace() < usage.getAvailableSwapSpace() * 5) {
    return free + "MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  }
  // Otherwise considered dangerously low.
  return Util.wrapToErrorSpan(free + "MB");
}

相关文章

微信公众号

最新文章

更多