feat: replace prompt with inform (fire-and-forget), logs default 20 lines
This commit is contained in:
parent
d2f77f8054
commit
af0b6b5ddb
5 changed files with 51 additions and 13 deletions
|
|
@ -401,6 +401,22 @@ pub async fn clipboard_set(
|
|||
}
|
||||
}
|
||||
|
||||
/// POST /devices/:label/inform
|
||||
pub async fn inform_user(
|
||||
Path(label): Path<String>,
|
||||
State(state): State<AppState>,
|
||||
Json(body): Json<PromptBody>,
|
||||
) -> impl IntoResponse {
|
||||
match dispatch(&state, &label, "inform", |rid| ServerMessage::InformRequest {
|
||||
request_id: rid,
|
||||
message: body.message.clone(),
|
||||
title: body.title.clone(),
|
||||
}).await {
|
||||
Ok(_) => (StatusCode::OK, Json(serde_json::json!({ "ok": true }))).into_response(),
|
||||
Err(e) => e.into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
/// POST /devices/:label/prompt
|
||||
#[derive(Deserialize)]
|
||||
pub struct PromptBody {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue