Skip to content

Follow the server's resources on a Resources page, and start, stop, restart or rescan them - #57

Merged
ImBaphomettt merged 6 commits into
mainfrom
resources-page
Nov 11, 2026
Merged

ImBaphomettt merged 6 commits into
mainfrom
resources-page

Conversation

@ImBaphomettt

Copy link
Copy Markdown
Member

Five commits, one per piece of work, each of which builds and passes on its own, then main (#56) merged in. Together: the bridge lists every resource FXServer knows, Observer writes FXServer's own start, stop, restart and refresh on its console when someone asks, and a Resources page shows the resources by folder as they stand, live, with a start, a stop or a restart of each. A stop or a restart that takes other resources down names them before it acts.

What changed

The bridge lists the resources, and Observer writes their commands (9f8918e)

  • resource/observer/server.lua: once the cfg has run, and after each refresh (onResourceListRefresh), the bridge reports every resource FXServer knows, in pages of 100: its name, state, path, manifest version, dependency and dependencies, and provide. An internal report (resource_list): the contract stays at 4.
  • observer-fxserver (resources): what a run knows of its resources. The folder comes from the path, the [x] folders that end it being its categories ([core]/[ox]), and system_resources marking the build's own. The bridge is left out. Each resource keeps what last happened to it in the run, and the resource it stopped with when FXServer stopped it along with another. The started resources that depend on one are found as ResourceDependencyLoader.cpp and ResourceManager.cpp find them, provide included.
  • stdin: start|stop|restart <name> and refresh join the lines Observer may write, with a name of ASCII letters, digits, _, . and -, 64 at most (ResourceName). A line written for someone is echoed in the console as their command.
  • start: what FXServer said of each resource as it started it, kept until the next start: that it could not start it, its warnings, heavy and oversized files and missing files, and what the last refresh found.
  • supervisor: resources(), resource() and refresh_resources(). A run's list is reset at each spawn and dropped at the exit.

The fake FXServer does them as FXServer does (ad2af30)

  • start, stop, restart, ensure and refresh follow FXServer's sources: a stop takes what depends on the resource first and starts none of it again, a start brings what the resource depends on first, a restart of a stopped resource answers "Can't restart a stopped resource.", and refresh reads the folders again and prints what it found. The fake reports the list as the bridge does (fake_resource_page), and its report of the resources started 500 ms after the last change, as the bridge does.

The service and the API (2a39c3f)

  • observer-domain (resources): ResourcesView, the whole list at each change, ResourceOrder and ResourceAck. Permission RESOURCES_CONTROL, bit 26, sensitive, in the Server area. Audit actions resource_started, resource_stopped, resource_restarted and resources_rescanned, each with the console command, and for a stop or a restart that takes others along, those it stopped and whether they were started again. Error codes resources_not_listed, resource_not_found, resource_name_refused, resource_busy and resource_changed. Topic server.resources, for DASHBOARD_VIEW or RESOURCES_CONTROL.
  • observer-app (supervision/resources): follows the supervisor and sends the list at most every 250 ms, and each second while a panel watches it, for what only the console says, such as a start that failed. An order is audited before its line is written and counts in the user's commands window. It shows on the list, with who asked, until FXServer answers it, and no other order is taken on that resource meanwhile. A restart can start again what FXServer stopped with the resource, with one start each. The bridge is never named in an order.
  • observer-web: POST /servers/default/resources/start, /stop, /restart and /rescan, behind RESOURCES_CONTROL. The list has no route: it comes on the topic.
  • File changes: a start or a stop asked on the page is put down to who asked, as a command typed in the console already is.

The Resources page (5fda1b9)

  • Panel: Resources, in the rail under Console. The resources by folder, the server's root first, then its categories, then the build's own, each with its state, version and what last happened to it and who asked; Did not start for one FXServer could not start; its warnings and what they were. Filters with their counts, a search by name, folders that fold, as the browser remembers. Start, Restart and Stop on each row, Rescan above, a menu per row on a phone. A stop or a restart that takes other resources down asks first and names them; a restart offers to start them again, checked by default. When there is no list, the page says why: no server, a server starting with how many resources are up, or a bridge that listed nothing. Without the permission, the list without its buttons.
  • Segmented takes a count beside each choice. The audit log words the details of the new actions.
  • README: a Resources section, and the line about SFTP uploads points to it.

End to end (bbcee69)

  • The e2e server folder gains a resource that depends on the first. Stopping the first from the page names and stops the second; starting the second brings both back; both orders are in the audit log.

Notes for review

  • The commits are in the order they were built, and each was checked alone (see Verified): the branch reads commit by commit.
  • Orders go through FXServer's console rather than through the bridge: STOP_RESOURCE refuses chat, monitor, spawnmanager, mapmanager, baseevents, sessionmanager and the resource that calls it (ServerResources.cpp).
  • When FXServer stops a resource, it stops every started resource that depends on it, and nothing starts them again (ResourceDependencyLoader.cpp). The page names them before a stop or a restart, and a restart can start them again. This goes past what the page was asked to do; it was kept.
  • What FXServer does of each command was read in its sources at the commit of build 38435, never measured on a real server (see Not verified).
  • Permission bit 26: the kick, entities and allowlist branches of the same wave took 26 too. Whichever merges after this one renumbers, with the owner's mask in crates/observer-web/src/tests.rs (7ffffff here) and KEEPER in crates/observer-web/src/tests/resources.rs.
  • No migration. The bridge's contract stays at 4.

Verified

  • On Windows, at the branch's head, with main at Run the fake FXServer tests on ports the system gives, so that two runs on one host no longer collide #56 merged in: cargo xtask check whole, exit 0. That is cargo fmt --all --check, cargo xtask icons --check, clippy on all targets with -D warnings with and without observer/test-catalog, cargo test --workspace (2,743 passed, none failed, one ignored as on main), cargo xtask bindings leaving the tree as it is, and the panel's format, lint, type check, 794 tests and build. The panel ran under Node 26.13.
  • Each commit on its own, checked out: cargo fmt --all --check, clippy on all targets, the tests of its layer (observer-fxserver's, then the fake's), bindings unchanged after cargo xtask bindings, and the panel's format, lint, type check and tests for the last two.
  • The browser tests as the CI's third job runs them, at the head: cargo build --locked -p observer -p fake-fxserver --features observer/test-catalog, then the flows of web/e2e through Playwright 1.65 with the Chromium installed here (1248, where Playwright wants 1254): 11 passed, the new one among them, and the 2 that run only on Linux skipped.
  • In the browser, a debug build against the fake FXServer: the list by folder with its counts and warnings, a restart of a resource with three dependants started again, a stop of it through its dialog, a dependant started back with what it depends on, a rescan that found a new resource and two changed manifests, an order under way, an account with View the dashboard only (no button; the routes answer 403 and the audit log has the refusals), the server stopped and starting, and the audit log. In both themes, at 1440 px and at 375 px, with no console error and no sideways scroll.
  • GitHub Actions did not start the jobs (the organisation's billing, as on Give the server setup a screen of its own, and fix what a pass over the panel found #53 and Follow a start, edit server.cfg, turn Tools into a hub, and count what the resources do on Debug pages #54): the Panel job ended before its first step and the two others were skipped. The checks above are the CI's Rust, panel and browser steps, run locally on Windows; its Linux half is below.

Not verified

  • On a real FXServer: the bridge's list (GetNumResources, GetResourceByFindIndex, GetResourceState, GetResourcePath, GetResourceMetadata, GetNumResourceMetadata), onResourceListRefresh, the commands written on its console and what it prints for them, and the stop of the dependants. The Lua parses (lua-language-server --check); it has never run.
  • Linux: WSL is not installed on this machine. The branch has no cfg(unix) or cfg(windows) code.
  • cargo xtask e2e as such: Playwright asks for a newer Chromium than the one installed here, so the flows ran through the same Playwright with the installed one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant