computeScrollInfo wasn't being called before the first detectScroll
call, because there is no search functionality (somehow, i think). Fixed
by calling it if _scroll.rowHeight is 0.
uses the <tool-tip> tag now, and the setupTooltips() function in ui.ts
must be called at any point in the pages load. added "below-center"
position, showing below and centered horizontally. breakpoint tailwind
lingo also now works (e.g. "below-center sm:right"). If a left or
right-aligned tooltip clips off the screen, it will be shifted the
appropriate amount left/right to avoid that automatically.
Navigatable has clearURL, which for Search clears "search" qp, and
invites clears "invite" qp. Tab interfaces optionally include
"contentObject: AsTab", and show/hide funcs are passed the contentObject
of the previously loaded tab if one is available, so that they can call
it's clearURL method. This means searches you typed for the accounts tab
won't pop up when switching to activity.
_loadLock set true when a load is happening, if another _load is called
when this is happening, the method call is appended to _loadQueue. When
a running _load finishes, it shift()s the _loadQueue and calls the
method from it if there is one.
searches are triggered by setting the search QP, and ran by a listener
set on PageManager. same with details. Works surprisingly well, but i'm
sure theres bugs.
tab content classes (e.g. settingsList, activityList)
can implement "AsTab", "Navigatable" and or "PageEventBindable",
the first giving them a tab name, a subpath and a reloader function,
the second an "isURL" and "navigate" function for loading resources,
the last giving them bind/unbindPageEvent methods. These are looped
through in ts/admin.ts still crudely, maybe tabs.ts could accept "AsTab"
implementers directly.
"Search" class now has a ?search query param which just encodes the
search box content, set when you perform a server search (hit enter or
press the button). ?user queries from the accounts or activity tab will
be converted to this form on loading.
RadioBasedTabs
when clicking a username in the accounts tab, the details comes up with
a copy of the row you clicked, so you can view logs and edit the user.
Also decided not to use a RadioBasedTab here, instead providing a link
to the activity tab with a search for the user (added the ability to do
that, ?user=username). FIXME: handle deleting the user or just generally
editing them.
pass a string (new "id" field) or number to RadioBasedTabSelector.selected = x.
setting an "id" for a tab is optional, if not set it's value defaults to the "name" value.
Also added optional buttonHTML to put inside the button insetad of the
given name.
added POST route for pagination to activity route, a count route, and
modified Search and PaginatedList a bit to support lists without search
fields (essentially just running an empty search). Visible by clicking
on a user's name in the accounts tab.
forgot to switch branches before doing a fix for #455, so it's in here
too. OmbiUserByJfID/getOmbiUser takes an optional email *string, to
optionally pass an override email address to search with, used when
changing it.
go's html/template was thinking header.html and other template snippets
were full documents, so inserting their own <html> and other tags,
breaking the head up. Renaming to txt seems to fix things.
When generating the cache and calling userSummary per user, previously
the DB was queried for an invite with the ReferrerJellyfinID set to the
user's ID. This was fast enough on my test system (~5000 users in
~1.5s), while testing cross-compilation, I found it ran extremely slow
on an arm64 build (running through QEMU admittedly), doing ~5000 in
~18s. Instead, a map of IDs to invites/referrals is generated once and
queried instead. Initial load now takes ~80ms on my system, and 0.95s
through QEMU, and 0.68s on a rockpro64 SBC.
removes one dependency. jfa-go-build-docker has been updated to reflect
this, and in general with a newer debian version and properly included
goreleaser, and a build for amd64. Dockerfiles now use a
"distroless"-style container as their base. Was gonna use
chainguard/glibc-dynamic, but it running as a different user meant it
wouldn't read/write from your /data mount without manual intervention.
I don't use and fancy typescript features, and apparently this version
is very usable at this point. Removes the typescript dependency, which
should have been in dev-deps anyway.
doesn't result in much gain on my machine or my CI server so it's not
the default. On local machine (5800x), went from ~5ms to ~4ms, on my CI
(hetzner ampere altra with 8 vCPUs) went from ~15ms to ~10ms.
uses regex mostly, resulting in a significantly faster execution (old:
~2s, new: ~31ms). Only matches classList.add/remove and class="..."
(won't touch string literal variables or colours), but these weren't
really used anyway. Supports multi-line classList.add/remove, which was
the reason I wrote this anyway (formatting the codebase introduced some
of these).
For #451. Setting in integrations > chat bots > telegram makes jfa-go
ignore the telegram users clients lanugage setting and always use
whatever is set as the default language in jfa-go. Also added /lang
default, to un-set a preferred language. the start message also now
shows up on typing /help or !help too.