feat(rest): simplify web ui and prune non-core endpoints

This commit is contained in:
admin
2026-02-28 21:52:11 +08:00
parent 421fd9da62
commit d6fae38d46
9 changed files with 282 additions and 2308 deletions

View File

@@ -1,8 +1,6 @@
#include "rest_server_internal.h"
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -154,28 +152,6 @@ esp_err_t rest_server_base64_decode_alloc(const char *b64, uint8_t **out_raw, si
return ESP_OK;
}
void rest_server_appendf(char *dst, size_t cap, size_t *offset, const char *fmt, ...) {
if (dst == NULL || cap == 0 || offset == NULL || fmt == NULL || *offset >= cap) {
return;
}
va_list ap;
va_start(ap, fmt);
int n = vsnprintf(dst + *offset, cap - *offset, fmt, ap);
va_end(ap);
if (n <= 0) {
return;
}
size_t written = (size_t)n;
if (written >= cap - *offset) {
*offset = cap - 1;
return;
}
*offset += written;
}
bool rest_server_json_bool_with_default(cJSON *item, bool default_value) {
if (item == NULL) {
return default_value;