Edit template for controller - Refine params copy and bring DB opens up to spec with UTF8

This commit is contained in:
2025-10-06 10:57:00 +01:00
parent 29f8de63fd
commit ecb846fc6c
119 changed files with 10059 additions and 36 deletions

View File

@@ -0,0 +1,78 @@
% layout "AdminLTE", title => "Sme server 2 - proxy";
% content_for "module" => begin
<div class="card-body">
% if (config->{debug} == 1) {
<pre>
<%= dumper $c->current_route %>
<%= dumper $prx_datas->{http_proxy_status} %>
<%= dumper $prx_datas->{smtp_proxy_status} %>
</pre>
% }
<h1><%= $title %></h1>
<br>
<%= $modul %>
<form action="/smanager/hostentriesd" method="POST">
<br>
<div>
<%=l "prx_HTTP_PROXY_STATUS_DESCRIPTION" %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%=l "prx_HTTP_PROXY_STATUS_LABEL" %>
</div>
<div class="col-auto">
% param "http_proxy_status" => $prx_datas->{http_proxy_status} unless param "http_proxy_status";
<%= select_field "http_proxy_status" => [[ (l "ENABLED") => "enabled"], [ (l "DISABLED") => "disabled"]], class => "form-select" %>
</div>
</div>
% if ( $prx_datas->{smtp_proxy_status} ) {
<br>
<div>
<%=l "prx_SMTP_PROXY_STATUS_DESCRIPTION" %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%=l "prx_SMTP_PROXY_STATUS_LABEL" %>
</div>
<div class="col-auto">
% param "smtp_proxy_status" => $prx_datas->{smtp_proxy_status} unless param "smtp_proxy_status";
<%= select_field "smtp_proxy_status" => [[ (l "ENABLED") => "transparent"], [ (l "DISABLED") => "disabled"], [ (l "Blocked") => "blocked"]], default => $prx_datas->{smtp_proxy_status} , class => "form-select" %>
</div>
</div>
% }
<br>
% my $btn = l("SAVE");
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
</div>
</div>
</form>
</div>
%end

View File

@@ -0,0 +1,43 @@
% layout "default", title => "Sme server 2 - proxy";
% content_for "module" => begin
<div id="module" class="module proxy-panel">
%if (config->{debug} == 1) {
<p>(DBG)route: <%= $c->current_route %><br>
(DBG)ht stat: <%= $prx_datas->{http_proxy_status}%> <br>
(DBG)sm stat: <%=$prx_datas->{smtp_proxy_status} %>
</p>
%}
<h1><%= $title %></h1>
<br>
<%= $modul %>
<% my $btn = l("SAVE"); %>
%= form_for "proxy" => (method => "POST") => begin
<p>
%=l "prx_HTTP_PROXY_STATUS_DESCRIPTION"
<br><br>
<span class=label>
%=l "prx_HTTP_PROXY_STATUS_LABEL"
</span><span class=data>
% param "http_proxy_status" => $prx_datas->{http_proxy_status} unless param "http_proxy_status";
%= select_field "http_proxy_status" => [[ (l "ENABLED") => "enabled"], [ (l "DISABLED") => "disabled"]], class => "input", id => "htproxstat"
</span>
</p>
%if ( $prx_datas->{smtp_proxy_status} ) {
<p>
%=l "prx_SMTP_PROXY_STATUS_DESCRIPTION"
<br><br>
<span class=label>
%=l "prx_SMTP_PROXY_STATUS_LABEL"
</span><span class=data>
% param "smtp_proxy_status" => $prx_datas->{smtp_proxy_status} unless param "smtp_proxy_status";
%= select_field "smtp_proxy_status" => [[ (l "ENABLED") => "transparent"], [ (l "DISABLED") => "disabled"], [ (l "Blocked") => "blocked"]], class => "input", id => "smproxstat", default => $prx_datas->{smtp_proxy_status}
<br><br>
</span>
</p>
%}
%= submit_button "$btn", class => "action"
% end
</div>
%end

View File

@@ -0,0 +1 @@
'Proxy settings' => 'Proxy settings',

View File

@@ -0,0 +1,30 @@
#
# Lex file for Proxy generated on 2025-07-17 09:52:33
#
'Proxy settings' => 'Proxy settings',
'prx_ERR_NO_SQUID_REC' => 'ERROR: There is no squid record in the configuration database.',
'prx_ERR_PROXY_UPDATE_FAILED' => 'ERROR: The proxy-update event returned an error.',
'prx_FIRST_PAGE_DESCRIPTION' => 'This page allows configuration of the server"s
proxy settings.
The server includes a transparent proxy and cache for
HTTP traffic. This is enabled by default, but not enforced
if the server is in &quot;serveronly&quot; mode.
If this server is acting as an e-mail server, connections
from local network clients to external SMTP servers
will default to being redirected to the local e-mail server.',
'prx_HTTP_PROXY_STATUS_DESCRIPTION' => 'The server"s HTTP proxy works to reduce overall uplink usage by
caching recently-visited pages. It is transparent to web browsers
using this server as their gateway. Enable or disable this proxy
with the following toggle.',
'prx_HTTP_PROXY_STATUS_LABEL' => 'HTTP proxy status',
'prx_SMTP_PROXY_STATUS_DESCRIPTION' => 'The server"s transparent SMTP proxy works to reduce virus traffic
from infected client hosts by forcing all outgoing SMTP traffic
through this server if set to "enabled".
If you wish to use an alternate SMTP server, and this server is
your gateway to it, set this proxy to "disabled". Setting the
proxy to "blocked" prevents all SMTP traffic to other servers,
this is the default. The proxy only intercepts/blocks normal smtp
(port 25) traffic.',
'prx_SMTP_PROXY_STATUS_LABEL' => 'SMTP proxy status',
'prx_SUCCESS' => 'The new proxy settings were applied successfully.',
'prx_TITLE' => 'Proxy settings',