diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-10-27 17:59:19 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-27 17:59:19 +0800 |
| commit | 5e150adf0e3d8b3843779eddd83469d1b1ba84bc (patch) | |
| tree | aedbd6cd10757da9c9d401a818ed1471f377d54b /crates/vcs_actions/src/actions | |
| parent | 49ad7a152cf849c8d91ee6b686da31f9c252f77c (diff) | |
| parent | 368687c943a13427b5338a30fb7b55558420f4de (diff) | |
Merge pull request #26 from JustEnoughVCS/jvcs_dev
Jvcs dev
Diffstat (limited to 'crates/vcs_actions/src/actions')
| -rw-r--r-- | crates/vcs_actions/src/actions/local_actions.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/crates/vcs_actions/src/actions/local_actions.rs b/crates/vcs_actions/src/actions/local_actions.rs index b11a934..f705692 100644 --- a/crates/vcs_actions/src/actions/local_actions.rs +++ b/crates/vcs_actions/src/actions/local_actions.rs @@ -1,9 +1,14 @@ -use action_system::{action::ActionContext, action_gen}; +use std::net::SocketAddr; + +use action_system::{action::ActionContext, macros::action_gen}; use log::info; use tcp_connection::error::TcpTargetError; #[action_gen] -pub async fn hello_world_action(ctx: ActionContext, _n: ()) -> Result<(), TcpTargetError> { +pub async fn set_upstream_vault_action( + ctx: ActionContext, + _upstream: SocketAddr, +) -> Result<(), TcpTargetError> { // Ensure the instance is available let Some(instance) = ctx.instance() else { return Err(TcpTargetError::NotFound( @@ -11,14 +16,14 @@ pub async fn hello_world_action(ctx: ActionContext, _n: ()) -> Result<(), TcpTar )); }; - if ctx.is_local() { + if ctx.is_proc_on_local() { // Invoke on local // Send the message to the server let _ = instance.lock().await.write_text("Hello World!").await; - } else if ctx.is_remote() { - // Read the message from the client + } else if ctx.is_proc_on_remote() { + // Remote execution - read the message from the client let read = instance.lock().await.read_text().await?; - info!("{}", read) + info!("Received: {}", read) } Ok(()) |
