Mountain/Vine/Server/Notification/
OutputAppendLine.rs1use serde_json::{Value, json};
9use tauri::Emitter;
10
11use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
12
13pub async fn OutputAppendLine(Service:&MountainVinegRPCService, Parameter:&Value) {
14 let Channel = Parameter.get("channel").and_then(Value::as_str).unwrap_or("");
15
16 let Text = Parameter.get("text").and_then(Value::as_str).unwrap_or("");
17
18 let _ = Service.ApplicationHandle().emit(
19 "sky://output/append",
20 json!({
21 "channel": Channel,
22 "text": format!("{}\n", Text),
23 }),
24 );
25
26 dev_log!("grpc", "[Output] appendLine channel={} bytes={}", Channel, Text.len());
27}