#[cfg(feature = "server")] use leptos::prelude::*; use serde::{Deserialize, Serialize}; use crate::version::Version; #[derive(Serialize, Deserialize)] pub struct Install { install_target: std::path::PathBuf } #[async_trait::async_trait] impl super::Action for Install { const REQ_VERSION: Version = Version::new(2, 0); const REQ_OS: Option<&'static str> = None; const REQ_FIELDS: &'static [(&'static str, &'static str, Option<&'static str>)] = &[ ("Binary to infect", "install_target", None) ]; type ActionData = (); #[cfg(feature = "beacon")] async fn execute(&self) -> Self::ActionData { "Hi".to_string(); } #[cfg(feature = "server")] fn render_data(&self, _data: Self::ActionData) -> impl IntoView { view! { "ls ran" } } }