Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions rustmail/src/api/handler/bot/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ pub async fn handle_update_config(
new_bot_config.client_secret = current_config.bot.client_secret.clone();
}

new_bot_config.ip = current_config.bot.ip.clone();

let new_config = Config {
bot: new_bot_config,
command: update.command,
Expand Down
2 changes: 1 addition & 1 deletion rustmail/src/commands/logs/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub async fn render_logs_page(
log.id,
log.ticket_id,
format!(
"http://{}:3002/panel/tickets/{}",
"{}/panel/tickets/{}",
&config.bot.ip.clone().unwrap(),
log.ticket_id
),
Expand Down
15 changes: 15 additions & 0 deletions rustmail_panel/src/components/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,21 @@ fn bot_section(props: &BotSectionProps) -> Html {
})
}}
/>

<TextInput
label={i18n.t("panel.configuration.bot.ip")}
value={config.bot.ip.clone().unwrap_or_default()}
help={Some(i18n.t("panel.configuration.bot.ip_help"))}
placeholder={Some("0.0.0.0".to_string())}
on_change={{
let config = config.clone();
Callback::from(move |val: String| {
let mut cfg = (*config).clone();
cfg.bot.ip = if val.is_empty() { None } else { Some(val) };
config.set(cfg);
})
}}
/>
</div>
}
}
Expand Down
4 changes: 3 additions & 1 deletion rustmail_panel/src/i18n/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
"redirect_url": "Redirect URL",
"timezone": "Timezone",
"logs_channel_id": "Logs Channel ID (optional)",
"features_channel_id": "Features Channel ID (optional)"
"features_channel_id": "Features Channel ID (optional)",
"ip": "Server IP Address",
"ip_help": "IP address for the API server (optional)"
},
"server_mode": {
"type": "Mode Type",
Expand Down
4 changes: 3 additions & 1 deletion rustmail_panel/src/i18n/fr/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
"redirect_url": "URL de redirection",
"timezone": "Fuseau horaire",
"logs_channel_id": "ID du canal de logs (optionnel)",
"features_channel_id": "ID du canal de features (optionnel)"
"features_channel_id": "ID du canal de features (optionnel)",
"ip": "Adresse IP du serveur",
"ip_help": "Adresse IP pour le serveur API (optionnel)"
},
"server_mode": {
"type": "Type de mode",
Expand Down