@cronwatch/sdk 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1367,14 +1367,14 @@ code,pre,.mono{font-family:var(--mono)}
1367
1367
  .brand .crumb{font:500 15px/1.2 var(--mono);color:var(--body);overflow-wrap:anywhere}.brand .slash{color:var(--rule-2);font-weight:400}
1368
1368
  .actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
1369
1369
  .meta{font:400 12px/1.4 var(--mono);color:var(--muted)}
1370
- button,select,details.confirm>summary{font:500 12.5px/1 var(--mono);color:var(--ink);background:var(--sheet);border:1px solid var(--rule-2);border-radius:3px;padding:8px 11px;cursor:pointer}
1371
- select{padding:7px 8px}
1372
- button:hover,select:hover,details.confirm>summary:hover{border-color:var(--muted)}
1373
- button.primary{background:var(--ink);border-color:var(--ink);color:var(--sheet)}button.primary:hover{opacity:.86}
1370
+ button,a.button,details.confirm>summary{font:500 12.5px/1 var(--mono);color:var(--ink);background:var(--sheet);border:1px solid var(--rule-2);border-radius:3px;height:32px;padding:0 11px;cursor:pointer}
1371
+ a.button{display:inline-flex;align-items:center;text-decoration:none}
1372
+ button:hover,a.button:hover,details.confirm>summary:hover{border-color:var(--muted)}
1373
+ button.primary{background:var(--ink);border-color:var(--ink);color:var(--sheet)}button.primary:hover{opacity:.86}button.danger{color:var(--bad)}button.danger:hover{border-color:var(--bad)}
1374
1374
  form.inline{display:inline-flex;align-items:center;gap:6px;margin:0}
1375
- details.confirm{display:inline-flex;align-items:center;gap:8px;margin:0}details.confirm>summary{list-style:none;display:inline-block}
1375
+ details.confirm{display:inline-flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0}details.confirm>summary{list-style:none;display:inline-flex;align-items:center}
1376
1376
  details.confirm>summary::-webkit-details-marker{display:none}details.confirm[open]>summary{border-color:var(--muted)}
1377
- details.confirm form{margin-left:8px;font-size:14px;color:var(--muted)}
1377
+ details.confirm form{flex-wrap:wrap;font-size:14px;color:var(--muted)}.delete details{margin-top:16px}
1378
1378
  .sec{display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px 40px;padding:30px 0;border-top:1px solid var(--rule)}
1379
1379
  .top+main>.sec:first-child{border-top:0}
1380
1380
  .sec>h2{margin:0;font:500 11px/1.5 var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding-top:5px}
@@ -1423,7 +1423,7 @@ dl.def dd{margin:0;font:400 13.5px/1.7 var(--mono);color:var(--body);overflow-wr
1423
1423
  .message p{margin:14px auto 0;max-width:52ch;color:var(--muted);text-wrap:pretty}
1424
1424
  .signin{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin:28px auto 0;max-width:420px}
1425
1425
  .signin label{font:500 11px/1.4 var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
1426
- .signin input{flex:1 1 180px;min-width:0;font:400 16px/1.2 var(--mono);color:var(--ink);background:var(--sheet);border:1px solid var(--rule-2);border-radius:3px;padding:8px 10px}
1426
+ .signin input{flex:1 1 180px;min-width:0;font:400 16px/1.2 var(--mono);color:var(--ink);background:var(--sheet);border:1px solid var(--rule-2);border-radius:3px;height:32px;padding:0 10px}
1427
1427
  footer{display:flex;flex-wrap:wrap;gap:6px 18px;padding:20px 0 40px;border-top:1px solid var(--rule);font:400 12px/1.5 var(--mono);color:var(--muted)}
1428
1428
  .timeline{margin:18px 0 0}
1429
1429
  .timeline .axis,.timeline .under,.timeline .over,.timeline .lane{display:grid;grid-template-columns:var(--who) minmax(0,1fr)}
@@ -1618,7 +1618,7 @@ ${jobs.length ? `<section class="sec" aria-label="Last 24 hours">
1618
1618
  </section>
1619
1619
  <section class="sec" aria-label="Jobs">
1620
1620
  <h2>Jobs</h2>
1621
- <p class="lede">Every job in the store. Open one for its week, its runs and their output.</p>
1621
+ <p class="lede">Every job in the store. Open one for its week, its runs, and their output.</p>
1622
1622
  <div class="wide"><table class="board">
1623
1623
  <thead><tr><th>Job</th><th>Health</th><th class="hide-sm">Schedule</th><th>Last run</th><th class="hide-sm">Next due</th><th class="hide-sm">Recent runs</th></tr></thead>
1624
1624
  <tbody>${rows}</tbody></table></div>
@@ -1662,8 +1662,7 @@ function jobPage(job, runs, now, base, complete = true) {
1662
1662
  ${d.description ? `<p class="desc">${h(d.description)}</p>` : ""}
1663
1663
  <p class="stateline">${healthState(job)}${why ? `<span class="why">${h(why)}</span>` : ""}</p>
1664
1664
  <div class="actions">
1665
- ${silenced ? `<form class="inline" method="post" action="${path}/unsilence"><button type="submit">Unsilence (until ${h(formatRelative(job.silencedUntil, now))})</button></form>` : `<form class="inline" method="post" action="${path}/silence"><select name="for" aria-label="Silence for"><option value="1h">1 hour</option><option value="4h">4 hours</option><option value="1d">1 day</option><option value="7d">1 week</option></select><button type="submit">Silence</button></form>`}
1666
- <details class="confirm"><summary>Forget</summary><form class="inline" method="post" action="${path}/forget"><span>Remove this job and its runs from the store?</span> <button type="submit">Forget</button></form></details>
1665
+ ${silenced ? `<form class="inline" method="post" action="${path}/unsilence"><button type="submit">Unsilence (until ${h(formatRelative(job.silencedUntil, now))})</button></form>` : `<details class="confirm"><summary>Silence</summary><form class="inline" method="post" action="${path}/silence"><span>for</span> <button type="submit" name="for" value="1h">1 hour</button><button type="submit" name="for" value="4h">4 hours</button><button type="submit" name="for" value="1d">1 day</button><button type="submit" name="for" value="7d">1 week</button></form></details>`}
1667
1666
  </div>
1668
1667
  <dl class="figures">
1669
1668
  <div><dt>Last run</dt><dd>${job.lastRun ? h(formatRelative(job.lastRun.startedAt, now)) : "never"}</dd></div>
@@ -1701,6 +1700,13 @@ function jobPage(job, runs, now, base, complete = true) {
1701
1700
  ${job.consecutiveFailures > 0 ? `<dt>Failures in a row</dt><dd>${h(job.consecutiveFailures)}</dd>` : ""}
1702
1701
  </dl>
1703
1702
  </section>
1703
+ <section class="sec delete" aria-label="Delete">
1704
+ <h2>Delete</h2>
1705
+ <div>
1706
+ <p class="lede">Removes this job and all its runs from the store, which cannot be undone. A job still in your code comes back on its next run, with no history.</p>
1707
+ <details class="confirm"><summary>Delete history</summary><form class="inline" method="post" action="${path}/forget"><span>Delete this job and all its runs?</span> <button class="danger" type="submit">Delete</button><a class="button" href="${path}">Cancel</a></form></details>
1708
+ </div>
1709
+ </section>
1704
1710
  </main>
1705
1711
  <footer><span>Refreshes every minute. Times are UTC.</span><a href="${h(base)}/api/jobs/${encodeURIComponent(job.name)}">JSON</a></footer>`;
1706
1712
  return layout(`${job.name}: CronWatch`, body, base, { refresh: 60 });
@@ -1711,7 +1717,7 @@ function messagePage(title, message, base, signIn = false) {
1711
1717
  }
1712
1718
 
1713
1719
  // src/version.ts
1714
- var VERSION = "0.12.0";
1720
+ var VERSION = "0.12.2";
1715
1721
  var API_VERSION = 1;
1716
1722
 
1717
1723
  // src/routes/index.ts