Difference between revisions of "Server Manager2 create panel for contrib"

From SME Server
Jump to navigationJump to search
Line 21: Line 21:
 
=== File Structure ===
 
=== File Structure ===
  
<nowiki>/usr/share/smanager
+
<pre>/usr/share/smanager
├── conf
+
├── conf - contains preferences file.
 
├── data
 
├── data
 
├── lib
 
├── lib
 
│   └── SrvMngr
 
│   └── SrvMngr
│      ├── Controller
+
│      ├── Controller - contains .pm files one for each module
 
│      ├── I18N
 
│      ├── I18N
│      │   ├── Module
 
│      │   │   └── Durep
 
 
│      │   └── Modules
 
│      │   └── Modules
 
│      │      ├── Backup
 
│      │      ├── Backup
...snip ....
+
...snip ....one for each module - contains translation strings
 
│      │      ├── Xt_geoip
 
│      │      ├── Xt_geoip
 
│      │      └── Yum
 
│      │      └── Yum
Line 47: Line 45:
 
         │   └── js
 
         │   └── js
 
         └── templates
 
         └── templates
             ├── layouts
+
             ├── layouts - contains one .html.ep file for each module
             └── partials</nowiki>
+
             └── partials - contains partial files - as many as required for modules
 +
                          (generally corresponds to subsidiary panels)
 +
</pre>

Revision as of 10:58, 8 January 2022

Creating a panel for a Contrib using Server Manager 2

Server Manager 2 is based on the perl library Mojolicious and has as its central tenet that the html structure is kept separate from the content that is displayed, giving a lot of flexibility. It has a structure so that the web pages can have a theme applied independant of the content. Behind the scenes a non blocking web server does the actual work, and comes with lots of additional plugins.

Initially the default theme mimics the current Server Manager pages (which is based on formMagick), however a new theme has also been developed which is based on AdminLTE.

If you follow the rules in this document, then your page should work in both themes without any trouble!

I am using the example of the DHCP Manager contrib which has a simple initial panel and 3 subsidiary panels.

File Structure

/usr/share/smanager
├── conf - contains preferences file.
├── data
├── lib
│   └── SrvMngr
│       ├── Controller - contains .pm files one for each module
│       ├── I18N
│       │   └── Modules
│       │       ├── Backup
...snip ....one for each module - contains translation strings
│       │       ├── Xt_geoip
│       │       └── Yum
│       ├── Model
│       └── Plugin
├── log
├── script
├── t
└── themes
    └── default
        ├── public
        │   ├── css
        │   ├── images
        │   └── js
        └── templates
            ├── layouts - contains one .html.ep file for each module
            └── partials - contains partial files - as many as required for modules 
                           (generally corresponds to subsidiary panels)