decomm ml, target algorithm a dalsi upravy
This commit is contained in:
33
v2realbot/static/js/ml.js
Normal file
33
v2realbot/static/js/ml.js
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user