mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-03-18 21:50:33 +01:00
accounts: show table row when clicking into details, more usage of
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.
This commit is contained in:
13
ts/admin.ts
13
ts/admin.ts
@@ -159,6 +159,7 @@ window.notifications = new notificationBox(document.getElementById("notification
|
||||
// Determine if url references an invite or account
|
||||
let isInviteURL = window.invites.isInviteURL();
|
||||
let isAccountURL = accounts.isAccountURL();
|
||||
let isActivityURL = activity.isActivityURL();
|
||||
|
||||
// load tabs
|
||||
const tabs: { id: string; url: string; reloader: () => void; unloader?: () => void }[] = [
|
||||
@@ -183,6 +184,8 @@ const tabs: { id: string; url: string; reloader: () => void; unloader?: () => vo
|
||||
accounts.loadAccountURL();
|
||||
// Don't keep loading the same item on every tab refresh
|
||||
isAccountURL = false;
|
||||
// Since accounts and activity accept ?user=x, wipe the other one.
|
||||
isActivityURL = false;
|
||||
}
|
||||
accounts.bindPageEvents();
|
||||
}),
|
||||
@@ -192,7 +195,15 @@ const tabs: { id: string; url: string; reloader: () => void; unloader?: () => vo
|
||||
id: "activity",
|
||||
url: "activity",
|
||||
reloader: () => {
|
||||
activity.reload();
|
||||
activity.reload(() => {
|
||||
if (isActivityURL) {
|
||||
activity.loadActivityURL();
|
||||
// Don't keep loading the same item on every tab refresh
|
||||
isActivityURL = false;
|
||||
// Since accounts and activity accept ?user=x, wipe the other one.
|
||||
isAccountURL = false;
|
||||
}
|
||||
});
|
||||
activity.bindPageEvents();
|
||||
},
|
||||
unloader: activity.unbindPageEvents,
|
||||
|
||||
Reference in New Issue
Block a user