v1.3.49: edit modal — remove mode toggle, show archive name, timeout-only save; add PUT /functions/:name/timeout
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
<div class="nubes">NUBES</div>
|
||||
<div class="product">FISSION CONSOLE</div>
|
||||
</div>
|
||||
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.48</div>
|
||||
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.49</div>
|
||||
</div>
|
||||
<div class="row" style="margin:0;">
|
||||
<button class="btn ghost" onclick="reloadAll()">Refresh</button>
|
||||
@@ -352,10 +352,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display:flex; gap:4px; margin-bottom:6px;">
|
||||
<button class="btn ghost" id="e-mode-code" onclick="setCodeMode('e','code')" style="font-size:.8rem; padding:3px 10px;">✏️ Код</button>
|
||||
<button class="btn ghost" id="e-mode-archive" onclick="setCodeMode('e','archive')" style="font-size:.8rem; padding:3px 10px;">📦 Архив (.zip)</button>
|
||||
</div>
|
||||
<div id="e-code-area">
|
||||
<label>Код</label>
|
||||
<textarea id="e-code"></textarea>
|
||||
@@ -367,6 +363,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="e-archive-area" style="display:none;">
|
||||
<div id="e-archive-current" style="margin-bottom:10px; padding:8px 12px; background:var(--bg-alt); border-radius:6px; font-size:13px; color:var(--text-secondary);">
|
||||
📦 <span id="e-archive-name"></span>
|
||||
</div>
|
||||
<label style="font-size:12px; color:var(--text-secondary); margin-bottom:4px; display:block;">Заменить архив (необязательно)</label>
|
||||
<input type="file" id="e-archive-file" accept=".zip" style="display:block; margin-bottom:8px; color:var(--text-primary);">
|
||||
<div style="display:flex; gap:6px; flex-wrap:wrap;">
|
||||
<button id="e-lint-btn" class="btn ghost" onclick="lintArchiveFile('e')">🔍 Проверка архива линтером</button>
|
||||
@@ -462,7 +462,7 @@
|
||||
</div>
|
||||
|
||||
<div class="actions" style="justify-content:space-between; align-items:center;">
|
||||
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.48</span>
|
||||
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.49</span>
|
||||
<button class="btn ghost" onclick="closeHelp()">Закрыть</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -149,6 +149,10 @@ async function openEdit(name) {
|
||||
// Сбрасываем режим: source_type из API (code / archive)
|
||||
if (fn.source_type === 'archive') {
|
||||
setCodeMode('e', 'archive');
|
||||
var archiveNameEl = document.getElementById('e-archive-name');
|
||||
if (archiveNameEl) archiveNameEl.textContent = fn.package || 'архив';
|
||||
var archiveFile = document.getElementById('e-archive-file');
|
||||
if (archiveFile) archiveFile.value = '';
|
||||
} else {
|
||||
setCodeMode('e', 'code');
|
||||
}
|
||||
@@ -205,6 +209,11 @@ async function submitEdit() {
|
||||
var resp = await fetch(API_BASE + '/functions/' + encodeURIComponent(name) + '/archive',
|
||||
{ method: 'PUT', headers: authHeaders(), body: fd });
|
||||
if (!resp.ok) { var e = await resp.json().catch(() => ({})); throw new Error(e.error || resp.statusText); }
|
||||
} else if (isArchiveMode) {
|
||||
// Архив не заменяется — обновляем только timeout
|
||||
await requestJSON(API_BASE + '/functions/' + encodeURIComponent(name) + '/timeout', 'PUT', {
|
||||
timeout: parseTimeout(document.getElementById('e-timeout').value)
|
||||
});
|
||||
} else {
|
||||
await requestJSON(API_BASE + '/functions/' + encodeURIComponent(name) + '/code', 'PUT', {
|
||||
code: document.getElementById('e-code').value,
|
||||
|
||||
Reference in New Issue
Block a user