v1.1.45: phase1 — escape fixes, refSvc top-level, redact secrets, validate inputs, no traceback, TIMEOUT save, remove legacy api_bp
This commit is contained in:
+5
-5
@@ -164,7 +164,7 @@ function showParams(opId,opName){
|
||||
}
|
||||
const form=document.getElementById('params-form');
|
||||
const displayNameValue=isCreate?makeCreateDisplayName():'';
|
||||
const createHeader=isCreate?`<div style="font-weight:600;font-size:13px;margin-bottom:8px;color:var(--brand-primary);">Создание: ${currentSvcName}</div>`:'';
|
||||
const createHeader=isCreate?`<div style="font-weight:600;font-size:13px;margin-bottom:8px;color:var(--brand-primary);">Создание: ${_esc(currentSvcName)}</div>`:'';
|
||||
const opHeader=!isCreate?`<div style="font-weight:600;font-size:13px;margin-bottom:8px;color:var(--brand-primary);">${_esc(opName)} → ${_esc(findInstName())}</div>`:'';
|
||||
form.innerHTML=createHeader+opHeader+(opName==='create'?`<div class="param-row"><label class="req">displayName</label><span style="font-size:12px;color:var(--muted);white-space:nowrap;">${AUTOTEST_PREFIX}</span><input type="text" id="param-displayname" value="${_esc(displayNameValue)}" autocomplete="off"></div>`:'')
|
||||
+ params.map(p=>{
|
||||
@@ -291,8 +291,8 @@ function setFinishedState(statusText, statusClass, statusError, statusDuration,
|
||||
btn.onclick=null;
|
||||
const opName=selectedOp?.opName||'операция';
|
||||
const durationText=statusDuration!==undefined&&statusDuration!==null?`${statusDuration}s`:'0s';
|
||||
const extra=statusError||'';
|
||||
const instName=instanceName||findInstName()||selectedInst||'';
|
||||
const extra=_esc(statusError||'');
|
||||
const instName=_esc(instanceName||findInstName()||selectedInst||'');
|
||||
document.getElementById('test-status').innerHTML=` <span class="badge ${statusClass}">${statusText}</span> <span style="color:var(--muted);">${opName}</span> <span style="color:var(--muted);">${durationText}</span> <span style="color:var(--muted);">${instName}</span> ${extra}`;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ async function executeOp(params){
|
||||
displayName:isCreate ? displayName : ''
|
||||
})});
|
||||
const d=await r.json();
|
||||
if(d.status==='FAIL'){busy=false;document.getElementById('test-status').innerHTML=` <span class="badge">FAIL</span> ${d.error||''}`;btn.disabled=false;return;}
|
||||
if(d.status==='FAIL'){busy=false;document.getElementById('test-status').innerHTML=` <span class="badge">FAIL</span> ${_esc(d.error||'')}`;btn.disabled=false;return;}
|
||||
// CMDB delete — мгновенное удаление, не надо поллинга
|
||||
if(d.status==='OK'&&(d.opUid||'').startsWith('cmdb-')){
|
||||
busy=false;
|
||||
@@ -457,7 +457,7 @@ function startLogPoll(){
|
||||
try{
|
||||
const r=await fetch('/api/log');
|
||||
const lines=await r.json();
|
||||
el.innerHTML=lines.map(l=>`<div>${l}</div>`).join('');
|
||||
el.innerHTML=lines.map(l=>`<div>${_esc(l)}</div>`).join('');
|
||||
el.scrollTop=el.scrollHeight;
|
||||
}catch(e){}
|
||||
},2000);
|
||||
|
||||
Reference in New Issue
Block a user