مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-16 21:23:37 +00:00
initial commit from appmail
هذا الالتزام موجود في:
59
app/views/http_endpoints/_form.html.haml
Normal file
59
app/views/http_endpoints/_form.html.haml
Normal file
@@ -0,0 +1,59 @@
|
||||
= form_for [organization, @server, @http_endpoint], :remote => true do |f|
|
||||
= f.error_messages
|
||||
%fieldset.fieldSet
|
||||
.fieldSet__field
|
||||
= f.label :name, :class => 'fieldSet__label'
|
||||
.fieldSet__input= f.text_field :name, :autofocus => true, :class => 'input input--text'
|
||||
.fieldSet__field
|
||||
= f.label :url, :class => 'fieldSet__label'
|
||||
.fieldSet__input
|
||||
= f.text_field :url, :class => 'input input--text'
|
||||
%p.fieldSet__text
|
||||
Enter the full URL that we should POST your messages to. We recommend using https URLs here to
|
||||
ensure your data remains secure in transit.
|
||||
.fieldSet__field
|
||||
= f.label :encoding, :class => 'fieldSet__label'
|
||||
.fieldSet__input
|
||||
= f.select :encoding, HTTPEndpoint::ENCODINGS.map { |e| [t("http_endpoint_encodings.#{e.underscore}"), e] }, {}, :class => 'input input--select'
|
||||
%p.fieldSet__text
|
||||
You can choose how the data will be delivered to your server. We recommend receiving data as JSON which will be
|
||||
posted to your endpoint with an application/json content type. If you choose to use form data, you'll be able
|
||||
to read parameters as normal without parsing any JSON.
|
||||
|
||||
.fieldSet__field
|
||||
= f.label :format, :class => 'fieldSet__label'
|
||||
.fieldSet__input
|
||||
= f.select :format, HTTPEndpoint::FORMATS.map { |e| [t("http_endpoint_formats.#{e.underscore}"), e] }, {}, :class => 'input input--select'
|
||||
%p.fieldSet__text
|
||||
You can choose whether to receive the full raw message or whether you'd prefer to receive a individual properties
|
||||
for a message individually.
|
||||
.fieldSet__field
|
||||
= f.label :strip_replies, :class => 'fieldSet__label'
|
||||
.fieldSet__input
|
||||
= f.select :strip_replies, [["Send the full message as received", false], ["Try to seperate replies/signatures from plain body", true]], {}, :class => 'input input--select'
|
||||
%p.fieldSet__text
|
||||
If enabled, we'll try to remove the replies/signatures from the plain body and send them seperately to the rest of the body.
|
||||
This is useful if you just want to see the latest message in a thread.
|
||||
.fieldSet__field
|
||||
= f.label :include_attachments, "Attachments", :class => 'fieldSet__label'
|
||||
.fieldSet__input
|
||||
= f.select :include_attachments, [["Include attachment data", true], ["Don't include attachment data", false]], {}, :class => 'input input--select'
|
||||
%p.fieldSet__text
|
||||
You can choose whether or not attachment data will be delivered to your app. This only applies when the message is delivered
|
||||
as a hash (rather than the raw message - these will always have attachment data within).
|
||||
.fieldSet__field
|
||||
= f.label :timeout, :class => 'fieldSet__label'
|
||||
.fieldSet__input
|
||||
= f.text_field :timeout, :class => 'input input--text', :placeholder => "Default: 5"
|
||||
%p.fieldSet__text
|
||||
This is how long (in seconds) we should wait for your server to respond before giving up and trying again later. By default this is 5
|
||||
seconds. The maximum value is 60 seconds.
|
||||
|
||||
.fieldSetSubmit.buttonSet
|
||||
= f.submit @http_endpoint.new_record? ? "Create HTTP endpoint" : "Save HTTP endpoint", :class => 'button button--positive js-form-submit'
|
||||
.fieldSetSubmit__delete
|
||||
- if f.object.persisted?
|
||||
= link_to "Delete HTTP endpoint", [organization, @server, @http_endpoint], :remote => true, :class => 'button button--danger', :method => :delete, :data => {:confirm => "Are you sure you wish to delete this HTTP endpoint?\n\r#{pluralize @http_endpoint.routes.size, 'route'} that uses this endpoint will also be deleted."}
|
||||
|
||||
= hidden_field_tag 'return_to', params[:return_to]
|
||||
= hidden_field_tag 'return_notice', params[:return_notice]
|
||||
11
app/views/http_endpoints/edit.html.haml
Normal file
11
app/views/http_endpoints/edit.html.haml
Normal file
@@ -0,0 +1,11 @@
|
||||
- page_title << @server.name
|
||||
- page_title << "Routing"
|
||||
- page_title << "HTTP Endpoints"
|
||||
- page_title << "Edit"
|
||||
|
||||
= render 'servers/sidebar', :active_server => @server
|
||||
= render 'servers/header', :active_nav => :routing
|
||||
= render 'routes/header', :active_nav => :http_endpoints
|
||||
.pageContent.pageContent--compact
|
||||
= render 'form'
|
||||
|
||||
38
app/views/http_endpoints/index.html.haml
Normal file
38
app/views/http_endpoints/index.html.haml
Normal file
@@ -0,0 +1,38 @@
|
||||
- page_title << @server.name
|
||||
- page_title << "Routing"
|
||||
- page_title << "HTTP Endpoints"
|
||||
|
||||
= render 'servers/sidebar', :active_server => @server
|
||||
= render 'servers/header', :active_nav => :routing
|
||||
= render 'routes/header', :active_nav => :http_endpoints
|
||||
.pageContent.pageContent--compact
|
||||
|
||||
- if @http_endpoints.empty?
|
||||
.noData.noData--cock.noData--clean
|
||||
%h2.noData__title Oh cock! There aren't any HTTP endpoints yet.
|
||||
%p.noData__text
|
||||
HTTP endpoints are essentially URLs that you'd like incoming e-mails
|
||||
to be delivered to. Once you've added some endpoints, you can route messages
|
||||
to them by creating #{link_to 'routes', [organization, @server, :routes], :class => 'u-link'}.
|
||||
%p.noData__button
|
||||
= link_to "Add your first HTTP endpoint", [:new, organization, @server, :http_endpoint], :class => 'button button--positive'
|
||||
|
||||
- else
|
||||
|
||||
%ul.endpointList.u-margin
|
||||
- for endpoint in @http_endpoints
|
||||
%li.endpointList__item
|
||||
= link_to [:edit, organization, @server, endpoint], :class => 'endpointList__link' do
|
||||
.endpointList__main
|
||||
%p.endpointList__name= endpoint.name
|
||||
%p.endpointList__url= endpoint.url
|
||||
%ul.endpointList__details
|
||||
%li.endpointList__detailItem= t("http_endpoint_encodings.#{endpoint.encoding.underscore}")
|
||||
%li.endpointList__detailItem= t("http_endpoint_formats.#{endpoint.format.underscore}")
|
||||
%li.endpointList__detailItem
|
||||
- if endpoint.last_used_at
|
||||
Last used #{distance_of_time_in_words_to_now endpoint.last_used_at} ago
|
||||
- else
|
||||
Not used yet
|
||||
|
||||
%p.u-center= link_to "Add another HTTP endpoint", [:new, organization, @server, :http_endpoint], :class => 'button button--positive'
|
||||
11
app/views/http_endpoints/new.html.haml
Normal file
11
app/views/http_endpoints/new.html.haml
Normal file
@@ -0,0 +1,11 @@
|
||||
- page_title << @server.name
|
||||
- page_title << "Routing"
|
||||
- page_title << "HTTP Endpoints"
|
||||
- page_title << "New"
|
||||
|
||||
= render 'servers/sidebar', :active_server => @server
|
||||
= render 'servers/header', :active_nav => :routing
|
||||
= render 'routes/header', :active_nav => :http_endpoints
|
||||
.pageContent.pageContent--compact
|
||||
= render 'form'
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم