chg: [eventReport:sendToLLM] Added loading text

llm_tests
Sami Mokaddem 2023-10-18 17:01:00 +02:00
parent d4256ad87a
commit f9cb9109af
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 10 additions and 2 deletions

View File

@ -6,14 +6,22 @@ echo $this->element('genericElements/Form/genericForm', array(
'model' => 'EventReport', 'model' => 'EventReport',
'submit' => array( 'submit' => array(
'action' => $this->request->params['action'], 'action' => $this->request->params['action'],
'ajaxSubmit' => 'confirmSubmissionToLLM()' 'ajaxSubmit' => 'confirmSubmissionToLLM(this)'
), ),
) )
)); ));
?> ?>
<script> <script>
function confirmSubmissionToLLM() { function confirmSubmissionToLLM(clicked) {
$clicked = $(clicked)
$loading = $('<div style="display:flex; align-items: center; flex-direction: column;"></div>').append(
$('<h3>Waiting for the robot to do its magic...</h3>'),
$('</br>'),
$('<i class="fas fa-robot fa-5x fa-spin"></i>'),
$('</br>'),
)
$clicked.parent().parent().find('.modal-body').append($loading)
submitGenericFormInPlace(function(data) { submitGenericFormInPlace(function(data) {
window.location.reload(); window.location.reload();
}); });