Skip to content

Commit 8510539

Browse files
authored
Merge pull request #242 from Rustmail/dev
feat(panel): add possibility to update panel url address
2 parents 1f8a414 + 5ba9d22 commit 8510539

5 files changed

Lines changed: 22 additions & 5 deletions

File tree

rustmail/src/api/handler/bot/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ pub async fn handle_update_config(
7575
new_bot_config.client_secret = current_config.bot.client_secret.clone();
7676
}
7777

78-
new_bot_config.ip = current_config.bot.ip.clone();
79-
8078
let new_config = Config {
8179
bot: new_bot_config,
8280
command: update.command,

rustmail/src/commands/logs/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub async fn render_logs_page(
5353
log.id,
5454
log.ticket_id,
5555
format!(
56-
"http://{}:3002/panel/tickets/{}",
56+
"{}/panel/tickets/{}",
5757
&config.bot.ip.clone().unwrap(),
5858
log.ticket_id
5959
),

rustmail_panel/src/components/configuration.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,21 @@ fn bot_section(props: &BotSectionProps) -> Html {
833833
})
834834
}}
835835
/>
836+
837+
<TextInput
838+
label={i18n.t("panel.configuration.bot.ip")}
839+
value={config.bot.ip.clone().unwrap_or_default()}
840+
help={Some(i18n.t("panel.configuration.bot.ip_help"))}
841+
placeholder={Some("0.0.0.0".to_string())}
842+
on_change={{
843+
let config = config.clone();
844+
Callback::from(move |val: String| {
845+
let mut cfg = (*config).clone();
846+
cfg.bot.ip = if val.is_empty() { None } else { Some(val) };
847+
config.set(cfg);
848+
})
849+
}}
850+
/>
836851
</div>
837852
}
838853
}

rustmail_panel/src/i18n/en/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
"redirect_url": "Redirect URL",
5959
"timezone": "Timezone",
6060
"logs_channel_id": "Logs Channel ID (optional)",
61-
"features_channel_id": "Features Channel ID (optional)"
61+
"features_channel_id": "Features Channel ID (optional)",
62+
"ip": "Server IP Address",
63+
"ip_help": "IP address for the API server (optional)"
6264
},
6365
"server_mode": {
6466
"type": "Mode Type",

rustmail_panel/src/i18n/fr/fr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
"redirect_url": "URL de redirection",
5959
"timezone": "Fuseau horaire",
6060
"logs_channel_id": "ID du canal de logs (optionnel)",
61-
"features_channel_id": "ID du canal de features (optionnel)"
61+
"features_channel_id": "ID du canal de features (optionnel)",
62+
"ip": "Adresse IP du serveur",
63+
"ip_help": "Adresse IP pour le serveur API (optionnel)"
6264
},
6365
"server_mode": {
6466
"type": "Type de mode",

0 commit comments

Comments
 (0)