From 3b6e1930a0f1fa46658b764e8d38871a29f5fbae Mon Sep 17 00:00:00 2001 From: Brian Read Date: Sat, 14 Sep 2024 18:08:48 +0100 Subject: [PATCH] Add in original html - play with sanitising paragraphs --- .../CreateStarterWebsite-Custom.pm.new | 63 +++++++++++ .../CreateStarterWebsite.pm | 2 +- .../createstarterwebsite.html.ep | 2 +- .../createstarterwebsite_en.lex | 18 +++- .../CreateStarterWebsite/csw_PARAMS.html.ep | 96 +++++++++++++++++ Targets/DiskUsage/diskusage_bg.lex | 11 -- Targets/DiskUsage/diskusage_de.lex | 11 -- Targets/DiskUsage/diskusage_dk.lex | 11 -- Targets/DiskUsage/diskusage_el.lex | 11 -- Targets/DiskUsage/diskusage_es.lex | 11 -- Targets/DiskUsage/diskusage_et.lex | 11 -- Targets/DiskUsage/diskusage_fr.lex | 11 -- Targets/DiskUsage/diskusage_hu.lex | 11 -- Targets/DiskUsage/diskusage_id.lex | 11 -- Targets/DiskUsage/diskusage_il.lex | 11 -- Targets/DiskUsage/diskusage_it.lex | 11 -- Targets/DiskUsage/diskusage_jp.lex | 11 -- .../Diskusage-Custom.pm | 2 +- Targets/Diskusage/Diskusage-Custom.pm.new | 79 ++++++++++++++ Targets/{DiskUsage => Diskusage}/Diskusage.pm | 2 +- .../diskusage.html.ep | 2 +- .../{DiskUsage => Diskusage}/diskusage_en.lex | 14 +-- .../du_PARAMS.html.ep} | 8 +- Templates/custom.pm.tem | 8 +- Templates/html_controls.html.ep.xml | 9 +- html/CreateStarterWebsite.html | 102 ++++++++++++++++++ html/CreateStarterWebsite.json5 | 61 +++++++++++ html/DiskUsage.html | 93 ++++++++++++++++ json5/CreateStarterWebsite.json5 | 19 ++-- sm1-html-2-json5.py | 17 ++- 30 files changed, 562 insertions(+), 167 deletions(-) create mode 100644 Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new create mode 100644 Targets/CreateStarterWebsite/csw_PARAMS.html.ep delete mode 100644 Targets/DiskUsage/diskusage_bg.lex delete mode 100644 Targets/DiskUsage/diskusage_de.lex delete mode 100644 Targets/DiskUsage/diskusage_dk.lex delete mode 100644 Targets/DiskUsage/diskusage_el.lex delete mode 100644 Targets/DiskUsage/diskusage_es.lex delete mode 100644 Targets/DiskUsage/diskusage_et.lex delete mode 100644 Targets/DiskUsage/diskusage_fr.lex delete mode 100644 Targets/DiskUsage/diskusage_hu.lex delete mode 100644 Targets/DiskUsage/diskusage_id.lex delete mode 100644 Targets/DiskUsage/diskusage_il.lex delete mode 100644 Targets/DiskUsage/diskusage_it.lex delete mode 100644 Targets/DiskUsage/diskusage_jp.lex rename Targets/{DiskUsage => Diskusage}/Diskusage-Custom.pm (98%) create mode 100644 Targets/Diskusage/Diskusage-Custom.pm.new rename Targets/{DiskUsage => Diskusage}/Diskusage.pm (99%) rename Targets/{DiskUsage => Diskusage}/diskusage.html.ep (97%) rename Targets/{DiskUsage => Diskusage}/diskusage_en.lex (100%) rename Targets/{DiskUsage/_du_PARAMS.html.ep => Diskusage/du_PARAMS.html.ep} (92%) create mode 100644 html/CreateStarterWebsite.html create mode 100644 html/CreateStarterWebsite.json5 create mode 100644 html/DiskUsage.html diff --git a/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new b/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new new file mode 100644 index 0000000..ff97552 --- /dev/null +++ b/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new @@ -0,0 +1,63 @@ +# +# Routines to be edited by the developer to provide validation for parameters +# and provison of the control data for table(s) +# +# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 17:41 +# + +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 { + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; + return $ret; + } + + +# Get control data for tables(s) + + +# Return hash with values from row in which link clicked on table + + sub get_selected_PARAMS { + my $c = shift; + my $selected = shift; #Parameter is name of selected row. + my $is_new_record = shift; #Indicates new record required (defaults) + my %ret = {}; + return $ret; + } + + +#after sucessful modify or create or whatever and submit then perfom (if the params validate) + + sub perform_PARAMS { + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; + return $ret; + } + + +sub create_link{ + # WIP + my ($c,$route, $panel, $index) = shift; + my $link = "$route?trt=$panel&Selected=$index"; + return $link; +} +1; diff --git a/Targets/CreateStarterWebsite/CreateStarterWebsite.pm b/Targets/CreateStarterWebsite/CreateStarterWebsite.pm index 5ecd91b..c809e82 100644 --- a/Targets/CreateStarterWebsite/CreateStarterWebsite.pm +++ b/Targets/CreateStarterWebsite/CreateStarterWebsite.pm @@ -1,6 +1,6 @@ package SrvMngr::Controller::CreateStarterWebsite; # -# Generated by version:SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-13 19:20 +# Generated by version:SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 17:41 # #---------------------------------------------------------------------- # heading : Miscellaneous diff --git a/Targets/CreateStarterWebsite/createstarterwebsite.html.ep b/Targets/CreateStarterWebsite/createstarterwebsite.html.ep index 8168f68..945609f 100644 --- a/Targets/CreateStarterWebsite/createstarterwebsite.html.ep +++ b/Targets/CreateStarterWebsite/createstarterwebsite.html.ep @@ -1,6 +1,6 @@ % layout 'default', title => "Sme server 2 - Create Starter Website", share_dir => './'; %# -%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-13 19:20 +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 17:41 %# % content_for 'module' => begin
diff --git a/Targets/CreateStarterWebsite/createstarterwebsite_en.lex b/Targets/CreateStarterWebsite/createstarterwebsite_en.lex index 6ffecb3..066c144 100644 --- a/Targets/CreateStarterWebsite/createstarterwebsite_en.lex +++ b/Targets/CreateStarterWebsite/createstarterwebsite_en.lex @@ -1,8 +1,16 @@ -'csw_APPLY' => 'Apply', -'csw_Do_you_wish_to_proceed?' => 'Do you wish to proceed?', -'csw_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful', -'csw_Manage_CreateStarterWebsite_settings:' => 'Manage CreateStarterWebsite settings:', +'csw_Do_not_use_this_optionif' => 'Do not use this optionif you have already customized your web site, Since it will overwrite the \'index. Htm\' file in your web site directory. ', +'csw_Second_header,_typically_used_for' => 'Second header, Typically used for short phrases such as \'For more information\' or \'To order our products\':', 'csw_Hello_PARAMS' => 'Hello PARAMS', -'csw_' => '', +'csw_To_create_a_simple_web' => 'To create a simple web page for your company, Fill in the fields below and click onCreate. ', +'csw_The_text_that_you_enter' => 'The text that you enter below will be line wrapped for a nicer appearance in your web page. Leave a blank line whenever you want to start a new paragraph. If you need to force a line break without starting a new paragraph (for example after each line of a mailing address), Then type the four-character sequence', 'csw_You_can_leave_any_field' => 'You can leave any field blank if you do not need it. ', +'csw_Text_following_first_header,_typically' => 'Text following first header, Typically used for a paragraph of marketing information. ', +'csw_Do_you_wish_to_proceed?' => 'Do you wish to proceed?', +'csw_Manage_CreateStarterWebsite_settings:' => 'Manage CreateStarterWebsite settings:', +'csw_When_you_create_this_web' => 'When you create this web page, The file \'index. Htm\' will be overwritten in your web site directory. ', +'csw_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful', 'csw_Create_Starter_Website' => 'Create Starter Website', +'csw_First_header,_typically_used_for' => 'First header, Typically used for short phrases such as \'Leader in the field of textile manufacturing\'', +'csw_' => '', +'csw_APPLY' => 'Apply', +'csw_Text_following_second_header,_typically' => 'Text following second header, Typically used for contact or ordering information:', diff --git a/Targets/CreateStarterWebsite/csw_PARAMS.html.ep b/Targets/CreateStarterWebsite/csw_PARAMS.html.ep new file mode 100644 index 0000000..d52fc06 --- /dev/null +++ b/Targets/CreateStarterWebsite/csw_PARAMS.html.ep @@ -0,0 +1,96 @@ +%# +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 17:41 +%# +
+ +

+ %= l('csw_Hello_PARAMS'); +

+ % my $btn = l('csw_APPLY'); + %= form_for "CreateStarterWebsited" => (method => 'POST') => begin + + % param 'trt' => $csw_data->{trt} unless param 'trt'; + %= hidden_field 'trt' => $csw_data->{trt} + %# Inputs etc in here. + +

<%=l('csw_Manage_CreateStarterWebsite_settings:')%>

+ +

+ %=l('csw_To_create_a_simple_web') +

+ +

+ %=l('csw_You_can_leave_any_field') +

+ +

+ %=l('csw_The_text_that_you_enter') +

+ +

+ %=l('csw_Do_not_use_this_optionif') +

+ +

+ %=l('csw_') + + %= +

+ +

+ %=l('csw_First_header,_typically_used_for') +

+ +

+ %=l('csw_') + + %= +

+ +

+ %=l('csw_Text_following_first_header,_typically') +

+ + + %=l('csw_') + + % param 'text1' => $csw_data->{text1} unless param 'text1'; + %= text_area 'text1', cols=>40, rows=>10 +
+ +

+ %=l('csw_Second_header,_typically_used_for') +

+ +

+ %=l('csw_') + + %= +

+ +

+ %=l('csw_Text_following_second_header,_typically') +

+ + + %=l('csw_') + + % param 'text2' => $csw_data->{text2} unless param 'text2'; + %= text_area 'text2', cols=>40, rows=>10 +
+ +

+ %=l('csw_When_you_create_this_web') +

+ +

+ %=l('csw_Do_you_wish_to_proceed?') +

+ + %# Probably finally by a submit. + %end +
diff --git a/Targets/DiskUsage/diskusage_bg.lex b/Targets/DiskUsage/diskusage_bg.lex deleted file mode 100644 index 2571dbb..0000000 --- a/Targets/DiskUsage/diskusage_bg.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Приложи", -'du_Usage' => "Употреба", -'du_Path' => "Път", -'du_Wed_Sep_11_19:01:00_BST' => "Сряда, 11 септември 19:01:00 BST 2024", -'du_PARAMS_panel_action_was_successful' => "Панелът PARAMS беше успешен", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Управление на настройките за използване на диска:", -'du_Disk_Usage' => "Дисково използване", -'du_Hello_PARAMS' => "~~~Здравейте PARAMS~~~", -'du_I-bays' => "I-бейове", -'du_Users' => "~~~Потребители~~~", diff --git a/Targets/DiskUsage/diskusage_de.lex b/Targets/DiskUsage/diskusage_de.lex deleted file mode 100644 index a6f6830..0000000 --- a/Targets/DiskUsage/diskusage_de.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Anwenden", -'du_Usage' => "~~~Verwendung~~~", -'du_Path' => "Pfad", -'du_Wed_Sep_11_19:01:00_BST' => "~~~Mi Sep 11 19:01:00 BST 2024~~~", -'du_PARAMS_panel_action_was_successful' => "Die PARAMS-Panel-Aktion war erfolgreich", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Festplattennutzungs-Einstellungen verwalten:", -'du_Disk_Usage' => "~~~Festplattennutzung~~~", -'du_Hello_PARAMS' => "~~~Hallo PARAMS~~~", -'du_I-bays' => "I-Bays", -'du_Users' => "Benutzer", diff --git a/Targets/DiskUsage/diskusage_dk.lex b/Targets/DiskUsage/diskusage_dk.lex deleted file mode 100644 index 7e7be79..0000000 --- a/Targets/DiskUsage/diskusage_dk.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Anvend", -'du_Usage' => "Brug", -'du_Path' => "Sti", -'du_Wed_Sep_11_19:01:00_BST' => "Ons d. 11. sep 2024 19:01:00 BST", -'du_PARAMS_panel_action_was_successful' => "~~~PARAMS-panelets handling var vellykket~~~", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Administrer indstillinger for diskforbrug:", -'du_Disk_Usage' => "Diskforbrug", -'du_Hello_PARAMS' => "Hej PARAMS", -'du_I-bays' => "I-bays", -'du_Users' => "Brugere", diff --git a/Targets/DiskUsage/diskusage_el.lex b/Targets/DiskUsage/diskusage_el.lex deleted file mode 100644 index 67351df..0000000 --- a/Targets/DiskUsage/diskusage_el.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Εφαρμογή", -'du_Usage' => "Χρήση", -'du_Path' => "Διαδρομή", -'du_Wed_Sep_11_19:01:00_BST' => "~~~Τετ 11 Σεπ 19:01:00 EET 2024~~~", -'du_PARAMS_panel_action_was_successful' => "Η ενέργεια του πίνακα PARAMS ήταν επιτυχής", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Διαχείριση ρυθμίσεων Χρήσης Δίσκου:", -'du_Disk_Usage' => "Χρήση Δίσκου", -'du_Hello_PARAMS' => "Γειά σου PARAMS", -'du_I-bays' => "Κόλποι I", -'du_Users' => "Χρήστες", diff --git a/Targets/DiskUsage/diskusage_es.lex b/Targets/DiskUsage/diskusage_es.lex deleted file mode 100644 index af3671a..0000000 --- a/Targets/DiskUsage/diskusage_es.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Aplicar", -'du_Usage' => "Uso", -'du_Path' => "Ruta", -'du_Wed_Sep_11_19:01:00_BST' => "Mié Sep 11 19:01:00 BST 2024", -'du_PARAMS_panel_action_was_successful' => "La acción del panel PARAMS fue exitosa", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Administrar configuraciones de uso de disco:", -'du_Disk_Usage' => "Uso de Disco", -'du_Hello_PARAMS' => "Hola PARAMS", -'du_I-bays' => "I-bays", -'du_Users' => "Usuarios", diff --git a/Targets/DiskUsage/diskusage_et.lex b/Targets/DiskUsage/diskusage_et.lex deleted file mode 100644 index a0293f2..0000000 --- a/Targets/DiskUsage/diskusage_et.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Rakenda", -'du_Usage' => "Kasutus", -'du_Path' => "Tee", -'du_Wed_Sep_11_19:01:00_BST' => "Kolm, 11. september 2024, 19:01:00 BST", -'du_PARAMS_panel_action_was_successful' => "PARAMS paneeli toiming oli edukas", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Halda kettakasutuse seadeid:", -'du_Disk_Usage' => "Kettakasutus", -'du_Hello_PARAMS' => "Tere PARAMS", -'du_I-bays' => "I-lahed", -'du_Users' => "Kasutajad", diff --git a/Targets/DiskUsage/diskusage_fr.lex b/Targets/DiskUsage/diskusage_fr.lex deleted file mode 100644 index 1cdf45e..0000000 --- a/Targets/DiskUsage/diskusage_fr.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Appliquer", -'du_Usage' => "Utilisation", -'du_Path' => "Chemin", -'du_Wed_Sep_11_19:01:00_BST' => "Mer 11 Sep 19:01:00 BST 2024", -'du_PARAMS_panel_action_was_successful' => "L\'action du panneau PARAMS a été réussie", -'du_&nbsp' => " ", -'du_Manage_DiskUsage_settings:' => "Gérer les paramètres d\'utilisation du disque :", -'du_Disk_Usage' => "Utilisation du disque", -'du_Hello_PARAMS' => "~~~Bonjour PARAMÈTRES~~~", -'du_I-bays' => "Baies I", -'du_Users' => "Utilisateurs", diff --git a/Targets/DiskUsage/diskusage_hu.lex b/Targets/DiskUsage/diskusage_hu.lex deleted file mode 100644 index 2f34052..0000000 --- a/Targets/DiskUsage/diskusage_hu.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Alkalmazás", -'du_Usage' => "Használat", -'du_Path' => "Útvonal", -'du_Wed_Sep_11_19:01:00_BST' => "2024. szeptember 11., szerda, 19:01:00 BST", -'du_PARAMS_panel_action_was_successful' => "~~~PARAMS panel művelet sikeres volt~~~", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Lemezhasználati beállítások kezelése:", -'du_Disk_Usage' => "Lemezhasználat", -'du_Hello_PARAMS' => "~~~Helló PARAMS~~~", -'du_I-bays' => "I-bayok", -'du_Users' => "Felhasználók", diff --git a/Targets/DiskUsage/diskusage_id.lex b/Targets/DiskUsage/diskusage_id.lex deleted file mode 100644 index 60de918..0000000 --- a/Targets/DiskUsage/diskusage_id.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Terapkan", -'du_Usage' => "Penggunaan", -'du_Path' => "Jalur", -'du_Wed_Sep_11_19:01:00_BST' => "~~~Rab 11 Sep 19:01:00 WIB 2024~~~", -'du_PARAMS_panel_action_was_successful' => "Panel PARAMS berhasil dijalankan", -'du_&nbsp' => "~~~ ~~~", -'du_Manage_DiskUsage_settings:' => "Kelola pengaturan Penggunaan Disk:", -'du_Disk_Usage' => "Penggunaan Disk", -'du_Hello_PARAMS' => "~~~Halo PARAMS~~~", -'du_I-bays' => "I-bays", -'du_Users' => "Pengguna", diff --git a/Targets/DiskUsage/diskusage_il.lex b/Targets/DiskUsage/diskusage_il.lex deleted file mode 100644 index 556e64c..0000000 --- a/Targets/DiskUsage/diskusage_il.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "החל", -'du_Usage' => "שימוש", -'du_Path' => "נתיב", -'du_Wed_Sep_11_19:01:00_BST' => "~~~ד׳ ספטמבר 11 19:01:00 שעון קיץ בריטי 2024~~~", -'du_PARAMS_panel_action_was_successful' => "פעולת לוח PARAMS הצליחה", -'du_&nbsp' => " ", -'du_Manage_DiskUsage_settings:' => "נהל הגדרות שימוש בדיסק:", -'du_Disk_Usage' => "שימוש בדיסק", -'du_Hello_PARAMS' => "שלום PARAMS", -'du_I-bays' => "מפרצים", -'du_Users' => "משתמשים", diff --git a/Targets/DiskUsage/diskusage_it.lex b/Targets/DiskUsage/diskusage_it.lex deleted file mode 100644 index 0a96499..0000000 --- a/Targets/DiskUsage/diskusage_it.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "Applica", -'du_Usage' => "Utilizzo", -'du_Path' => "Percorso", -'du_Wed_Sep_11_19:01:00_BST' => "Mer 11 Set 19:01:00 BST 2024", -'du_PARAMS_panel_action_was_successful' => "L\'azione del pannello PARAMS è stata completata con successo", -'du_&nbsp' => " ", -'du_Manage_DiskUsage_settings:' => "Gestisci impostazioni di utilizzo del disco:", -'du_Disk_Usage' => "Utilizzo del Disco", -'du_Hello_PARAMS' => "Ciao PARAMS", -'du_I-bays' => "I-bay", -'du_Users' => "Utenti", diff --git a/Targets/DiskUsage/diskusage_jp.lex b/Targets/DiskUsage/diskusage_jp.lex deleted file mode 100644 index 5ad89e2..0000000 --- a/Targets/DiskUsage/diskusage_jp.lex +++ /dev/null @@ -1,11 +0,0 @@ -'du_APPLY' => "適用", -'du_Usage' => "使用", -'du_Path' => "パス", -'du_Wed_Sep_11_19:01:00_BST' => "2024年9月11日(水) 19:01:00 BST", -'du_PARAMS_panel_action_was_successful' => "~~~PARAMSパネルの操作が成功しました~~~", -'du_&nbsp' => " ", -'du_Manage_DiskUsage_settings:' => "ディスク使用量設定の管理:", -'du_Disk_Usage' => "ディスク使用量", -'du_Hello_PARAMS' => "こんにちは PARAMS", -'du_I-bays' => "I-bays", -'du_Users' => "ユーザー", diff --git a/Targets/DiskUsage/Diskusage-Custom.pm b/Targets/Diskusage/Diskusage-Custom.pm similarity index 98% rename from Targets/DiskUsage/Diskusage-Custom.pm rename to Targets/Diskusage/Diskusage-Custom.pm index 8d7d9c6..8209d5c 100644 --- a/Targets/DiskUsage/Diskusage-Custom.pm +++ b/Targets/Diskusage/Diskusage-Custom.pm @@ -2,7 +2,7 @@ # Routines to be edited by the developer to provide validation for parameters # and provison of the control data for table(s) # -# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-13 19:18 +# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 11:53 # use esmith::util; diff --git a/Targets/Diskusage/Diskusage-Custom.pm.new b/Targets/Diskusage/Diskusage-Custom.pm.new new file mode 100644 index 0000000..343a208 --- /dev/null +++ b/Targets/Diskusage/Diskusage-Custom.pm.new @@ -0,0 +1,79 @@ +# +# Routines to be edited by the developer to provide validation for parameters +# and provison of the control data for table(s) +# +# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 12:09 +# + +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 { + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; + return $ret; + } + + +# Get control data for tables(s) + + sub get_Table1 { + # Return an array of hashes of the contents for each row and column for Table1 + # default is a single row of strings "col1header-1, col2header-1, col3Header-1 etc" + my $c = shift; + my @ret = {}; + return \@ret + } + + sub get_Table2 { + # Return an array of hashes of the contents for each row and column for Table2 + # default is a single row of strings "col1header-1, col2header-1, col3Header-1 etc" + my $c = shift; + my @ret = {}; + return \@ret + } + + +# Return hash with values from row in which link clicked on table + + sub get_selected_PARAMS { + my $c = shift; + my $selected = shift; #Parameter is name of selected row. + my $is_new_record = shift; #Indicates new record required (defaults) + my %ret = {}; + return $ret; + } + + +#after sucessful modify or create or whatever and submit then perfom (if the params validate) + + sub perform_PARAMS { + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; + return $ret; + } + + +sub create_link{ + # WIP + my ($c,$route, $panel, $index) = shift; + my $link = "$route?trt=$panel&Selected=$index"; + return $link; +} +1; diff --git a/Targets/DiskUsage/Diskusage.pm b/Targets/Diskusage/Diskusage.pm similarity index 99% rename from Targets/DiskUsage/Diskusage.pm rename to Targets/Diskusage/Diskusage.pm index bf382bc..c8a93e7 100644 --- a/Targets/DiskUsage/Diskusage.pm +++ b/Targets/Diskusage/Diskusage.pm @@ -1,6 +1,6 @@ package SrvMngr::Controller::Diskusage; # -# Generated by version:SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-13 19:18 +# Generated by version:SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 12:09 # #---------------------------------------------------------------------- # heading : Miscellaneous diff --git a/Targets/DiskUsage/diskusage.html.ep b/Targets/Diskusage/diskusage.html.ep similarity index 97% rename from Targets/DiskUsage/diskusage.html.ep rename to Targets/Diskusage/diskusage.html.ep index ebb3dd1..7e356ae 100644 --- a/Targets/DiskUsage/diskusage.html.ep +++ b/Targets/Diskusage/diskusage.html.ep @@ -1,6 +1,6 @@ % layout 'default', title => "Sme server 2 - Disk Usage", share_dir => './'; %# -%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-13 19:18 +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 12:09 %# % content_for 'module' => begin
diff --git a/Targets/DiskUsage/diskusage_en.lex b/Targets/Diskusage/diskusage_en.lex similarity index 100% rename from Targets/DiskUsage/diskusage_en.lex rename to Targets/Diskusage/diskusage_en.lex index 18f2c6e..6de7113 100644 --- a/Targets/DiskUsage/diskusage_en.lex +++ b/Targets/Diskusage/diskusage_en.lex @@ -1,11 +1,11 @@ -'du_APPLY' => 'Apply', +'du_&nbsp' => '&nbsp', +'du_I-bays' => 'I-bays', 'du_Usage' => 'Usage', +'du_Disk_Usage' => 'Disk Usage', 'du_Path' => 'Path', 'du_Wed_Sep_11_19:01:00_BST' => 'Wed Sep 11 19:01:00 BST 2024', -'du_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful', -'du_&nbsp' => '&nbsp', -'du_Manage_DiskUsage_settings:' => 'Manage DiskUsage settings:', -'du_Disk_Usage' => 'Disk Usage', -'du_Hello_PARAMS' => 'Hello PARAMS', -'du_I-bays' => 'I-bays', 'du_Users' => 'Users', +'du_APPLY' => 'Apply', +'du_Hello_PARAMS' => 'Hello PARAMS', +'du_Manage_DiskUsage_settings:' => 'Manage DiskUsage settings:', +'du_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful', diff --git a/Targets/DiskUsage/_du_PARAMS.html.ep b/Targets/Diskusage/du_PARAMS.html.ep similarity index 92% rename from Targets/DiskUsage/_du_PARAMS.html.ep rename to Targets/Diskusage/du_PARAMS.html.ep index f002926..9ca8189 100644 --- a/Targets/DiskUsage/_du_PARAMS.html.ep +++ b/Targets/Diskusage/du_PARAMS.html.ep @@ -1,5 +1,5 @@ %# -%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-13 19:18 +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-14 12:09 %#