feat(com-moodle): enhance COM reconnect/disconnect lifecycle and update Moodle URL and password RAG knowledge (v3.8.53)
This commit is contained in:
@@ -82,14 +82,22 @@
|
||||
<span class="small fw-bold text-uppercase text-muted">
|
||||
<i class="bi bi-usb-symbol me-1 text-primary"></i> Lectores Serie COM (Hasta 4)
|
||||
</span>
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<span class="badge bg-secondary-subtle text-secondary rounded-pill px-2 py-1 small" id="comGlobalBadge">
|
||||
<i class="bi bi-circle-fill text-muted me-1" style="font-size: 0.5rem;"></i> 0 / 4 Activos
|
||||
</span>
|
||||
<button type="button" class="btn btn-xs btn-link text-decoration-none p-0 text-muted" title="Reconectar autorizados" onclick="reconnectAuthorizedComPorts()">
|
||||
<i class="bi bi-arrow-clockwise"></i>
|
||||
</button>
|
||||
</div>
|
||||
<span class="badge bg-secondary-subtle text-secondary rounded-pill px-2 py-1 small" id="comGlobalBadge">
|
||||
<i class="bi bi-circle-fill text-muted me-1" style="font-size: 0.5rem;"></i> 0 / 4 Activos
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Botones de Acción Rápida Global -->
|
||||
<div class="d-flex align-items-center gap-2 mb-3">
|
||||
<button type="button" class="btn btn-sm btn-primary rounded-pill px-3 py-1 flex-grow-1 shadow-xs" id="btnQuickConnectCOM" onclick="handleQuickConnectCOM()">
|
||||
<i class="bi bi-usb-plug-fill me-1"></i> Conectar Lector COM
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary rounded-pill px-2 py-1" title="Reconectar lectores autorizados" onclick="reconnectAuthorizedComPorts()">
|
||||
<i class="bi bi-arrow-clockwise"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger rounded-pill px-2 py-1" title="Desconectar todos los puertos COM" onclick="handleDisconnectAllCOM()">
|
||||
<i class="bi bi-power"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Grilla de los 4 Slots de Lectores Seriales -->
|
||||
@@ -430,6 +438,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handleQuickConnectCOM() {
|
||||
if (!multiScanner) initSerialScanner();
|
||||
if (!multiScanner.isSupported()) {
|
||||
alert('La Web Serial API no está disponible en este navegador. Utiliza Google Chrome o Microsoft Edge en entornos Windows.');
|
||||
return;
|
||||
}
|
||||
// Buscar el primer slot disponible
|
||||
const freeSlot = multiScanner.slots.find(s => !s.isConnected());
|
||||
const targetSlotId = freeSlot ? freeSlot.id : 1;
|
||||
await handleConnectSlot(targetSlotId);
|
||||
}
|
||||
|
||||
async function handleDisconnectAllCOM() {
|
||||
if (!multiScanner) return;
|
||||
await multiScanner.disconnectAll();
|
||||
}
|
||||
|
||||
async function reconnectAuthorizedComPorts() {
|
||||
if (!multiScanner) initSerialScanner();
|
||||
if (multiScanner && multiScanner.isSupported()) {
|
||||
|
||||
Reference in New Issue
Block a user