mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 17:06:09 +00:00
A failed backup, a scheduled backup not taken, backups the daily check finds missing and a job that ends uncertain could only be seen on the pages. They are now queued as alerts in the transaction of the change they tell of (never stopping it) and sent by the worker's periodic pass to the Settings page's alert e-mail addresses (the server's SMTP settings) and alert webhook (a JSON POST), each tried again for ten passes on its own. A skip for a host in maintenance is no alert. Setting values take 255 characters. /healthz answers 200 while the database answers and the job worker runs, 503 otherwise, without a login.
13 lines
533 B
Python
13 lines
533 B
Python
from django.db import models
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
class AppSettings(models.Model):
|
|
def choices_as_list(self):
|
|
return self.choices.split(",")
|
|
|
|
name = models.CharField(_("name"), max_length=25, null=False)
|
|
key = models.CharField(_("key"), db_index=True, max_length=50, unique=True)
|
|
value = models.CharField(_("value"), max_length=255)
|
|
choices = models.CharField(_("choices"), max_length=70)
|
|
description = models.CharField(_("description"), max_length=100, null=True)
|