From 4ce69ad43fb20042d78048e71054c3368fe0205e Mon Sep 17 00:00:00 2001 From: PramUkesh Date: Fri, 12 Jan 2024 05:04:58 +0530 Subject: [PATCH] core::site > Site, add event field for file_status --- src/core/site.rs | 2 ++ src/plugins/websocket/handlers/sites.rs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/site.rs b/src/core/site.rs index cdc263a..aa1b531 100644 --- a/src/core/site.rs +++ b/src/core/site.rs @@ -14,6 +14,7 @@ use super::{address::Address as Addr, error::Error, peer::Peer}; pub mod models { use serde::{Deserialize, Serialize}; + use serde_json::Value; use std::collections::{BTreeMap, HashMap}; use crate::utils::is_default; @@ -35,6 +36,7 @@ pub mod models { pub workers: usize, pub content: serde_json::Value, pub privatekey: bool, + pub event: Option } #[derive(Serialize, Deserialize, Debug, Default, Clone)] diff --git a/src/plugins/websocket/handlers/sites.rs b/src/plugins/websocket/handlers/sites.rs index f91ae9d..a847d15 100644 --- a/src/plugins/websocket/handlers/sites.rs +++ b/src/plugins/websocket/handlers/sites.rs @@ -3,7 +3,7 @@ use actix_web_actors::ws::WebsocketContext; use futures::executor::block_on; use log::*; use serde::Serialize; -use serde_json::Value; +use serde_json::{Value, json}; use super::super::{error::Error, request::Command, response::Message, ZeruWebsocket}; use crate::{ @@ -65,6 +65,11 @@ pub fn handle_site_info(ws: &ZeruWebsocket, command: &Command) -> Result