mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-01 05:32:56 +03:00
requested changes
This commit is contained in:
parent
9caa82c792
commit
d21f77b243
@ -1,6 +1,7 @@
|
||||
use kinode_process_lib::{
|
||||
await_next_request_body, call_init, println, Address, ProcessId, Request,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
|
||||
wit_bindgen::generate!({
|
||||
@ -11,6 +12,12 @@ wit_bindgen::generate!({
|
||||
},
|
||||
});
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct EditAliases {
|
||||
alias: String,
|
||||
process: Option<ProcessId>,
|
||||
}
|
||||
|
||||
call_init!(init);
|
||||
|
||||
fn init(_our: Address) {
|
||||
@ -31,9 +38,9 @@ fn init(_our: Address) {
|
||||
let _ = Request::new()
|
||||
.target(("our", "terminal", "terminal", "sys"))
|
||||
.body(
|
||||
json!({
|
||||
"alias": alias,
|
||||
"process": null
|
||||
json!(EditAliases {
|
||||
alias: alias.to_string(),
|
||||
process: None
|
||||
})
|
||||
.to_string()
|
||||
.as_bytes()
|
||||
@ -46,9 +53,9 @@ fn init(_our: Address) {
|
||||
let _ = Request::new()
|
||||
.target(("our", "terminal", "terminal", "sys"))
|
||||
.body(
|
||||
json!({
|
||||
"alias": alias,
|
||||
"process": process
|
||||
json!(EditAliases {
|
||||
alias: alias.to_string(),
|
||||
process: Some(process)
|
||||
})
|
||||
.to_string()
|
||||
.as_bytes()
|
||||
|
@ -112,9 +112,8 @@ impl Guest for Component {
|
||||
.aliases
|
||||
.insert(edit_aliases.alias.clone(), process.clone());
|
||||
println!(
|
||||
"terminal: alias {:?} set to {:?}",
|
||||
edit_aliases.alias,
|
||||
process.to_string()
|
||||
"terminal: alias {} set to {}",
|
||||
edit_aliases.alias, process
|
||||
);
|
||||
}
|
||||
None => {
|
||||
|
Loading…
Reference in New Issue
Block a user