Skip to content

Commit 8555f98

Browse files
authored
Update plugin docs (#207)
* update plugin docs for HasPluginSettings change * update hub references and update comparison * add update and uninstall docs
1 parent e4c937d commit 8555f98

2 files changed

Lines changed: 46 additions & 13 deletions

File tree

docs/comparison.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Pelican is a fork of [Pterodactyl](https://pterodactyl.io). However, Pelican has
1818
<TabItem value="1" label="General">
1919
* ![Planned](https://img.shields.io/badge/Planned-blue) Rework allocations
2020
* ![Planned](https://img.shields.io/badge/Planned-blue) More database types for Database Hosts
21-
* ![Done](https://img.shields.io/badge/Done-green) First party Plugins & Themes
21+
* ![Done](https://img.shields.io/badge/Done-green) First party Plugin system
2222
* ![Done](https://img.shields.io/badge/Done-green) Webhooks
2323
* ![Done](https://img.shields.io/badge/Done-green) Roles & Permissions for Admins
2424
* ![Done](https://img.shields.io/badge/Done-green) Replace Nests & Locations with Tags
@@ -87,7 +87,7 @@ Pelican is a fork of [Pterodactyl](https://pterodactyl.io). However, Pelican has
8787
</TabItem>
8888
<TabItem value="9" label="Hub">
8989
* ![Planned](https://img.shields.io/badge/Planned-blue) Marketplace for Eggs
90-
* ![In Progress](https://img.shields.io/badge/In_Progress-orange) Marketplace for Plugins & Themes
90+
* ![Done](https://img.shields.io/badge/Done-green) Marketplace for Plugins & Themes
9191
* ![Done](https://img.shields.io/badge/Done-green) Open Finances
9292
* ![Done](https://img.shields.io/badge/Done-green) Support Tickets
9393
</TabItem>

docs/panel/advanced/plugins.mdx

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,50 @@ Plugins allow you to add new functionality to the panel without modifying any pa
1212

1313
## Install a Plugin
1414

15-
<Tabs>
15+
<Tabs groupId="method">
1616
<TabItem value="frontend" label="Via Panel Frontend">
17-
Use the Import Button on the plugin list to upload & install a plugin.
17+
Use the Import button on the plugin list to upload a plugin. After the import is done, use the Install button to complete the installation.
18+
19+
Plugin installs run in the background so it might take a few seconds. If a plugin isn't installing [check your queue worker configuration](../../troubleshooting#schedules-not-running).
1820
</TabItem>
1921
<TabItem value="manually" label="Manually">
2022
Move the plugin folder to `plugins` inside your panel directory (`/var/www/pelican/plugins` by default). Then run `php artisan p:plugin:install` inside your panel directory and select the new plugin.
2123
</TabItem>
2224
</Tabs>
2325

2426
<Admonition type="info" title="Need some plugins?">
25-
Check out our [Plugins repo](https://github.com/pelican-dev/plugins)! It contains free and open source plugins created by the Pelican team and the community.
26-
We are also working on adding a plugin marketplace to the [Hub](https://hub.pelican.dev).
27+
You can find various offical and third party plugins on the [Hub plugin marketplace](https://hub.pelican.dev/plugins)!
28+
Also check out our [Plugins repo](https://github.com/pelican-dev/plugins)! It contains free and open source plugins created by the Pelican team.
2729
</Admonition>
2830

31+
## Update a Plugin
32+
33+
For one-click updates to work the plugin needs to have a [update url](#update-url) set. Otherwise you need to manually update the plugin files.
34+
35+
<Tabs groupId="method">
36+
<TabItem value="frontend" label="Via Panel Frontend">
37+
The panel will automatically check for plugins updates when visiting the plugin list. If an update is available you can use the Update button to download and install the update.
38+
39+
Plugin updates run in the background so it might take a few seconds. If a plugin isn't updating [check your queue worker configuration](../../troubleshooting#schedules-not-running).
40+
</TabItem>
41+
<TabItem value="manually" label="Manually">
42+
Run `php artisan p:plugin:uninstall` inside your panel directory (`/var/www/pelican` by default) and select the plugin you want to uninstall.
43+
</TabItem>
44+
</Tabs>
45+
46+
## Uninstall a Plugin
47+
48+
<Tabs groupId="method">
49+
<TabItem value="frontend" label="Via Panel Frontend">
50+
Use the Uninstall button on the plugin list.
51+
52+
Plugin uninstalls run in the background so it might take a few seconds. If a plugin isn't uninstalling [check your queue worker configuration](../../troubleshooting#schedules-not-running).
53+
</TabItem>
54+
<TabItem value="manually" label="Manually">
55+
Run `php artisan p:plugin:update` inside your panel directory (`/var/www/pelican` by default) and select the plugin you want to update.
56+
</TabItem>
57+
</Tabs>
58+
2959
## Create a Plugin
3060

3161
<Admonition type="danger">
@@ -238,22 +268,25 @@ class MyPluginRoutesProvider extends RouteServiceProvider
238268
### Plugin Settings
239269

240270
Your main plugin class can implement the `HasPluginSettings` interface to conveniently add a settings page to your plugin.
241-
The settings page can be accessed on the plugin list on the panel. Your plugin needs to provide the form and how the data should be saved.
271+
The settings page can be accessed on the plugin list on the panel. Your plugin needs to provide the form, the form data and how the data should be saved.
242272

243273
If you want to save the settings in the `.env` file you can use the `EnvironmentWriterTrait`. Example:
244274

245275
```php
246276
use EnvironmentWriterTrait;
247277

278+
public function getSettingsFormData(): array
279+
{
280+
return config('myplugin');
281+
}
282+
248283
public function getSettingsForm(): array
249284
{
250285
return [
251286
TextInput::make('test_input')
252-
->required()
253-
->default(fn () => config('myplugin.test_input')),
287+
->required(),
254288
Toggle::make('test_toggle')
255-
->inline(false)
256-
->default(fn () => config('myplugin.test_toggle')),
289+
->inline(false),
257290
];
258291
}
259292

@@ -363,8 +396,8 @@ To publish a plugin you only need to do two things:
363396
And that's it! Now you can take the zip file and share it with the world!
364397

365398
<Admonition type="info" title="Marketplace">
366-
We are currently working on adding a plugin marketplace to the [Hub](https://hub.pelican.dev).
367-
Until then you can publish your plugins on our [plugins repo](https://github.com/pelican-dev/plugins). You can also share them in the `#plugins` channel in our [Discord](https://discord.gg/pelican-panel).
399+
Publish your plugins on the [Hub plugin marketplcae](https://hub.pelican.dev/plugins)! This will allow users to easily install or download your plugin.
400+
You can also share them in the `#share-plugins` channel in our [Discord](https://discord.gg/pelican-panel).
368401
</Admonition>
369402

370403
<Admonition type="info" title="License">

0 commit comments

Comments
 (0)