fix: clone — poll until function visible in list, up to 5 attempts (v1.3.85)

This commit is contained in:
“Naeel”
2026-05-09 20:53:17 +04:00
parent f729bbfd85
commit 1ea0c5a9de
3 changed files with 19 additions and 6 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ spec:
serviceAccountName: fission-console serviceAccountName: fission-console
containers: containers:
- name: console - name: console
image: naeel/fission-console:v1.3.84 image: naeel/fission-console:v1.3.85
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 8090 - containerPort: 8090
+2 -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.84</div> <div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.85</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>
@@ -542,7 +542,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.84</span> <span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.85</span>
<button class="btn ghost" onclick="closeHelp()">Закрыть</button> <button class="btn ghost" onclick="closeHelp()">Закрыть</button>
</div> </div>
</div> </div>
+16 -3
View File
@@ -448,10 +448,23 @@ async function submitClone() {
try { try {
var data = await requestJSON(API_BASE + '/functions/' + encodeURIComponent(srcName) + '/clone', 'POST', {new_name: newName}); var data = await requestJSON(API_BASE + '/functions/' + encodeURIComponent(srcName) + '/clone', 'POST', {new_name: newName});
// Успех — закрываем модалку, обновляем список // Успех — закрываем модалку, ждём появления в списке
closeEdit(); closeEdit();
setStatus('Функция «' + newName + '» создана как копия «' + srcName + '»', false); showStatus('Клонирование завершено, обновляем список...', '');
setTimeout(function() { reloadAll(); }, 800); var attempts = 0;
async function pollUntilVisible() {
attempts++;
await reloadAll();
var found = (S.fns || []).some(function(f) {
return f && f.metadata && f.metadata.name === newName;
});
if (found || attempts >= 5) {
showStatus('Функция «' + newName + '» создана как копия «' + srcName + '»', 'ok');
} else {
setTimeout(pollUntilVisible, 1000);
}
}
setTimeout(pollUntilVisible, 700);
} catch(e) { } catch(e) {
if (errEl) { errEl.textContent = e.message; errEl.style.display = 'block'; } if (errEl) { errEl.textContent = e.message; errEl.style.display = 'block'; }
} finally { } finally {