Skip to content

Commit

Permalink
style: highlight custom headers
Browse files Browse the repository at this point in the history
  • Loading branch information
avwo committed Jul 14, 2020
1 parent ce3a14c commit df674ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions biz/webui/htdocs/js/index.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions biz/webui/htdocs/src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,7 @@ body .cm-s-cobalt span.cm-number {
.w-not-allowed {
cursor: not-allowed;
}

.w-bold {
font-weight: bold!important;
}
6 changes: 5 additions & 1 deletion biz/webui/htdocs/src/js/props-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ var MAX_NAME_LEN = 128;
var MAX_VALUE_LEN = 36 * 1024;
var MAX_COUNT = 160;
var index = MAX_COUNT;
var W2_HEADER_RE = /^x-whistle-/;

var highlight = function(name) {
return name === 'x-forwarded-for' || W2_HEADER_RE.test(name);
};
var PropsEditor = React.createClass({
getInitialState: function() {
return {};
Expand Down Expand Up @@ -259,7 +263,7 @@ var PropsEditor = React.createClass({
var item = modal[name];
return (
<tr key={name}>
<th>{item.name}</th>
<th className={isHeader && highlight(item.name) ? 'w-bold' : undefined}>{item.name}</th>
<td>
<pre>
{item.data ? <span className="glyphicon glyphicon-file"></span> : undefined}
Expand Down

0 comments on commit df674ae

Please sign in to comment.