Skip to content

Commit

Permalink
http-old: use common CSS for pool manager configuration section
Browse files Browse the repository at this point in the history
Motivation:
Harmonise colors of old pages

Modification:
Use common CSS. Update css class of generated table rows to match with
entries in common css.

Result:
more harmonized colors (I hope)

Acked-by: Karen Hoyos
Target: master
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann committed Aug 29, 2024
1 parent 8ea0efc commit 60292c7
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public class HttpPoolMgrEngineV3 implements
private static final Logger LOGGER =
LoggerFactory.getLogger(HttpPoolMgrEngineV3.class);

// ROW_ODDNESS is used to alternate the row colors in the HTML table
private static final String[] ROW_ODDNESS = {"even", "odd"};

private static final long TIMEOUT = 20000;

private final Thread _restoreCollector;
Expand Down Expand Up @@ -97,7 +100,7 @@ protected SimpleDateFormat initialValue() {
private final Object _updateLock = new Object();
private boolean _addStorageInfo;
private String[] _siDetails;
private String _cssFile = "/poolInfo/css/default.css";
private String _cssFile = "/styles/common.css";
private Map<String, Object> _context;

private CellEndpoint _endpoint;
Expand Down Expand Up @@ -532,6 +535,7 @@ public void queryUrl(HttpRequest request) throws HttpException {
}
pw.println("</ul>");
} finally {
pw.println("</div>");
pw.println("</body>");
pw.println("</html>");
}
Expand All @@ -544,6 +548,7 @@ private void printConfigurationHeader(PrintWriter pw) {
pw.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + _cssFile + "\">");
pw.println("</head>");

pw.println("<div id=\"main\">");
pw.println("<body class=\"m-body\">");

}
Expand Down Expand Up @@ -644,7 +649,6 @@ private void printParameterInMatrix(PrintWriter pw, Map<String, Partition> param
Map<String, Object[]> defaultMap = new TreeMap<>(defaultParas.toMap());
row = 0;
String[] setColor = {"s-table-disabled", "s-table-regular"};
String[] rowClass = {"s-table-a", "s-table-b"};

for (Map.Entry<String, Object[]> entry : defaultMap.entrySet()) {
String key = entry.getKey();
Expand All @@ -655,10 +659,10 @@ private void printParameterInMatrix(PrintWriter pw, Map<String, Partition> param
//
// the keys
//
pw.print("<tr class=\"" + rowClass[row % rowClass.length] + "\">");
pw.print("<th class=\"s-table\">");
pw.print("<tr class=\"" + ROW_ODDNESS[row % ROW_ODDNESS.length] + "\">");
pw.print("<td class=\"s-table\">");
pw.print(key);
pw.print("</th>");
pw.print("</td>");
//
// default values
//
Expand Down Expand Up @@ -1364,10 +1368,9 @@ private void queryLinkList(PrintWriter pw)
pw.print("<th class=\"s-table\">Cache</th><th class=\"s-table\">P2p</th>");
pw.println("</tr>");
int row = 0;
String[] rowColor = {"s-table-a", "s-table-b"};

for (LinkProperties lp : list) {
pw.println("<tr class=\"" + rowColor[row % rowColor.length] + "\">");
pw.println("<tr class=\"" + ROW_ODDNESS[row % ROW_ODDNESS.length] + "\">");
printLinkPropertyRow(pw, lp);
pw.println("</tr>");
row++;
Expand Down

0 comments on commit 60292c7

Please sign in to comment.