* Mon Mar 17 2025 Brian Read <brianr@koozali.org> 11.0.0-67.sme
- re-write qmailanalog for postfix [SME: 12951] - Clean up backup.pm - Enhance module panel - used by mail log analysis and Licence display
This commit is contained in:
43
root/usr/share/smanager/themes/default/public/css/module.css
Normal file
43
root/usr/share/smanager/themes/default/public/css/module.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/* General styles for the module panel */
|
||||
#module {
|
||||
padding: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 10px;
|
||||
background-color: #f9f9f9;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Debug information styling */
|
||||
#module p {
|
||||
font-family: monospace;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#module pre {
|
||||
background-color: #eee;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* Error message styling */
|
||||
.sme-error {
|
||||
color: #d9534f;
|
||||
font-weight: bold;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* Title styling */
|
||||
#module h1 {
|
||||
font-family: Arial, sans-serif;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* Content styling */
|
||||
.module-content {
|
||||
font-family: Georgia, serif;
|
||||
font-size: 13px;
|
||||
line-height: 1.2;
|
||||
color: #555;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const analysisType = document.getElementById('analysis_type');
|
||||
const messageIdGroup = document.getElementById('message_id_group');
|
||||
const emailAddressGroup = document.getElementById('email_address_group');
|
||||
|
||||
// Initially hide both controls
|
||||
messageIdGroup.style.display = 'none';
|
||||
emailAddressGroup.style.display = 'none';
|
||||
|
||||
analysisType.addEventListener('change', function() {
|
||||
// Hide both controls first
|
||||
messageIdGroup.style.display = 'none';
|
||||
emailAddressGroup.style.display = 'none';
|
||||
|
||||
// Show the relevant control based on the selected option
|
||||
switch(this.value) {
|
||||
case 'trace_message':
|
||||
messageIdGroup.style.display = 'block';
|
||||
break;
|
||||
case 'user_activity':
|
||||
emailAddressGroup.style.display = 'block';
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
@@ -1,20 +1,27 @@
|
||||
% layout 'default', title => "Sme server 2 - module";
|
||||
|
||||
% content_for 'module' => begin
|
||||
|
||||
%= stylesheet '/css/module.css'
|
||||
<div id='module' class='module module-panel'>
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
</p>
|
||||
<p>
|
||||
<strong>Debug Info:</strong>
|
||||
<pre><%= dumper $c->current_route %></pre>
|
||||
</p>
|
||||
% }
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
</div>
|
||||
%}
|
||||
<h1> <%=$title %></h1><br>
|
||||
%= $c->render_to_string( inline => stash 'modul' )
|
||||
|
||||
% if (stash 'error') {
|
||||
<div class="sme-error">
|
||||
<strong>Error:</strong><br>
|
||||
<%= $c->render_to_string(inline => stash 'error') %>
|
||||
</div>
|
||||
% }
|
||||
|
||||
<h1><%= $title %></h1>
|
||||
|
||||
<div class="module-content">
|
||||
<%= $c->render_to_string(inline => stash 'modul') %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
%end
|
||||
% end
|
@@ -1,6 +1,6 @@
|
||||
% layout 'default', title => "Sme server 2 - qmailanalog";
|
||||
|
||||
% content_for 'module' => begin
|
||||
%= javascript '/js/qmailanalog.js'
|
||||
<div id='module' class='module qmailanalog-panel'>
|
||||
%if (config->{debug} == 1) {
|
||||
<p>
|
||||
@@ -11,17 +11,34 @@
|
||||
<br>
|
||||
<%= $modul %>
|
||||
<% my $btn = l('qma_GENERATE_REPORT'); %>
|
||||
|
||||
%= form_for 'qmailanalog' => (method => 'POST') => begin
|
||||
<p>
|
||||
<span class=label>
|
||||
%=l 'qma_REPORT_TYPE'
|
||||
</span><span class=data>
|
||||
<!-- (to be sorted) -->
|
||||
%= select_field 'report_type' => $c->reportType_list()
|
||||
</span>
|
||||
</p>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
<p>
|
||||
<span class=label>
|
||||
%=l 'qma_REPORT_TYPE'
|
||||
</span><span class=data>
|
||||
<!-- (to be sorted) -->
|
||||
%= select_field 'report_type' => $c->reportType_list(), id => 'analysis_type'
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<!--And optional parameters, depending on the choice.-->
|
||||
<div id="message_id_group">
|
||||
<span class=label>
|
||||
%= label_for message_id => 'Message ID:'
|
||||
</span><span class=data>
|
||||
%= text_field 'message_id', placeholder => 'Enter Postfix Message ID', id => 'message_id_group'
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="email_address_group">
|
||||
<span class=label>
|
||||
%= label_for email_address => 'Email Address:'
|
||||
</span><span class=data>
|
||||
%= email_field 'email_address', placeholder => 'Enter email address', id => 'email_address_group'
|
||||
</span>
|
||||
</div>
|
||||
|
||||
%= submit_button "$btn", class => 'action'
|
||||
% end
|
||||
</div>
|
||||
%end
|
Reference in New Issue
Block a user