From 4467094230b469da142244f9ca28fd1e13c45def Mon Sep 17 00:00:00 2001 From: bel Date: Sun, 15 Mar 2020 18:45:27 +0000 Subject: [PATCH] TODO and emoji things --- TODO.md | 6 ++-- public/css/water.css | 30 ++++++++++------ public/js/js.js | 49 ++++++++++++++++++-------- testdata/hostname_fail_per_second.cron | 2 ++ 4 files changed, 61 insertions(+), 26 deletions(-) create mode 100644 testdata/hostname_fail_per_second.cron diff --git a/TODO.md b/TODO.md index e9775a4..1b3544c 100755 --- a/TODO.md +++ b/TODO.md @@ -3,12 +3,12 @@ 1. UI to view 1. running job x jobs - 1. job definition + x job definition 1. next runtime x last runtime x last output x add titles to jobs - 1. job title includes last pass/fail icon + x job title includes last pass/fail icon 1. button to modify (copies to upsert form) 1. button to delete 1. UI to mutate @@ -16,6 +16,7 @@ 1. delete job 1. pause jobs 1. interrupt job + 1. force run 1. JS x ajax for json calls @@ -35,6 +36,7 @@ x load from file 1. pause/disable job 1. running job 1. interrupt job + 1. force run 1. change cron to load the full job from storage so not holding big queued jobs in ram x add optional second for test main 1. test main diff --git a/public/css/water.css b/public/css/water.css index 966a974..84d0ee8 100755 --- a/public/css/water.css +++ b/public/css/water.css @@ -1,6 +1,15 @@ body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.4;max-width:800px;margin:20px auto;padding:0 10px;color:#dbdbdb;background:#202b38;text-rendering:optimizeLegibility}button,input,textarea{transition:background-color .1s linear,border-color .1s linear,color .1s linear,box-shadow .1s linear,transform .1s ease}h1{font-size:2.2em;margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:12px}h1,h2,h3,h4,h5,h6,strong{color:#fff}b,h1,h2,h3,h4,h5,h6,strong,th{font-weight:600}q:after,q:before{content:none}blockquote,q{border-left:4px solid rgba(0,150,191,.67);margin:1.5em 0;padding:.5em 1em;font-style:italic}blockquote>footer{font-style:normal;border:0}address,blockquote cite{font-style:normal}a[href^=mailto]:before{content:"📧 "}a[href^=tel]:before{content:"📞 "}a[href^=sms]:before{content:"💬 "}mark{background-color:#efdb43;border-radius:2px;padding:0 2px;color:#000}button,input[type=button],input[type=checkbox],input[type=radio],input[type=range],input[type=submit],select{cursor:pointer}input:not([type=checkbox]):not([type=radio]),select{display:block}button,input,select,textarea{color:#fff;background-color:#161f27;font-family:inherit;font-size:inherit;margin-right:6px;margin-bottom:6px;padding:10px;border:none;border-radius:6px;outline:none}button,input,select,textarea{-webkit-appearance:none}textarea{margin-right:0;width:100%;box-sizing:border-box;resize:vertical}select{background:#161f27 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='63' width='117' fill='%23efefef'%3E%3Cpath d='M115 2c-1-2-4-2-5 0L59 53 7 2a4 4 0 0 0-5 5l54 54 2 2 3-2 54-54c2-1 2-4 0-5z'/%3E%3C/svg%3E") calc(100% - 12px) 50%/12px no-repeat;padding-right:35px}select::-ms-expand{display:none}select[multiple]{padding-right:10px;background-image:none;overflow-y:auto}button,input[type=button],input[type=submit]{padding-right:30px;padding-left:30px}button:hover,input[type=button]:hover,input[type=submit]:hover{background:#324759}button:focus,input:focus,select:focus,textarea:focus{box-shadow:0 0 0 2px rgba(0,150,191,.67)}input[type=checkbox],input[type=radio]{position:relative;width:14px;height:14px;display:inline-block;vertical-align:middle;margin:0 2px 0 0}input[type=radio]{border-radius:50%}input[type=checkbox]:checked,input[type=radio]:checked{background:#324759}input[type=checkbox]:checked:before,input[type=radio]:checked:before{content:"•";display:block;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}input[type=checkbox]:checked:before{content:"✔";transform:translateY(-50%) translateY(.5px) translateX(-6px)}button:active,input[type=button]:active,input[type=checkbox]:active,input[type=radio]:active,input[type=range]:active,input[type=submit]:active{transform:translateY(2px)}button:disabled,input:disabled,select:disabled,textarea:disabled{cursor:not-allowed;opacity:.5}::-webkit-input-placeholder{color:#a9a9a9}:-ms-input-placeholder{color:#a9a9a9}::-ms-input-placeholder{color:#a9a9a9}::placeholder{color:#a9a9a9}fieldset{border:1px solid rgba(0,150,191,.67);border-radius:6px;margin:0 0 6px;padding:10px}legend{font-size:.9em;font-weight:600}input[type=range]{margin:10px 0;padding:10px 0;background:transparent}input[type=range]:focus{outline:none}input[type=range]::-webkit-slider-runnable-track{width:100%;height:9.5px;transition:.2s;background:#161f27;border-radius:3px}input[type=range]::-webkit-slider-thumb{box-shadow:0 1px 1px #000,0 0 1px #0d0d0d;height:20px;width:20px;border-radius:50%;background:#dbdbdb;-webkit-appearance:none;margin-top:-7px}input[type=range]:focus::-webkit-slider-runnable-track{background:#161f27}input[type=range]::-moz-range-track{width:100%;height:9.5px;transition:.2s;background:#161f27;border-radius:3px}input[type=range]::-moz-range-thumb{box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d;height:20px;width:20px;border-radius:50%;background:#dbdbdb}input[type=range]::-ms-track{width:100%;height:9.5px;background:transparent;border-color:transparent;border-width:16px 0;color:transparent}input[type=range]::-ms-fill-lower,input[type=range]::-ms-fill-upper{background:#161f27;border:.2px solid #010101;border-radius:3px;box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d}input[type=range]::-ms-thumb{box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d;border:1px solid #000;height:20px;width:20px;border-radius:50%;background:#dbdbdb}input[type=range]:focus::-ms-fill-lower,input[type=range]:focus::-ms-fill-upper{background:#161f27}a{text-decoration:none;color:#41adff}a:hover{text-decoration:underline}code,samp,time{background:#161f27;color:#ffbe85;padding:2.5px 5px;border-radius:6px;font-size:1em}pre>code{padding:10px;display:block;overflow-x:auto}var{color:#d941e2;font-style:normal;font-family:monospace}kbd{background:#161f27;border:1px solid #dbdbdb;border-radius:2px;color:#dbdbdb;padding:2px 4px}img{max-width:100%;height:auto}hr{border:none;border-top:1px solid #dbdbdb}table{border-collapse:collapse;margin-bottom:10px;width:100%}td,th{padding:6px;text-align:left}thead{border-bottom:1px solid #dbdbdb}tfoot{border-top:1px solid #dbdbdb}tbody tr:nth-child(2n){background-color:#1a242f}::-webkit-scrollbar{height:10px;width:10px}::-webkit-scrollbar-track{background:#161f27;border-radius:6px}::-webkit-scrollbar-thumb{background:#324759;border-radius:6px}::-webkit-scrollbar-thumb:hover{background:#415c73}::-moz-selection{background-color:#161f27}::selection{background-color:#161f27}details{display:flex;flex-direction:column;align-items:flex-start;background-color:#1a242f;padding:10px 10px 0;margin:1em 0;border-radius:6px;overflow:hidden}details[open]{padding:10px}details>:last-child{margin-bottom:0}details[open] summary{margin-bottom:10px}summary{display:list-item;background-color:#161f27;padding:10px;margin:-10px -10px 0}details>:not(summary){margin-top:0}summary::-webkit-details-marker{color:#dbdbdb}footer{border-top:1px solid #161f27;padding-top:10px;font-size:.8em;color:#717880} /*# sourceMappingURL=dark-legacy.standalone.min.css.map */ +/* + background-color: #1a242f; + background-color: #161f27; +*/ + +tbody tr:nth-child(2n+1) { + background-color: #161f27; +} + #upserts { width: 100%; } @@ -23,19 +32,20 @@ body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxyg border-radius: 0; } -#jobs > tbody > tr:nth-child(2n) > td > details > summary , -#jobs > tbody > tr:nth-child(2n) > td > details { - background-color: #1a242f; +#jobs > tbody > tr > td > details > summary > * { + min-width: 1em; } -#jobs > tbody > tr:nth-child(2n+1) > td > details { - background-color: #161f27; -} - -#jobs > tbody > tr > td > details > summary > span:not(:first-child) { +#jobs > tbody > tr > td > details > summary > :not(:first-child) , +#jobs > tbody > tr > td > details > summary > * > input[type="button"] { float: right; + padding: 0 .5em 0 .5em; + margin: 0; } -#jobs > tbody > tr > td > details > table > tbody > tr > td { - font-family: monospace; +#jobs > tbody > tr > td > details > table > tbody > tr > td > code { + background: inherit; + min-width: 40%; + display: inline-block; } + diff --git a/public/js/js.js b/public/js/js.js index ab4395d..fdc0062 100755 --- a/public/js/js.js +++ b/public/js/js.js @@ -38,27 +38,48 @@ function init() { }) } function format(job) { - var smiley = "128522" + var pause = "⏸" + var passing = "9711" if (job.last.status != 0) { - smiley = "129324" + passing = "129314" + passing = "129324" } - smiley = `&#${smiley};` + passing = `&#${passing};` + var buttons = "" + var btns = [ + {"name":"disable", "icon":"11035"}, + {"name":"enable", "icon":"9654"}, + {"name":"modify", "icon":"9999"}, + {"name":"delete", "icon":"10006"} + ] + btns.forEach(function(e) { + buttons += ` + + + + ` + }) return `
${job.title} - ${job.last.status} ${smiley} + ${passing} + ${buttons} - - - - - - - - - - + + + +
${job.cron}${job.language}${job.script}
${job.last.run}${job.last.runtime}${job.last.output}
+ ${job.cron} + ${job.language} +
+ ${job.last.run} + ${job.last.runtime} +
+ ${job.script} +
+ ${job.last.output} +
` } diff --git a/testdata/hostname_fail_per_second.cron b/testdata/hostname_fail_per_second.cron new file mode 100644 index 0000000..2c05140 --- /dev/null +++ b/testdata/hostname_fail_per_second.cron @@ -0,0 +1,2 @@ +* * * * * * hostname #hostname per sec +* * * * * * false #always fail