Initial commit — cynfo RMM (clean history, no secrets)

This commit is contained in:
cynfo3000
2026-03-06 09:18:45 +01:00
parent d4b6ca86e5
commit 48ac353d28
35 changed files with 732 additions and 52 deletions
+21
View File
@@ -422,6 +422,27 @@ func (d *Database) UpdateTaskStatusDirect(id int, status string) error {
return err
}
func (d *Database) UpdateTask(id int, name, scheduleType, scheduleTime string, weekday, monthday *int,
reboot, healthCheck bool, healthCheckTimeout int, webhookURL string, active bool) (*models.Task, error) {
now := time.Now()
nextRun := CalculateNextRun(scheduleType, scheduleTime, weekday, monthday, now)
_, err := d.db.Exec(`
UPDATE tasks SET
name = $1, schedule_type = $2, schedule_time = $3,
schedule_weekday = $4, schedule_monthday = $5,
reboot = $6, health_check = $7, health_check_timeout = $8,
webhook_url = $9, active = $10, next_run = $11
WHERE id = $12
`, name, scheduleType, scheduleTime, weekday, monthday,
reboot, healthCheck, healthCheckTimeout, webhookURL, active, nextRun, id)
if err != nil {
return nil, fmt.Errorf("Task aktualisieren: %w", err)
}
return d.GetTask(id)
}
func (d *Database) DeleteTask(id int) error {
res, err := d.db.Exec("DELETE FROM tasks WHERE id = $1", id)
if err != nil {