Repository navigation
[stable35] feat(settings): split the admin page into Status and Background jobs - #1126
Merged
Merged
Conversation
Every "not available" figure in this app is -1, and several paths did
arithmetic on that sentinel or formatted it as though it were a reading:
- SystemStatistics scaled it to kB, so the OCS API answered
mem_total: -1024 to external monitoring tools
- formatBytes() took the absolute value, so PHP's memory_limit = -1
("unlimited") rendered as "1.0 B"
- DatabaseStatistics returned the string 'N/A' for a field typed and
formatted as a number, which reached the page as "NaN B"
- MemoryChartSection and ResourceOverviewSection guarded against an 'N/A'
string the backend never sends, so -1 charted as a real series on a
degenerate 0-to-0 axis
- the OS backends claimed a single core when the count was unknown, and
that 1 became the divisor for the load average: an eight-core host under
load read as "800 %"
Unknown values are now -1 throughout and render as "Unknown", or are left
out where a percentage cannot be computed. PHP's own "unlimited" sentinels
(memory_limit -1, max_execution_time 0) are labelled as such rather than
formatted as sizes. The load average survives a missing core count: it
comes from sys_getloadavg() and is real even when the count is not.
Read CPU, memory and uptime where /proc is hidden
Debian's and Ubuntu's apache2 unit ships ProcSubset=pid and
ProtectProc=invisible, so the web server sees only its own processes in
/proc. On those hosts -- a large share of installs -- this app has never
been able to report CPU, memory or uptime at all, and now reports honestly
that it cannot, which is worse to look at than it needs to be.
Commands still run there, so the Linux backend now falls back:
- threads: nproc, which uses sched_getaffinity rather than /proc
- memory: the per-NUMA-node meminfo files under /sys, which ProcSubset
does not cover, before free(1) -- free reads /proc/meminfo itself and is
bound to fail wherever that file is hidden, so trying /sys first settles
which situation we are in without paying for a fork
- uptime: a process that has only just started carries the system uptime
in its own /proc/<pid>/stat, and a process may always read its own entry
aarch64 and s390x are handled too: they list their processors but carry no
"model name" line, so the count is now taken separately from the name.
Cut the cost of the two-second poll
A poll spends about 1.3 ms collecting data inside a request that costs
hundreds of milliseconds, so the fix is fewer and cheaper requests, not
faster collection:
- useLiveData stops polling while the tab is hidden and polls immediately
on return, so a page left open in the background no longer fetches
numbers nobody can see
- getTime() no longer forks date(1) for something PHP can answer; the
system zone is read from /etc/localtime because Nextcloud runs on UTC
- LiveData no longer calls getCPU() -- which parses /proc/cpuinfo, or forks
nproc -- only to reach sys_getloadavg(), which uses none of it
- the sampled uptime is cached as a boot time and re-measured once a
minute rather than once per poll
Together these leave the poll forking less than it did before: hosts with a
readable /proc now fork nothing at all, where every host used to fork date.
Signed-off-by: Frank Karlitschek <frank.karlitschek@nextcloud.com>
Assisted-by: Claude Code:claude-opus-5
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
The Monitoring page had grown to fourteen sections on one long scroll, with the background job tables — three of them, each potentially long — sitting in the middle of the hardware readings. Checking whether cron is alive meant scrolling past the CPU and memory charts every time. Add a navigation at the top of the page that switches between a "Status" page, which keeps everything that describes the machine, and a new "Background jobs" page, which the background jobs section moves to unchanged. The page body is split into StatusView and BackgroundJobsView so that SettingsAdmin is left as a shell that fetches the data and picks a view. The two are toggled with v-show rather than v-if on purpose: the CPU and memory charts accumulate their history in the component, so v-if would reset both graphs every time the admin glanced at the job tables. The switch is an NcRadioGroup of NcRadioGroupButton, so it renders real radio inputs with a group label rather than click handlers on divs. Signed-off-by: Frank Karlitschek <frank.karlitschek@nextcloud.com> Assisted-by: Claude Code:claude-opus-5 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
kesselb
force-pushed
the
backport/1119/stable35
branch
from
September 9, 2026 17:45
78b5dde to
2e158b5
Compare
Collaborator
|
Rebased on top of #1127 |
kesselb
marked this pull request as ready for review
September 9, 2026 17:46
karlitschek
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #1119
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.