Skip to main content

Dashboards

msk_fuel ships two in-game panels, both built with React + Vite + Tailwind and served from the committed html/ build. The server needs no npm.

They share one ui_page: the Lua side decides which one opens.

Admin dashboard

Opened with /fueladmin (the command name is configurable in the Settings tab).

Access

Two things have to line up before the dashboard opens:

  1. The player is in a group listed in Config.dashboardGroups, and
  2. that group holds at least one permission.

group.admin always may and always holds every right. group.user never may, no matter what is configured.

add_ace

FiveM keeps principals and ACE objects apart: add_principal … group.admin makes a player a member of that group but does not grant the ACE object of the same name. msk_fuel registers its own ACE objects through msk_core, which needs one line in your server.cfg:

add_ace resource.msk_core command.add_ace allow

Without it, group access falls back to your framework group (the ESX users table, QBCore's permission list) and the script says so on start.

Tabs

TabContents
StationsCreate, edit and delete stations; stock and price per fuel type; remove an owner
Prices & marketBase prices, price limits, market parameters, default tank sizes
Unowned stationsPublic delivery jobs and automatic restocking, per station without an owner
SettingsLanguage, debug, version checker, command name, colours, economy defaults, unowned-station income
PermissionsWhich groups may open the dashboard, and the permission matrix per group

Permissions

Nine rights, granted per group:

RightAllows
station.viewsee the station list
station.createcreate stations
station.editedit stations and unowned-station settings
station.deletedelete stations
station.ownertake a station away from its owner
stock.manageset stock and capacity
market.manageprices, limits and market parameters
settings.managegeneral settings
permissions.managegroups and the permission matrix

Every action is checked again on the server. Hiding a tab is a convenience, not the security boundary.

Owner dashboard

Opened at the pump of a station the player owns or works at, through the manage this fuel station target option.

Which tabs appear depends on what the player's rank allows. An employee who may only order fuel sees the overview, the stock and the supply tab, and nothing else.

TabNeedsContents
Overview24-hour and 7-day figures, rename the station, sell it (owner only)
Financedeposit or withdrawbalance, deposit, withdraw, transaction history
Pricesset_pricesprice mode and price per fuel type, with base price and limits shown
Stocktank levels and current prices
Supplyorder_fuelNPC driver, instant restocking, delivery runs
Pumpsrepairpump condition, repair, mechanic
Staffhirehire, let go, change rank, per-employee statistics
Rankshirecreate, edit and delete ranks
Standing at the station

Every owner action carries the pump coordinates, and the server verifies the player is really there. A dashboard cannot be driven from across the map, and a station id in a payload proves nothing on its own.

Colours

The Settings tab of the admin dashboard sets five colours (accent, background, panel, primary and secondary text). Every other shade is derived from them, and the change previews live before it is saved. Both dashboards use the same palette.