feat(api, web): enhance agent installation process with invited status and policy support
- Updated the agent enrollment process to include an 'invited' status, allowing for better tracking of agent states. - Implemented support for install links that can now include an `install_link_id`, facilitating the transition from invited to pending status upon enrollment. - Enhanced the MikroTik installation script to include the `EvofwInstallLinkId` for better tracking and management. - Added new API endpoints for fetching agent policies and serving MikroTik-specific installation scripts. - Improved the web UI to reflect the new agent statuses and provide copyable installation commands for agents. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ import { refreshAllLists } from './services/lists/refresh.js'
|
||||
import { repos } from '@evofw/db'
|
||||
import {
|
||||
isValidInstallSlug,
|
||||
resolveAndRenderInstallScript,
|
||||
resolveAndRenderInstall,
|
||||
} from './services/install-links.js'
|
||||
|
||||
export interface BuildAppOptions {
|
||||
@@ -85,13 +85,13 @@ export async function buildApp(opts: BuildAppOptions = {}) {
|
||||
) {
|
||||
const link = repos.getInstallLinkBySlug(app.db, segment)
|
||||
if (link) {
|
||||
const script = resolveAndRenderInstallScript(
|
||||
const { body, contentType } = resolveAndRenderInstall(
|
||||
app.db,
|
||||
link,
|
||||
config.publicBaseUrl,
|
||||
config.enrollSeed,
|
||||
)
|
||||
return reply.type('text/x-shellscript').send(script)
|
||||
return reply.type(contentType).send(body)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user