### Initializing Dependencies with Yarn Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This command navigates to the Pterodactyl directory and uses Yarn to install the project's dependencies as specified in the package.json file. ```bash cd /path/to/pterodactyl yarn ``` -------------------------------- ### Executing Blueprint Installation Script Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This snippet demonstrates how to execute the blueprint.sh script after giving it execute permissions. This script automates the necessary commands to install and configure the Blueprint framework. ```bash chmod +x blueprint.sh bash blueprint.sh ``` -------------------------------- ### Installing Additional Dependencies with apt Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This command installs additional dependencies (zip, unzip, git, curl, wget) using apt package manager. This is required for distributions that are Debian-based. ```bash apt install -y zip unzip git curl wget ``` -------------------------------- ### Install Node.js v20 via apt-get Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md These commands install Node.js v20 using apt-get. It adds the NodeSource repository, updates the package list, and installs Node.js. This is required for rebuilding panel assets in Blueprint. ```bash sudo apt-get install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list apt-get update apt-get install -y nodejs ``` -------------------------------- ### Installing Yarn Globally with npm Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This command installs Yarn globally using npm, making it available for managing Node.js dependencies. ```bash npm i -g yarn ``` -------------------------------- ### Extracting the Blueprint Release Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md These commands move the downloaded release.zip file to the Pterodactyl directory, navigate into that directory, and then extract the contents of the zip file. ```bash mv release.zip /path/to/pterodactyl/release.zip cd /path/to/pterodactyl unzip release.zip ``` -------------------------------- ### Downloading the Latest Blueprint Release Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This command downloads the latest release of the Blueprint framework from GitHub using wget and curl, saving it as release.zip. ```bash wget "$(curl -s https://api.github.com/repos/BlueprintFramework/framework/releases/latest | grep 'browser_download_url' | cut -d '"' -f 4)" -O release.zip ``` -------------------------------- ### Installing Blueprint Extensions - Command Line Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Frequently-asked-questions.md This command installs a Blueprint extension. Replace '(extension)' with the actual filename of the extension. ```bash blueprint -install (extension) ``` -------------------------------- ### Building and applying extension changes Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Extension-development.md This command builds the extension and applies any changes made to the files in the `.blueprint/dev` directory. It installs the extension files as if it were a normal extension, allowing you to preview the changes on the panel. ```shell blueprint -build ``` -------------------------------- ### Creating the .blueprintrc Configuration File Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This command creates an empty .blueprintrc file inside the Pterodactyl directory, which will be used to store Blueprint configuration settings. ```bash touch /path/to/pterodactyl/.blueprintrc ``` -------------------------------- ### Configuring .blueprintrc with Environment Variables Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This command appends configuration settings to the .blueprintrc file, defining the WEBUSER, OWNERSHIP, and USERSHELL variables. These values should be modified to match the environment. ```bash echo \ 'WEBUSER="www-data"; OWNERSHIP="www-data:www-data"; USERSHELL="/bin/bash";' >> /path/to/pterodactyl/.blueprintrc ``` -------------------------------- ### Initializing a new Blueprint extension Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Extension-development.md This command initializes a new Blueprint extension, prompting for details such as the extension name, description, and template. It creates the necessary files and directories in the `.blueprint/dev` directory. ```shell blueprint -init ``` -------------------------------- ### Installing Blueprint Extension via Command Line Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Managing-extensions.md To install a Blueprint extension, the `.blueprint` file must be placed in the Pterodactyl root directory. This command triggers the installation process for the specified extension. ```sh blueprint -install (extension) ``` -------------------------------- ### Enabling Bash Autocompletion for Blueprint Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Installation.md This snippet shows how to enable bash autocompletion for the Blueprint command-line utility by sourcing the blueprint script in your .bashrc or .zshrc file. This allows for easier command-line interaction with Blueprint. ```bash source blueprint; ``` -------------------------------- ### Extension Installation Check Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Checks if an extension with the given identifier is installed. Returns true if the extension is installed; otherwise, returns false. ```plaintext extension(identifier) ``` -------------------------------- ### Exporting Extension to Pterodactyl Installation Folder Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Packaging-extensions.md This command exports the extension to the Pterodactyl installation folder, making it available for use within that environment. It is a direct export without generating a download link. ```bash blueprint -export ``` -------------------------------- ### Navigating to the extension development directory Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Extension-development.md This command changes the current directory to the `.blueprint/dev` directory, where the extension files are located. This directory is typically located inside the Pterodactyl folder. ```shell cd .blueprint/dev ``` -------------------------------- ### Installed Extensions Retrieval Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Returns an array containing the identifiers of all installed extensions. ```plaintext extensions() ``` -------------------------------- ### Creating a Content Component in React Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/React-components.md Creates a simple React component that displays example content. This component is designed to be imported and used within other components. ```tsx // Content.tsx import React from 'react'; const Content = () => { return ( <>

This is an example component.

); }; export default Content; ``` -------------------------------- ### Exporting Extension with Temporary Download Link Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Packaging-extensions.md This command generates a random download link that expires after two minutes. It also exports the extension to the Pterodactyl installation folder. This is useful for providing temporary access to the extension for testing or distribution. ```bash blueprint -export expose ``` -------------------------------- ### Rendering Admin View Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-controllers.md Renders the admin view when a GET request is made to the extension's admin page. It uses the ViewFactory to create the view and passes data to it, including the root path and the Blueprint library instance. ```php // Render page upon GET request. public function index(): View { return $this->view->make( 'admin.extensions.{identifier}.index', [ 'root' => "/admin/extensions/{identifier}", 'blueprint' => $this->blueprint, ] ); } ``` -------------------------------- ### Enable Bash Autocompletion for Blueprint Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Frequently-asked-questions.md This command enables Bash autocompletion for the Blueprint command by sourcing the blueprint script in your .bashrc or .zshrc file. ```bash source blueprint; ``` -------------------------------- ### Configuring Artisan Commands in Console.yml Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/consoleyml.md This YAML configuration defines three Artisan commands with their signatures, descriptions, file paths, and scheduling intervals. The `Signature` specifies the command's name, `Description` provides a brief explanation, `Path` indicates the file to execute, and `Interval` sets the schedule using cron syntax or predefined options. ```YAML - { Signature: "foo", Description: "returns bar", Path: "foobar.php", Interval: "" } - { Signature: "byte", Description: "[ ^ ^]", Path: "byte.php", Interval: "everyMinute" } - { Signature: "hello", Description: "prints 'hello world'", Path: "folder/hello.php", Interval: "*/5 * * * *" } ``` -------------------------------- ### File Creation Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Creates a new file at the specified path. ```plaintext fileMake(path) ``` -------------------------------- ### Importing DB Facade Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-table-and-migrations.md Imports the DB facade from Laravel to interact with the database. ```php use Illuminate\Support\Facades\DB; ``` -------------------------------- ### Displaying Extension Information with Placeholders - HTML Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Admin-views.md This snippet demonstrates how to display extension information using placeholders within an HTML paragraph. The placeholders {name}, {identifier}, and {version} are automatically replaced with the corresponding values of the extension. ```HTML

This extension is called {name}. {identifier} is the identifier of this extension. The current version is {version}.

``` -------------------------------- ### Removing Blueprint Extensions - Command Line Source: https://github.com/blueprintframework/web/blob/main/docs/pages/getting-started/Frequently-asked-questions.md This command removes a Blueprint extension. Replace '(extension)' with the actual filename of the extension. ```bash blueprint -remove (extension) ``` -------------------------------- ### Changelog Card with Link Source: https://github.com/blueprintframework/web/blob/main/docs/pages/about/Changelog.md This HTML snippet creates a card that links to a specific changelog page. It uses Bootstrap classes for styling and hover effects. ```HTML

alpha-XT1

``` -------------------------------- ### Importing the Content Component Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/React-components.md Imports the `Content` component into the `ExampleComponent.tsx` file. This allows the `Content` component to be rendered within the `ExampleComponent`. ```tsx // ExampleComponent.tsx import Content from '@/blueprint/extensions/{identifier}/Content'; ``` -------------------------------- ### MIT License Text Source: https://github.com/blueprintframework/web/blob/main/docs/pages/about/License.md This snippet contains the full text of the MIT License, including the copyright notice and the terms and conditions for use, modification, and distribution. It specifies the permissions granted and the limitations of liability. ```txt MIT License Copyright (c) 2023-2025 Emma (prpl.wtf) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -------------------------------- ### Multiple Database Record Setting Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Sets multiple records in the database at once using an associative array. ```plaintext dbSetMany(table, associative_array) ``` -------------------------------- ### Components.yml Configuration Options Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/componentsyml.md This YAML file outlines the configuration options supported by Blueprint's components feature. It defines various locations within the application's navigation, dashboard, authentication, account, and server sections where React components can be inserted. ```yaml Navigation: NavigationBar: BeforeNavigation: "" AdditionalItems: "" AfterNavigation: "" SubNavigation: BeforeSubNavigation: "" AdditionalServerItems: "" AdditionalAccountItems: "" AfterSubNavigation: "" Routes: # - { Name: "", Path: "", Type: "account/server", Component: "", AdminOnly: "boolean" } Dashboard: Global: BeforeSection: "" # beta-2024-12 and later AfterSection: "" # beta-2024-12 and later Serverlist: BeforeContent: "" AfterContent: "" ServerRow: BeforeEntryName: "" AfterEntryName: "" BeforeEntryDescription: "" AfterEntryDescription: "" ResourceLimits: "" Authentication: Container: BeforeContent: "" AfterContent: "" Account: Overview: BeforeContent: "" AfterContent: "" API: BeforeContent: "" AfterContent: "" SSH: BeforeContent: "" AfterContent: "" Server: Terminal: BeforeContent: "" AdditionalPowerButtons: "" BeforeInformation: "" AfterInformation: "" CommandRow: "" AfterContent: "" Files: Browse: BeforeContent: "" FileButtons: "" DropdownItems: "" AfterContent: "" Edit: BeforeEdit: "" AfterEdit: "" Databases: BeforeContent: "" AfterContent: "" Schedules: List: BeforeContent: "" AfterContent: "" Edit: BeforeEdit: "" AfterEdit: "" Users: BeforeContent: "" AfterContent: "" Backups: BeforeContent: "" DropdownItems: "" AfterContent: "" Network: BeforeContent: "" AfterContent: "" Startup: BeforeContent: "" AfterContent: "" Settings: BeforeContent: "" AfterContent: "" ``` -------------------------------- ### Import Stylesheet Function Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md This function generates an HTML link tag to import a stylesheet. It appends a timestamp to the URL to prevent caching issues. The function takes the stylesheet URL as input and returns the HTML link tag as a string. ```JavaScript importStylesheet(url) ``` ```JavaScript Returns a HTML link tag importing the specified stylesheet with additional URL params to avoid issues with stylesheet cache. ``` -------------------------------- ### Creating a Migration File for User Data Table Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-table-and-migrations.md Creates a table for custom user-specific data. The up() function defines the table structure, including user_id as a foreign key, enabled as a boolean, customName as a string, and categories as a JSON field. The down() function drops the table. ```PHP // 2025_04_23_163000_add_userdata_table.php unsignedInteger('user_id'); $table->foreign('user_id')->references('id')->on('users'); $table->boolean('enabled')->default(0); $table->string('customName')->default(""); $table->json('categories')->default("[]"); }); } /** * Reverse the migrations. */ public function down(): void { Schema::drop('{identifier}_userdata'); } }; ``` -------------------------------- ### Styling Admin View with Box Container - XML Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Admin-views.md This snippet demonstrates how to style the admin view using the 'box' CSS class, which is included in the Pterodactyl admin panel by default. It also shows how to add a color to the box using classes like 'box-info'. ```XML

My awesome box

This extension is called {name}.
{identifier} is the identifier of this extension.
The current version is {version}.

``` -------------------------------- ### File Content Reading Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Reads and returns the contents of the file located at the specified path. ```plaintext fileRead(path) ``` -------------------------------- ### Database Record Retrieval Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Fetches a record from the specified database table. If the record is empty, it returns the provided default value (or null if no default is provided). ```plaintext dbGet(table, record, default: optional) ``` -------------------------------- ### Components.yml Correct Path Usage Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/componentsyml.md This YAML snippet demonstrates the correct way to specify a component file path within the Components.yml file. The path should point directly to the component name without the file extension and must reside within the components directory. ```yaml Option: "Component" ``` -------------------------------- ### Import Script Function Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md This function generates an HTML script tag to import a script. It appends a timestamp to the URL to prevent caching issues. The function takes the script URL as input and returns the HTML script tag as a string. ```JavaScript importScript(url) ``` ```JavaScript Returns a HTML script tag importing the specified script with additional URL params to avoid issues with script cache. ``` -------------------------------- ### Components.yml Incorrect Path Usage Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/componentsyml.md This YAML snippet demonstrates an incorrect way to specify a component file path within the Components.yml file. The path attempts to escape the components directory and includes the file extension, both of which are invalid. ```yaml Option: "../Component.tsx" ``` -------------------------------- ### Rendering the Content Component Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/React-components.md Renders the imported `Content` component within the `ExampleComponent`. This integrates the content into the custom page. ```tsx // ExampleComponent.tsx return ( <> ); ``` -------------------------------- ### Setting Migration Directory in conf.yml Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-table-and-migrations.md Specifies the directory to store migration files. Migrations are versioned and only run once, so future schema updates should be handled by additional migration files. ```YAML database: migrations: "migrations" ``` -------------------------------- ### Database Record Setting Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Sets a value for a specific record in the specified database table. ```plaintext dbSet(table, record, value) ``` -------------------------------- ### Multiple Database Record Retrieval Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Fetches multiple records from the database in an associative array. ```plaintext dbGetMany(table, string_array: optional) ``` -------------------------------- ### Importing Libraries in controller.php Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-controllers.md Imports necessary libraries for rendering blade views and using the Blueprint library. These libraries provide functionalities for creating views and interacting with the Blueprint framework. ```php // Import libraries. use Illuminate\View\View; use Illuminate\View\Factory as ViewFactory; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\BlueprintFramework\Libraries\ExtensionLibrary\Admin\BlueprintAdminLibrary as BlueprintExtensionLibrary; ``` -------------------------------- ### Creating ExtensionController Class Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-controllers.md Creates the extension-specific controller class. Functions from this class are called when loading the extension's admin page. It injects ViewFactory and BlueprintExtensionLibrary. ```php // Register extension-specific ExtensionController class. class {identifier}ExtensionController extends Controller { // Construct class variables. public function __construct( private ViewFactory $view, private BlueprintExtensionLibrary $blueprint, ) {} // ... } ``` -------------------------------- ### File Deletion Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Deletes the file located at the specified path from the filesystem. ```plaintext fileWipe(path) ``` -------------------------------- ### Registering Namespace in controller.php Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-controllers.md Registers the namespace for the controller. The {identifier} placeholder is automatically replaced by Blueprint. ```php tag. This is necessary because Blueprint doesn't handle line breaks automatically. ```XML

This extension is called {name}.
{identifier} is the identifier of this extension.
The current version is {version}.

``` -------------------------------- ### Defining a Route in Components.yml Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/React-components.md Defines a new route for the custom page in the `Components.yml` configuration file. This configuration specifies the name, path, type, and component associated with the route. ```yaml # Components.yml Navigation: Routes: - { Name: "Example", Path: "/example", Type: "server", Component: "ExampleComponent" } ``` -------------------------------- ### Defining Controller in conf.yml Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-controllers.md Defines the controller file in the extension's conf.yml file. This tells Pterodactyl to use the specified controller for the extension's admin page. ```yaml admin: controller: "controller.php" ``` -------------------------------- ### Creating a Custom Page Component in React Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/React-components.md Defines a React component for a custom page in a Blueprint extension. It imports `PageContentBlock` and renders content within it. ```tsx // ExampleComponent.tsx import React from 'react'; import PageContentBlock from '@/components/elements/PageContentBlock'; const ExampleComponent = () => { return ( <> {/* ... */} ); }; export default ExampleComponent; ``` -------------------------------- ### Admin Notification Display Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Displays a notification on the admin panel. The notification appears upon the next page reload. ```plaintext notify(text) ``` -------------------------------- ### Disabled Changelog Card Source: https://github.com/blueprintframework/web/blob/main/docs/pages/about/Changelog.md This HTML snippet creates a disabled card, visually indicated by reduced opacity and a secondary text color. It does not link to any page. ```HTML

alpha-VKL

``` -------------------------------- ### Multiple Database Record Deletion Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Deletes or forgets multiple records from the database using an array of record identifiers. ```plaintext dbForgetMany(table, array) ``` -------------------------------- ### Querying Data from Table Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-table-and-migrations.md Retrieves data from a custom table based on the authenticated user's ID, specifically fetching the 'categories' field. It checks for user authentication and data existence before returning the categories. ```php public function getCategories() { // Check if the user of the current request exists $user = auth()->user(); if ($user == null) {return response(null);} // Gets the data corrensponding to the user id $data = DB::table('{identifier}_userdata')->where('user_id', $user->id)->first(); // Check if data exists if ($data == null) {return response(null);} // Returns the requested data return response($data->categories); } ``` -------------------------------- ### Database Record Deletion Source: https://github.com/blueprintframework/web/blob/main/docs/pages/documentation/$blueprint.md Deletes or forgets a specific record from the specified database table. ```plaintext dbForget(table, record) ``` -------------------------------- ### Saving Data to Table Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-table-and-migrations.md Saves or updates a user's row in a custom table using the `updateOrInsert()` method. It retrieves the user ID and normalizes the request data before updating or inserting the data. ```php public function update({identifier}UserSettingsFormRequest $request) { $userId = auth()->user()->id; $valuesToUpdate = $request->normalize(); DB::table('{identifier}_userdata') ->updateOrInsert( ['user_id' => $userId], $valuesToUpdate ); return response()->json($valuesToUpdate); } ``` -------------------------------- ### Defining Custom Form Request Source: https://github.com/blueprintframework/web/blob/main/docs/pages/developing-extensions/Custom-table-and-migrations.md Defines a custom form request class for validating incoming data. It specifies validation rules for 'enabled', 'customName', and 'categories' fields, ensuring data integrity before writing to the database. ```php class {identifier}UserSettingsFormRequest extends AdminFormRequest { public function rules(): array { return [ 'enabled' => 'nullable|numeric|min:0|max:1', 'customName' => 'nullable|string', 'categories' => 'nullable|string', ]; } public function attributes(): array { return [ 'enabled' => 'Enabled', 'categories' => 'Categorie', 'customName' => 'Custom Name', ]; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.