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:
@@ -400,16 +400,19 @@ function vv_script_children(string $orchPath, array $schedule): array {
|
||||
$seen[$rel] = true;
|
||||
$entry = $schedule[$rel] ?? ['enabled' => false, 'cron' => ''];
|
||||
$conf = $confMap[$rel] ?? ['array' => null, 'enabled' => null, 'managed' => false];
|
||||
$suggested = vv_script_suggested_cron("$scriptsDir/$rel");
|
||||
$children[] = [
|
||||
'id' => $rel,
|
||||
'label' => basename($rel, '.sh'),
|
||||
'desc' => vv_script_description("$scriptsDir/$rel"),
|
||||
'type' => 'script',
|
||||
'enabled' => (bool)($entry['enabled'] ?? false),
|
||||
'cron' => $entry['cron'] ?? '',
|
||||
'log_enabled' => (bool)($entry['log_enabled'] ?? false),
|
||||
'conf_managed' => $conf['managed'],
|
||||
'conf_enabled' => $conf['enabled'], // null if not in any *_SCRIPTS array
|
||||
'id' => $rel,
|
||||
'label' => basename($rel, '.sh'),
|
||||
'desc' => vv_script_description("$scriptsDir/$rel"),
|
||||
'type' => 'script',
|
||||
'enabled' => (bool)($entry['enabled'] ?? false),
|
||||
'cron' => $entry['cron'] ?? '',
|
||||
'log_enabled' => (bool)($entry['log_enabled'] ?? false),
|
||||
'conf_managed' => $conf['managed'],
|
||||
'conf_enabled' => $conf['enabled'], // null if not in any *_SCRIPTS array
|
||||
'suggested_cron' => $suggested['cron'],
|
||||
'suggested_label' => $suggested['label'],
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user