Varaverk: suggested cron hints left of every cron input
- vv_script_children() now calls vv_script_suggested_cron() per child, adding suggested_cron and suggested_label to each child entry - Orch rows (non-event) and regular script child rows render a faint .vv-cron-hint span to the left of the cron input showing the suggested cron from the script's # Schedule: header - Clicking the hint fills in the cron input (data-cron + onclick) - Tooltip shows full "suggested_cron — label" string on hover - .vv-cron-hint: color #444, brightens to #888 on hover
This commit is contained in:
@@ -36,6 +36,14 @@ foreach ($tree as $orch) {
|
||||
<span class="vv-event-badge"><?= $orch['cron'] === '@array_start' ? '⚡ Array Start' : '⚡ Array Stop' ?></span>
|
||||
<input type="hidden" class="vv-cron" value="<?= htmlspecialchars($orch['cron']) ?>">
|
||||
<?php else: ?>
|
||||
<?php if ($orch['suggested_cron']): ?>
|
||||
<span class="vv-cron-hint"
|
||||
data-cron="<?= htmlspecialchars($orch['suggested_cron']) ?>"
|
||||
onclick="this.nextElementSibling.value=this.dataset.cron"
|
||||
title="Suggested: <?= htmlspecialchars($orch['suggested_cron'] . ($orch['suggested_label'] ? ' — ' . $orch['suggested_label'] : '')) ?>">
|
||||
<?= htmlspecialchars($orch['suggested_cron']) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<input type="text" class="vv-cron" value="<?= htmlspecialchars($orch['cron']) ?>"
|
||||
placeholder="cron expression">
|
||||
<?php endif; ?>
|
||||
@@ -106,6 +114,14 @@ foreach ($tree as $orch) {
|
||||
<span class="vv-slider"></span>
|
||||
</label>
|
||||
<span class="vv-job-label"><?= htmlspecialchars($child['label']) ?></span>
|
||||
<?php if (!empty($child['suggested_cron'])): ?>
|
||||
<span class="vv-cron-hint"
|
||||
data-cron="<?= htmlspecialchars($child['suggested_cron']) ?>"
|
||||
onclick="this.nextElementSibling.value=this.dataset.cron"
|
||||
title="Suggested: <?= htmlspecialchars($child['suggested_cron'] . (!empty($child['suggested_label']) ? ' — ' . $child['suggested_label'] : '')) ?>">
|
||||
<?= htmlspecialchars($child['suggested_cron']) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<input type="text" class="vv-cron" value="<?= htmlspecialchars($child['cron']) ?>"
|
||||
placeholder="cron (orch off only)">
|
||||
<span class="vv-save-check"></span>
|
||||
|
||||
Reference in New Issue
Block a user