From b96239639c6e170f2497e09eb2836b022597c8fa Mon Sep 17 00:00:00 2001 From: Brian Read Date: Fri, 26 Apr 2024 09:26:38 +0100 Subject: [PATCH] Added version to all files, create .new Custom file if already there --- Targets/Nfsshare-Custom.pm | 2 ++ Targets/Nfsshare-Custom.pm.new | 49 +++++++++++++++++++++++++++++ Targets/nfsshare_en.lex | 30 +++++++++--------- Templates/controller.pm.tem | 4 ++- Templates/custom.pm.tem | 8 ++--- Templates/html_controls.html.ep.xml | 2 +- Templates/layout.html.ep.tem | 3 ++ Templates/partial.html.ep.tem | 3 ++ sm2gen-ImportJSON5.py => sm2gen.py | 27 ++++++++++++---- 9 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 Targets/Nfsshare-Custom.pm.new rename sm2gen-ImportJSON5.py => sm2gen.py (95%) diff --git a/Targets/Nfsshare-Custom.pm b/Targets/Nfsshare-Custom.pm index 41b9843..9d489c2 100644 --- a/Targets/Nfsshare-Custom.pm +++ b/Targets/Nfsshare-Custom.pm @@ -2,6 +2,8 @@ # Routines to be editted by the developer to provide validation for parameters # and provison of the control data for table(s) # +# Generated by SM2Gen version:${version} +# #$cdb=$main::cdb; #$adb=$main::adb; #$ndb=$main::ndb; diff --git a/Targets/Nfsshare-Custom.pm.new b/Targets/Nfsshare-Custom.pm.new new file mode 100644 index 0000000..e56af02 --- /dev/null +++ b/Targets/Nfsshare-Custom.pm.new @@ -0,0 +1,49 @@ +# +# Routines to be editted by the developer to provide validation for parameters +# and provison of the control data for table(s) +# +#$cdb=$main::cdb; +#$adb=$main::adb; +#$ndb=$main::ndb; +#$hdb=$main::hdb; +#$ddb=$main::ddb; + +use esmith::util; +use esmith::HostsDB; +use esmith::AccountsDB; +use esmith::NetworksDB; +use esmith::HostsDB; +use esmith::DomainsDB; + + +#The most common ones +our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); +our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db"); +our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db"); +our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db"); +our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); + +# Validation routines - parameters for each panel + + sub validate_PARAMS { + $ret = 'ok'; + return $ret; + } + + sub validate_TABLE { + $ret = 'ok'; + return $ret; + } + + +# Get control data for tables(s) + +sub get_ibays { + return [] +} + +1; + + + + diff --git a/Targets/nfsshare_en.lex b/Targets/nfsshare_en.lex index 1cd7e23..60a13a1 100644 --- a/Targets/nfsshare_en.lex +++ b/Targets/nfsshare_en.lex @@ -1,22 +1,22 @@ -'nfs_These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files' => 'These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files' -'nfs_For writing permissions,allowing the root user and using insecure ports, you must configure a list of one IP per line, being part of the local network(s).' => 'For writing permissions,allowing the root user and using insecure ports, you must configure a list of one IP per line, being part of the local network(s).' -'nfs_Share owner Group' => 'Share owner Group' -'nfs_Squash the power of users' => 'Squash the power of users' -'nfs_$thispanel successfull message' => '$thispanel successfull message' -'nfs Hello TABLE' => 'Hello TABLE' -'nfs_Set the UID.' => 'Set the UID.' -'nfs_NFS Client(s) allowed' => 'NFS Client(s) allowed' -'nfs Hello PARAMS' => 'Hello PARAMS' +'nfs_Delays the disk writing' => 'Delays the disk writing' 'nfs_Save' => 'Save' 'nfs_Set the uid and gid if you want all requests appear to be from one user or one group, otherwise leave blank' => 'Set the uid and gid if you want all requests appear to be from one user or one group, otherwise leave blank' -'nfs_EnableShare on local network' => 'EnableShare on local network' -'nfs_Set the GID.' => 'Set the GID.' -'nfs_APPLY' => 'APPLY' 'nfs_NFS data share' => 'NFS data share' -'nfs_File system permissions' => 'File system permissions' -'nfs_Requests on secure ports' => 'Requests on secure ports' +'nfs_$thispanel successfull message' => '$thispanel successfull message' +'nfs Hello TABLE' => 'Hello TABLE' +'nfs_For writing permissions,allowing the root user and using insecure ports, you must configure a list of one IP per line, being part of the local network(s).' => 'For writing permissions,allowing the root user and using insecure ports, you must configure a list of one IP per line, being part of the local network(s).' 'nfs_Write (a)synchronously' => 'Write (a)synchronously' -'nfs_Delays the disk writing' => 'Delays the disk writing' +'nfs_Share owner Group' => 'Share owner Group' +'nfs_File system permissions' => 'File system permissions' +'nfs_EnableShare on local network' => 'EnableShare on local network' +'nfs_Squash the power of users' => 'Squash the power of users' +'nfs_Set the GID.' => 'Set the GID.' +'nfs_These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files' => 'These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files' 'nfs_Enable the NFS Share' => 'Enable the NFS Share' +'nfs_APPLY' => 'APPLY' +'nfs_Requests on secure ports' => 'Requests on secure ports' 'nfs_Browse the parent folders' => 'Browse the parent folders' +'nfs_NFS Client(s) allowed' => 'NFS Client(s) allowed' +'nfs Hello PARAMS' => 'Hello PARAMS' 'nfs_Information Bay name' => 'Information Bay name' +'nfs_Set the UID.' => 'Set the UID.' diff --git a/Templates/controller.pm.tem b/Templates/controller.pm.tem index 019955b..5a43452 100644 --- a/Templates/controller.pm.tem +++ b/Templates/controller.pm.tem @@ -1,5 +1,7 @@ package SrvMngr::Controller::${PackageName}; - +# +# Generated by SM2Gen version:${version} +# #---------------------------------------------------------------------- # heading : ${MenuHeading} # description : ${MenuDescription} diff --git a/Templates/custom.pm.tem b/Templates/custom.pm.tem index e7a98b6..49f1b4f 100644 --- a/Templates/custom.pm.tem +++ b/Templates/custom.pm.tem @@ -2,11 +2,9 @@ # Routines to be editted by the developer to provide validation for parameters # and provison of the control data for table(s) # -#$cdb=$main::cdb; -#$adb=$main::adb; -#$ndb=$main::ndb; -#$hdb=$main::hdb; -#$ddb=$main::ddb; +# +# Generated by SM2Gen version:${version} +# use esmith::util; use esmith::HostsDB; diff --git a/Templates/html_controls.html.ep.xml b/Templates/html_controls.html.ep.xml index ebf5512..d943a29 100644 --- a/Templates/html_controls.html.ep.xml +++ b/Templates/html_controls.html.ep.xml @@ -98,7 +98,7 @@ +
diff --git a/Templates/layout.html.ep.tem b/Templates/layout.html.ep.tem index e358431..6a43a90 100644 --- a/Templates/layout.html.ep.tem +++ b/Templates/layout.html.ep.tem @@ -1,4 +1,7 @@ % layout 'default', title => "Sme server 2 - ${MenuDescription}", share_dir => './'; +%# +%# Generated by SM2Gen version:${version} +%# % content_for 'module' => begin
diff --git a/Templates/partial.html.ep.tem b/Templates/partial.html.ep.tem index b820303..59ffa4e 100644 --- a/Templates/partial.html.ep.tem +++ b/Templates/partial.html.ep.tem @@ -1,3 +1,6 @@ +%# +%# Generated by SM2Gen version:${version} +%#
${ColHead}