Skip to content

Commit

Permalink
chore: nui perf increase + fix menu link
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Dec 30, 2023
1 parent 71aa41e commit 2377dc1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
7 changes: 7 additions & 0 deletions core/components/WebServer/getReactIndex.ts
Expand Up @@ -178,5 +178,12 @@ export default async function getReactIndex(ctx: CtxWithVars | AuthedCtx) {
htmlOut = htmlOut.replaceAll(replacerRegex, value);
}

//If in prod mode and NUI, replace the entry point with the local one
//This is required because of how badly the WebPipe handles "large" files
if (!ctx.txVars.isWebInterface && !convars.isDevMode){
htmlOut = htmlOut.replace(/src="\.\/index.js"/, 'src="nui://monitor/panel/index.js"');
htmlOut = htmlOut.replace(/href="\.\/index.css"/, 'href="nui://monitor/panel/index.css"');
}

return htmlOut;
}
1 change: 1 addition & 0 deletions docs/dev_notes.md
Expand Up @@ -222,6 +222,7 @@ Quickies
- [x] commit the fixes for the player ids and god mode issues
> BETA RELEASE
- [ ] feat(menu): add keymapping for tp to waypoint (PR #886)
- [ ] fix the tsc build
- [ ] do i need to add a input type hidden with the username in the add master and account modal so vaults can save it both?
- [ ] put in server name in the login page, to help lost admins notice they are in the wrong txAdmin
Expand Down
3 changes: 2 additions & 1 deletion fxmanifest.lua
Expand Up @@ -5,7 +5,7 @@
author 'Tabarra'
description 'Remotely Manage & Monitor your GTA5 FiveM Server'
repository 'https://github.com/tabarra/txAdmin'
version '7.0.0-dev'
version '7.0.0-beta1'
ui_label 'txAdmin'

rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
Expand Down Expand Up @@ -65,6 +65,7 @@ files {
'nui/**/*',

-- WebPipe optimization:
'panel/**/*',
'web/public/css/coreui.min.css',
'web/public/css/jquery-confirm.min.css',
'web/public/css/txAdmin.css',
Expand Down
9 changes: 8 additions & 1 deletion panel/src/layout/DesktopNavbar.tsx
Expand Up @@ -125,6 +125,13 @@ export default function DesktopHeader() {
Diagnostics
</HeaderMenuLink>
<HeaderMenuLink
className="w-36 justify-start"
href="/system/system-logs"
disabled={!hasPerm('txadmin.log.view')}
>
System Logs
</HeaderMenuLink>
{/* <HeaderMenuLink
className="w-36 justify-start"
href="/system/console-log"
disabled={!hasPerm('txadmin.log.view')}
Expand All @@ -137,7 +144,7 @@ export default function DesktopHeader() {
disabled={!hasPerm('txadmin.log.view')}
>
Action Log
</HeaderMenuLink>
</HeaderMenuLink> */}
</NavigationMenuContent>
</NavigationMenuItem>
</NavigationMenuList>
Expand Down
16 changes: 13 additions & 3 deletions panel/src/layout/MainRouter.tsx
Expand Up @@ -59,10 +59,20 @@ const allRoutes: RouteType[] = [
children: <Iframe legacyUrl="systemLog#nav-console" />
},
{
path: '/system/action-log',
title: 'Action Log',
children: <Iframe legacyUrl="systemLog#nav-actions" />
path: '/system/system-logs',
title: 'System Logs',
children: <Iframe legacyUrl="systemLog" />
},
// {
// path: '/system/console-log',
// title: 'Console Log',
// children: <Iframe legacyUrl="systemLog#nav-console" />
// },
// {
// path: '/system/action-log',
// title: 'Action Log',
// children: <Iframe legacyUrl="systemLog#nav-actions" />
// },

//Server Routes
{
Expand Down

0 comments on commit 2377dc1

Please sign in to comment.