Skip to content

Commit

Permalink
Change "admin" to "config" in the menu
Browse files Browse the repository at this point in the history
Otherwise it's unclear which username logs in for config
  • Loading branch information
mkj committed Jun 10, 2024
1 parent ca454a0 commit 6d536f0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions embassy/demos/picow/src/picowmenu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ const AUTH_ITEM: Item<MenuCtx> = Item {
help: None,
},
&Item {
command: "admin-key",
command: "config-key",
item_type: ItemType::Callback {
parameters: &[
Parameter::Mandatory { parameter_name: "slot", help: None },
Expand All @@ -329,7 +329,7 @@ const AUTH_ITEM: Item<MenuCtx> = Item {
help: None,
},
&Item {
command: "clear-admin-key",
command: "clear-config-key",
item_type: ItemType::Callback {
parameters: &[Parameter::Mandatory {
parameter_name: "slot",
Expand All @@ -340,7 +340,7 @@ const AUTH_ITEM: Item<MenuCtx> = Item {
help: None,
},
&Item {
command: "admin-password",
command: "config-password",
item_type: ItemType::Callback {
parameters: &[Parameter::Mandatory {
parameter_name: "pw",
Expand All @@ -351,7 +351,7 @@ const AUTH_ITEM: Item<MenuCtx> = Item {
help: Some("Password for serial or config@. 'None' to clear"),
},
&Item {
command: "clear-admin-password",
command: "clear-config-password",
item_type: ItemType::Callback {
parameters: &[],
function: do_admin_clear_pw,
Expand Down Expand Up @@ -542,10 +542,10 @@ fn do_auth_show(_item: &Item<MenuCtx>, _args: &[&str], context: &mut MenuCtx) {
prkey(out, "Console key1", &c.console_keys[0]);
prkey(out, "Console key2", &c.console_keys[1]);
prkey(out, "Console key3", &c.console_keys[2]);
let _ = writeln!(out, "Admin password {}", endis(c.admin_pw.is_some()));
prkey(out, "Admin key1", &c.admin_keys[0]);
prkey(out, "Admin key2", &c.admin_keys[1]);
prkey(out, "Admin key3", &c.admin_keys[2]);
let _ = writeln!(out, "Config password {}", endis(c.admin_pw.is_some()));
prkey(out, "Config key1", &c.admin_keys[0]);
prkey(out, "Config key2", &c.admin_keys[1]);
prkey(out, "Config key3", &c.admin_keys[2]);
});
}

Expand Down Expand Up @@ -618,7 +618,7 @@ fn do_admin_pw(_item: &Item<MenuCtx>, args: &[&str], context: &mut MenuCtx) {
}
context.with_config(|c, out| {
let _ = match c.set_admin_pw(Some(pw)) {
Ok(()) => writeln!(out, "Set admin password"),
Ok(()) => writeln!(out, "Set config password"),
Err(e) => writeln!(out, "Failed setting, {}", e),
};
});
Expand All @@ -627,7 +627,7 @@ fn do_admin_pw(_item: &Item<MenuCtx>, args: &[&str], context: &mut MenuCtx) {
fn do_admin_clear_pw(_item: &Item<MenuCtx>, args: &[&str], context: &mut MenuCtx) {
context.with_config(|c, out| {
let _ = c.set_admin_pw(None);
let _ = writeln!(out, "Disabled admin password");
let _ = writeln!(out, "Disabled config password");
});
}

Expand Down

0 comments on commit 6d536f0

Please sign in to comment.