From 2d3fabcc5b6c529dde77e1df1a43f5723da60a19 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Wed, 10 Apr 2024 08:41:31 +0100 Subject: [PATCH] Lex file creation --- Targets/Nfsshare.pm | 4 +- Targets/_nfs_PARAMS.html.ep | 26 ++++---- Targets/nfsshare_en.lex | 20 +++++++ Templates/controller.pm.tem | 2 +- Templates/html_controls.html.ep.xml | 20 +++---- sm2gen-ImportJSON5.py | 92 +++++++++++++++++++++++++---- 6 files changed, 128 insertions(+), 36 deletions(-) create mode 100644 Targets/nfsshare_en.lex diff --git a/Targets/Nfsshare.pm b/Targets/Nfsshare.pm index 18b23bb..67de87a 100644 --- a/Targets/Nfsshare.pm +++ b/Targets/Nfsshare.pm @@ -87,12 +87,12 @@ sub do_update { if ($trt eq 'PARAMS'){ #Validate for panel PARAMS - # set $ret = $c->l(''Error message') if invalid' + # set $ret = $c->l('Error message') if invalid' } if ($trt eq 'TABLE'){ #Validate for panel TABLE - # set $ret = $c->l(''Error message') if invalid' + # set $ret = $c->l('Error message') if invalid' } if ($ret ne "ok"){ diff --git a/Targets/_nfs_PARAMS.html.ep b/Targets/_nfs_PARAMS.html.ep index 1d901a5..32d994d 100644 --- a/Targets/_nfs_PARAMS.html.ep +++ b/Targets/_nfs_PARAMS.html.ep @@ -15,13 +15,13 @@ %# Inputs etc in here.

Manage NFS Ibay settings:

These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays/$(STASH:ibayname)/files

- %=l('Information Bay name'), class => 'label' + %=l('nfs_Information Bay name'), class => 'label' %= stash("IbayName"), class => 'data'

- %=l('Share owner Group') + %=l('nfs_Share owner Group') % my @ShareOwnerGrp_options = ['Write = admin, Read = group', 'Write = group, Read = everyone', 'Write = group, Read = group']; % param 'ShareOwnerGrp' => $nfs_data->{ShareOwnerGrp} unless param 'ShareOwnerGrp'; @@ -29,7 +29,7 @@

- %=l('Enable the NFS Share') + %=l('nfs_Enable the NFS Share') % my @EnableNFSshare_options = ['Disabled', 'Enabled']; % param 'EnableNFSshare' => $nfs_data->{EnableNFSshare} unless param 'EnableNFSshare'; @@ -37,7 +37,7 @@

- %=l('EnableShare on local network') + %=l('nfs_EnableShare on local network') % my @ShareOnLocalNetwork_options = ['Disabled', 'Enabled']; % param 'ShareOnLocalNetwork' => $nfs_data->{ShareOnLocalNetwork} unless param 'ShareOnLocalNetwork'; @@ -45,14 +45,14 @@

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).

- %=l('NFS Client(s) allowed') + %=l('nfs_NFS Client(s) allowed') % param 'NFSClientsAllowed' => $nfs_data->{NFSClientsAllowed} unless param 'NFSClientsAllowed'; %= text_area 'NFSClientsAllowed', cols=>40, rows=>5

- %=l('File system permissions') + %=l('nfs_File system permissions') % my @FileSystemPermissions_options = ['Read only', 'Read and Write']; % param 'FileSystemPermissions' => $nfs_data->{FileSystemPermissions} unless param 'FileSystemPermissions'; @@ -60,7 +60,7 @@

- %=l('Write (a)synchronously.') + %=l('nfs_Write (a)synchronously.') % my @WriteAsync_options = ['Synchronous', 'Asynchronous']; % param 'WriteAsync' => $nfs_data->{WriteAsync} unless param 'WriteAsync'; @@ -68,7 +68,7 @@

- %=l('Delays the disk writings.') + %=l('nfs_Delays the disk writings.') % my @DelayWrite_options = ['Write delay', 'No write delay']; % param 'DelayWrite' => $nfs_data->{DelayWrite} unless param 'DelayWrite'; @@ -76,7 +76,7 @@

- %=l('Squash the power of users.') + %=l('nfs_Squash the power of users.') % my @Squash_options = ['All users squash', 'No root squash', 'root squash']; % param 'Squash' => $nfs_data->{Squash} unless param 'Squash'; @@ -84,7 +84,7 @@

- %=l('Browse the parent folders') + %=l('nfs_Browse the parent folders') % my @BrowseParents_options = ['Hide folder', 'Show folder']; % param 'BrowseParents' => $nfs_data->{BrowseParents} unless param 'BrowseParents'; @@ -92,7 +92,7 @@

- %=l('Requests on secure ports.') + %=l('nfs_Requests on secure ports.') % my @SecurePorts_options = ['Secure', 'Insecure']; % param 'SecurePorts' => $nfs_data->{SecurePorts} unless param 'SecurePorts'; @@ -100,14 +100,14 @@

Set the uid and gid if you want all requests appear to be from one user or one group, otherwise leave blank.

- %=l('Set the UID.') + %=l('nfs_Set the UID.') % param 'SetUID' => $nfs_data->{SetUID} unless param 'SetUID'; %= text_field 'SetUID', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'SetUID'

- %=l('Set the GID.') + %=l('nfs_Set the GID.') % param 'SetGID' => $nfs_data->{SetGID} unless param 'SetGID'; %= text_field 'SetGID', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'SetGID' diff --git a/Targets/nfsshare_en.lex b/Targets/nfsshare_en.lex new file mode 100644 index 0000000..8b34ad9 --- /dev/null +++ b/Targets/nfsshare_en.lex @@ -0,0 +1,20 @@ +'nfs_APPLY' => 'APPLY' +'nfs_Save' => 'Save' +'nfs_Squash the power of users.' => 'Squash the power of users.' +'nfs Hello PARAMS' => 'Hello PARAMS' +'nfs_Requests on secure ports.' => 'Requests on secure ports.' +'nfs_Error message' => 'Error message' +'nfs_Enable the NFS Share' => 'Enable the NFS Share' +'nfs_NFS data share' => 'NFS data share' +'nfs_Delays the disk writings.' => 'Delays the disk writings.' +'nfs_Browse the parent folders' => 'Browse the parent folders' +'nfs_Write (a)synchronously.' => 'Write (a)synchronously.' +'nfs_NFS Client(s) allowed' => 'NFS Client(s) allowed' +'nfs_EnableShare on local network' => 'EnableShare on local network' +'nfs_Information Bay name' => 'Information Bay name' +'nfs_ok message' => 'ok message' +'nfs_Set the GID.' => 'Set the GID.' +'nfs_Share owner Group' => 'Share owner Group' +'nfs Hello TABLE' => 'Hello TABLE' +'nfs_Set the UID.' => 'Set the UID.' +'nfs_File system permissions' => 'File system permissions' diff --git a/Templates/controller.pm.tem b/Templates/controller.pm.tem index d76f8c1..6f6daf1 100644 --- a/Templates/controller.pm.tem +++ b/Templates/controller.pm.tem @@ -87,7 +87,7 @@ sub do_update { if ($trt eq '${condition}'){ #Validate for panel ${condition} - # set $ret = $c->l(''Error message') if invalid' + # set $ret = $c->l('Error message') if invalid' } if ($ret ne "ok"){ diff --git a/Templates/html_controls.html.ep.xml b/Templates/html_controls.html.ep.xml index 684a20e..1aa69d3 100644 --- a/Templates/html_controls.html.ep.xml +++ b/Templates/html_controls.html.ep.xml @@ -1,7 +1,7 @@ - %=l('${Label}'), class => 'label' + %=l('${prefix}_${Label}'), class => 'label' %= ${Value}, class => 'data'

@@ -9,7 +9,7 @@ - %=l('${Label}') + %=l('${prefix}_${Label}') % my @${Name}_options = ${Value}; % param '${Name}' => $$${prefix}_data->{${Name}} unless param '${Name}'; @@ -19,7 +19,7 @@