webcodelab commited on
Commit
fbb78ef
·
verified ·
1 Parent(s): c785583

Update app/templates/api_keys.html

Browse files
Files changed (1) hide show
  1. app/templates/api_keys.html +9 -0
app/templates/api_keys.html CHANGED
@@ -79,10 +79,19 @@
79
  <div class="section-card api-key-full-section">
80
  <h3 class="section-title">Your API Key</h3>
81
  <p class="section-description">This is your unique API key. Keep it secure and do not share it publicly.</p>
 
82
  <div class="input-group">
83
  <input type="text" class="form-input" id="apiKey" value="{{ user.api_key }}" readonly>
84
  <button class="btn primary-btn copy-btn" type="button" onclick="copyApiKey()">Copy</button>
85
  </div>
 
 
 
 
 
 
 
 
86
  <form method="POST" action="{{ url_for('auth.regenerate_api_key') }}" class="api-key-form">
87
  <button class="btn secondary-btn">Regenerate API Key</button>
88
  </form>
 
79
  <div class="section-card api-key-full-section">
80
  <h3 class="section-title">Your API Key</h3>
81
  <p class="section-description">This is your unique API key. Keep it secure and do not share it publicly.</p>
82
+ {% if user.api_key %}
83
  <div class="input-group">
84
  <input type="text" class="form-input" id="apiKey" value="{{ user.api_key }}" readonly>
85
  <button class="btn primary-btn copy-btn" type="button" onclick="copyApiKey()">Copy</button>
86
  </div>
87
+ {% else %}
88
+ <div class="no-api-key-message">
89
+ <p>No API key generated yet.</p>
90
+ <form method="POST" action="{{ url_for('auth.generate_initial_api_key') }}" style="display: inline;">
91
+ <button type="submit" class="btn primary-btn">Generate API Key</button>
92
+ </form>
93
+ </div>
94
+ {% endif %}
95
  <form method="POST" action="{{ url_for('auth.regenerate_api_key') }}" class="api-key-form">
96
  <button class="btn secondary-btn">Regenerate API Key</button>
97
  </form>