Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Create Database btn on admin side #721

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

notAreYouScared
Copy link
Member

Adds a Create Database button to edit server page to allow admins to create databases on the users behalf, checks for database hosts and if the server has database feature allocations.

@lancepioch lancepioch removed their request for review November 20, 2024 02:41
Copy link
Contributor

@RMartinOscar RMartinOscar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't check for Database limit like it did on Pterodactyl (don't know if its intentional)
image
databaseHost can be not suitable (dbHost is set to an other node then the one the server has) for this server and it will still create
Also would be nice if the first databaseHost it could find would be selected by default
Delete button doesn't ask for a confirmation

@notAreYouScared
Copy link
Member Author

Doesn't check for Database limit like it did on Pterodactyl (don't know if its intentional).
Correct, Admins are not limited by the servers feature limit, It will create it if the server does not have enough.

databaseHost can be not suitable (dbHost is set to an other node then the one the server has) for this server and it will still create

Also would be nice if the first databaseHost it could find would be selected by default

Its wonky and we found a filament bug as i tried to use ->selectableplaceholder(false) to remove the place holder but the first option is still returned as null so you'd never be able to use the first option in the dropdown.

@RMartinOscar
Copy link
Contributor

Its wonky and we found a filament bug as i tried to use ->selectableplaceholder(false) to remove the place holder but the first option is still returned as null so you'd never be able to use the first option in the dropdown.

SDhoudl be able to use default like we did on the CreateServer page

->default(fn () => ($this->node = Node::query()->latest()->first())?->id)

app/Filament/Resources/ServerResource/Pages/EditServer.php Outdated Show resolved Hide resolved
TextColumn::make('username')->icon('tabler-user'),
TextColumn::make('remote'),
TextColumn::make('database')
->hidden(fn () => !auth()->user()->can('viewList database'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a nicer way to hide the whole table instead of hiding every single column?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's a relation manager. Not a tab, so it's rendered as it's own table. Just like allocations on the edit node/server page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants