From 5ba9d226a97d2f64627ab00d019433b09d8bc393 Mon Sep 17 00:00:00 2001 From: Akinator31 Date: Thu, 20 Nov 2025 22:01:23 +0100 Subject: [PATCH] feat(panel): add possibility to update panel url address --- rustmail/src/api/handler/bot/config.rs | 2 -- rustmail/src/commands/logs/common.rs | 2 +- rustmail_panel/src/components/configuration.rs | 15 +++++++++++++++ rustmail_panel/src/i18n/en/en.json | 4 +++- rustmail_panel/src/i18n/fr/fr.json | 4 +++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/rustmail/src/api/handler/bot/config.rs b/rustmail/src/api/handler/bot/config.rs index dd1f1917..60001b31 100644 --- a/rustmail/src/api/handler/bot/config.rs +++ b/rustmail/src/api/handler/bot/config.rs @@ -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, diff --git a/rustmail/src/commands/logs/common.rs b/rustmail/src/commands/logs/common.rs index e86681ad..95e8f3c2 100644 --- a/rustmail/src/commands/logs/common.rs +++ b/rustmail/src/commands/logs/common.rs @@ -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 ), diff --git a/rustmail_panel/src/components/configuration.rs b/rustmail_panel/src/components/configuration.rs index a8ca7fed..b7126940 100644 --- a/rustmail_panel/src/components/configuration.rs +++ b/rustmail_panel/src/components/configuration.rs @@ -833,6 +833,21 @@ fn bot_section(props: &BotSectionProps) -> Html { }) }} /> + + } } diff --git a/rustmail_panel/src/i18n/en/en.json b/rustmail_panel/src/i18n/en/en.json index 72b3b09e..fc953b26 100644 --- a/rustmail_panel/src/i18n/en/en.json +++ b/rustmail_panel/src/i18n/en/en.json @@ -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", diff --git a/rustmail_panel/src/i18n/fr/fr.json b/rustmail_panel/src/i18n/fr/fr.json index bf24e3fb..eb586c14 100644 --- a/rustmail_panel/src/i18n/fr/fr.json +++ b/rustmail_panel/src/i18n/fr/fr.json @@ -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",