Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2 new pages #144

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions development/docker-compose-example-list.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Plugin Development
===========================

Create Row Container List - File Structure
------------------------------------------

.. code:: tree

└──ContainerName
├──ContainerName.env
├──ContainerName.yml
├──Containername - This is icon
└──readme

ContainerName.env
-----------------

.. code:: env

Various Options

ContainerName.yml
-----------------

Example based on the radarr.yml file

.. code:: yml

---
services:
radarr:
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Istanbul
volumes:
- CHANGE_TO_COMPOSE_DATA_PATH/radarr/config:/config
- CHANGE_TO_COMPOSE_DATA_PATH/radarr/movies:/movies
- CHANGE_TO_COMPOSE_DATA_PATH/radarr/downloads:/downloads
ports:
- 7878:7878
restart: unless-stopped

Readme
------

.. code:: readme

Container description

Icon
----

The icon should be downloaded to the container directory, i.e.

ContainerName/ContainerName

The icon must be without an ending, i.e. without .png .jpg .svg .bmp
etc.

Pull Request
------------

Upload the finished files to Github
(https://github.com/OpenMediaVault-Plugin-Developers/packages)
2 changes: 2 additions & 0 deletions development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Development
howitworks
tools/index
plugins
plugins-build-plugin
docker-compose-example-list
203 changes: 203 additions & 0 deletions development/plugins-build-plugin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
Files and directory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to move that into under Development > Plugin Development?
A short introduction that describes what this chapter is about would be helpful for the users to understand what they are watching here.

===================

Tree files and directory
------------------------

Type Files:

- FILETYPE

1. network
2. storage
3. services
4. usermgmt
5. diagnostics

.. code:: shell


├── DEBIAN
│ ├── changelog
│ ├── compat
│ ├── control
│ ├── copyright
│ ├── install
│ ├── postinst
│ ├── postrm
│ ├── rules
│ └── triggers
└── usr
├── sbin
│ └── plugin-file-name
└── share
└── openmediavault
├── confdb
│ └── create.d
│ └── conf.system.network.PLUGINNAME.sh
├── datamodels
│ └── conf.system.network.PLUGINNAME.json
├── engined
│ ├── inc
│ │ └── PLUGINNAME.inc # LogFileSpec
│ ├── module
│ │ └── PLUGINNAME.inc
│ └── rpc
│ └── PLUGINNAME.inc
├── locale
│ ├── openmediavault-PLUGINNAME.pot
│ ├── pl
│ │ └── openmediavault-PLUGINNAME.po
│ └── pl_PL
│ └── openmediavault-PLUGINNAME.po
└── workbench
├── component.d
│ ├── omv-network-PLUGINNAME-form-page.yaml
│ ├── omv-network-PLUGINNAME-navigation-page.yaml
│ └── omv-network-PLUGINNAME-noip-form-page.yaml
├── log.d
│ └── PLUGINNAME.yaml
├── navigation.d
│ └── network.PLUGINNAME.yaml
└── route.d
└── network.PLUGINNAME.yaml

Files
-----

rpc
~~~

``PLUGINNAME.inc``

.. code:: php

<?php

#SET NAME filetypePluginame example - ServicesExample
class ServicesExample extends \OMV\Rpc\ServiceAbstract {

#SET NAME filetypePluginame example - ServicesExample
public function getName() {
return "NAME";
}


#Register Method to use function
public function initialize() {
$this->registerMethod('getSettings');
$this->registerMethod('setSettings');
}
}
?>

debian
~~~~~~

``changelog``

``control`` - Set name and author plugin

``postinst`` - Creating a database, directories, and installing the
necessary libraries you need

``postrm`` - Code used when uninstalling a plugin

workbench
~~~~~~~~~

Datatable Example
-----------------

.. code:: yaml

version: "1.0"
type: component
data:
name: omv-services-example-file-form-page
type: datatablePage
config:
autoReload: false
hasSearchField: true
rowId: name
sorters:
- dir: asc
prop: name
store:
proxy:
service: Example
get:
method: getExampleList //GET ROWS FROM rpc
columns:
- name: " "
prop: image
flexGrow: 0.15
cellTemplateName: image
cellTemplateConfig:
class: "mat-icon notranslate mat-icon-no-color"
alt: " "
src: "{{ image }}"
- name: _("Name")
prop: name
flexGrow: 1
sortable: true
actions:
- type: iconButton
icon: mdi:plus-box
tooltip: _("Add example file")
enabledConstraints:
minSelected: 1
maxSelected: 1
execute:
type: formDialog
formDialog:
title: _("Add...")
fields:
- type: textInput
name: name
label: _("Name")
value: "{{ _selected[0].name }}"
- type: textInput
name: description
label: _("Description")
value: ""
buttons:
submit:
text: _("Add")
execute:
type: request
request:
service: Example
method: setExample
progressMessage: _("Adding an example ...")
successNotification: _("Example has been added.")
successUrl: /services/example/files

Form
----

- NO INFORMATION

Database write and read
-----------------------

- NO INFORMATION

Bash executables
----------------

- NO INFORMATION

Generating the deb file and installing
--------------------------------------

.. code:: shell

cd openmediavault-pluginame
dpkg-buildpackage -us -uc

``Install``

.. code:: shell

dpkg -i openmediavault-pluginname_VERSION_all.deb