Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show incoming mail configuration on dashboard #32738

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
12 changes: 12 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3289,6 +3289,18 @@ config.send_test_mail_submit = Send
config.test_mail_failed = Failed to send a testing email to "%s": %v
config.test_mail_sent = A testing email has been sent to "%s".

config.incoming_mail_config = Incoming Mail Configuration
config.incoming_mail_enabled = Enabled
config.incoming_mail_reply_to_address = Reply To Address
config.incoming_mail_host = Host
config.incoming_mail_port = Port
config.incoming_mail_username = Username
config.incoming_mail_password = Password
config.incoming_mail_use_tls = Use TLS
config.incoming_mail_skip_tls_verify = Skip TLS Verify
config.incoming_mail_mailbox = Mailbox
config.incoming_mail_maximum_message_size = Maximum Message Size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think it is good to translate all these config options.

There are hundreds of them, who would really translate them one by one?


config.oauth_config = OAuth Configuration
config.oauth_enabled = Enabled

Expand Down
6 changes: 6 additions & 0 deletions routers/web/admin/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ func Config(ctx *context.Context) {
ctx.Data["Mailer"] = setting.MailService
}

ctx.Data["IncomingMailEnabled"] = false
if setting.MailService != nil && setting.IncomingEmail.Enabled {
ctx.Data["IncomingMailEnabled"] = true
}
ctx.Data["IncomingMail"] = setting.IncomingEmail

ctx.Data["CacheAdapter"] = setting.CacheService.Adapter
ctx.Data["CacheInterval"] = setting.CacheService.Interval

Expand Down
28 changes: 28 additions & 0 deletions templates/admin/config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,34 @@
</dl>
</div>

<h4 class="ui top attached header">
{{ctx.Locale.Tr "admin.config.incoming_mail_config"}}
</h4>
<div class="ui attached table segment">
<dl class="admin-dl-horizontal">
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_enabled"}}</dt>
<dd>{{svg (Iif .IncomingMailEnabled "octicon-check" "octicon-x")}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_reply_to_address"}}</dt>
<dd>{{.IncomingMail.ReplyToAddress}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_host"}}</dt>
<dd>{{.IncomingMail.Host}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_port"}}</dt>
<dd>{{.IncomingMail.Host}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_username"}}</dt>
<dd>{{.IncomingMail.Host}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_password"}}</dt>
<dd>{{.IncomingMail.Password}}</dd>
hiifong marked this conversation as resolved.
Show resolved Hide resolved
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_use_tls"}}</dt>
<dd>{{svg (Iif .IncomingMail.UseTLS "octicon-check" "octicon-x")}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_skip_tls_verify"}}</dt>
<dd>{{svg (Iif .IncomingMail.SkipTLSVerify "octicon-check" "octicon-x")}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_mailbox"}}</dt>
<dd>{{.IncomingMail.Mailbox}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.incoming_mail_maximum_message_size"}}</dt>
<dd>{{.IncomingMail.MaximumMessageSize}}</dd>
</dl>
</div>

<h4 class="ui top attached header">
{{ctx.Locale.Tr "admin.config.cache_config"}}
</h4>
Expand Down
Loading