diff --git a/assets/sai.css b/assets/sai.css
index ac6c188..045994a 100644
--- a/assets/sai.css
+++ b/assets/sai.css
@@ -1292,6 +1292,10 @@ canvas.power-graph {
background-color: #79da80;
}
+.pcon-header-on .pcon-on, .pcon-header-on .pcon-off {
+ color: #000000;
+}
+
.plat-peer-ip {
font-size: 0.8em;
color: #555;
diff --git a/assets/sai.js b/assets/sai.js
index cfe9592..64d4770 100644
--- a/assets/sai.js
+++ b/assets/sai.js
@@ -2057,7 +2057,7 @@ function ws_open_sai()
pcon_topology[b.pcon] = {
name: b.pcon,
on: 0, /* Default to off so it shows grey until we get real state */
- type: "auto-discovered",
+ type: "",
depends_on: "",
children: []
};
diff --git a/src/common/c-sqlite3.c b/src/common/c-sqlite3.c
index e007d33..c37f028 100644
--- a/src/common/c-sqlite3.c
+++ b/src/common/c-sqlite3.c
@@ -23,6 +23,7 @@
#include <sqlite3.h>
#include <assert.h>
+#include <errno.h>
#include "include/private.h"
diff --git a/src/power/p-ws-server.c b/src/power/p-ws-server.c
index 20b004f..f745071 100644
--- a/src/power/p-ws-server.c
+++ b/src/power/p-ws-server.c
@@ -226,9 +226,12 @@ saip_m_rx(void *userobj, const uint8_t *buf, size_t len, int flags)
if (ctl->on) {
pc->flags |= SAIP_PCON_F_MANUAL_STAY;
saip_switch(pc, 1);
+ saip_notify_server_power_state(pc->name, 1, 0);
+ saip_queue_stay_info(sps);
} else {
pc->flags &= (uint8_t)~SAIP_PCON_F_MANUAL_STAY;
saip_pcon_start_check();
+ saip_queue_stay_info(sps);
}
} else {
lwsl_warn("%s: Unknown PCON '%s'\n", __func__, ctl->pcon_name);
@@ -260,10 +263,13 @@ saip_m_rx(void *userobj, const uint8_t *buf, size_t len, int flags)
pc->flags |= SAIP_PCON_F_MANUAL_STAY;
/* If stay is set, ensure it is on immediately */
saip_switch(pc, 1);
+ saip_notify_server_power_state(pc->name, 1, 0);
+ saip_queue_stay_info(sps);
} else {
pc->flags &= (uint8_t)~SAIP_PCON_F_MANUAL_STAY;
/* If stay is cleared, schedule power off check */
saip_pcon_start_check();
+ saip_queue_stay_info(sps);
}
goto found;
}
@@ -281,10 +287,13 @@ saip_m_rx(void *userobj, const uint8_t *buf, size_t len, int flags)
pc->flags |= SAIP_PCON_F_MANUAL_STAY;
/* If stay is set, ensure it is on immediately */
saip_switch(pc, 1);
+ saip_notify_server_power_state(pc->name, 1, 0);
+ saip_queue_stay_info(sps);
} else {
pc->flags &= (uint8_t)~SAIP_PCON_F_MANUAL_STAY;
/* If stay is cleared, schedule power off check */
saip_pcon_start_check();
+ saip_queue_stay_info(sps);
}
goto found;
}
@@ -397,8 +406,9 @@ saip_m_tx(void *userobj, lws_ss_tx_ordinal_t ord, uint8_t *buf, size_t *len,
r = sai_ss_tx_from_buflist_helper(pss->ss, &pss->bl_pwr_to_srv,
buf, len, flags);
- if (r == LWSSSSRET_OK)
- sai_dump_stderr(buf, *len);
+ if (r == LWSSSSRET_OK) {
+ /* sai_dump_stderr(buf, *len); */
+ }
return r;
}
diff --git a/src/server/s-central.c b/src/server/s-central.c
index aff0f0c..3f4f583 100644
--- a/src/server/s-central.c
+++ b/src/server/s-central.c
@@ -212,8 +212,8 @@ sais_central_gc_deleted_events_cb(lws_sorted_usec_list_t *sul)
return;
/* Pick 1 task that is stopped to garbage collect */
- /* 0=WAITING, 3=SUCCESS, 4=FAIL, 5=CANCELLED */
- lws_snprintf(q, sizeof(q), "SELECT uuid FROM tasks WHERE state IN (0, 3, 4, 5) LIMIT 1");
+ /* 0=WAITING, 3=SUCCESS, 4=FAIL, 5=CANCELLED, 8=NOT_READY, 9=STEP_SUCCESS, 10=PAUSED */
+ lws_snprintf(q, sizeof(q), "SELECT uuid FROM tasks WHERE state IN (0, 3, 4, 5, 8, 9, 10) LIMIT 1");
if (sqlite3_prepare_v2(pdb, q, -1, &tsm, NULL) == SQLITE_OK) {
if (sqlite3_step(tsm) == SQLITE_ROW) {
diff --git a/src/server/s-task-helpers.c b/src/server/s-task-helpers.c
index cf07ca8..b6c7d2b 100644
--- a/src/server/s-task-helpers.c
+++ b/src/server/s-task-helpers.c
@@ -330,6 +330,9 @@ sais_set_task_state(struct vhd *vhd, const char *task_uuid,
sta = SAIES_BEING_BUILT_HAS_FAILURES;
}
+ if (oes == SAIES_DELETED)
+ sta = SAIES_DELETED;
+
if (sta != oes) {
lwsl_notice("%s: event state changed\n", __func__);
diff --git a/src/server/s-task.c b/src/server/s-task.c
index 8bc2452..704b561 100644
--- a/src/server/s-task.c
+++ b/src/server/s-task.c
@@ -508,7 +508,7 @@ sais_platforms_with_tasks_pending(struct vhd *vhd)
* Collect a list of *events* (not tasks) that still have any open tasks
*/
- lws_snprintf(pf, sizeof(pf)," and (state != 3 and state != 5) and (created < %llu)",
+ lws_snprintf(pf, sizeof(pf)," and (state != 3 and state != 5 and state != 7) and (created < %llu)",
(unsigned long long)(lws_now_secs() - 10));
n = lws_struct_sq3_deserialize(vhd->server.pdb, pf, "created desc ",