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