Files
BetterDesk/web-nodejs/views/agents.ejs
T
UNITRONIX a426bf1a65 fix(console): dashboard agent pairing issues a one-time code, not the QR scanner
Główne asked operators to scan a QR while the product moved to short-code pairing, so the dashboard button and the /?activateAgent=1 deep link opened the wrong flow.

- Client-config card button and the sidebar entry (nav.pair_agent) open a pairing-code dialog: server address prefilled from the resolved client address, optional label, code generation, 10-minute countdown, copy.

- Codes are minted via the existing POST /api/panel/pairing/codes behind enrollment.approve; plaintext shown once, never logged. No new endpoint.

- The QR scanner stays reachable from the dialog (Scan agent QR) and from /pairing; the scanner modal title now names itself instead of reusing the old Activate agent label.

- New keys nav.pair_agent, dashboard.pair_with_code, pairing.scan_qr_agent, pairing.generating in all 26 locales; agents.* step 3 / button / body no longer present QR as the primary path.

- Test: web-nodejs/tests/dashboardPairingUi.test.js renders the view and asserts the code dialog wiring and the deep-link target.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 20:59:57 +01:00

103 lines
4.6 KiB
HTML

<%- include('layouts/main', {
title: _('nav.agents'),
pageStyles: ['pages', 'agents'],
pageScripts: ['agents'],
currentPage: 'agents',
breadcrumb: [{ label: _('nav.agents') }],
body: `
<div class="page-header">
<h1 class="page-title">
<span class="material-icons" aria-hidden="true">support_agent</span>
${_('agents.title')}
</h1>
<p class="page-subtitle">${_('agents.subtitle')}</p>
</div>
<div class="agents-page">
<section class="card agents-info-card">
<div class="card-header">
<h2 class="card-title">
<span class="material-icons" aria-hidden="true">info</span>
${_('agents.what_title')}
</h2>
</div>
<div class="card-body">
<p>${_('agents.what_body')}</p>
<p class="form-hint agents-note">${_('agents.note_no_build')}</p>
</div>
</section>
<section class="card agents-info-card">
<div class="card-header">
<h2 class="card-title">
<span class="material-icons" aria-hidden="true">download</span>
${_('agents.get_title')}
</h2>
</div>
<div class="card-body">
<p>${_('agents.get_body')}</p>
<div class="agents-actions">
<a class="btn btn-primary" href="https://github.com/UNITRONIX/BetterDesk-Client/releases" target="_blank" rel="noopener noreferrer">
<span class="material-icons" aria-hidden="true">open_in_new</span>
${_('agents.get_github')}
</a>
<a class="btn btn-secondary" href="/portal" target="_blank" rel="noopener noreferrer">
<span class="material-icons" aria-hidden="true">public</span>
${_('agents.get_portal')}
</a>
</div>
</div>
</section>
<section class="card agents-info-card" id="agents-sync-card">
<div class="card-header">
<h2 class="card-title">
<span class="material-icons" aria-hidden="true">cloud_download</span>
${_('agents.sync_title')}
</h2>
<button type="button" class="btn btn-primary btn-sm" id="agents-sync-release">
<span class="material-icons" aria-hidden="true">sync</span>
${_('agents.sync_import')}
</button>
</div>
<div class="card-body">
<p class="form-hint">${_('agents.sync_hint')}</p>
<div id="agents-release-list" class="agents-release-list">
<span class="text-muted">${_('agents.sync_empty')}</span>
</div>
<p id="agents-release-status" class="form-hint" role="status"></p>
</div>
</section>
<section class="card agents-info-card">
<div class="card-header">
<h2 class="card-title">
<span class="material-icons" aria-hidden="true">checklist</span>
${_('agents.steps_title')}
</h2>
</div>
<div class="card-body">
<ol class="agents-steps">
<li>${_('agents.step1')}</li>
<li>${_('agents.step2')}</li>
<li>${_('agents.step3')}</li>
<li>${_('agents.step4')}</li>
</ol>
<div class="agents-actions">
<a class="btn btn-primary" href="/?activateAgent=1">
<span class="material-icons" aria-hidden="true">pin</span>
${_('agents.pair_activate')}
</a>
<a class="btn btn-secondary" href="/client-branding">
<span class="material-icons" aria-hidden="true">palette</span>
${_('agents.branding_link')}
</a>
</div>
<p class="form-hint">${_('agents.pair_body')}</p>
<p class="form-hint">${_('agents.branding_body')}</p>
</div>
</section>
</div>
`
}); %>