Add LLM endpoints, web frontend, and rate limiting config
- Added OpenAI-compatible LLM endpoints to API backend - Introduced web frontend with Jinja2 templates and static assets - Implemented API proxy routes in web service - Added sample db.json data for items, users, orders, reviews, categories, llm_requests - Updated ADC and Helm configs for separate AI and standard rate limiting - Upgraded FastAPI, Uvicorn, and added httpx, Jinja2, python-multipart dependencies - Added API configuration modal and client-side JS for web app
This commit is contained in:
95
web/templates/base.html
Normal file
95
web/templates/base.html
Normal file
@@ -0,0 +1,95 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{% block title %}API Demo{% endblock %}</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar">
|
||||
<div class="container">
|
||||
<div class="nav-brand">
|
||||
<h2>🚀 API7EE Demo</h2>
|
||||
</div>
|
||||
<ul class="nav-menu">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/items">Items</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/llm">LLM Chat</a></li>
|
||||
<li><a href="/api/docs" target="_blank">API Docs</a></li>
|
||||
<li>
|
||||
<a href="#" onclick="openApiConfig(event)"
|
||||
>⚙️ API Config</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- API Configuration Modal -->
|
||||
<div id="api-config-modal" class="modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>⚙️ API Configuration</h2>
|
||||
<span class="close" onclick="closeApiConfig()"
|
||||
>×</span
|
||||
>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Configure the base URL for API requests:</p>
|
||||
<div class="form-group">
|
||||
<label for="api-base-url">API Base URL:</label>
|
||||
<input
|
||||
type="text"
|
||||
id="api-base-url"
|
||||
placeholder="https://commandware.it/api"
|
||||
class="form-control"
|
||||
/>
|
||||
<small class="form-hint">
|
||||
Examples:
|
||||
<code>/api</code> (relative),
|
||||
<code>https://commandware.it/api</code> (absolute),
|
||||
<code>http://localhost:8001</code> (local)
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Current Configuration:</label>
|
||||
<div class="config-info">
|
||||
<strong>Base URL:</strong>
|
||||
<span id="current-api-url">-</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
onclick="saveApiConfig()"
|
||||
>
|
||||
Save Configuration
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-secondary"
|
||||
onclick="resetApiConfig()"
|
||||
>
|
||||
Reset to Default
|
||||
</button>
|
||||
<button class="btn" onclick="closeApiConfig()">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main class="container">{% block content %}{% endblock %}</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p>© 2025 API7EE Demo | Powered by FastAPI & API7</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="/static/js/app.js"></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user