1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-01-17 05:33:35 +00:00

hide away IP pool things in the UI if not enabled

هذا الالتزام موجود في:
Adam Cooke
2017-04-27 09:41:21 +01:00
الأصل 1f64c61105
التزام 61da4bf48c
6 ملفات معدلة مع 12 إضافات و16 حذوفات

عرض الملف

@@ -64,7 +64,7 @@ class QueuedMessage < ApplicationRecord
end
def allocate_ip_address
if Postal.config.general.use_ip_pools && self.message && pool = self.server.ip_pool_for_message(self.message)
if Postal.ip_pools? && self.message && pool = self.server.ip_pool_for_message(self.message)
self.ip_address = pool.ip_addresses.order("RAND()").first
end
end

عرض الملف

@@ -47,7 +47,7 @@ class Server < ApplicationRecord
include HasSoftDestroy
belongs_to :organization
belongs_to :ip_pool
belongs_to :ip_pool, :optional => true
has_many :domains, :dependent => :destroy, :as => :owner
has_many :credentials, :dependent => :destroy
has_many :smtp_endpoints, :dependent => :destroy
@@ -280,7 +280,6 @@ class Server < ApplicationRecord
def ip_pool_for_message(message)
if message.scope == 'outgoing'
[self, self.organization].each do |scope|
rules = scope.ip_pool_rules.order(:created_at => :desc)
rules.each do |rule|
@@ -289,7 +288,6 @@ class Server < ApplicationRecord
end
end
end
self.ip_pool
else
nil

عرض الملف

@@ -39,7 +39,7 @@
%li.siteHeader__subMenuItem= link_to "Switch organization", root_path, :class => 'siteHeader__subMenuLink'
%li.siteHeader__navItem.siteHeader__navItem--user= current_user.name
%li.siteHeader__navItem= link_to "My Settings", settings_path, :class => 'sideHeader__navItemLink'
- if current_user.admin?
- if current_user.admin? && Postal.ip_pools?
%li.siteHeader__navItem= link_to "IP Pools", ip_pools_path, :class => 'sideHeader__navItemLink'
%li.siteHeader__navItem= link_to "Logout", logout_path, :method => :delete, :class => 'sideHeader__navItemLink'

عرض الملف

@@ -21,12 +21,13 @@
outgoing & incoming mail will be held and only visible in the web interface and will not be
sent to any recipients or HTTP endpoints.
.fieldSet__field
= f.label :ip_pool_id, :class => 'fieldSet__label'
.fieldSet__input
= f.collection_select :ip_pool_id, organization.ip_pools.includes(:ip_addresses).order("`default` desc, name asc"), :id, :description, {}, :class => 'input input--select'
%p.fieldSet__text
This is the set of IP addresses which outbound e-mails will be delivered from.
- if Postal.ip_pools?
.fieldSet__field
= f.label :ip_pool_id, :class => 'fieldSet__label'
.fieldSet__input
= f.collection_select :ip_pool_id, organization.ip_pools.includes(:ip_addresses).order("`default` desc, name asc"), :id, :description, {}, :class => 'input input--select'
%p.fieldSet__text
This is the set of IP addresses which outbound e-mails will be delivered from.
- if @server.persisted?
.fieldSet__field

عرض الملف

@@ -14,7 +14,8 @@
%li.serverHeader__list--warning= link_to "#{pluralize bad_dns, 'domain'} has misconfigured DNS records", [organization, @server, :domains]
- if unverified > 0
%li= link_to "#{pluralize unverified, 'domain'} is awaiting verification", [organization, @server, :domains]
%li Sending via #{@server.ip_pool.name}
- if Postal.ip_pools?
%li Sending via #{@server.ip_pool.name}
.serverHeader__stats{"data-turbolinks-permanent" => true, :id => "serverStats-#{@server.uuid}"}
%ul.serverHeader__statsList