pub const PICKER_NO_HOSTS: &str = "No hosts yet. Add a host first.";
pub const GLOBAL_DEFAULT_CLEARED: &str = "Global default cleared.";
pub const PASSWORD_SOURCE_CLEARED: &str = "Password source cleared.";
pub const ASKPASS_CUSTOM_COMMAND_HINT: &str =
"Type your command. Use %a (alias) and %h (hostname) as placeholders.";
pub fn global_default_set(label: &str) -> String {
format!("Global default set to {}.", label)
}
pub fn password_source_set(label: &str) -> String {
format!("Password source set to {}.", label)
}
pub fn complete_path(label: &str) -> String {
format!("Complete the {} path.", label)
}
pub fn key_selected(name: &str) -> String {
format!("Locked and loaded with {}.", name)
}
pub fn keys_copy_success(name: &str) -> String {
format!("Copied {}.pub to clipboard.", name)
}
pub fn keys_copy_read_failed(name: &str) -> String {
format!("Could not read {}.pub from disk.", name)
}
pub const TAB_EMPTY_HOSTS_HEADLINE: &str = "It's quiet in here.";
pub const TAB_EMPTY_HOSTS_EXPLAINER: &str = "purple reads hosts from ~/.ssh/config and from the cloud providers you connect. Add one by hand or sync a provider and the list fills up.";
pub const TAB_EMPTY_HOSTS_HINT_ADD: &str = "add a host";
pub const TAB_EMPTY_HOSTS_HINT_SYNC: &str = "open providers to sync from the cloud";
pub const TAB_EMPTY_CONTAINERS_HEADLINE: &str = "No containers cached yet.";
pub const TAB_EMPTY_CONTAINERS_EXPLAINER: &str = "purple snapshots docker or podman output per host and caches it locally. Pick a host below and its containers show up here.";
pub const TAB_EMPTY_CONTAINERS_HINT_ADD: &str = "pick a host to scan";
pub const TAB_EMPTY_TUNNELS_HEADLINE: &str = "No tunnels yet.";
pub const TAB_EMPTY_TUNNELS_EXPLAINER: &str = "Tunnels are SSH port forwards stored per host in ~/.ssh/config. This tab aggregates Local, Remote and Dynamic forwards across every alias.";
pub const TAB_EMPTY_TUNNELS_HINT_ADD: &str = "add a tunnel";
pub const TAB_EMPTY_KEYS_HEADLINE: &str = "No SSH keys in ~/.ssh/ yet.";
pub const TAB_EMPTY_KEYS_EXPLAINER: &str = "purple reads every public-key file in ~/.ssh/ along with its activity history. Generate one and the new key shows up here on next refresh.";
pub const TAB_EMPTY_KEYS_HINT_KEYGEN: &str = "ssh-keygen -t ed25519 -C \"$(whoami)@$(hostname)\"";
pub const CONFIRM_TUNNEL_DELETE_TITLE: &str = " Remove tunnel? ";
pub const CONFIRM_TUNNEL_DELETE_QUESTION: &str = "Remove the selected tunnel rule from this host?";
pub const CONFIRM_TUNNEL_DELETE_DETAIL: &str =
"Rewrites ~/.ssh/config. The rule is gone after save.";
pub const CONFIRM_SNIPPET_DELETE_TITLE: &str = " Remove snippet? ";
pub const CONFIRM_SNIPPET_DELETE_DETAIL: &str = "The snippet file is rewritten on disk.";
pub fn confirm_snippet_delete_question(name: &str) -> String {
format!("Remove \"{}\" from the snippet store?", name)
}
pub const CONFIRM_PROVIDER_REMOVE_TITLE: &str = " Remove provider? ";
pub const CONFIRM_PROVIDER_REMOVE_DETAIL: &str =
"Synced hosts stay in ~/.ssh/config. The integration is gone after save.";
pub fn confirm_provider_remove_question(display: &str) -> String {
format!("Remove the \"{}\" provider config?", display)
}
pub fn confirm_provider_remove_labeled_question(display: &str, label: &str) -> String {
format!("Remove the \"{}\" config labelled \"{}\"?", display, label)
}
pub const KEY_PUSH_NO_HOSTS: &str =
"No hosts in ~/.ssh/config. Add a host first, then come back here.";
pub const VAULT_STRIP_EMPTY: &str =
" No active certs. Press V to sign all Vault SSH hosts at once.";
pub const KEY_PUSH_VAULT_TAG: &str = " (vault)";
pub fn key_push_picker_title_eligible(key_label: &str, eligible: usize, total: usize) -> String {
format!(
"Push {} \u{203A} Select Hosts ({} eligible of {})",
key_label, eligible, total
)
}
pub fn key_push_picker_title_selected(
key_label: &str,
selected: usize,
total: usize,
eligible: usize,
) -> String {
format!(
"Push {} \u{203A} {} selected of {} ({} eligible)",
key_label, selected, total, eligible
)
}
pub fn key_push_no_pubkey(name: &str) -> String {
format!(
"Cannot read {}.pub. The file is missing or unreadable.",
name
)
}
pub const KEY_PUSH_NONE_SELECTED: &str = "Select at least one host with Space.";
pub const KEY_PUSH_VAULT_SKIP: &str =
"Vault SSH host. Use V on the host list to sign a cert instead.";
pub fn key_push_in_progress(key_name: &str, host_count: usize) -> String {
format!("Pushing {} to {} host(s)...", key_name, host_count)
}
pub fn key_push_thread_spawn_failed() -> String {
"Could not spawn push worker thread. Check resource limits.".to_string()
}
pub const KEY_PUSH_ALREADY_IN_PROGRESS: &str =
"A push is already running. Press Esc to cancel first.";
pub fn key_push_pubkey_not_regular(name: &str) -> String {
format!("{}.pub is not a regular file. Symlinks are rejected.", name)
}
pub fn key_push_pubkey_too_large(name: &str, bytes: u64) -> String {
format!(
"{}.pub is {} bytes, larger than the 16 KiB push limit.",
name, bytes
)
}
pub fn key_push_invalid_pubkey(name: &str, detail: &str) -> String {
format!("{}.pub failed validation: {}. Push aborted.", name, detail)
}
pub const KEY_PUSH_NO_HOSTS_SELECTED: &str =
"Picker committed with no eligible hosts. Push aborted.";
pub const KEY_PUSH_CERT_NOT_PUSHABLE: &str =
"Certificates cannot be pushed as static keys. Sign with V instead.";
pub fn key_push_cancelled(done: usize, total: usize) -> String {
format!(
"Push cancelled after {} of {} host(s). Re-run to finish the rest.",
done, total,
)
}
pub fn key_push_confirm_body(key_name: &str, host_count: usize) -> String {
if host_count == 1 {
format!("Push {} to 1 host?", key_name)
} else {
format!("Push {} to {} hosts?", key_name, host_count)
}
}
pub fn key_push_success(appended: usize, already: usize) -> String {
if appended == 0 && already > 0 {
format!("Key already present on {} host(s). Nothing to do.", already)
} else if already == 0 {
format!("Pushed to {} host(s).", appended)
} else {
format!(
"Pushed to {} host(s). Already present on {}.",
appended, already
)
}
}
pub fn key_push_partial_failure(succeeded: usize, failed: usize) -> String {
format!("Pushed to {} host(s). {} failed.", succeeded, failed)
}
pub fn key_push_all_failed(count: usize) -> String {
format!(
"Push failed for all {} host(s). Check the host log for details.",
count
)
}
pub fn proxy_jump_set(alias: &str) -> String {
format!("Jumping through {}.", alias)
}
pub fn save_default_failed(e: &impl std::fmt::Display) -> String {
format!("Failed to save default: {}", e)
}