Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • opCharts version >= 4.0.9
  • You will need system administration privileges so you can create the required files in the /usr/local/omk directory.

How to

...

  1. Create a new template file and have its prefix .html.ep

...

  1. in <omk_dir>/templates/public/
  2. Define

...

  1. any arbitrary HTML inside the template as you see fit, mojolicious templates are also supported, see more on rendering mojolicious templates at https://mojolicious.org/perldoc/Mojo/Template

After any change you will need to restart the omkd daemon

...

  1. Create an opCharts component to tell the dashboard it can render this new file.

...

  1. For this, create a new json file in /usr/local/omk/lib/json/opCharts/components.d/

...

  1. : Example: acme_component.json 

    Code Block
    {
      "name": "What the component is called in the dashboards dropdown list",
      "ep_template_file": "The loccation of the template file",
      "options": {
        "titleText": "the component display name"
      },
      "type": "ep_template"
    }


  2. Restart the omkd daemon. Please note that omkd daemon should be restarted after any change. 

Examples

acme_component

  1. Create <omk_dir>/templates/public/acme_list.html.ep
  2. Add the html content.
  3. Create <omk_dir>/lib/json/opCharts/components.d/acme_component.json 

    Code Block
    languagejs
    titleacme_component.json
    {
      "name": "Acme Component",
      "ep_template_file": "public/acme_list",
      "options": {
        "titleText": "My Title"
      },
      "type": "ep_template"
    }

...


  1. Restart omkd daemon:

    Code Block
    languagejs
    titleacme_component.json
    sudo service omkd restart



Embebed DuckDuckGo

Name is what the component is called in the dashboards dropdown list

ep_template_file is the loccation of the template file.

...