Dashboard Wrapping

Hello, I am learning how to use blueprint. I've gotten the admin part done of my mod manager now I am trying to figure out to add a mod manager option in the servers dashboard.
No description
29 Replies
Emma
Emma•9mo ago
I'm currently not able to provide a full-length explaination of how this API works exactly. Try going over the "Components.yml" and "React components" documentation pages on Blueprint's website. Additionally, there are examples related to this feature on the templates repository (see screenshot).
No description
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
appreicated thank you! hey, so can I do a custom controller or? I'm trying to pass data into the section.
Emma
Emma•9mo ago
You should be able to make API routes and controllers for them with certain extension APIs. Although, I don't really have an example with me right now.
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
so modify pterodactyl's routing or is there something with blueprint I am missing?
Emma
Emma•9mo ago
Blueprint provides Extension APIs (config options in conf.yml) to extend Pterodactyl's Laravel routes with custom ones. I'll have to revisit this stuff before I can confidently give you answers on how to work with it though.
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
That would be appreciated, I'm sorry for being a annoyance. There just isn't alot of documentation, if there is I am missing a bit. Not trying to be a bother how long do you think it'll take to get a response?
Emma
Emma•9mo ago
Really depends on how busy my day is 😅 No worries, it's completely understandable. Documentation should definitely be worked more on. Do you already know how Laravel routes work (outside of Blueprint)?
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
Yes I do.
Emma
Emma•9mo ago
So basically, Blueprint allows you to create your own routes file and have it imported dynamically into Blueprint's Laravel routes. Create your own routes.php (or whatever you'd like to call the file) and add it to the client routers suboption in your conf.yml.
requests:
routers:
application: ""
client: "routes.php"
web: ""
requests:
routers:
application: ""
client: "routes.php"
web: ""
No description
Emma
Emma•9mo ago
Documentation is a little unclear on the app option. This option exists on the current latest version of Blueprint under requests: controllers. Everything about this API is the exact same though, and the upcoming version of Blueprint will handle controllers just like it would handle app.
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
So do I just create normal routes using route::get etc Do I need to import something or? Because I tried that and it just doesn’t work
Emma
Emma•9mo ago
Yeah basically. Forgot to mention that client routes automatically get prefixed with /api/client/extensions/<identifier>/
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
Ah ok, thank you!
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
No description
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
@Emma does blueprint not allow this
Emma
Emma•9mo ago
What do you mean exactly?
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
nvm I was being stupid this still isn't what I was really hoping for though but it's fine.
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
@Emma so using that logic, I'm still confused on how I'm supposed to send my data to here.
No description
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
or do I actually have to fetch the data, and there is no where to just serve the page with it
Emma
Emma•9mo ago
Yup you have to fetch it
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
ah ok
Emma
Emma•9mo ago
That's generally how the entire Pterodactyl client ui functions 😭
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
does pterodactyl natively pass in the server id etc gag @Emma off the top of your head do you know if there is a way to get a servers ID the short UUID
Griind
Griind•9mo ago
The server ID should be the short string of characters in the URL as in https://example.domain.com/server/845h385 where 845h385 would be the server id It can also be found by going to the Settings page on the server and looking at Debug Information, which shows you a longer Server ID, the short version of that ID is just that first part up until the first -
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
I am wanting to obtain the server id via blueprint For my blueprint plugin
Emma
Emma•9mo ago
Should be somewhere in the current server state You are able to utilize the Pterodactyl API from Pterodactyl's functions. There should also be a server ID mentioned somewhere. I can dive deeper into this for you later, got some stuff to do beforehand.
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
Any update?
Emma
Emma•9mo ago
import { ServerContext } from '@/state/server';
import { useStoreState } from 'easy-peasy';
import { ServerContext } from '@/state/server';
import { useStoreState } from 'easy-peasy';
const id = ServerContext.useStoreState((state) => state.server.data!.id);
const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);
const id = ServerContext.useStoreState((state) => state.server.data!.id);
const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);
YoWaitAMinute
YoWaitAMinuteOP•9mo ago
Thanks!

Did you find this page helpful?