5 changed files with 27 additions and 6 deletions
+2
View File
@@ -157,6 +157,8 @@ server {
location / { location / {
add_header Access-Control-Allow-Origin $xssorigin; add_header Access-Control-Allow-Origin $xssorigin;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://127.0.0.1:8080; proxy_pass http://127.0.0.1:8080;
} }
} }
+5
View File
@@ -53,6 +53,11 @@ class APIAlertsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
self.sse_alert_queues = sse_alert_queues self.sse_alert_queues = sse_alert_queues
self.web_server_metrics = web_server_metrics self.web_server_metrics = web_server_metrics
# Custom headers to avoid e.g. nginx reverse proxy from buffering SSE data
def custom_headers(self):
return {"Cache-Control": "no-store",
"X-Accel-Buffering": "no"}
def open(self): def open(self):
try: try:
# Metrics # Metrics
+5
View File
@@ -54,6 +54,11 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
self.sse_spot_queues = sse_spot_queues self.sse_spot_queues = sse_spot_queues
self.web_server_metrics = web_server_metrics self.web_server_metrics = web_server_metrics
# Custom headers to avoid e.g. nginx reverse proxy from buffering SSE data
def custom_headers(self):
return {"Cache-Control": "no-store",
"X-Accel-Buffering": "no"}
# Called once on the client opening a connection, set things up # Called once on the client opening a connection, set things up
def open(self): def open(self):
try: try:
+1 -1
View File
@@ -1,5 +1,5 @@
import tornado import tornado
from prometheus_client.openmetrics.exposition import CONTENT_TYPE_LATEST from prometheus_client import CONTENT_TYPE_LATEST
from core.prometheus_metrics_handler import get_metrics from core.prometheus_metrics_handler import get_metrics
+14 -5
View File
@@ -182,9 +182,6 @@ function createNewTableRowsForSpot(s, highlightNew) {
// Create row // Create row
let $tr = $('<tr>'); let $tr = $('<tr>');
if (highlightNew) {
$tr.addClass("new");
}
// Apply striping to the table. We can't just use Bootstrap's table-striped class because we have all sorts of // Apply striping to the table. We can't just use Bootstrap's table-striped class because we have all sorts of
// extra faff to deal with, like the mobile view having extra rows, and the On Now / Next 24h / Later banners // extra faff to deal with, like the mobile view having extra rows, and the On Now / Next 24h / Later banners
@@ -195,7 +192,13 @@ function createNewTableRowsForSpot(s, highlightNew) {
// Show faded out if QRT // Show faded out if QRT
if (s["qrt"] == true) { if (s["qrt"] == true) {
$tr.addClass("table-faded"); $tr.addClass("table-faded");
}
// If we are asked to highlight new rows (i.e. this row is being added "live" via the SSE client and not as a bulk
// reload of the whole table)
if (highlightNew) {
$tr.addClass("new");
} }
// Format a UTC or local time for display // Format a UTC or local time for display
@@ -341,12 +344,18 @@ function createNewTableRowsForSpot(s, highlightNew) {
// Second row for mobile view only, containing type, ref & comment // Second row for mobile view only, containing type, ref & comment
$tr2 = $("<tr class='hidenotonmobile'>"); $tr2 = $("<tr class='hidenotonmobile'>");
// Apply styles as per the first row
if (rowCount % 2 == 1) { if (rowCount % 2 == 1) {
$tr2.addClass("table-active"); $tr2.addClass("table-active");
} }
if (s["qrt"] == true) { if (s["qrt"] == true) {
$tr2.addClass("table-faded"); $tr2.addClass("table-faded");
} }
if (highlightNew) {
$tr2.addClass("new");
}
$td2 = $("<td colspan='100'>"); $td2 = $("<td colspan='100'>");
if (showType) { if (showType) {
$td2.append(`<span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${typeText} `); $td2.append(`<span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${typeText} `);