Compare commits

..

4 Commits

Author SHA1 Message Date
5c227a2032 * Mon Nov 03 2025 Brian Read <brianr@koozali.org> 11.0.0-125.sme
- Arrange that Macaddress, InternalIP and comment cleared out when host entry switched to self [SME: 13207]
2025-11-03 11:34:55 +00:00
8e270ef3fd * Fri Oct 24 2025 Brian Read <brianr@koozali.org> 11.0.0-124.sme
- Adjust CSS for logout button to remove overlap of border and rounding [SME: 13247]
2025-10-24 12:41:51 +01:00
a04097bf5a * Fri Oct 24 2025 Brian Read <brianr@koozali.org> 11.0.0-123.sme
- Take out references to js/jquery files now incorporated in the datatables.min.js [SME:13253]
2025-10-24 10:50:46 +01:00
9437dd792a html comment closure leaks onto panel 2025-10-22 09:44:15 +01:00
9 changed files with 59 additions and 27 deletions

View File

@@ -116,15 +116,38 @@ sub do_update {
$ndb = esmith::NetworksDB::UTF8->open || die "Couldn't open networks db";
my $notif = '';
my $result = '';
$hos_datas{'name'} = lc $c->param('Name');
$hos_datas{'domain'} = lc $c->param('Domain');
$hos_datas{'hostname'} = $c->param('Hostname');
$hos_datas{'comment'} = $c->param('Comment');
$hos_datas{'hosttype'} = $c->param('Hosttype');
$hos_datas{'internalip'} = $c->param('Internalip');
$hos_datas{'macaddress'} = $c->param('Macaddress');
$hos_datas{'externalip'} = $c->param('Externalip');
my $hostname = "$hos_datas{'name'}.$hos_datas{'domain'}";
# Fetch parameters with forced scalar context and default empty string if undefined
$hos_datas{'name'} = lc(scalar $c->param('Name') // '');
$hos_datas{'domain'} = lc(scalar $c->param('Domain') // '');
$hos_datas{'hostname'} = scalar $c->param('Hostname') // '';
$hos_datas{'comment'} = scalar $c->param('Comment') // '';
$hos_datas{'hosttype'} = scalar $c->param('Hosttype') // '';
$hos_datas{'internalip'} = scalar $c->param('Internalip') // '';
$hos_datas{'externalip'} = scalar $c->param('Externalip') // '';
my $hostname = "$hos_datas{'name'}.$hos_datas{'domain'}";
if (my $hostrec = $hdb->get($hostname)) {
my $hosttype = $hostrec->prop('HostType') // '';
#$c->app->log->info("$hosttype $hos_datas{'hosttype'} $hos_datas{'comment'} $hostrec->prop('Comment')");
# Clear comment if hosttype changes to 'self' and comment was not intentionally changed
if ($hosttype ne 'Self'
&& $hos_datas{'hosttype'} eq 'Self'
&& $hos_datas{'comment'} eq $hostrec->prop('Comment')) {
$hos_datas{'comment'} = '';
}
}
# Clear MAC address if hosttype is 'self', otherwise get from param
if ($hos_datas{'hosttype'} eq 'Self') {
$hos_datas{'macaddress'} = '';
$hos_datas{'internalip'} = '';
#$c->app->log->info("yes $hos_datas{'hosttype'} $hos_datas{'macaddress'}");
} else {
$hos_datas{'macaddress'} = scalar $c->param('Macaddress') // '';
#$c->app->log->info("no $hos_datas{'hosttype'} $hos_datas{'macaddress'}");
}
if ($trt eq 'ADD') {
$hos_datas{'hostname'} = $hostname;
@@ -521,4 +544,4 @@ sub must_be_local {
# Not OK. The IP is not on any of our local networks.
return $c->l('hos_ERR_IP_NOT_LOCAL');
} ## end sub must_be_local
1;
1;

View File

@@ -63,7 +63,7 @@
position: absolute;
left: 7%;
transform: translateX(-50%);
background-color: #4caf50b8;
background-color: #4caf50;
color: white !important;
border: none;
padding: 8px;

View File

@@ -1 +1 @@
<script src='js/jquery.min.js' type='text/javascript'></script>
<!--<script src='js/jquery.min.js' type='text/javascript'></script>-->

View File

@@ -21,12 +21,12 @@
%= javascript '/js/datatables.min.js'
%= stylesheet '/js/jquery-ui.min.css'
%= javascript '/js/jquery-ui.min.js'
%= javascript '/js/dataTables.buttons.min.js'
%= javascript '/js/jszip.min.js'
%= javascript '/js/pdfmake.min.js'
%#= javascript '/js/dataTables.buttons.min.js'
%#= javascript '/js/jszip.min.js'
%#= javascript '/js/pdfmake.min.js'
%= javascript '/js/vfs_fonts.js'
%= javascript '/js/buttons.html5.min.js'
%= javascript '/js/buttons.print.min.js'
%#= javascript '/js/buttons.html5.min.js'
%#= javascript '/js/buttons.print.min.js'
%= javascript '/js/flag-by-locale.js'
%= javascript '/js/sme-password.js'

View File

@@ -4,7 +4,7 @@
% if ( not defined $c->session->{username} ) {
<a class="login-button no-visited-state" target="_parent" href="/smanager/login">Login</a>
% } else {
<!--><button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a></button>-->
<!--<button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a></button>xxx-->
<a class="login-button no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a>
% }
<div id="flag-container" class = "flag-style">

View File

@@ -2,14 +2,14 @@
% my %nav = %{ SrvMngr->getNavigation( $c->languages(), 'N' ) };
<div id='navmenu'>
<!-- <a href='#' id='tognav' class='menu-title'>NAVIGATION</a> -->
<!-- <a href='#' id='tognav' class='menu-title'>NAVIGATION</a> ffff-->
<div id='menunav'>
% my $cc = 200;
% foreach my $h (sort { ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'})
% <=> ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav) {
%
<!-- div class='section section-title'><%= $h %></div -->
<!-- div class='section section-title'><%= $h %></div gggg-->
<div><a href='#' class='section section-title'><%= $h %></a></div>
<div class='togms'>
% my ( $classNew, $target, $href ) = '';
@@ -33,4 +33,4 @@
% }
</div>
</div>
</div>

View File

@@ -2,7 +2,7 @@
% my %nav = %{ SrvMngr->getNavigation( $c->languages(), 'A' ) };
<div id='navigat2'>
<!-- ><div><a href='#' id='togadm' class='menu-title'>ADMINISTRATION</a></div> -->
<!-- <div><a href='#' id='togadm' class='menu-title'>ADMINISTRATION</a></div> dddd-->
<div id='menuadm'>
% my $cc = 100;
@@ -35,4 +35,4 @@
% }
</div>
</div>
</div>

View File

@@ -9,7 +9,7 @@
% my $cc = 300;
% foreach my $h (sort { ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'})
% <=> ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav) {
<!-- div class='section'><%= $h %></div -->
<!-- div class='section'><%= $h %></div> nnnn-->
% my ( $classNew, $target, $href ) = '';
% foreach (sort { $a->{'WEIGHT'} <=> $b->{'WEIGHT'} } @{$nav{$h}{'DESCRIPTIONS'}}) {
% next if ( $_->{'MENUCAT'} ne 'A' && $_->{'MENUCAT'} ne 'U' ); # menu User
@@ -29,4 +29,4 @@
% }
</div>
</div>
</div>

View File

@@ -2,7 +2,7 @@ Summary: Sme Server Configuration : Manager 2
%define name smeserver-manager
Name: %{name}
%define version 11.0.0
%define release 122
%define release 125
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -39,7 +39,7 @@ Requires: perl(Mojo::JWT) >= 0.08-1
#Requires: perl(Time::TAI64) >= 2.11
Requires: perl(Data::Validate::IP)
Requires: mutt >= 1.5.21
Requires: smeserver-manager-jsquery >= 1.0
Requires: smeserver-manager-jsquery >= 11.0.0-11
Requires: smeserver-certificates >= 11.0
#Requires: js-jquery > 2.2.4-3 (optional)
@@ -147,6 +147,15 @@ true
%defattr(-,root,root)
%changelog
* Mon Nov 03 2025 Brian Read <brianr@koozali.org> 11.0.0-125.sme
- Arrange that Macaddress, InternalIP and comment cleared out when host entry switched to self [SME: 13207]
* Fri Oct 24 2025 Brian Read <brianr@koozali.org> 11.0.0-124.sme
- Adjust CSS for logout button to remove overlap of border and rounding [SME: 13247]
* Fri Oct 24 2025 Brian Read <brianr@koozali.org> 11.0.0-123.sme
- Take out references to js/jquery files now incorporated in the datatables.min.js [SME:13253]
* Tue Oct 21 2025 Brian Read <brianr@koozali.org> 11.0.0-122.sme
- Correct code to only show user panels when AdminPanels property is empty or non existent [SME: 13082]