v1.3.47: fix InvokeStrategy in archive handler, modal error display, draggable modals

This commit is contained in:
“Naeel”
2026-05-04 06:54:18 +04:00
parent 1cceb42f83
commit 4f6b4b87be
8 changed files with 97 additions and 12 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ spec:
serviceAccountName: fission-console serviceAccountName: fission-console
containers: containers:
- name: console - name: console
image: naeel/fission-console:v1.3.46 image: naeel/fission-console:v1.3.47
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 8090 - containerPort: 8090
+6 -2
View File
@@ -1378,8 +1378,12 @@ func (s *Server) handleCreateFunctionFromArchive(w http.ResponseWriter, r *http.
"kind": "Function", "kind": "Function",
"metadata": map[string]any{"name": name, "namespace": ns, "annotations": fnAnnotations}, "metadata": map[string]any{"name": name, "namespace": ns, "annotations": fnAnnotations},
"spec": map[string]any{ "spec": map[string]any{
"environment": map[string]any{"name": envName, "namespace": ns}, "environment": map[string]any{"name": envName, "namespace": ns},
"package": map[string]any{"packageref": map[string]any{"name": pkgName, "namespace": ns}}, "package": map[string]any{"packageref": map[string]any{"name": pkgName, "namespace": ns}},
"InvokeStrategy": map[string]any{
"ExecutionStrategy": map[string]any{"ExecutorType": "poolmgr"},
"StrategyType": "execution",
},
"functionTimeout": timeout, "functionTimeout": timeout,
}, },
}} }}
+12
View File
@@ -318,3 +318,15 @@ textarea {
white-space: pre-wrap; white-space: pre-wrap;
word-break: break-word; word-break: break-word;
} }
.modal-error {
display: none;
margin-top: 10px;
padding: 8px 12px;
border-radius: 6px;
background: #3a1a1a;
color: #f88;
font-size: 13px;
white-space: pre-wrap;
word-break: break-word;
}
+4 -2
View File
@@ -102,7 +102,7 @@
<div class="nubes">NUBES</div> <div class="nubes">NUBES</div>
<div class="product">FISSION CONSOLE</div> <div class="product">FISSION CONSOLE</div>
</div> </div>
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.46</div> <div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.47</div>
</div> </div>
<div class="row" style="margin:0;"> <div class="row" style="margin:0;">
<button class="btn ghost" onclick="reloadAll()">Refresh</button> <button class="btn ghost" onclick="reloadAll()">Refresh</button>
@@ -234,6 +234,7 @@
style="display:none;margin-top:8px;padding:10px 12px;border-radius:6px;font-size:13px;line-height:1.5;white-space:pre-wrap;font-family:monospace;"> style="display:none;margin-top:8px;padding:10px 12px;border-radius:6px;font-size:13px;line-height:1.5;white-space:pre-wrap;font-family:monospace;">
</div> </div>
</div> </div>
<div id="cc-error" class="modal-error"></div>
<div class="actions"> <div class="actions">
<button class="btn ghost" onclick="closeCreateCode()">Отмена</button> <button class="btn ghost" onclick="closeCreateCode()">Отмена</button>
<button id="cc-submit" class="btn" onclick="submitCreateCode()">Создать</button> <button id="cc-submit" class="btn" onclick="submitCreateCode()">Создать</button>
@@ -303,6 +304,7 @@
style="display:none;margin-top:8px;padding:10px 12px;border-radius:6px;font-size:13px;line-height:1.5;white-space:pre-wrap;font-family:monospace;"> style="display:none;margin-top:8px;padding:10px 12px;border-radius:6px;font-size:13px;line-height:1.5;white-space:pre-wrap;font-family:monospace;">
</div> </div>
</div> </div>
<div id="ca-error" class="modal-error"></div>
<div class="actions"> <div class="actions">
<button class="btn ghost" onclick="closeCreateArchive()">Отмена</button> <button class="btn ghost" onclick="closeCreateArchive()">Отмена</button>
<button id="ca-submit" class="btn" onclick="submitCreateArchive()">Создать</button> <button id="ca-submit" class="btn" onclick="submitCreateArchive()">Создать</button>
@@ -460,7 +462,7 @@
</div> </div>
<div class="actions" style="justify-content:space-between; align-items:center;"> <div class="actions" style="justify-content:space-between; align-items:center;">
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.46</span> <span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.47</span>
<button class="btn ghost" onclick="closeHelp()">Закрыть</button> <button class="btn ghost" onclick="closeHelp()">Закрыть</button>
</div> </div>
</div> </div>
+2
View File
@@ -22,6 +22,7 @@ function openCreateArchive() {
if (fileInput) fileInput.value = ''; if (fileInput) fileInput.value = '';
var aiRes = document.getElementById('ca-ai-result'); var aiRes = document.getElementById('ca-ai-result');
if (aiRes) { aiRes.style.display = 'none'; aiRes.textContent = ''; } if (aiRes) { aiRes.style.display = 'none'; aiRes.textContent = ''; }
hideModalError('ca-error');
document.getElementById('create-archive-modal').classList.add('open'); document.getElementById('create-archive-modal').classList.add('open');
document.getElementById('ca-name').focus(); document.getElementById('ca-name').focus();
} }
@@ -77,6 +78,7 @@ async function submitCreateArchive() {
await reloadAll(); await reloadAll();
} catch (e) { } catch (e) {
progress.stop('Ошибка создания: ' + e.message, 'err'); progress.stop('Ошибка создания: ' + e.message, 'err');
showModalError('ca-error', 'Ошибка: ' + e.message);
} finally { } finally {
btn.disabled = false; btn.disabled = false;
} }
+2
View File
@@ -21,6 +21,7 @@ function openCreateCode() {
toggleScheduleFields('cc'); toggleScheduleFields('cc');
var aiRes = document.getElementById('cc-ai-result'); var aiRes = document.getElementById('cc-ai-result');
if (aiRes) { aiRes.style.display = 'none'; aiRes.textContent = ''; } if (aiRes) { aiRes.style.display = 'none'; aiRes.textContent = ''; }
hideModalError('cc-error');
document.getElementById('create-code-modal').classList.add('open'); document.getElementById('create-code-modal').classList.add('open');
document.getElementById('cc-name').focus(); document.getElementById('cc-name').focus();
} }
@@ -65,6 +66,7 @@ async function submitCreateCode() {
await reloadAll(); await reloadAll();
} catch (e) { } catch (e) {
progress.stop('Ошибка создания: ' + e.message, 'err'); progress.stop('Ошибка создания: ' + e.message, 'err');
showModalError('cc-error', 'Ошибка: ' + e.message);
} finally { } finally {
btn.disabled = false; btn.disabled = false;
} }
+63
View File
@@ -1,5 +1,68 @@
/* modals.js — управление модальными окнами Help и Invoke */ /* modals.js — управление модальными окнами Help и Invoke */
// makeDraggable — делает .panel внутри modalId перетаскиваемым за заголовок (h3).
function makeDraggable(modalId) {
var modal = document.getElementById(modalId);
if (!modal) return;
var panel = modal.querySelector('.panel');
if (!panel) return;
var handle = panel.querySelector('h3');
if (!handle) return;
handle.style.cursor = 'move';
handle.style.userSelect = 'none';
var startX, startY, startLeft, startTop;
handle.addEventListener('mousedown', function(e) {
e.preventDefault();
var rect = panel.getBoundingClientRect();
// Переводим в position:fixed если ещё не
if (!panel.style.left) {
panel.style.position = 'fixed';
panel.style.left = rect.left + 'px';
panel.style.top = rect.top + 'px';
panel.style.margin = '0';
}
startX = e.clientX;
startY = e.clientY;
startLeft = parseInt(panel.style.left, 10) || rect.left;
startTop = parseInt(panel.style.top, 10) || rect.top;
function onMove(e) {
var dx = e.clientX - startX;
var dy = e.clientY - startY;
panel.style.left = (startLeft + dx) + 'px';
panel.style.top = (startTop + dy) + 'px';
}
function onUp() {
document.removeEventListener('mousemove', onMove);
document.removeEventListener('mouseup', onUp);
}
document.addEventListener('mousemove', onMove);
document.addEventListener('mouseup', onUp);
});
}
// Инициализация после загрузки DOM
document.addEventListener('DOMContentLoaded', function() {
['create-code-modal', 'create-archive-modal', 'edit-modal', 'help-modal', 'invoke-modal'].forEach(makeDraggable);
});
// showModalError — показывает ошибку внутри модалки.
// errorDivId — id элемента с классом modal-error.
function showModalError(errorDivId, message) {
var el = document.getElementById(errorDivId);
if (!el) return;
el.textContent = message;
el.style.display = 'block';
}
function hideModalError(errorDivId) {
var el = document.getElementById(errorDivId);
if (el) { el.style.display = 'none'; el.textContent = ''; }
}
function openHelp() { function openHelp() {
document.getElementById('help-modal').classList.add('open'); document.getElementById('help-modal').classList.add('open');
} }
+7 -7
View File
@@ -56,13 +56,13 @@
| # | Задача | Статус | | # | Задача | Статус |
|---|--------|--------| |---|--------|--------|
| 1 | Создать `fn-code.js` | [ ] | | 1 | Создать `fn-code.js` | ✅ |
| 2 | Создать `fn-archive.js` | [ ] | | 2 | Создать `fn-archive.js` | ✅ |
| 3 | Изменить `index.html` | [ ] | | 3 | Изменить `index.html` | ✅ |
| 4 | Изменить `functions.js` | [ ] | | 4 | Изменить `functions.js` | ✅ |
| 5 | rsync + проверка на VM | [ ] | | 5 | rsync + проверка на VM | ✅ |
| 6 | docker build + push + apply | [ ] | | 6 | docker build + push + apply | ✅ v1.3.46 |
| 7 | git commit + push | [ ] | | 7 | git commit + push | ✅ ветка separate-create-modals |
--- ---