Loop over servers

Using JS, how do I loop over servers and their elements so I can add a class to them?
19 Replies
Emma
Emma14mo ago
Are you referring to Components JS/TS or Javascript placed in the wrapper
PerryPlaysMC
PerryPlaysMCOP14mo ago
Is there a wrapper/component available for the server list?
Emma
Emma14mo ago
I'm trying to figure out the context. It really depends on which extension api you are using.
PerryPlaysMC
PerryPlaysMCOP14mo ago
I was thinking just JS placed in the wrapper Essentially just replace the current container for the server list with my own Not only do I want to theme it, but I want to display more stuff and change things
Emma
Emma14mo ago
There are generally only APIs that allow adding stuff, replacing existing stuff creates extension conflicts.
PerryPlaysMC
PerryPlaysMCOP14mo ago
Can I wrap the list of servers in something so I can modify the layout easier or do I have to use CSS selectors? and how do I go about adding an endpoint? like /serverstats and this is all the sudden at the top of my page and nothing is loading Route::group(['prefix' => 'extensions/testing'], function () { Route::get('/', [Admin\Extensions\testing\testingExtensionController::class, 'index'])->name('admin.extensions.testing.index'); }); Can I modify the default route to my own page? so instead of "url/" it goes to my custom dashboard? so I can display things however I wish?
PerryPlaysMC
PerryPlaysMCOP14mo ago
and how do I add to the nav?
No description
PerryPlaysMC
PerryPlaysMCOP14mo ago
if you can answer all of my question (which is a lot, sorry xD) may be wise to just pin this chat so anyone can see it, and title it like "Got a question? Probably been asked here."
Emma
Emma14mo ago
Anything that could cause conflicts between extensions changing the same thing is generally advised against. Blueprint does not offer things like these in it's own extension APIs. Blueprint has APIs for adding stuff to existing pages and elements (including the navbar) which is available here. The API you are looking for is Navigation: NavigationBar: AdditionalItems. Please note that this extension API is not supported across certain themes, adding new pages through Component.yml's routes API is recommended instead. Unless you provide additional information and context, I'm unable to help you. You'll need to add an endpoint like /account/serverstats which is supported across multiple themes. To achieve this, use Components.yml's routes API. Doing all these things through the wrapper is nearly impossible.
PerryPlaysMC
PerryPlaysMCOP14mo ago
Fixed that one by just resetting BP xD But it’s possible? I don’t think I’ll use any additional extensions so, I don’t see why I couldn’t?
Emma
Emma14mo ago
If you are not going to sell or put the extension up for download you could overwrite the file through install scripts.
PerryPlaysMC
PerryPlaysMCOP14mo ago
any resources on how I might do that? cause this is purely for my uses
Emma
Emma14mo ago
Not really, for using install/remove/export scripts, you are pretty much on your own. There is a little bit of documentation on this page, but that's basically it.
PerryPlaysMC
PerryPlaysMCOP14mo ago
Custom endpoints can be php, yeah? Cause I could add in the wrapper to automatically go to my endpoint lol And do the custom page there
Emma
Emma14mo ago
Custom API endpoints, yes. Custom pages with PHP, no.
PerryPlaysMC
PerryPlaysMCOP14mo ago
dang
Emma
Emma14mo ago
You can learn more about working with components here.
PerryPlaysMC
PerryPlaysMCOP14mo ago
So with said EP, how would you do CRUD req?
Emma
Emma14mo ago
I'm not exactly sure, best to do some searching online.

Did you find this page helpful?