Skip to content

Commit

Permalink
wip: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Jan 4, 2025
1 parent 7c47226 commit 152a125
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 54 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2024 André Tabarra <[email protected]>
Copyright (c) 2019-2025 André Tabarra <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions core/modules/WebServer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export default class WebServer {
},
roots: [
txDevEnv.ENABLED
? path.join(txDevEnv.SRC_PATH, 'panel/public')
: path.join(txEnv.txAdminResourcePath, 'panel'),
? path.join(txDevEnv.SRC_PATH, 'panel/public')
: path.join(txEnv.txAdminResourcePath, 'panel'),
path.join(txEnv.txAdminResourcePath, 'web/public'),
],
onReady: () => {
Expand Down
99 changes: 56 additions & 43 deletions docs/dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ Legend:
- criar um estado "any modal open" pra desabilitar todos hotkeys das páginas?
- [ ] reported cases of crash reason too big without word break causing page to scroll horizontal

## Highlights
- [x] New player drops page
## Pending Improvements
- [ ] Player drops page
- [!] fix: blurred chart lines
- [!] fix: crashes table overflowing (DrilldownCrashesSubcard.tsx)
- [ ] review page layout:
- [ ] make it less card-y
- [ ] fix crashes table widening the outer shell - is it just the scroll?
- [ ] fix crashes table is not responsive
- [ ] fix scroll popping in/out
- [ ] add drilldown interval buttons
- Dashboard stuff:
- [ ] add testing for getServerStatsData
- [ ] warning for top servers
- full perf chart:
- [ ] disable `<...>.curve(d3.curveNatural)` on `playerLineGenerator` if more than 20 players?
- [ ] buttons to show memory usage, maybe hide player count
- [ ] calculate initial zoom of 30h
- Initial zoom code: https://observablehq.com/@d3/zoomable-area-chart?intent=fork
Expand All @@ -41,11 +43,19 @@ Legend:
- [ ] change the bg color to the color of the average ticket with heavy transparency?

## Small feat
- [x] improve UX for debugging bans
- tweak: improved readability on player join/leave events on server log
- feat(core): added server log for blocked joins of banned players
- feat(panel): added button to compare player/action ids
- feat(panel): added copy IDs button to player and action modals
- [x] feat(core): implement custom serveStatic middleware
- [ ] live console
- [x] feat(panel/console): added hidden copy options
- [ ] if socket connects but no data received, add a warning to the console and wipe it after first write
- [ ] persistent cls via ts offsets
- [ ] improve the bufferization to allow just loading most recent "block" and loading prev blocks via button
- [ ] separate server log join/leave filter, and shorten the IDs of the joins, and copy ids button on the modal
- [ ] options dropdown?


## Database Changes
- [ ] migration to change "revocation" to optional
Expand All @@ -61,8 +71,13 @@ Legend:
- happens when some page starts the server and redirects you to the live console
- you join the room and gets initial data (directly from logger)
- while the websocket out buffer still haven't sent the boot message
- [ ] maybe update xterm to v5.6
- https://github.com/xtermjs/xterm.js/issues/3864
- [ ] xterm changes
- [ ] deprecate canvas renderer and use the webgl instead
- [ ] check compatibility with text scaling - `window.devicePixelRatio`
- [ ] maybe update xterm to v5.6
- ref: https://github.com/xtermjs/xterm.js/issues/3864
- ref: https://github.com/xtermjs/xterm.js/issues/4779
- ref: https://github.com/xtermjs/xterm.js/milestone/78

## Refactor + DX
- [x] deprecate fxRunner.srvCmd
Expand All @@ -89,6 +104,16 @@ Legend:
- [x] .env
- [x] convert builders to use txDevEnv
- [x] convert tx code use txDevEnv
- [ ] New Settings Page:
- [ ] hide onesync
- [ ] new layout
- [ ] move all options from old page to new page (no code just yet)
- [ ] ?????
- [ ] ?????
- [ ] ?????
- [ ] double check:
- check if all text fields and selects have the `htmlFor`
- check if all textarea fields are auto-sized

- [ ] Layout refactor:
- não ter espaço em branco abaixo do header
Expand All @@ -100,44 +125,15 @@ Legend:
- checar warning bar
- tirar o servername do menu de server?
- tirar servername do mobile header?
- 390x670 resolução mais comum
- 360x
- NOTE: resoluções mobile
- 360x510 menor razoável
- 390x670 mais comum

- [ ] new txConfig
- [ ] remove dynamicAds from the modules

> Alright, so what I'm gonna do:
> 1. default continues being "on"
> 2. the dropdown will be hidden under advanced
> 3. the dropdown will still have all 3 options (having only 2 would be annoying due to code)
> 4. Once we have data on legacy usage, if the number is below 20% or something like that, I can remove the dropdown entirely but the option would still be configurable by editing config.json


- [ ] remove `fs-extra` - right now only used in deployer and setup
- [ ] headless deployer, without instantiating TxAdmin
- [ ] lua file changes (after PR merges)
- 4 spaces
- Upper case for globals
- alt+shift+f
- `.git-blame-ignore-revs`
- [ ] xterm changes:
- ref: https://github.com/xtermjs/xterm.js/issues/4779
- ref: https://github.com/xtermjs/xterm.js/milestone/78
- [ ] deprecate canvas renderer and use the webgl instead
- [ ] check compatibility with text scaling - `window.devicePixelRatio`
- [ ] include `list-dependencies.js` as part of the test workflow
- improve to read the parent package deps
- exit 1 on error
- detect circular imports
- [ ] testing
- use playwright
- [ ] use https://mswjs.io/docs/getting-started
- [ ] write some automated tests for the auth logic and middlewares

## Chores + boring stuff
- [ ] switch to `game 'common'` and remove `rdr3_warning`
- [ ] add `.yarn.installed` to the dist? even in dev
Expand Down Expand Up @@ -186,7 +182,6 @@ Legend:
- migrar admins.json
- pra cada admin do admins.json
- const admin = new StoredAdmin(rawObj)
-
- Middleware:
storedAdmin.getAuthed(csrfToken): AuthedAdmin
- class AuthedAdmin extends StoredAdmin
Expand Down Expand Up @@ -221,6 +216,18 @@ if (!params) return;



## Other annoying stuff to do
- [ ] remove `fs-extra` - right now only used in deployer and setup
- [ ] headless deployer, without instantiating TxAdmin
- [ ] include `list-dependencies.js` as part of the test workflow
- improve to read the parent package deps
- exit 1 on error
- detect circular imports
- [ ] testing
- use playwright
- [ ] use https://mswjs.io/docs/getting-started
- [ ] write some automated tests for the auth logic and middlewares

## Refactor: Formatting + Linting
- [ ] fix the eslint config + tailwind sort
- [alternative](https://biomejs.dev/linter/rules/use-sorted-classes/)
Expand All @@ -233,8 +240,11 @@ if (!params) return;
- When running prettier, add ignore to the imported external files
https://prettier.io/docs/en/integrating-with-linters.html
https://tailwindcss.com/blog/automatic-class-sorting-with-prettier


- [ ] lua file changes (after PR merges)
- 4 spaces
- Upper case for globals
- alt+shift+f
- `.git-blame-ignore-revs`

=======================================================================

Expand Down Expand Up @@ -282,11 +292,14 @@ https://tailwindcss.com/blog/automatic-class-sorting-with-prettier
- [ ] cfg parser: resource relative read errors shouldn't trigger warnings
- [ ] check again for the need of lazy loading
- [ ] put in server name in the login page, to help lost admins notice they are in the wrong txAdmin
- [ ] update stuff that requires WMIC to use PS command directly
- NOTE: perhaps just use `systeminformation.processLoad()` instead
- issue: https://github.com/tabarra/txAdmin/issues/970#issuecomment-2308462733
- new lib, same dev: https://www.npmjs.com/package/pidusage-gwmi
- https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/07-working-with-wmi?view=powershell-7.2
- [ ] Try to replace all the host stats/data with stuff from the SI lib (eg `systeminformation.processLoad()`).
- They are already using GWMI: https://github.com/sebhildebrandt/systeminformation/issues/616
- Pay attention to the boot and shutdown comments
- NOTE: Old ref:
- update stuff that requires WMIC to use PS command directly
- issue: https://github.com/tabarra/txAdmin/issues/970#issuecomment-2308462733
- new lib, same dev: https://www.npmjs.com/package/pidusage-gwmi
- https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/07-working-with-wmi?view=powershell-7.2

- After Node 22:
- check all `.npm-upgrade.json` for packages that can now be updated
Expand Down
3 changes: 1 addition & 2 deletions docs/translation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Translation Support
txAdmin supports translation in over 25 languages for the in-game interface (menu/warn) and chat messages, as well as discord warnings.
txAdmin supports translation for over 30 languages for the in-game interface (menu/warn) and chat messages, as well as discord warnings.


## Custom locales:
Expand All @@ -23,4 +23,3 @@ For that you will need to:
> **Pro Tip2:** To make sure you didn't miss anything in the locale file, you can download the txAdmin source code, execute `npm i`, move the `locale.json` to inside the `txAdmin/locale` folder and run `npm run locale:check`. This will tell you about missing or extra keys.
> **Note:** The performance of custom locale for big servers may not be ideal due to the way we need to sync dynamic content to clients. So it is strongly encouraged that you contribute with translations in our GitHub so it gets packed with the rest of txAdmin.
3 changes: 1 addition & 2 deletions panel/src/layout/MainShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export default function MainShell() {
window.history.replaceState({}, '', pageUrl);
}, []);

//Listens to hotkeys
//NOTE: WILL NOT WORK IF THE FOCUS IS ON THE IFRAME
//Listens to hotkeys (doesn't work if the focus is on an iframe)
useEventListener('keydown', hotkeyEventListener);

return <>
Expand Down
2 changes: 1 addition & 1 deletion panel/src/lib/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const handleExternalLinkClick = (event: React.MouseEvent<HTMLElement, Mou


/**
* Sets a URL search param with a given value, or deletes it if value is undefined
* Sets the window URL search param with a given value, or deletes it if value is undefined
*/
export const setUrlSearchParam = (paramName: string, ref: string | undefined) => {
if (typeof paramName !== 'string' || !paramName.length) {
Expand Down
2 changes: 1 addition & 1 deletion panel/src/pages/Dashboard/drawFullPerfChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export default function drawFullPerfChart({
const playerLineGenerator = d3.line<PerfSnapType>(
(d) => timeScale(d.end),
(d) => playersScale(d.players),
).curve(d3.curveNatural);
).curve(d3.curveNatural); //FIXME: overflows the canvas on extreme changes
lifespanGSel.selectAll('path.players-line-bg')
.data(prepareLifespanDataItem)
.join('path')
Expand Down
2 changes: 1 addition & 1 deletion web/main/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
<div class="col-sm-9">
<input type="text" class="form-control" id="frmMenu-pageKey"
value="<%= global.menuPageKey || '' %>"
placeholder="578045190955335691" <%= readOnly ? 'disabled' : '' %>>
placeholder="" <%= readOnly ? 'disabled' : '' %>>
<span class="form-text text-muted">
The key used to to switch tabs in the menu. <br>
Click above and press any key to change the configuration. <br>
Expand Down
2 changes: 1 addition & 1 deletion web/public/css/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ body.theme--dark {
.blur-input:not(:focus):not(:placeholder-shown) {
color: transparent !important;
text-shadow: 0 0 5px rgba(235, 235, 235, 0.5) !important;
}
}

/**
* txAdmin player list
Expand Down

0 comments on commit 152a125

Please sign in to comment.