Download the PHP package lukaskleinschmidt/kirby-terminal without Composer
On this page you can find all versions of the php package lukaskleinschmidt/kirby-terminal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package kirby-terminal
Kirby Terminal
Manage background processes from the panel. Define scripts like you might already be familiar with from npm
. Start or stop predefined scripts and monitor the output directly in the panel.
Commercial Usage
This plugin is free. Please consider to make a donation if you use it in a commercial project.
Installation
Download
Download and copy this repository to /site/plugins/terminal
.
Git submodule
Composer
Define Scripts
You are able to run almost any scripts or commands you would normally run from a terminal. A script can be defined as a simple string or if you need more control you can define your script as a callback. The callback is expected to return either a string
or a Script
object. The closure of the callback is bound to the scripts section model.
To get a better understanding of what is possible you can add those three scripts to your config and simply throw them into the site
or a page
blueprint.
The example deploy
script works for the site
or a page
blueprint. Using it in the site
blueprint will deploy the whole content folder. Using it in a page
blueprint will only deploy the page and the corresponding subtree.
Permissions
You may want to restrict access to some scripts. You can do this by adding a gate callback to your config file. The callback is expected to return either true
or false
. Within the callback you have access to the authenticated user. In addition the closure is bound to the section object allowing you to make more fine grained decisions. The following two examples will help you getting started.
If you want to disable all scripts for a specific environment set the gate to false
.
Endpoint
You can change the used API endpoint if you run into any conflicts.
Blueprint
Available options
Property | Type | Default | Description |
---|---|---|---|
confirm | – | The confirmation text | |
delay | int |
1000 |
The polling delay |
headline | – | The headline for the section | |
help | – | The help text | |
script | string |
– | The executable script |
start | Start |
The start button text | |
stop | Stop |
The stop button text | |
theme | string |
light |
The theme of the terminal. Available themes are: light , dark |
Confirmation dialog
Property | Type | Default | Description |
---|---|---|---|
button | – | The text for the submit button. Inherits from the start property by default |
|
icon | string |
check |
The icon type for the submit button |
size | string |
small |
The dialog size. Available sizes are: small , medium , large |
text | – | The confirmation text | |
theme | – | The theme of the submit button. Available options: positive , negative |
Multiple languages
You can provide translations for multiple languages for the headline
, help
, start
, stop
and confirm
property. If you are using the advanced confirmation dialog you can also provide translations for the button
and text
property.
License
MIT