built-in agent

This commit is contained in:
Henry Dollman
2024-10-07 18:58:57 -04:00
parent 7a82571921
commit 8de2dee4e9
5 changed files with 80 additions and 33 deletions

View File

@@ -94,13 +94,15 @@ export function UserAuthForm({
setErrors({ passwordConfirm: msg })
return
}
// create admin user
await pb.admins.create({
email,
password,
passwordConfirm: password,
})
await pb.admins.authWithPassword(email, password)
await pb.collection('users').create({
// create regular user
const user = await pb.collection('users').create({
username,
email,
password,
@@ -108,6 +110,13 @@ export function UserAuthForm({
role: 'admin',
verified: true,
})
// create hubsys
await pb.collection('systems').create({
name: 'x',
port: 'x',
host: 'hubsys',
users: user.id,
})
await pb.collection('users').authWithPassword(email, password)
} else {
await pb.collection('users').authWithPassword(email, password)

View File

@@ -197,7 +197,7 @@ export default function SystemDetail({ name }: { name: string }) {
uptime = `${Math.trunc(system.info?.u / 86400)} days`
}
return [
{ value: system.host, Icon: GlobeIcon },
{ value: system.host, Icon: GlobeIcon, hide: system.host === 'hubsys' },
{
value: system.info.h,
Icon: MonitorIcon,