Исправление синтаксической ошибки в molecule_executor.py и обновление k8s preset'ов
- Исправлена незакрытая скобка в _build_test_command (строка 745) - Добавлена поддержка k8s preset'ов: выполнение create_k8s_cluster.py перед create.yml - Обновлены образы в k8s preset'ах: заменен недоступный ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy на inecs/ansible-lab:ubuntu22-latest - Обновлены preset'ы в базе данных через SQL - Обновлены файлы: k8s-single.yml, k8s-multi.yml, k8s-istio-full.yml
This commit is contained in:
@@ -255,8 +255,7 @@
|
||||
|
||||
<form
|
||||
hx-post="/api/v1/profile"
|
||||
hx-target="#result"
|
||||
hx-swap="innerHTML"
|
||||
hx-swap="none"
|
||||
>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Имя пользователя</label>
|
||||
@@ -292,8 +291,6 @@
|
||||
>
|
||||
</div>
|
||||
|
||||
<div id="result" class="mb-3"></div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save me-2"></i>
|
||||
@@ -318,20 +315,48 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Обработка успешного сохранения профиля
|
||||
document.body.addEventListener('htmx:afterRequest', function(event) {
|
||||
if (event.detail.target.id === 'result' && event.detail.xhr.status === 200) {
|
||||
const response = JSON.parse(event.detail.xhr.responseText);
|
||||
if (response.success) {
|
||||
// Показываем сообщение об успехе
|
||||
const resultDiv = document.getElementById('result');
|
||||
resultDiv.innerHTML = '<div class="alert alert-success alert-dismissible fade show" role="alert">' +
|
||||
'<i class="fas fa-check-circle me-2"></i>' + response.message +
|
||||
'<button type="button" class="btn-close" data-bs-dismiss="alert"></button>' +
|
||||
'</div>';
|
||||
|
||||
// Обновляем страницу через 1.5 секунды
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
if (event.detail.path === '/api/v1/profile' && event.detail.xhr.status === 200) {
|
||||
try {
|
||||
const response = JSON.parse(event.detail.xhr.responseText);
|
||||
if (response.success) {
|
||||
// Показываем модальное окно с успешным сообщением
|
||||
if (window.showMessageModal) {
|
||||
window.showMessageModal(
|
||||
response.message || 'Профиль успешно обновлен',
|
||||
'success',
|
||||
'Успешно',
|
||||
function() {
|
||||
// После закрытия модального окна обновляем страницу
|
||||
location.reload();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
// Если функция недоступна, просто обновляем страницу
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Ошибка парсинга ответа:', e);
|
||||
if (window.showMessageModal) {
|
||||
window.showMessageModal('Ошибка при обновлении профиля', 'error');
|
||||
}
|
||||
}
|
||||
} else if (event.detail.path === '/api/v1/profile' && event.detail.xhr.status !== 200) {
|
||||
// Ошибка - показываем в модальном окне
|
||||
try {
|
||||
const response = JSON.parse(event.detail.xhr.responseText);
|
||||
const errorMessage = response.detail || response.message || 'Ошибка при обновлении профиля';
|
||||
if (window.showMessageModal) {
|
||||
window.showMessageModal(errorMessage, 'error');
|
||||
} else {
|
||||
alert(errorMessage);
|
||||
}
|
||||
} catch (e) {
|
||||
if (window.showMessageModal) {
|
||||
window.showMessageModal('Ошибка при обновлении профиля', 'error');
|
||||
} else {
|
||||
alert('Ошибка при обновлении профиля');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user