gsdf
This commit is contained in:
+67
-7
@@ -6,19 +6,26 @@
|
||||
|
||||
<!-- Quick navigation -->
|
||||
<nav id="settings-quicknav" aria-label="Settings sections">
|
||||
@if(!session.is_anon)
|
||||
<a href="#profile"><i class="fa-solid fa-user-pen"></i> {{ t('settings.profile') }}</a>
|
||||
@endif
|
||||
<a href="#preferences"><i class="fa-solid fa-sliders"></i> {{ t('settings.preferences') }}</a>
|
||||
@if(enable_data_export)
|
||||
@if(session.is_anon)
|
||||
<a href="#anon-ssh"><i class="fa-solid fa-key"></i> SSH Identity</a>
|
||||
@endif
|
||||
@if(!session.is_anon && enable_data_export)
|
||||
<a href="#export"><i class="fa-solid fa-file-export"></i> {{ t('settings.export_data_title') }}</a>
|
||||
@endif
|
||||
@if(!session.is_anon)
|
||||
<a href="#account"><i class="fa-solid fa-shield-halved"></i> {{ t('settings.account') }}</a>
|
||||
@if(matrix_enabled || telegram_enabled)
|
||||
@endif
|
||||
@if(!session.is_anon && (matrix_enabled || telegram_enabled))
|
||||
<a href="#linked"><i class="fa-solid fa-link"></i> {{ t('settings.linked_accounts') }}</a>
|
||||
@endif
|
||||
@if(enable_user_api_keys)
|
||||
@if(!session.is_anon && enable_user_api_keys)
|
||||
<a href="#apikey"><i class="fa-solid fa-key"></i> API Key</a>
|
||||
@endif
|
||||
@if(enable_user_invites)
|
||||
@if(!session.is_anon && enable_user_invites)
|
||||
<a href="#invites"><i class="fa-solid fa-ticket"></i> {{ t('invites.section_title') }}</a>
|
||||
@endif
|
||||
</nav>
|
||||
@@ -74,6 +81,7 @@
|
||||
</script>
|
||||
|
||||
|
||||
@if(!session.is_anon)
|
||||
<!-- ═══════════════════════════════ PROFILE ═══════════════════════════════ -->
|
||||
<h2 id="profile"><i class="fa-solid fa-user-pen"></i> {{ t('settings.profile') }}</h2>
|
||||
|
||||
@@ -187,6 +195,7 @@
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@@ -510,6 +519,55 @@
|
||||
|
||||
</div>
|
||||
|
||||
@if(session.is_anon)
|
||||
<!-- ═══════════════════════════════ ANONYMOUS SSH IDENTITY ═══════════════════════════════ -->
|
||||
<h2 id="anon-ssh"><i class="fa-solid fa-key"></i> Anonymous SSH Identity</h2>
|
||||
<div class="account-settings-wrapper" style="background: rgba(0,0,0,0.1); padding: 20px; border-radius: 6px; border: 1px solid var(--nav-border-color); margin-bottom: 30px;">
|
||||
<p style="color: var(--text-muted); margin-bottom: 16px;">
|
||||
You are currently browsing anonymously using an OpenSSH Ed25519 keypair. Your favorites and comments are tied to this cryptographic identity without requiring a username, password, or email.
|
||||
</p>
|
||||
|
||||
<div style="margin-bottom: 16px;">
|
||||
<label style="font-weight: bold; color: var(--text-muted); display: block; margin-bottom: 6px;">OpenSSH SHA256 Fingerprint</label>
|
||||
<code id="settings-anon-fp" style="background: rgba(0,0,0,0.3); padding: 6px 12px; border-radius: 4px; display: inline-block; color: #5bc0be; font-family: monospace;">{{ session.fingerprint || 'Loading...' }}</code>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="font-weight: bold; color: var(--text-muted); display: block; margin-bottom: 6px;">OpenSSH Public Key</label>
|
||||
<div style="display: flex; gap: 10px; align-items: center; flex-wrap: wrap;">
|
||||
<input type="text" id="settings-anon-pubkey" readonly class="input" style="flex: 1; min-width: 250px; font-family: monospace; font-size: 0.85em;" value="" placeholder="Loading public key...">
|
||||
<button type="button" class="button" onclick="if(window.f0ckAnonSSH) window.f0ckAnonSSH.copyPublicKey();"><i class="fa-solid fa-copy"></i> Copy</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;">
|
||||
<button type="button" class="button button-primary" onclick="if(window.f0ckAnonSSH) window.f0ckAnonSSH.downloadPrivateKey();"><i class="fa-solid fa-download"></i> Download id_ed25519</button>
|
||||
<button type="button" class="button" onclick="if(window.f0ckAnonSSH) window.f0ckAnonSSH.downloadPublicKey();"><i class="fa-solid fa-download"></i> Download id_ed25519.pub</button>
|
||||
<button type="button" class="button" onclick="const m = document.getElementById('anon-ssh-modal'); if(m) m.style.display='flex';"><i class="fa-solid fa-key"></i> Import / Supply Key</button>
|
||||
</div>
|
||||
|
||||
<div style="padding: 12px 16px; background: rgba(255,255,255,0.03); border-radius: 6px; border: 1px solid rgba(255,255,255,0.08); font-size: 0.88em; color: var(--text-muted);">
|
||||
<i class="fa-solid fa-circle-info" style="color: var(--accent); margin-right: 6px;"></i>
|
||||
<strong>Want full features?</strong> Registered accounts can upload items, customize avatars, create API keys, and invite friends. You can <a href="#" onclick="event.preventDefault(); const m=document.getElementById('register-modal'); if(m) m.style.display='flex';" style="color: var(--accent); text-decoration: underline;">register an account</a> at any time.
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function() {
|
||||
const syncKey = () => {
|
||||
if (window.f0ckAnonSSH) {
|
||||
const pk = document.getElementById('settings-anon-pubkey');
|
||||
if (pk && window.f0ckAnonSSH.pubkey) pk.value = window.f0ckAnonSSH.pubkey;
|
||||
const fp = document.getElementById('settings-anon-fp');
|
||||
if (fp && window.f0ckAnonSSH.fingerprint) fp.textContent = window.f0ckAnonSSH.fingerprint;
|
||||
}
|
||||
};
|
||||
syncKey();
|
||||
window.addEventListener('f0ck:anon_session_ready', syncKey);
|
||||
document.addEventListener('DOMContentLoaded', syncKey);
|
||||
})();
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if(enable_data_export)
|
||||
<!-- ═══════════════════════════════ EXPORT ═══════════════════════════════ -->
|
||||
<h2 id="export"><i class="fa-solid fa-file-export"></i> {{ t('settings.export_data_title') || 'Export Data' }}</h2>
|
||||
@@ -553,6 +611,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(!session.is_anon)
|
||||
<!-- ═══════════════════════════════ ACCOUNT ═══════════════════════════════ -->
|
||||
<h2 id="account"><i class="fa-solid fa-shield-halved"></i> {{ t('settings.account') }}</h2>
|
||||
<div class="account-settings-wrapper"
|
||||
@@ -612,8 +671,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(matrix_enabled || telegram_enabled)
|
||||
@if(!session.is_anon && (matrix_enabled || telegram_enabled))
|
||||
<!-- ═══════════════════════════════ LINKED ACCOUNTS ═══════════════════════════════ -->
|
||||
<h2 id="linked"><i class="fa-solid fa-link"></i> {{ t('settings.linked_accounts') }}</h2>
|
||||
<div class="linked-accounts-wrapper" style="background: rgba(0,0,0,0.1); padding: 20px; border-radius: 6px; border: 1px solid var(--nav-border-color); margin-bottom: 30px;">
|
||||
@@ -650,7 +710,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(enable_user_api_keys)
|
||||
@if(!session.is_anon && enable_user_api_keys)
|
||||
<!-- ═══════════════════════════════ API KEY ═══════════════════════════════ -->
|
||||
<h2 id="apikey"><i class="fa-solid fa-key"></i> Upload API Key</h2>
|
||||
<div id="api-key-section" class="account-settings-wrapper"
|
||||
@@ -686,7 +746,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(enable_user_invites)
|
||||
@if(!session.is_anon && enable_user_invites)
|
||||
<!-- ═══════════════════════════════ INVITES ═══════════════════════════════ -->
|
||||
<h2 id="invites"><i class="fa-solid fa-ticket"></i> {{ t('invites.section_title') }}</h2>
|
||||
<div id="invite-section" class="account-settings-wrapper"
|
||||
|
||||
Reference in New Issue
Block a user