diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2026-02-20 23:42:09 +0100 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2026-02-20 23:42:09 +0100 |
| commit | 560d1c9a16a3bcbf8234bf297ec36e8a6e7bf453 (patch) | |
| tree | 6fc47d0afe6ee6d38ae4846e41a2f25e967e7ff6 /src/web.h | |
| parent | 9dcaa06dca178f280b6acc9e978239836c8f4120 (diff) | |
Fancy new UI
Diffstat (limited to 'src/web.h')
| -rw-r--r-- | src/web.h | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -2,11 +2,14 @@ #include <stddef.h> #include <stdint.h> +#include <time.h> struct MHD_PostProcessor; #define CLIENT_NAME_MAX 32 #define CLIENT_SECRET_LEN 33 +#define BACKUP_STATUS_MAX 16 +#define MAX_BACKUPS_DISPLAY 50 struct App { const char* dbname; @@ -64,6 +67,9 @@ struct ListClientResultClient { int64_t id; char name[CLIENT_NAME_MAX]; char secret[CLIENT_SECRET_LEN]; + struct timespec last_backup; + char status[BACKUP_STATUS_MAX]; // "OK", "RUNNING", "STALE", "FAILED", "INTERRUPTED" + int is_stale; }; struct ListClientResult { @@ -74,24 +80,24 @@ struct ListClientResult { int list_clients(struct Request *req, struct ListClientResult *result); -#define BACKUP_STATUS_MAX 16 -#define BACKUP_DATETIME_MAX 32 -#define MAX_BACKUPS_DISPLAY 50 - struct BackupRecord { int64_t id; char status[BACKUP_STATUS_MAX]; - char started[BACKUP_DATETIME_MAX]; - char completed[BACKUP_DATETIME_MAX]; + struct timespec started; + struct timespec completed; }; -struct GetClientResult { +struct GetClientOnlyResult { int found; int64_t id; char name[CLIENT_NAME_MAX]; char secret[CLIENT_SECRET_LEN]; - uint16_t backups_len; +}; + +struct GetBackupsResult { + uint16_t backups_len; // On input: max backups to fetch; On output: actual count struct BackupRecord backups[]; }; -int get_client_with_backups(struct Request *req, int64_t client_id, struct GetClientResult *result); +int get_client(struct Request *req, int64_t client_id, struct GetClientOnlyResult *result); +int get_client_backups(struct Request *req, int64_t client_id, struct GetBackupsResult *result); |
