diff --git a/README.md b/README.md index d446ea6..a106e92 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A curated list of plugins for the [Pelican Panel](https://pelican.dev). Feel fre ## How to install plugins -[Download the repository archive](https://github.com/pelican-dev/plugins/archive/refs/heads/main.zip) and extract the folders of the plugins you want to install to your panels `plugins` folder (`/var/www/pelican/plugins` by default). Finally, open your panel and head to the plugins page and click on "Install". +[Download the repository archive](https://github.com/pelican-dev/plugins/archive/refs/heads/main.zip) and extract the folders of the plugins you want to install to your panels `plugins` folder (`(/var/www/pelican/plugins` by default). Finally, open your panel and head to the plugins page and click on "Install". ## Plugins @@ -12,7 +12,7 @@ A curated list of plugins for the [Pelican Panel](https://pelican.dev). Feel fre - [Billing](/billing) - Allows users to purchase servers via Stripe - [Generic OIDC Providers](/generic-oidc-providers) - Create generic OIDC providers for authentication - [Legal Pages](/legal-pages) - Adds legal pages (Imprint, Privacy Policy, ToS) to the panel -- [MCLogs Uploader](/mclogs-uploader) - Upload console logs to mclo.gs +- [MCLogs Uploader](/mclogs-uploader) - Upload console logs to mclo.gs (add `mclogs-updater` tag to eggs to enable) - [Minecraft Modrinth](/minecraft-modrinth) - Download Minecraft mods & plugins from Modrinth - [Player Counter](/player-counter) - Show connected players count for game servers - [Register](/register) - Enable user self-registration on all panels @@ -32,4 +32,4 @@ A curated list of plugins for the [Pelican Panel](https://pelican.dev). Feel fre ## Language Packs -- [Pirate Language](/pirate-language) - Turns yer site's lingo into pirate talk, matey! +- [Pirate Language](/pirate-language) - Turns yer site's lingo into pirate talk, matey! \ No newline at end of file diff --git a/mclogs-uploader/README.md b/mclogs-uploader/README.md index 4ec9e92..368b4de 100644 --- a/mclogs-uploader/README.md +++ b/mclogs-uploader/README.md @@ -6,4 +6,40 @@ Upload server console logs to mclo.gs for easy sharing and troubleshooting. - One-click upload of console logs to mclo.gs - Integrated action button in the server console -- Perfect for (but not limited to) Minecraft server +- **Tag-based visibility**: Show upload button only for specific eggs +- Perfect for (but not limited to) Minecraft servers + +## Configuration + +### Tag-Based Filtering + +The upload button can be configured to only appear for servers using eggs with the `mclogs-updater` tag. + +#### How to enable: + +1. Navigate to the Egg configuration in your Pelican Panel +2. Add the tag `mclogs-updater` to eggs that support log uploading +3. The upload button will automatically appear only on servers using tagged eggs + +**Note:** If no eggs have the `mclogs-updater` tag, the button will be hidden for all servers. This ensures the plugin only appears where it's actually needed. + +## Usage + +1. Navigate to your server's console page +2. Click the "Upload logs" button (visible only if your egg has the `mclogs-updater` tag) +3. The current console logs will be uploaded to mclo.gs +4. You'll receive a shareable link in a notification + +## Requirements + +- Pelican Panel +- Server must be online to upload logs +- Egg must have the `mclogs-updater` tag (for tag-based filtering) + +## Installation + +Install via Pelican Panel's plugin system or manually place in the plugins directory. + +## Support + +For issues or feature requests, please visit the [GitHub repository](https://github.com/pelican-dev/plugins/tree/main/mclogs-uploader). \ No newline at end of file diff --git a/mclogs-uploader/src/Filament/Components/Actions/UploadLogsAction.php b/mclogs-uploader/src/Filament/Components/Actions/UploadLogsAction.php index 977c042..e558902 100644 --- a/mclogs-uploader/src/Filament/Components/Actions/UploadLogsAction.php +++ b/mclogs-uploader/src/Filament/Components/Actions/UploadLogsAction.php @@ -25,7 +25,18 @@ protected function setUp(): void /** @var Server $server */ $server = Filament::getTenant(); - return $server->retrieveStatus()->isOffline(); + if ($server->retrieveStatus()->isOffline()) { + return true; + } + + $egg = $server->egg; + $mcTag = 'mclogs-updater'; + + if (!in_array($mcTag, $egg->tags ?? [])) { + return true; + } + + return false; }); $this->label(fn () => trans('mclogs-uploader::upload.upload_logs')); @@ -82,4 +93,4 @@ protected function setUp(): void } }); } -} +} \ No newline at end of file