- Are you sure you want to continue connecting?
-
- `;
- modal.appendChild(body);
-
- const footer = createElement('div', 'modal-footer');
- const rejectBtn = createElement('button', 'btn btn-secondary', { textContent: 'Reject' });
- const acceptBtn = createElement('button', 'btn btn-primary', { textContent: 'Accept & Save' });
- footer.appendChild(rejectBtn);
- footer.appendChild(acceptBtn);
- modal.appendChild(footer);
-
- overlay.appendChild(modal);
- document.body.appendChild(overlay);
- this._overlay = overlay;
-
- requestAnimationFrame(() => {
- overlay.classList.add('is-visible');
- modal.classList.add('is-visible');
- acceptBtn.focus();
- });
-
- acceptBtn.addEventListener('click', () => {
- this._close();
- resolve(true);
- });
-
- rejectBtn.addEventListener('click', () => {
- this._close();
- resolve(false);
- });
-
- header.querySelector('.modal-close').addEventListener('click', () => {
- this._close();
- resolve(false);
- });
-
- overlay.addEventListener('click', (e) => {
- if (e.target === overlay) {
- this._close();
- resolve(false);
- }
- });
-
- overlay.addEventListener('keydown', (e) => {
- if (e.key === 'Escape') {
- this._close();
- resolve(false);
- }
- });
- });
- }
-
- // ── Internal helpers ─────────────────────────────────────────────
-
- /**
- * Closes and removes the current overlay, if any.
- * @private
- */
- _close() {
- if (this._overlay) {
- this._overlay.remove();
- this._overlay = null;
- }
- }
-}
-
-/**
- * Estimates password strength based on length and character diversity.
- * Returns an object with { percent, level, label } for the strength meter.
- * @param {string} pw
- * @returns {{ percent: number, level: string, label: string }}
- * @private
- */
-function _measureStrength(pw) {
- if (!pw) return { percent: 0, level: 'none', label: '' };
-
- let score = 0;
- const len = pw.length;
-
- // Length contribution (0–40 points)
- score += Math.min(len * 3, 40);
-
- // Character-class diversity (0–40 points)
- const hasLower = /[a-z]/.test(pw);
- const hasUpper = /[A-Z]/.test(pw);
- const hasDigit = /[0-9]/.test(pw);
- const hasSymbol = /[^a-zA-Z0-9]/.test(pw);
- const classes = [hasLower, hasUpper, hasDigit, hasSymbol].filter(Boolean).length;
- score += classes * 10;
-
- // Unique-character ratio bonus (0–20 points)
- const unique = new Set(pw).size;
- score += Math.min(Math.floor((unique / Math.max(len, 1)) * 20), 20);
-
- score = Math.min(score, 100);
-
- if (score < 25) return { percent: score, level: 'weak', label: 'Weak' };
- if (score < 50) return { percent: score, level: 'fair', label: 'Fair' };
- if (score < 75) return { percent: score, level: 'good', label: 'Good' };
- return { percent: score, level: 'strong', label: 'Strong' };
-}
-
-window.AlchementaryLink = window.AlchementaryLink || {};
-window.AlchementaryLink.SecretPrompt = SecretPrompt;
-
-})();
diff --git a/frontend/src/js/settings.js b/frontend/src/js/settings.js
deleted file mode 100644
index 3bf6e37..0000000
--- a/frontend/src/js/settings.js
+++ /dev/null
@@ -1,1276 +0,0 @@
-(function () {
- /**
- * Alchementary Link — settings modal.
- * Renders a tabbed settings dialog for application-wide preferences,
- * terminal defaults, security, known-hosts management, and about info.
- */
-
- const { createElement, escapeHtml, formatTimestamp, $ } =
- window.AlchementaryLink;
-
- /** Settings tab definitions. */
- const TABS = [
- { key: "general", label: "General" },
- { key: "terminal", label: "Terminal" },
- { key: "security", label: "Security" },
- { key: "knownhosts", label: "Known Hosts" },
- { key: "help", label: "Help" },
- { key: "about", label: "About" },
- ];
-
- const KONAMI_SEQUENCE = [
- "ArrowUp",
- "ArrowUp",
- "ArrowDown",
- "ArrowDown",
- "ArrowLeft",
- "ArrowRight",
- "ArrowLeft",
- "ArrowRight",
- "b",
- "a",
- ];
-
- class Settings {
- /**
- * @param {App} app
- */
- constructor(app) {
- this.app = app;
-
- /** @type {HTMLElement|null} */
- this._overlay = null;
-
- /** @type {string} Currently active tab key. */
- this._activeTab = "general";
-
- /** @type {Object} Working copy of preferences. */
- this._prefs = {};
-
- /** @type {Array