mirror of
https://github.com/renorris/openfsd
synced 2026-04-25 18:25:48 +08:00
Changes:
- Implement bootstrapping library for managing several concurrent internal services
- Refactor concurrency model for connections/logical clients and their associated I/O
- Refactor server context singleton
- Refactor error handling
- Most errors are now gracefully sent to the FSD client directly encoded as an $ER packet,
enhancing visibility and debugging
- Most errors are now rightfully treated as non-fatal
- Refactor package/dependency graph
- Refactor calling conventions/interfaces for many packages
- Refactor database package
- Refactor post office
Features:
- Add VATSIM-esque HTTP/JSON "data feed"
- Add ephemeral in-memory database option
- Add user management REST API
- Add improved web interface
- Add MySQL support (drop SQLite support)
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
$(document).ready(function () {
|
|
$('#login-form').on('submit', function (event) {
|
|
event.preventDefault(); // Prevent the default form submission
|
|
|
|
// Get the values from the input fields
|
|
const cid = $('input[name="cid"]').val();
|
|
const password = $('input[name="password"]').val();
|
|
|
|
// Send AJAX POST request
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: '/login',
|
|
data: {
|
|
cid: cid,
|
|
password: password
|
|
},
|
|
xhrFields: {
|
|
withCredentials: true // Include credentials (cookies, etc.) in the request
|
|
},
|
|
success: function (data, textStatus, jqXHR) {
|
|
// If we received a successful response from the server (HTTP 200)
|
|
if (jqXHR.status === 204) {
|
|
window.location.href = '/dashboard'; // Redirect to dashboard
|
|
}
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
// If we received an error response from the server
|
|
alert('Error: ' + jqXHR.statusText + '\nMessage: ' + jqXHR.responseText); // Alert with the status code and response body
|
|
}
|
|
});
|
|
});
|
|
});
|