feat(cron): blueprint start-from + delivery target picker in job editor (issue #780) (#822)

- New-job dialog gains a Start-from dropdown: pick a catalog blueprint, fill its typed slots (time/enum/weekdays/text), save instantiates it via POST /api/cron/blueprints/instantiate
- Delivery field is now an editable picker fed by GET /api/cron/delivery-targets (origin + local + connected platforms)
- Blueprints and targets fetched on editor open; 422 slot errors surface the backend detail

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-08-05 22:44:13 +03:00
1 parent 80be168801
commit 442e868ce2
6 files changed
+740 -118

No files matched your search

@@ -0,0 +1,58 @@
package com.m57.hermescontrol.data.model
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonPrimitive
@Serializable
data class CronBlueprintListResponse(
val blueprints: List<CronBlueprint> = emptyList(),
)
@Serializable
data class CronBlueprint(
val key: String,
val title: String = "",
val description: String = "",
val category: String = "",
val tags: List<String> = emptyList(),
val fields: List<CronBlueprintField> = emptyList(),
val schedule: String = "",
val scheduleHuman: String = "",
val command: String = "",
val appUrl: String = "",
)
@Serializable
data class CronBlueprintField(
val name: String,
val type: String = "text",
val label: String = "",
val default: JsonElement? = null,
val options: List<String> = emptyList(),
val optional: Boolean = false,
val strict: Boolean = true,
val help: String = "",
) {
val defaultText: String
get() = (default as? JsonPrimitive)?.content.orEmpty()
}
@Serializable
data class DeliveryTargetsResponse(
val targets: List<DeliveryTarget> = emptyList(),
)
@Serializable
data class DeliveryTarget(
val id: String,
val name: String = "",
val home_target_set: Boolean = false,
val home_env_var: String? = null,
)
@Serializable
data class InstantiateBlueprintRequest(
val blueprint: String,
val values: Map<String, String>,
)