diff --git a/server/static.go b/server/static.go
index 27865fc..aa7c470 100644
--- a/server/static.go
+++ b/server/static.go
@@ -7,1813 +7,1813 @@ type staticFile struct {
// This file is autogenerated by go generate. Do not modify.
var webStatics = map[string]staticFile{
- "/": { Content: `
-
-
- Doomsday
-
-
-
-
-
-
-
-
-
-
-
an x509 monitoring tool
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-`, MIMEType: `text/html` },
- "/web/assets/stylesheet.css": { Content: `#viewport {
- display: flex;
- width: 100%;
- height: calc(100vh - 50px);
- overflow: auto;
- background: repeating-linear-gradient(
- 45deg,
- rgba(0, 0, 0, 0),
- rgba(0, 0, 0, 0) 60px,
- rgba(0, 0, 0, 0.15) 60px,
- rgba(0, 0, 0, 0.15) 120px
- );
- padding-top: 50px;
+.horizontal-line {
+ display: block;
+ height: 2px;
+ width: 95%;
+ margin: auto;
+ background-color: rgba(0,0,0,0.100);
}
-#login {
- height: 100%;
+.cert-list-footer-left-buffer .horizontal-line {
width: 100%;
- display: none;
+ background-color: white;
+ height: 4px;
}
-#login-page-container {
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
+.horizontal-line-taper {
+ height: 4px;
+ width: 40px;
+ position: relative;
+ margin-right: 1%;
+ background-image: linear-gradient(to right, rgba(255,255,255,1), rgba(0,0,0,0));
}
-#login-box {
+.expired-card {
background-color: #252525;
- border-radius: 14px;
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- align-content: center;
- width: 400px;
+ box-shadow: 7px 5px rgb(229, 53, 69);
+ border-color: rgba(255, 255, 255, 0.25) rgba(0, 0, 0, 0.7) rgba(0, 0, 0, 0.7) rgba(255, 255, 255, 0.25) !important;
}
-#login-box label {
- color: white;
- width: 100%;
+.expired-card .certs-content-header {
+ border-color: rgba(255, 255, 255, 0.1);
}
-#login-form {
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- align-content: center;
- margin: 1em;
- width: 100%;
+.expired-card .certs-content-value {
+ color: rgb(229, 53, 69);
}
-.login-text-box {
- margin: 0.75em 1.5em;
- width: 100%;
- display: flex;
- flex-wrap: wrap;
+@media only screen and (min-width: 600px) {
+ #navbar #subtitle {
+ display: inline-block;
+ }
}
-.login-text-box input[type=text], input[type=password] {
- font-size: 20px;
- width: 100%;
- border-radius: 6px;
+@media only screen and (min-width: 1200px) {
+ .cert-grid-container {
+ width: 50%;
+ }
+
}
-.login-button-box {
- margin: 0.4em;
- display: flex;
- justify-content: center;
- width: 100%;
+@media only screen and (min-width: 1800px) {
+ .cert-grid-container {
+ width: 33.33333%;
+ }
}
-.login-button-box input[type=submit] {
- font-size: 20px;
- font-family: inherit;
- border-radius: 6px;
- padding: 0em 1em;
+@media only screen and (min-width: 2400px) {
+ .cert-grid-container {
+ width: 25%;
+ }
+}
+
+@media only screen and (min-width: 3000px) {
+ .cert-grid-container {
+ width: 20%;
+ }
+}
+
+@media only screen and (min-width: 3600px) {
+ .cert-grid-container {
+ width: 16.66666%;
+ }
}
+`, MIMEType: `text/css` },
+ "/web/assets/lens.js": { Content: `var Lens = {};
+;(function () {
+
+ var nil = function () { };
+
+ if (!console) {
+ console = { log: nil };
+ }
+
+ var log = {
+ debug: nil,
+ info: nil,
+ warn: nil,
+ error: nil,
+
+ level: function (level) {
+ log.debug = nil;
+ log.info = nil;
+ log.warn = nil;
+ log.error = nil;
+
+ switch (level) {
+ case 'debug': log.debug = console.log;
+ case 'info': log.info = console.log;
+ case 'warn': log.warn = console.log;
+ case 'error': log.error = console.log;
+ }
+ }
+ };
+
+ Lens.log = log;
+})()
+;(function () {
+ const SET_ATTRIBUTE = 1,
+ REMOVE_ATTRIBUTE = 2,
+ SET_PROPERTY = 3,
+ REMOVE_PROPERTY = 4,
+ REPLACE_NODE = 5,
+ APPEND_CHILD = 6,
+ REMOVE_CHILD = 7,
+ REPLACE_TEXT = 8;
+
+ /* diff the ATTRIBUTES of two nodes, and return a
+ (potentially empty) patch op list. */
+ var diffa = function (a, b) {
+ const ops = [];
+ const _a = {};
+ const _b = {};
-.login-error {
- margin: 1em;
- margin-top: 0;
- padding: 0.2em;
- font-size: 16px;
- width: 90%;
- text-align: center;
- border-radius: 6px;
- background-color: rgb(229, 53, 69);
-}
+ for (let i = 0; i < a.attributes.length; i++) {
+ _a[a.attributes[i].nodeName] = a.attributes[i].nodeValue;
+ }
+ for (let i = 0; i < b.attributes.length; i++) {
+ _b[b.attributes[i].nodeName] = b.attributes[i].nodeValue;
+ }
-#navbar {
- background-color: #252525;
- display: flex;
- align-content: center;
- font-size: 40;
- height: 1.5em;
- border-bottom: solid rgba(0,0,0,0.4) thin;
- z-index: 100;
- top: 0;
- width: 100%;
-}
+ /* if the attribute is only defined in (a), then
+ it has been removed in (b) and should be patched
+ as a REMOVE_ATTRIBUTE. */
+ for (let attr in _a) {
+ if (!(attr in _b)) {
+ ops.push({
+ op: REMOVE_ATTRIBUTE,
+ node: a,
+ key: attr,
+ });
+ }
+ }
-#navbar-left-buffer {
- width: 0px;
-}
+ /* if the attribute is only defined in (b), or is
+ defined in both with different values, patch as
+ a SET_ATTRIBUTE to get the correct value. */
+ for (let attr in _b) {
+ if (!(attr in _a) || _a[attr] !== _b[attr]) {
+ ops.push({
+ op: SET_ATTRIBUTE,
+ node: a,
+ key: attr,
+ value: _b[attr]
+ });
+ }
+ }
-.navbar-content {
- display: flex;
- align-items: center;
- justify-content: center;
- padding-left: 15px;
- padding-right: 15px;
-}
+ return ops;
+ };
-.navbar-border {
- border-right-color: rgba(255, 255, 255, 0.3);
- border-right-style: solid;
- border-right-width: thin;
-}
+ var diffe = function (a, b) {
+ if (a.localName === b.localName) {
+ return diffa(a, b);
+ }
+ return null;
+ };
-.sticky {
- position: fixed;
-}
+ var difft = function (a, b) {
+ if (a.textContent === b.textContent) {
+ return [];
+ }
+ return [{
+ op: REPLACE_TEXT,
+ node: a,
+ with: b.textContent
+ }];
+ };
-#navbar #logo {
- color: white;
- font-size: 40;
- position: relative;
- top: -2px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
+ /* diff two NODEs, without recursing through child nodes */
+ var diffn1 = function (a, b) {
+ if (a.nodeType != b.nodeType) {
+ /* nothing in common */
+ return null;
+ }
-#hamburger {
- height: 25px;
- width: 25px;
- flex: 1 1 auto;
-}
+ if (a.nodeType == Node.ELEMENT_NODE) {
+ return diffe(a, b);
+ }
+ if (a.nodeType == Node.TEXT_NODE) {
+ return difft(a, b);
+ }
+ if (a.nodeType == Node.COMMENT_NODE) {
+ return null;
+ }
-#hamburger-box {
- display: flex;
- align-items: center;
-}
+ console.log('unrecognized a type %s', a.nodeType);
+ return null;
+ };
-.navbar-button:hover {
- background-color: rgba(255, 255, 255, 0.1);
-}
+ /* diff two NODEs, co-recursively with diff() */
+ var diffn = function (a, b) {
+ let ops = diffn1(a, b);
-.navbar-button:active {
- background-color: rgba(255, 255, 255, 0.2);
-}
+ if (ops) {
+ return ops.concat(diff(a, b));
+ }
-#hamburger-menu {
- background-color: rgba(37, 37, 37, 0.9);
- height: calc(100% - 60px);
- width: 250px;
- z-index: 100;
- top: 60px;
- left: -251px;
- display: inline-block;
-}
+ return [{
+ op: REPLACE_NODE,
+ node: a,
+ with: b
+ }];
+ };
-.hamburger-menu-button {
- display: flex;
- align-items: center;
- align-content: center;
- justify-content: center;
- height: 30px;
- padding: 5px 20px 5px 20px;
- font-size: 24px;
- color: white;
- border-style: solid none solid none;
- border-width: thin;
- border-color: rgba(255, 255, 255, 0.3);
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-color: #252525;
-}
+ window.diff = function (a, b) {
+ let ops = [];
+ const { childNodes: _a } = a;
+ const { childNodes: _b } = b;
-.hamburger-menu-button-inactive {
- display: flex;
- align-items: center;
- align-content: center;
- justify-content: center;
- height: 30px;
- padding: 5px 20px 5px 20px;
- font-size: 24px;
- color: grey;
- border-style: solid none solid none;
- border-width: thin;
- border-color: rgba(255, 255, 255, 0.3);
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-color: #252525;
-}
+ const _al = _a ? _a.length : 0;
+ const _bl = _b ? _b.length : 0;
-#navbar #subtitle {
- color: white;
- font-size: 20;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
+ for (let i = 0; i < _bl; i++) {
+ if (!_a[i]) {
+ ops.push({
+ op: APPEND_CHILD,
+ node: a,
+ child: _b[i]
+ });
+ continue;
+ }
-#certs {
- margin-top: 20px;
- flex: 1 1 auto;
-}
+ ops = ops.concat(diffn(_a[i], _b[i]));
+ }
-#no-cert-container {
- display: flex;
-}
+ for (var i = _bl; i < _al; i++) {
+ ops.push({
+ op: REMOVE_CHILD,
+ node: a,
+ child: _a[i]
+ });
+ }
+
+ return ops;
+ };
-.no-cert-textbox {
- border-style: solid;
- border-radius: 8px;
- border-color: white;
- border-width: thick;
- font-weight: bold;
- background-color: rgba(0, 0, 0, 0.15);
- color: white;
- font-size: 4vw;
- padding: 0.75em;
- position: relative;
- top: 30vh;
- margin: auto;
-}
-body {
- margin: 0px;
- background-color: #444444;
-}
-div {
- font-family: "Walter Turncoat", "Verdana";
- color: rgba(0,0,0,.8);
-}
-.cert-grid-container {
- width: 100%;
-}
+ window.patch = function (e, ops) {
+ for (let i = 0; i < ops.length; i++) {
+ switch (ops[i].op) {
+ case SET_ATTRIBUTE: ops[i].node.setAttribute(ops[i].key, ops[i].value); break;
+ case REMOVE_ATTRIBUTE: ops[i].node.removeAttribute(ops[i].key); break;
+ case SET_PROPERTY: /* FIXME needs implemented! */ break;
+ case REMOVE_PROPERTY: /* FIXME needs implemented! */ break;
+ case REPLACE_NODE: ops[i].node.parentNode.replaceChild(ops[i].with, ops[i].node); break;
+ case APPEND_CHILD: ops[i].node.appendChild(ops[i].child); break;
+ case REMOVE_CHILD: ops[i].node.removeChild(ops[i].child); break;
+ case REPLACE_TEXT: ops[i].node.textContent = ops[i].with; break;
+ default:
+ console.log('unrecognized patch op %d for ', ops[i].op, ops[i]);
+ break;
+ }
+ }
+ };
-.certs-content-header {
- background-color: rgba(0,0,0,.0700);
- border-radius: 8px 8px 0px 0px;
- border-bottom-style: solid;
- border-bottom-color: rgba(0,0,0,0.0500);
- border-width: thin;
- text-align: center;
- font-size: 24;
- padding: 0.3em 0em;
- font-weight: bold;
- color: #FFFFFF;
-}
-.certs-content-body {
- padding: 0.5em 1em;
-}
-.cert-list-footer-container {
- margin: 4px 8px 4px 0;
- display: flex;
-}
-.cert-list-footer-left-buffer {
- align-self: center;
- align-content: center;
- display: flex;
- flex: 1 1 auto;
-}
+ window.explainPatch = function (ops) {
+ var l = [];
+ for (let i = 0; i < ops.length; i++) {
+ switch (ops[i].op) {
+ case SET_ATTRIBUTE: l.push(['SET_ATTRIBUTE', ops[i].node, ops[i].key+'='+ops[i].value]); break;
+ case REMOVE_ATTRIBUTE: l.push(['REMOVE_ATTRIBUTE', ops[i].node, ops[i].key]); break;
+ case SET_PROPERTY: l.push(['SET_PROPERTY', 'FIXME']); break;
+ case REMOVE_PROPERTY: l.push(['REMOVE_PROPERTY', 'FIXME']); break;
+ case REPLACE_NODE: l.push(['REPLACE_NODE', ops[i].node, { with: ops[i].with }]); break;
+ case APPEND_CHILD: l.push(['APPEND_CHILD', ops[i].node, { child: ops[i].child }]); break;
+ case REMOVE_CHILD: l.push(['REMOVE_CHILD', ops[i].node, { child: ops[i].child }]); break;
+ case REPLACE_TEXT: l.push(['REPLACE_TEXT', ops[i].node, { with: ops[i].with }]); break;
+ default: l.push(['**UNKNOWN**', ops[i]]); break;
+ }
+ }
+ return l;
+ };
+})(window, document);
+;(function () {
-.cert-list-footer-timeline-label {
- color: white;
- text-align: right;
- font-size: 20px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
+ var __templates = {};
+ var template = function (name, data) {
+ if (!(name in __templates)) {
+ Lens.log.debug('template {%s} not found in the cache; compiling from source.', name);
+ __templates[name] = compile(name);
+ }
+ return __templates[name](data || {});
+ };
-.cert-list-body-timeline-container {
- position: relative;
- margin-right: 10px;
-}
+ var parse = function (src) {
+ var tokenizer = new RegExp('([\\s\\S]*?)\\[\\[([\\s\\S]*?)\\]\\]([\\s\\S]*)');
+ var str = function (s) {
+ if (!s) { return "''"; }
+ return "'"+s.replace(/(['\\])/g, '\\$1').replace(/\n/g, "\\n")+"'";
+ };
-.cert-list-body-line-taper-in {
- height: 40px;
- width: 4px;
- position: relative;
- background-image: linear-gradient(to top, rgba(255,255,255,1), rgba(0,0,0,0));
-}
+ var code = [];
+ for (;;) {
+ var tokens = tokenizer.exec(src)
+ if (!tokens) {
+ code.push('__ += '+str(src)+';');
+ break;
+ }
-.cert-list-body-timeline-line {
- width: 4px;
- position: absolute;
- height: calc(100% - 80px);
- background-color: white;
-}
+ if (tokens[2][0] == ':') { /* trim preceeding literal */
+ tokens[1] = tokens[1].replace(/\s+$/, '');
+ tokens[2] = tokens[2].substr(1);
+ }
+ if (tokens[2][tokens[2].length - 1] == ':') { /* trim following literal */
+ tokens[3] = tokens[3].replace(/^\s+/, '');
+ tokens[2] = tokens[2].substr(0, tokens[2].length-2);
+ }
-.cert-list-body-line-taper-out {
- height: 40px;
- width: 4px;
- position: absolute;
- top: calc(100% - 40px);
- background-image: linear-gradient(to bottom, rgba(255,255,255,1), rgba(0,0,0,0));
-}
+ code.push('__ += '+str(tokens[1])+';');
+ if (tokens[2][0] == '=') {
+ code.push('__ += ('+tokens[2].replace(/^=\s*/, '')+');');
-.cert-list-body {
- display: flex;
-}
+ } else if (tokens[2][0] != '#') { /* skip comments */
+ code.push(tokens[2]);
+ }
-.cert-list-body-card-container {
- flex: 1 1 auto;
-}
+ src = tokens[3];
+ }
-.cert-list-body-card-container {
- display: flex;
- flex-wrap: wrap;
- flex: 1 1 auto;
-}
+ return code.join('');
+ };
-.cert-list {
- width: 100%;
-}
+ var compile = function (name) {
+ name = name.toString();
+ var script = document.getElementById('template:'+name);
+ if (!script) {
+ Lens.log.error('unable to find a
+
- [[= include('other-template') ]]
+
- */
- include: function (name, data) {
- __ += template(name, data || _);
- return '';
- }
- };
+
- /* aliases ... */
- lens.u = encodeURIComponent;
- lens.h = lens.escapeHTML;
- var include = lens.include;
+
- Lens.log.debug('evaluating the {%s} template', name);
- eval(code);
- return __;
- };
- };
+
- jQuery.fn.template = function (name, data, force) {
- if (force || this.length == 0) {
- this.html(template(name, data));
- } else {
- window.patch(this[0], diff(this[0], $(''+template(name, data)+'
')[0]));
- }
- return this;
- };
+
- } else if (typeof(window) !== 'undefined') {
- window.template = template;
+
- } else {
- throw 'neither jQuery or top-level window object were found; unsure where to attach template()...';
- }
-})();
-;(function () {
- var strftime = function (fmt, d) {
- if (!(d instanceof Date)) {
- var _d = new Date();
- if (!isNaN(d)) {
- _d.setTime(d * 1000); /* epoch s -> ms */
- }
- d = _d;
- }
- if (typeof(d) === 'undefined') {
- return "";
- }
+
- en_US = {
- pref: {
- /* %c */ datetime: function (d) { return strftime("%a %b %e %H:%M:%S %Y", d); },
- /* %x */ date: function (d) { return strftime("%m/%d/%Y", d); },
- /* %X */ time: function (d) { return strftime("%H:%M:%S", d); }
- },
- weekday: {
- abbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
- full: ['Sunday',
- 'Monday',
- 'Tuesday',
- 'Wednesday',
- 'Thursday',
- 'Friday',
- 'Saturday']
- },
- month: {
- abbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- full: ['January',
- 'February',
- 'March',
- 'April',
- 'May',
- 'June',
- 'July',
- 'August',
- 'September',
- 'October',
- 'November',
- 'December']
- },
- AM: "AM", am: "am", PM: "PM", pm: "pm",
- ordinal: ['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', // 1 - 10
- 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', // 11 - 20
- 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', // 21 - 30
- 'st'],
- zero: ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09',
- '10', '11', '12', '13', '14', '15', '16', '17', '18', '19',
- '20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
- '30', '31', '32', '33', '34', '35', '36', '37', '38', '39',
- '40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
- '50', '51', '52', '53', '54', '55', '56', '57', '58', '59'],
+
- var lc = en_US;
+
+