feat(host-agent): add Console task submission with Host self-submission client
Adds a CSRF-protected task submission form to the local Console Tasks page
This commit is contained in:
@@ -55,6 +55,21 @@ class ConsoleHistoryStore:
|
||||
{"revision": revision},
|
||||
)
|
||||
|
||||
def record_task_submission(
|
||||
self,
|
||||
*,
|
||||
task_id: str,
|
||||
device_id: str | None,
|
||||
) -> None:
|
||||
if device_id:
|
||||
summary = f"task submitted: {task_id} on {device_id}"
|
||||
else:
|
||||
summary = f"task submitted: {task_id} (automatic device)"
|
||||
detail: dict[str, Any] = {"task_id": task_id}
|
||||
if device_id is not None:
|
||||
detail["device_id"] = device_id
|
||||
self._insert("task_submission", summary, detail)
|
||||
|
||||
def list_recent(self, limit: int | None = None) -> list[dict[str, Any]]:
|
||||
effective_limit = limit if limit is not None else self.limit
|
||||
with self._connect() as connection:
|
||||
|
||||
Reference in New Issue
Block a user