mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Merge pull request #315 from eraiza0816/feat/webui-compression
Feat/webui: compress the embedded assets and switch to a single-page layout
This commit is contained in:
41 files changed
+3085
-2903
No files matched your search
+5
-2
@@ -1013,7 +1013,7 @@ void httpd_appcall(void)
|
||||
if (!authenticated && !(f_data[entry].start == FDATA_START_login_html
|
||||
|| f_data[entry].start == FDATA_START_port_svg
|
||||
|| f_data[entry].start == FDATA_START_sfp_svg
|
||||
|| f_data[entry].start == FDATA_START_i18n_js
|
||||
|| f_data[entry].start == FDATA_START_main_js
|
||||
|| f_data[entry].start == FDATA_START_style_css)) {
|
||||
send_to_login();
|
||||
goto do_send;
|
||||
@@ -1031,7 +1031,10 @@ void httpd_appcall(void)
|
||||
* response; without advertising it a browser reuses the socket
|
||||
* from its keep-alive pool and the next request hits the already
|
||||
* closed connection (a POST is then dropped without a retry). */
|
||||
slen += strtox(outbuf + slen, "; charset=UTF-8\r\nCache-Control: max-age=60, must-revalidate\r\nConnection: close\r\nAccess-Control-Allow-Origin: *\r\nContent-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; form-action 'self'\r\n\r\n");
|
||||
slen += strtox(outbuf + slen, "; charset=UTF-8\r\n");
|
||||
if (f_data[entry].gzip)
|
||||
slen += strtox(outbuf + slen, "Content-Encoding: gzip\r\n");
|
||||
slen += strtox(outbuf + slen, "Cache-Control: max-age=60, must-revalidate\r\nConnection: close\r\nAccess-Control-Allow-Origin: *\r\nContent-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; form-action 'self'\r\n\r\n");
|
||||
|
||||
len_left = f_data[entry].len;
|
||||
if (len_left > (TCP_OUTBUF_SIZE - slen)) {
|
||||
|
||||
+1
-3
@@ -299,11 +299,9 @@ void send_vlan(uint16_t vlan)
|
||||
bool send_counters(uint8_t phys_port)
|
||||
{
|
||||
uint8_t phys_port_idx = phys_port - 1;
|
||||
if (phys_port_idx > 8)
|
||||
if (phys_port_idx > (machine.max_port - machine.min_port))
|
||||
goto err;
|
||||
uint8_t log_port = machine.phys_to_log_port[phys_port_idx];
|
||||
if (log_port == 0)
|
||||
goto err;
|
||||
|
||||
dbg_string("send_counters called: "); dbg_byte(phys_port_idx); dbg_char('\n');
|
||||
slen = strtox(outbuf, HTTP_RESPONCE_JSON);
|
||||
|
||||
Reference in new issue
Block a user