@samitouri / QOSami-HFS / commits / 69af9da9

admin/home: make it clearer that you are accessing admin-panel because of localhost and not because you are logged in #918

Massimo Melina committed Feb 24, 2025 at 00:40 UTC 69af9da9c02b39c5a6d6f85b86da083b9fc5c791
1 file changed +4 -3
admin/src/HomePage.ts
+4 -3
@@ -65,7 +65,9 @@ export default function HomePage() {
65 title: status.updatePossible && "Right-click if you want to install a zip",
66 }
67 return h(Box, { display:'flex', gap: 2, flexDirection:'column', alignItems: 'flex-start', height: '100%' },
68 - username && entry('', "Welcome, "+username),
68 + account?.adminActualAccess ? entry('', "Welcome, "+username)
69 + : entry('', md("On <u>localhost</u> you don't need to login"),
70 + SOLUTION_SEP, "to access Admin-panel from another computer ", h(InLink, { to:'accounts' }, md("create an account with *admin* permission")) ),
71 dontBotherWithKeys(status.alerts?.map(x => entry('warning', md(x, { html: false })))),
72 errors.length ? dontBotherWithKeys(errors.map(msg => entry('error', dontBotherWithKeys(msg))))
73 : entry('success', "Server is working"),
@@ -84,8 +86,7 @@ export default function HomePage() {
86 : !vfs.root?.children?.length && !vfs.root?.source ? entry('warning', "You have no files shared", SOLUTION_SEP, fsLink("add some"))
87 : entry('', md("This is the Admin-panel, where you manage your server. Access your files on "),
88 h(Link, { target:'frontend', href: '../..' }, "Front-end", h(Launch, { sx: { verticalAlign: 'sub', ml: '.2em' } }))),
87 - !account?.adminActualAccess && entry('', md("On <u>localhost</u> you don't need to login"),
88 - SOLUTION_SEP, "to access Admin-panel from another computer ", h(InLink, { to:'accounts' }, md("create an account with *admin* permission")) ),
89 +
90 with_(proxyWarning(cfg, status), x => x && entry('warning', x,
91 SOLUTION_SEP, cfgLink("set the number of proxies"),
92 SOLUTION_SEP, "unless you are sure and you can ", h(Btn, {