# Others

### 1. Custom Route Category

To organize the server menu (tabs) into sections like "General", "Management" or "Configuration", we use something called **categories**.\
These categories are defined in a file called `dravix-config.ts`, which is located at:

```batch
/var/www/pterodactyl/resources/scripts/
```

Open the file and look for the following section:

```typescript
export const SERVER_ROUTE_CATEGORIES = {
    general: 'general',
    management: 'management',
    configuration: 'configuration',
} as const;
```

Each entry here represents a group name to display and organize navigation links in the server page.

#### Adding a new category

Let's say you want to add a new section called "**Minecraft**".

Just add a new line like this:

```typescript
export const SERVER_ROUTE_CATEGORIES = {
    general: 'general',
    management: 'management',
    configuration: 'configuration',
    minecraft: 'minecraft',    // 👈 here is your category
} as const;
```

That's it, now you can use it to your routes.

#### Assign the category to a route

After you've added your category in `dravix-config.ts`, the next step is to use that category in the routes array, located at:

```bash
/var/www/pterodactyl/resources/scripts/routers/routes.ts
```

Inside this file, you'll find a large list of all routes displayed under each server.

Each route is an object that defines:

* the path
* the permission required
* the component to load
* and now: **the category it belongs to**

Now, in `routes.ts`, you can assign this new category to a route like so:

```typescript
{
    path: '/minecraft',
    permission: null,
    name: 'minecraft',
    icon: LuSettings2,
    category: SERVER_ROUTE_CATEGORIES.minecraft, // ✅ use your new category here
    component: StartupContainer,
}
```

Once added, the route will appear under a new navigation section labeled "**Minecraft**".

{% hint style="warning" %}
After making this changes, you must rebuild the panel assets.

[Click here](#build-the-assets) if you don't know how to do that.
{% endhint %}

### 2. Restrict a Route to Specific Egg IDs

Sometimes, you might want a route to appear only for a specific server type (for example, only for Minecraft server or only for Rust servers).

To achieve this, you can use the `eggIds` option.

#### What is `eggId` ?

Every server in Pterodactyl is created using an Egg (template).

Each Egg has a unique numeric ID, which is used to identify the type of server (e.g. Minecraft = 1, Rust = 7, etc).

You can restrict certain routes to show up only if the current server matches on of those Egg IDs.\ <br>

#### Where to add `eggIds`:

Go to this file:

```bash
/var/www/pterodactyl/resources/scripts/routers/routes.ts
```

Then find the route you want to restrict.

Add the `eggIds` field like this:

```typescript
{
    path: '/minecraft',
    permission: null,
    name: 'minecraft',
    icon: LuSettings2,
    category: SERVER_ROUTE_CATEGORIES.minecraft,
    component: StartupContainer,
    eggIds: [3, 4, 5], // ✅ only visible for these Egg IDs
}
```

> This means that this route will only be visible to servers created using Egg ID 3, 4 or 5.

#### What happens if you don't add `eggIds` ?

If you don't define `eggIds`, the route will be shown to all server types.

This is the default behavior.

{% hint style="warning" %}
After making this changes, you must rebuild the panel assets.

[Click here](#build-the-assets) if you don't know how to do that.
{% endhint %}

### 3. Change the Default Theme

By default, the panel uses the system's theme preference (light or dark).

If you want to set a different default theme (regardless of the user's system), you can change the `DEFAULT_THEME_MODE` value.

Open `dravix-config.ts`, which is located at:

```bash
/var/www/pterodactyl/resources/scripts
```

Then replace 'system' with one of the following values:

* `'light'` - Force light mode
* `'dark'` - Forces dark mode
* `'system'` - Uses the user's system preference (default)

{% hint style="warning" %}
After making this changes, you must rebuild the panel assets.

[Click here](#build-the-assets) if you don't know how to do that.
{% endhint %}

### Build the assets

```bash
cd /var/www/pterodactyl
yarn run build:production
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theodor-work.gitbook.io/dravix-theme/others-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
