Skip to content

Commit

Permalink
Merge origin/main into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Dec 17, 2024
2 parents 85d747e + af35176 commit 754bb64
Show file tree
Hide file tree
Showing 19 changed files with 194 additions and 9 deletions.
24 changes: 24 additions & 0 deletions db/migrations/20241217144842_my_s_q_lutf_8mb_4.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class MySQLutf8mb4 extends AbstractMigration
{
public function change(): void
{
// Check if the database is MySQL
$databaseType = $this->getAdapter()->getOption('adapter');
if ($databaseType === 'mysql') {
// Apply utf8mb4 character set to the database
$this->execute("ALTER DATABASE `" . $this->getAdapter()->getOption('name') . "` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci");

// Apply utf8mb4 character set to all tables
$tables = $this->fetchAll("SHOW TABLES");
foreach ($tables as $table) {
$tableName = $table[array_keys($table)[0]];
$this->execute("ALTER TABLE `{$tableName}` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
}
}
}
}
1 change: 1 addition & 0 deletions debian/manpages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
multiflexi-trigger: multiflexi-trigger.1
10 changes: 5 additions & 5 deletions debian/multiflexi-trigger.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH MULTIFLEXI-TRIGGER 1 "October 2023" "1.0.0" "MultiFlexi Manual"
.TH MULTIFLEXI-TRIGGER 1 "October 2024" "1.0.0" "MultiFlexi Manual"
.SH NAME
multiflexi-trigger \- Trigger a job in MultiFlexi

Expand Down Expand Up @@ -33,17 +33,17 @@ Enable verbose mode for more debug messages.
.SH EXAMPLES
.TP
Trigger a job with a specific run template and company code:
.B multiflexi-trigger --runtemplate template1 --company TEST
.B multiflexi-trigger --runtemplate template1
.TP
Trigger a job with environment variables and a schedule:
.B multiflexi-trigger --runtemplate template1 --company TEST --environment '{"key":"value"}' --schedule "2023-10-01 12:00:00"
.B multiflexi-trigger --runtemplate template1 --environment '{"key":"value"}' --schedule "2023-10-01 12:00:00"
.TP
Run a job in the foreground:
.B multiflexi-trigger --runtemplate template1 --company TEST --foreground
.B multiflexi-trigger --runtemplate template1 --foreground

.SH SEE ALSO
.BR multiflexi (1),
.BR multiflexi-scheduler (1)

.SH AUTHOR
MultiFlexi Team <support@multiflexi.com>
MultiFlexi Team <support@multiflexi.eu>
8 changes: 8 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
API
===


.. toctree::
:maxdepth: 2

.. contents::



API calls are handled by the `api/index.php` file. This file is responsible for routing the request to the appropriate controller and method. The API is designed to be flexible and easy to use. It is built on top of the `MultiFlexi` class, which provides a simple interface for creating and managing API endpoints.

The endpoints
Expand Down
Binary file added docs/source/appconfigfieldseditor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/source/apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ The ``environment`` field contains a list of environment variables required by t
- ``defval``: Default value of the variable - you can use {VARIABLE_NAME} to reference other environment variables
- ``required``: Whether the variable is required or not

.. note::

See more about configuration fields on :ref:`configuration` page.


The application icon is svg file stored in the same directory as json application definition. The icon must be named using the application's UUID.

Special variables
Expand Down
57 changes: 57 additions & 0 deletions docs/source/commandline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Command Line Utilities
======================

MultiFlexi provides several command line utilities to manage and interact with the system. Below is a list of available utilities and their descriptions:

1. **multiflexi-app2json**
- Converts application configuration to JSON format.

2. **multiflexi-cli**
- Command line interface for interacting with MultiFlexi.

3. **multiflexi-executor**
- Executes scheduled jobs and tasks.

4. **multiflexi-job2env**
- Export job configuration as environment variables file.

5. **multiflexi-job2script**
- Export job configuration as a script.

6. **multiflexi-json-app-remover**
- Removes applications based on JSON configuration.

7. **multiflexi-json2app**
- Converts JSON configuration to application configuration.

8. **multiflexi-json2apps**
- Converts multiple JSON configurations to application configurations.

9. **multiflexi-phinx**
- Perform database migrations using Phinx.

10. **multiflexi-probe**
- Probes the system for status and health checks.

11. **multiflexi-scheduler**
- Schedules jobs and tasks for execution.

12. **multiflexi-trigger**
- Triggers specific actions or jobs.

13. **multiflexi-zabbix-lld**
- Generates Zabbix Low-Level Discovery (LLD) data.

14. **multiflexi-zabbix-lld-actions**
- Manages Zabbix LLD actions.

15. **multiflexi-zabbix-lld-company**
- Manages Zabbix LLD company data.

16. **multiflexi-zabbix-lld-tasks**
- Manages Zabbix LLD tasks.

Each utility serves a specific purpose and can be used to automate and manage various aspects of the MultiFlexi system. For detailed usage and options, refer to the respective utility's help command.

.. image:: trigger-manpage.png
:alt: Trigger Manpage
38 changes: 38 additions & 0 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _configuration:

Configuration
=============

.. toctree::
:maxdepth: 2

.. contents::

Each application in MultiFlexi defines its own configuration fields. This is of a specific type and has additional properties.

Configuration Fields
--------------------

- Configuration ``Field Type`` - one of the following:
- **Text**: A single line text input.
- **Number**: A numeric input.
- **Date**: A date input.
- **Email**: An email input.
- **Password**: A password input.
- **Checkbox**: A yes/no checkbox.
- **File**: A file upload input.
- **Directory**: A directory path input.
- ``Keyword`` - The name of configuration field (capital letters)
- ``Default Value`` - (used unless otherwise specified)
- Configuration ``Field Description``
- ``required`` yes/no

.. image:: appconfigfieldseditor.png
:alt: Configuration fields of an application in an editor


JSON Configuration
------------------

To configure the MultiFlexi project, you can also create a configuration file (e.g., `config.yaml`) with the necessary fields. Below is an example configuration file:

7 changes: 7 additions & 0 deletions docs/source/executors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Executors
=========


.. toctree::
:maxdepth: 2

.. contents::


This document provides information about the two types of executors available: Native and Docker.

Native Executor
Expand Down
8 changes: 8 additions & 0 deletions docs/source/firstrun.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
First Run Manual
================


.. toctree::
:maxdepth: 2

.. contents::



This manual will guide you through the first run of the MultiFlexi application.

.. image:: ../../doc/prvnispusteni.png
Expand Down
4 changes: 3 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Welcome to MultiFlexi's documentation!
**MultiFlexi** is an environment that allows you to run various tools on top of AbraFlexi and Stormware Pohoda.
It provides a flexible and customizable platform for integrating and extending the functionality of these software systems.

With MultiFlexi, you can leverage the power of AbraFlexi and Stormware Pohoda to build and automate complex business processes.
With MultiFlexi, you can leverage the power of `AbraFlexi <https://www.abra.eu/flexi/>`_ and `Stormware Pohoda <https://www.stormware.cz/>`_ to build and automate complex business processes.
It offers a wide range of features and capabilities, including data synchronization, workflow automation, reporting, and more.

By utilizing MultiFlexi, you can streamline your business operations, improve efficiency, and enhance collaboration between different systems.
Expand Down Expand Up @@ -43,9 +43,11 @@ Contents
usage
api
application
configuration
company
job
runtemplate
apps
executors
commandline
zabbix
3 changes: 3 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Installation Guide
==================

.. toctree::
:maxdepth: 2

.. contents::

This is the installation guide for MultiFlexi.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/job.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Job
===


.. toctree::
:maxdepth: 2

.. contents::

7 changes: 7 additions & 0 deletions docs/source/runtemplate.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
RunTemplate
===========

.. toctree::
:maxdepth: 2

.. contents::



The `RunTemplate` is a key component of the MultiFlexi application. It allows users to define environment and frequency for running an application.

Binary file added docs/source/trigger-manpage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Usage
=====

.. toctree::
:maxdepth: 2

.. contents::


.. _installation:

Installation
Expand Down
6 changes: 6 additions & 0 deletions docs/source/zabbix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ Zabbix Integration
==================


.. toctree::
:maxdepth: 2

.. contents::


11 changes: 9 additions & 2 deletions src/MultiFlexi/Ui/Form/RaiffeisenBank.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ public function __construct()
$body = new \Ease\Html\DivTag();

$body->addItem(new \Ease\TWB4\FormGroup('ACCOUNT_NUMBER', new \Ease\Html\InputTextTag('ACCOUNT_NUMBER'), '', _('Raiffeisen Bank Account Number')));
$body->addItem(new \Ease\TWB4\FormGroup('CERT_FILE', new \Ease\Html\InputTextTag('CERT_FILE'), '', _('Path to Certificate File')));
$body->addItem(new \Ease\TWB4\FormGroup('CERT_PASS', new \Ease\Html\InputTextTag('CERT_PASS'), '', _('Password for Certificate')));
$body->addItem(new \Ease\TWB4\FormGroup('ACCOUNT_CURRENCY', new \Ease\Html\InputTextTag('ACCOUNT_CURRENCY'), 'CZK', _('Raiffeisen Bank Account Currency Code: CZK,EUR,USD,...')));
$body->addItem(new \Ease\TWB4\FormGroup('CERT_FILE', new \Ease\Html\InputTextTag('CERT_FILE'), '/path/to/certificate/file.p12', _('Path to Certificate File')));
$body->addItem(new \Ease\TWB4\FormGroup('CERT_PASS', new \Ease\Html\InputTextTag('CERT_PASS'), \Ease\Functions::randomString(20), _('Password for Certificate')));
$body->addItem(new \Ease\TWB4\FormGroup('XIBMCLIENTID', new \Ease\Html\InputTextTag('XIBMCLIENTID'), '', new ATag('https://developers.rb.cz/premium/applications', _('X-IBM-Client-Id'))));

parent::__construct($header, 'inverse', $body, '');
Expand All @@ -57,6 +58,12 @@ public static function fields(): array
'defval' => '',
'required' => true,
],
'ACCOUNT_CURRENCY' => [
'type' => 'text',
'description' => _('Bank Account Currency'),
'defval' => 'CZK',
'required' => false,
],
'CERT_PASS' => [
'type' => 'password',
'description' => _('Certificate password'),
Expand Down
2 changes: 1 addition & 1 deletion src/MultiFlexi/Ui/RuntemplateConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function __construct(\MultiFlexi\RunTemplate $engine)
$fieldInfo = \array_key_exists($fieldName, $appFields) ? $appFields[$fieldName] : ['type' => 'text', 'source' => _('Custom')];
}

$value = \array_key_exists('value', $fieldInfo) ? $fieldInfo['value'] : (\array_key_exists('defval', $fieldInfo) ? $fieldInfo['defval'] : '');
$value = \array_key_exists('value', $fieldInfo) ? $fieldInfo['value'] : '';

if ($fieldInfo['type'] === 'checkbox') {
$input = new \Ease\Html\DivTag(new \Ease\TWB4\Widgets\Toggle($fieldName, $value === 'true' ? true : false, 'true', []));
Expand Down

0 comments on commit 754bb64

Please sign in to comment.