Conversation
cf3eb8d to
1a6156a
Compare
|
If you use docker you can just use the two services provided in the PR description. To test the legacy chrome backend, just follow the existing documentation. The PdfExport module allows you to create PDFs of any page in IW2, it is also used to create reports with a custom cover page in the reporting module. |
It is not. The connection to the user can time out before the PDF is done generating, that seems to be a problem that has always existed, and this PR doesn't change that. |
ReactPHP event loop, promise and child process have been removed and replaced with native PHP io stream functions
This allows us to set headers and footers
Now requires Icinga/icingaweb2#5480
No longer requires callouts
Makes pdfexport compatible with Icinga/icingaweb2#5491
|
Please have a look at this comment and the screenshot. |
This is only done to provide backward compatibility and can be removed after we decide to break compatability.
This has been addressed in 6861696 |
| 'required' => true, | ||
| 'placeholder' => 100, | ||
| 'min' => 0, | ||
| 'description' => $this->translate('The priority of the backend. A lower priority will be used first.'), |
There was a problem hiding this comment.
This ordering seems counter-intuitive to me at first sight.
@flourish86 What do you think?
There was a problem hiding this comment.
This is the same order as menu items internally.
To be fair afaik. it is the first time that a user would have to interact with the number directly.
| $this->addContent($table); | ||
| } | ||
|
|
||
| public function backendAction(): void |
There was a problem hiding this comment.
Being able to rename a backend would be nice. See https://github.com/Icinga/icinga-sso-web/pull/3
There was a problem hiding this comment.
Shouldn't be necessary if you use random IDs as section keys like https://github.com/Icinga/icinga-sso-web/pull/3.
| $this->addContent($table); | ||
| } | ||
|
|
||
| public function backendAction(): void |
There was a problem hiding this comment.
Being able to deactivate a backend temporarily for testing would be nice, but I guess changing priorities will do it as well. You decide.
| case 'local_chrome': | ||
| $this->addElement('text', 'binary', [ | ||
| 'label' => $this->translate('Binary'), | ||
| 'placeholder' => '/usr/bin/google-chrome', |
There was a problem hiding this comment.
On my Fedora, it's sbin. While on it, I'd evaluate whether we can suggest Chromium instead.
| ) { | ||
| } | ||
|
|
||
| public function execute(Command $command): mixed |
There was a problem hiding this comment.
Seems like all variables here can be inlined.
Changes
Removed ReactPHP dependency
The module no longer relies on ReactPHP, as such it no longer provides the asynchronous methods to generate PDFs that were never part of the Hook
Introduced backend abstraction
A new backend concept allows different rendering strategies to be plugged in and extended more easily.
Added WebDriver support
Implemented a WebDriver-based backend with support for Chrome and Firefox.
Automatic backend fallback
If a backend fails or is unavailable, the system now automatically falls back to the next available option. (The order of this is currently hardcoded as Webdriver > Remote Chrome > Local Chrome)
New configuration form
Replaced the existing configuration with a new
ipl\Web\Compat\Form-based ConfigForm.requires Icinga/icingaweb2#5480
requires Icinga/ipl-web#358requires Icinga/icingaweb2#5491related to Icinga/icingaweb2-module-reporting#275
WebDriver
This module can be configured to connect to a webdriver instance. (Backend)
When a PDF is requested, via the Print PDF button on any site or the one in the reporting module, it sends commands to the WebDriver server in a standardized format.
Each browser has its own driver (like ChromeDriver for Chrome or GeckoDriver for Firefox).
This driver acts as a bridge between your script and the browser.
Browser
The driver sends commands to the browser, which executes them just like a user interaction.
For this to work we require a working chromedriver or geckodriver (firefox) instance.
Adding this this to a docker compose file will spin up one for each of the supported webdrivers.
Currently supported features:
Known issues
Chromedriver reports an error with the coverpage properties.Is actually related to a deprecated command.