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 let Text = Parameter.get("text").and_then(Value::as_str).unwrap_or("");
17 let _ = Service.ApplicationHandle().emit(
18 "sky://output/append",
19 json!({
20 "channel": Channel,
21 "text": format!("{}\n", Text),
22 }),
23 );
24 dev_log!("grpc", "[Output] appendLine channel={} bytes={}", Channel, Text.len());
25}