feat(gui): the person is asked when a web assistant wants to connect (P15 B1, D-83)
The window shows a card, over any page of the company and on the Connect page, that says in plain words who is asking (the product by where it is sent back to, never by what it calls itself), where it will be sent back to, the internet address it asked from and what it will be able to do: read and draft, and post only if the box is ticked. Allow and Don't allow answer through the owner and the admin socket (ledger-host AppServer::web_decide); nothing on the web page approves. Each web connection shows what it may do, with a button to let it post or stop. Revoke stays the one row of 'Who can reach these books'. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c36c1f020
commit
c9b6614688
7 files changed
+688
-12
No files matched your search
@@ -34,7 +34,7 @@
|
||||
//! 5. Nothing here holds a token's text: the server never sends one.
|
||||
//! ```
|
||||
|
||||
use crate::owner::{Assistant, LastCall, Owner, Roster, TokenRow};
|
||||
use crate::owner::{Assistant, LastCall, Owner, Roster, TokenRow, WebApproval, WebRequest};
|
||||
use chrono::{DateTime, Utc};
|
||||
use egui_phosphor::regular as icon;
|
||||
use std::sync::{Arc, Mutex, MutexGuard};
|
||||
@@ -94,6 +94,10 @@ pub struct Status {
|
||||
pub assistants: Vec<Assistant>,
|
||||
/// The tokens of this company: who may connect.
|
||||
pub tokens: Vec<TokenRow>,
|
||||
/// Web assistants waiting for the person to allow them.
|
||||
pub web_pending: Vec<WebRequest>,
|
||||
/// The web connections the person allowed.
|
||||
pub web_approvals: Vec<WebApproval>,
|
||||
/// "Now", for "10 seconds ago" (fixed in tests and screenshots).
|
||||
pub now: DateTime<Utc>,
|
||||
}
|
||||
@@ -108,6 +112,8 @@ impl Status {
|
||||
link: Link::Unknown,
|
||||
assistants: Vec::new(),
|
||||
tokens: Vec::new(),
|
||||
web_pending: Vec::new(),
|
||||
web_approvals: Vec::new(),
|
||||
now: Utc::now(),
|
||||
}
|
||||
}
|
||||
@@ -561,6 +567,16 @@ impl Connections {
|
||||
.into_iter()
|
||||
.filter(|t| t.book == book)
|
||||
.collect();
|
||||
status.web_pending = roster
|
||||
.web_pending
|
||||
.into_iter()
|
||||
.filter(|r| r.book == book)
|
||||
.collect();
|
||||
status.web_approvals = roster
|
||||
.web_approvals
|
||||
.into_iter()
|
||||
.filter(|a| a.book == book)
|
||||
.collect();
|
||||
status.link = if status.assistants.is_empty() {
|
||||
Link::None
|
||||
} else if status.assistants.iter().any(|a| a.running > 0) {
|
||||
|
||||
Reference in new issue
Block a user