MCPcopy
hub / github.com/7836246/cursor2api / selReq

Function selReq

public/logs.js:144–158  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

142
143// ===== Select Request =====
144async function selReq(id){
145 if(selId===id){desel();return}
146 selId=id;renderRL();
147 const s=rmap[id];
148 if(s){document.getElementById('dTitle').textContent=s.title||'请求 '+id;renderSCard(s)}
149 document.getElementById('tabs').style.display='flex';
150 // ★ 保持当前 tab(不重置为 logs)
151 const tabEl=document.querySelector('.tab[data-tab="'+curTab+'"]');
152 if(tabEl){setTab(curTab,tabEl)}else{setTab('logs',document.querySelector('.tab'))}
153 // Load payload
154 try{const r=await fetch(authQ('/api/payload/'+id));if(r.ok)curPayload=await r.json();else curPayload=null}catch{curPayload=null}
155 // Re-render current tab with new data
156 const tabEl2=document.querySelector('.tab[data-tab="'+curTab+'"]');
157 if(tabEl2)setTab(curTab,tabEl2);
158}
159
160function desel(){
161 selId=null;curPayload=null;renderRL();

Callers 1

logs.jsFile · 0.85

Calls 6

deselFunction · 0.85
renderRLFunction · 0.85
renderSCardFunction · 0.85
setTabFunction · 0.85
authQFunction · 0.85
jsonMethod · 0.45

Tested by

no test coverage detected