Add HTML templates for all tools
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled
This commit is contained in:
96
devterm/templates/cron.html
Normal file
96
devterm/templates/cron.html
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Cron Validator - Devterm</title>
|
||||||
|
<style>
|
||||||
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||||
|
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||||
|
min-height: 100vh;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.container { max-width: 800px; margin: 0 auto; padding: 2rem; }
|
||||||
|
header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
h1 { font-size: 1.5rem; background: linear-gradient(90deg, #00d4ff, #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
||||||
|
.back-link { color: #94a3b8; text-decoration: none; }
|
||||||
|
.back-link:hover { color: #00d4ff; }
|
||||||
|
.panel { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; margin-bottom: 1.5rem; }
|
||||||
|
.panel-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 600; }
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
color: #e2e8f0;
|
||||||
|
padding: 1rem;
|
||||||
|
font-family: 'Monaco', 'Menlo', monospace;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
input:focus { outline: none; }
|
||||||
|
.actions { display: flex; gap: 1rem; margin: 1.5rem 0; }
|
||||||
|
button {
|
||||||
|
background: linear-gradient(90deg, #00d4ff, #7c3aed);
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
button:hover { opacity: 0.9; }
|
||||||
|
.result { padding: 1rem; color: #94a3b8; font-size: 0.9rem; }
|
||||||
|
.error { color: #ef4444; }
|
||||||
|
.success { color: #22c55e; }
|
||||||
|
.info { color: #00d4ff; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<header>
|
||||||
|
<a href="/" class="back-link">←</a>
|
||||||
|
<h1>Cron Validator</h1>
|
||||||
|
</header>
|
||||||
|
<div class="panel">
|
||||||
|
<div class="panel-header">Cron Expression</div>
|
||||||
|
<input type="text" id="cron" placeholder="* * * * * (minute hour day month dow)">
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<button onclick="validateCron()">Validate</button>
|
||||||
|
<button onclick="clearAll()">Clear</button>
|
||||||
|
</div>
|
||||||
|
<div class="panel">
|
||||||
|
<div class="panel-header">Result</div>
|
||||||
|
<div class="result" id="result">Enter a cron expression to validate</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
async function validateCron() {
|
||||||
|
const cron = document.getElementById('cron').value;
|
||||||
|
if (!cron.trim()) return;
|
||||||
|
const res = await fetch('/cron/validate', { method: 'POST', body: cron });
|
||||||
|
const data = await res.json();
|
||||||
|
if (data.error) {
|
||||||
|
document.getElementById('result').innerHTML = `<span class="error">Error: ${data.error}</span>`;
|
||||||
|
} else if (data.valid) {
|
||||||
|
document.getElementById('result').innerHTML = `<span class="success">✓ Valid cron expression</span><br><br><span class="info">Next run: ${data.next_run}</span>`;
|
||||||
|
} else {
|
||||||
|
document.getElementById('result').innerHTML = `<span class="error">✗ Invalid cron expression</span>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function clearAll() {
|
||||||
|
document.getElementById('cron').value = '';
|
||||||
|
document.getElementById('result').textContent = 'Enter a cron expression to validate';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user