Removed stanalone support from UI SDK

This commit is contained in:
dqj
2026-01-18 22:49:11 +09:00
parent 89ea8a48fc
commit 9218662a4b
4 changed files with 12 additions and 175 deletions

View File

@@ -1685,137 +1685,6 @@
this.containerElement = null;
};
UIRenderer.prototype.renderStandalone = function() {
if (this.config.container) {
const container = typeof this.config.container === 'string'
? document.querySelector(this.config.container)
: this.config.container;
if (container) {
container.innerHTML = this._getStandaloneBodyHTML();
this.containerElement = container;
this.themeManager.applyTheme(container);
this._bindEvents();
return container;
}
}
document.body.innerHTML = this._getStandaloneBodyHTML();
document.body.className = 'fido2-sdk-standalone';
this.containerElement = document.body;
this.themeManager.applyTheme(document.body);
this._bindEvents();
return document.body;
};
UIRenderer.prototype._getStandaloneBodyHTML = function() {
const theme = this.config.theme;
const dm = window.Fido2UIManager ? window.Fido2UIManager.deviceManager : null;
const userId = dm ? dm.getEffectiveUserId() : (this.config.userId || '');
return `
<div class="container fido2-sdk-container">
<div class="card fido2-sdk-card">
<div class="card-header fido2-sdk-header d-flex justify-content-between align-items-center">
<div>
${theme.logo ? `<img src="${theme.logo}" class="fido2-sdk-logo me-2" alt="Logo">` : ''}
<h4 class="mb-0 fido2-sdk-text">${this.i18n.getText('my_devices')}</h4>
</div>
${this.config.features.showSessionStatus ? '<span class="badge fido2-sdk-status-badge" id="fido2SessionStatus"></span>' : ''}
</div>
<div class="card-body fido2-sdk-body">
${this.config.features.showUserInfo && userId ? `
<div class="alert alert-info fido2-sdk-user-info fido2-sdk-text">
<strong>${this.i18n.getText('title_welcome')}:</strong> ${userId}
</div>
` : ''}
${this.config.features.showAddButton ? `
<button type="button" class="btn btn-info mt-2 mb-3 fido2-sdk-btn fido2-sdk-btn-primary" id="fido2AddDeviceBtn">
${this.i18n.getText('btn_add')}
</button>
` : ''}
<div class="table-responsive mt-2">
<table class="table table-striped fido2-sdk-table">
<thead>
<tr>
<th>${this.i18n.getText('title_device')}</th>
<th>${this.i18n.getText('title_time')}</th>
${this.config.features.showDeleteButton ? `<th>${this.i18n.getText('title_act')}</th>` : ''}
</tr>
</thead>
<tbody id="fido2DevicesList">
<tr>
<td colspan="3" class="text-center fido2-sdk-text">${this.i18n.getText('title_empty_list')}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
`;
};
UIRenderer.prototype._getStandaloneHTML = function() {
const theme = this.config.theme;
const dm = window.Fido2UIManager ? window.Fido2UIManager.deviceManager : null;
const userId = dm ? dm.getEffectiveUserId() : (this.config.userId || '');
return `
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${this.i18n.getText('my_devices')}</title>
<link rel="stylesheet" href="files/bootstrap.css">
<link rel="stylesheet" href="files/boxicons.css">
<link rel="stylesheet" href="files/fido2-ui-sdk.css">
</head>
<body class="fido2-sdk-standalone">
<div class="container fido2-sdk-container">
<div class="card fido2-sdk-card">
<div class="card-header fido2-sdk-header d-flex justify-content-between align-items-center">
<div>
${theme.logo ? `<img src="${theme.logo}" class="fido2-sdk-logo me-2" alt="Logo">` : ''}
<h4 class="mb-0 fido2-sdk-text">${this.i18n.getText('my_devices')}</h4>
</div>
${this.config.features.showSessionStatus ? '<span class="badge fido2-sdk-status-badge" id="fido2SessionStatus"></span>' : ''}
</div>
<div class="card-body fido2-sdk-body">
${this.config.features.showUserInfo && userId ? `
<div class="alert alert-info fido2-sdk-user-info fido2-sdk-text">
<strong>${this.i18n.getText('title_welcome')}:</strong> ${userId}
</div>
` : ''}
${this.config.features.showAddButton ? `
<button type="button" class="btn btn-info mt-2 mb-3 fido2-sdk-btn fido2-sdk-btn-primary" id="fido2AddDeviceBtn">
${this.i18n.getText('btn_add')}
</button>
` : ''}
<div class="table-responsive mt-2">
<table class="table table-striped fido2-sdk-table">
<thead>
<tr>
<th>${this.i18n.getText('title_device')}</th>
<th>${this.i18n.getText('title_time')}</th>
${this.config.features.showDeleteButton ? `<th>${this.i18n.getText('title_act')}</th>` : ''}
</tr>
</thead>
<tbody id="fido2DevicesList">
<tr>
<td colspan="3" class="text-center fido2-sdk-text">${this.i18n.getText('title_empty_list')}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
`;
};
function Fido2UIManager() {
this.config = null;
@@ -1888,11 +1757,7 @@
const mode = manager.config.mode;
if (mode === 'standalone') {
manager.uiRenderer.renderStandalone();
} else {
manager.uiRenderer.renderModal();
}
manager.uiRenderer.renderModal();
manager._bindInternalEvents();
manager._loadInitialData();