decomm ml, target algorithm a dalsi upravy

This commit is contained in:
David Brazda
2023-12-06 10:51:50 +01:00
parent d38bf0600f
commit 6cdc0a45c5
32 changed files with 1112 additions and 877 deletions

33
v2realbot/static/js/ml.js Normal file
View File

@ -0,0 +1,33 @@
$(document).ready(function() {
function fetchModels() {
$.ajax({
url: '/model/list-models',
type: 'GET',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-API-Key',
API_KEY); },
success: function(response) {
$('#model-list').empty();
if(response.error) {
$('#model-list').html('Error: ' + response.error);
} else {
const models = response.models;
models.forEach(function(model) {
$('#model-list').append('<p>' + model + '</p>');
});
}
},
error: function(xhr, status, error) {
$('#model-list').html('An error occurred: ' + error);
}
});
}
// Fetch models on page load
fetchModels();
// Refresh models on button click
$('#ml-refresh-button').click(function() {
fetchModels();
});
});