stm32-project/Core/Src/http_pages.c

57 lines
1.6 KiB
C
Raw Permalink Normal View History

2026-04-18 14:37:49 +00:00
/*
* http_pages.c
*
* Created on: 09/04/2026
* Author: carec
*/
#include "http_pages.h"
const char *HTTP_Page_Index(void)
{
return
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/html; charset=utf-8\r\n"
"Connection: close\r\n"
"\r\n"
"<!DOCTYPE html>"
"<html><head><meta charset='utf-8'>"
"<meta name='viewport' content='width=device-width,initial-scale=1'>"
"<title>Portal WiFi</title>"
"<style>"
"body{font-family:Arial;background:#111;color:#eee;padding:20px;}"
".box{max-width:420px;margin:auto;background:#1c1c1c;padding:20px;border-radius:10px;}"
"input{width:100%;padding:10px;margin-top:8px;margin-bottom:12px;background:#222;color:#fff;border:1px solid #444;border-radius:8px;}"
"button{width:100%;padding:12px;background:#2d7ef7;color:white;border:0;border-radius:8px;}"
"</style></head><body>"
"<div class='box'>"
"<h1>Portal WiFi</h1>"
"<p>Configuração da rede principal.</p>"
"<form action='/save' method='get'>"
"<label>SSID</label><input name='ssid'>"
"<label>Password</label><input name='pass'>"
"<button type='submit'>Guardar</button>"
"</form>"
"</div></body></html>";
}
const char *HTTP_Page_Saved(void)
{
return
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/html; charset=utf-8\r\n"
"Connection: close\r\n"
"\r\n"
"<html><body><h2>Guardado.</h2><p>Configuração recebida pelo STM32.</p></body></html>";
}
const char *HTTP_Page_404(void)
{
return
"HTTP/1.1 404 Not Found\r\n"
"Content-Type: text/html; charset=utf-8\r\n"
"Connection: close\r\n"
"\r\n"
"<html><body><h2>404</h2></body></html>";
}