Skip to content

Commit

Permalink
tweak: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Jan 18, 2024
1 parent 33f3fb9 commit 34c89a8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
5 changes: 2 additions & 3 deletions core/components/StatisticsManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default class StatisticsManager {
#publicKey: jose.KeyLike | undefined;

#fxServerBootSeconds: number | false = false;
public readonly pageViews = new MultipleCounter();
public readonly loginOrigins = new MultipleCounter();
public readonly loginMethods = new MultipleCounter();
public readonly botCommands = new MultipleCounter();
Expand Down Expand Up @@ -123,6 +122,7 @@ export default class StatisticsManager {
* 9: for tx v7, loginOrigin dropped the 'webpipe' and 'cfxre',
* and loginMethods dropped 'nui' and 'iframe'
* Did not change the version because its fully compatible.
* 10: deprecated pageViews because of the react migration
*
* TODO:
* Use the average q5 and q95 to find out the buckets.
Expand Down Expand Up @@ -166,7 +166,6 @@ export default class StatisticsManager {

//Passive runtime data
fxServerBootSeconds: this.#fxServerBootSeconds,
pageViews: this.pageViews,
loginOrigins: this.loginOrigins,
loginMethods: this.loginMethods,
botCommands: this.#txAdmin.discordBot.config.enabled
Expand Down Expand Up @@ -205,7 +204,7 @@ export default class StatisticsManager {
const jwe = await new jose.CompactEncrypt(encodedHbData)
.setProtectedHeader(jweHeader)
.encrypt(this.#publicKey);
this.currHbData = JSON.stringify({ '$statsVersion': 9, jwe });
this.currHbData = JSON.stringify({ '$statsVersion': 10, jwe });
tmpDurationDebugLog('finished');

} catch (error) {
Expand Down
3 changes: 0 additions & 3 deletions core/components/WebServer/middlewares/ctxUtilsMw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ export default async function ctxUtilsMw(ctx: CtxWithVars, next: Next) {

//Functions
const renderUtil = async (view: string, data?: { headerTitle?: string, [key: string]: any }) => {
//Usage stats
txAdmin.statisticsManager?.pageViews.count(view);

//Typescript is very annoying
const possiblyAuthedAdmin = ctx.admin as AuthedAdminType | undefined;

Expand Down
9 changes: 5 additions & 4 deletions docs/dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
- [x] Add clear copyright/license notice at the bottom of the server sidebar?
- [ ] talk to r* and make sure the new build process wipes the old cache

- [ ] deprecate StatisticsManager.pageViews as its now untrackable?
- [ ] check all discord invites (use utm params maybe?)
- [ ] onesync should be legacy by default
- [x] deprecate StatisticsManager.pageViews as its now untrackable?
- [x] check all discord invites (use utm params maybe?)
- [x] onesync should be legacy by default

- [ ] fix issue where the forced password change on save reloads the page instead of moving to the identifiers tab
- [ ] easter egg with some old music? https://www.youtube.com/watch?v=nNoaXej0Jeg
Expand Down Expand Up @@ -174,8 +174,9 @@ setTimeout(() => {
- lib

### panel z-order
z-10 UI: Header, and asides
z-10 UI: server/playerlist asides
z-10 shadcn: NavigationMenu
z-20 UI: Header

z-10 Terminal: LiveConsoleSearchBar
z-10 Terminal "scroll to bottom" button
Expand Down
2 changes: 1 addition & 1 deletion panel/src/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function AuthedHeaderFragment() {

export function Header() {
return (
<header className="sticky top-0 z-10 flex flex-col items-center justify-center
<header className="sticky top-0 z-20 flex flex-col items-center justify-center
border-b bg-card text-card-foreground border-card-background">
<div className="h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all">
<div className="flex flex-row items-center flex-grow gap-5 mr-5">
Expand Down
4 changes: 2 additions & 2 deletions panel/src/layout/PlayerlistSidebar/Playerlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function PlayerlistFilter({ filterString, setFilterString }: PlayerlistFilterPro
<XIcon />
</button>
) : (
<div className="absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400">
<InlineCode className="text-xs tracking-wide select-none">ctrl+k</InlineCode>
<div className="absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none">
<InlineCode className="text-xs tracking-wide">ctrl+k</InlineCode>
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion shared/otherTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type UpdateDataType = {
export type ThemeType = {
name: string;
isDark: boolean;
style: {[key: string]: string};
style: { [key: string]: string };
};

export type AdsDataType = {
Expand Down

0 comments on commit 34c89a8

Please sign in to comment.