feat: Add API URL input field to login form for dynamic endpoint configuration

This commit is contained in:
2025-09-02 07:33:48 +00:00
parent 210569ad37
commit fbaf775e2a
2 changed files with 48 additions and 24 deletions

View File

@ -41,6 +41,10 @@
</header>
<form id="loginForm" class="space-y-4">
<div>
<label for="apiUrl" class="block text-sm font-medium text-gray-300">API URL</label>
<input type="text" id="apiUrl" name="apiUrl" value="http://127.0.0.1:8000/api/v1/auth/login" class="mt-1 block w-full bg-gray-900/50 border border-gray-600 rounded-md shadow-sm p-2 text-white focus:ring-blue-500 focus:border-blue-500" placeholder="e.g., http://your-domain.com/api/v1/auth/login" required>
</div>
<div>
<label for="username" class="block text-sm font-medium text-gray-300">Username</label>
<input type="text" id="username" name="username" class="mt-1 block w-full bg-gray-900/50 border border-gray-600 rounded-md shadow-sm p-2 text-white focus:ring-blue-500 focus:border-blue-500" required>
@ -73,9 +77,8 @@
</div>
<script>
const API_URL = "http://10.6.14.233:8000/api/v1/auth/login";
const loginForm = document.getElementById('loginForm');
const apiUrlInput = document.getElementById('apiUrl');
const usernameInput = document.getElementById('username');
const passwordInput = document.getElementById('password');
const resultContainer = document.getElementById('resultContainer');
@ -87,6 +90,7 @@
loginForm.addEventListener('submit', async (e) => {
e.preventDefault();
const API_URL = apiUrlInput.value;
const username = usernameInput.value;
const password = passwordInput.value;