feat: connected accounts + Gemini API key in account settings UI
Settings page gains two new sections: - Connected Accounts: shows linked Google email (read-only) - Gemini API Key: paste personal key from aistudio.google.com, shows masked hint of saved key, remove link to revert to server key POST /settings/gemini-key saves/clears gemini_api_key in auth.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -232,6 +232,45 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Connected accounts -->
|
||||
<div class="section">
|
||||
<h2>Connected Accounts</h2>
|
||||
<div class="field">
|
||||
<label>Google Account</label>
|
||||
<input type="text" value="{{ google_email }}" readonly
|
||||
placeholder="No Google account linked"
|
||||
style="{{ google_email == '' and 'color:#475569' or '' }}">
|
||||
</div>
|
||||
<p style="font-size:0.75rem; color:#94a3b8; margin-top:-0.5rem;">
|
||||
To link or change your Google account, contact Scott.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Gemini API key -->
|
||||
<div class="section">
|
||||
<h2>Gemini API Key</h2>
|
||||
<p style="font-size:0.8rem; color:#94a3b8; margin-bottom:0.85rem; line-height:1.55;">
|
||||
Paste your personal key from
|
||||
<a href="https://aistudio.google.com/apikey" target="_blank" rel="noopener"
|
||||
style="color:#a78bfa;">aistudio.google.com/apikey</a>
|
||||
to use your own Gemini quota. Leave blank to use the shared server key.
|
||||
</p>
|
||||
<form method="POST" action="/settings/gemini-key">
|
||||
<div class="field">
|
||||
<label for="gemini_api_key">API Key</label>
|
||||
<input type="password" id="gemini_api_key" name="gemini_api_key"
|
||||
placeholder="{{ gemini_key_hint }}" autocomplete="off">
|
||||
</div>
|
||||
<button type="submit">Save Key</button>
|
||||
</form>
|
||||
<p id="gemini-key-status" style="font-size:0.75rem; color:#94a3b8; margin-top:0.5rem;">
|
||||
Current: {{ gemini_key_hint }}
|
||||
<span id="gemini-remove-wrap" style="{{ gemini_key_set == 'false' and 'display:none' or '' }}">
|
||||
— <a href="#" id="gemini-remove-link" style="color:#f87171;">remove</a>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Change password -->
|
||||
<div class="section">
|
||||
<h2>Change Password</h2>
|
||||
@@ -287,6 +326,16 @@
|
||||
document.getElementById('show-rename-user').style.display = '';
|
||||
});
|
||||
|
||||
// Gemini key — "remove" link clears the input and submits the form
|
||||
const geminiRemove = document.getElementById('gemini-remove-link');
|
||||
if (geminiRemove) {
|
||||
geminiRemove.addEventListener('click', e => {
|
||||
e.preventDefault();
|
||||
document.getElementById('gemini_api_key').value = '';
|
||||
document.querySelector('form[action="/settings/gemini-key"]').submit();
|
||||
});
|
||||
}
|
||||
|
||||
// Persona rename toggle
|
||||
document.querySelectorAll('.persona-rename-toggle').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
|
||||
Reference in New Issue
Block a user