v1.36.0: los enlaces de Mempool van a la web de Mempool, y copiar en todos los txids y direcciones

- Los enlaces ↗ ya no se montan sobre el sitio del dashboard (:4083): se
  derivan al 4081/4080 del mismo nodo, o a la «Web de Mempool» de Ajustes.
- Botón de copiar en los txids y direcciones abreviados de Auditoría, Red,
  Explorar, rastro y peritaje.
- tests/test25.js.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5npnUYgSPkAaHkdaeUqBr
This commit is contained in:
2026-10-22 23:12:36 +02:00
co-authored by Claude Sonnet 5.5
parent cb30a458c4
commit 6973838a59
13 changed files with 129 additions and 27 deletions
+13 -1
View File
@@ -131,6 +131,9 @@
const [url,setUrl]=useState(config.url||origen||"");
const choqueProtocolo = paginaHttps && /^http:\/\//i.test(url.trim());
const [name,setName]=useState(config.name||"");
const [web,setWeb]=useState(config.web||"");
const webOk = !web.trim() || /^https?:\/\/[^\s]{1,200}$/.test(web.trim());
const webPropuesta = derivarWebMempool(url) || "";
const [remember,setRemember]=useState(()=>ALMACEN.get("config", null)!=null);
const [testing,setTesting]=useState(false);
const [testResult,setTestResult]=useState(null);
@@ -142,6 +145,7 @@
};
const handleSave=()=>{
const cfg={url:url.replace(/\/$/,""),name:name||"Mi nodo"};
if(web.trim()) cfg.web=web.trim().replace(/\/$/,"");
if(remember){ ALMACEN.set("config", cfg); }
else { ALMACEN.del("config"); }
onSave(cfg);
@@ -165,6 +169,14 @@
? <>Si has abierto el dashboard desde tu nodo, es la misma dirección que la de esta página: <span style={{fontFamily:C.mono,color:C.t1}}>{origen}</span>{url.trim().replace(/\/$/,"")!==origen&&<button onClick={()=>setUrl(origen)} style={{marginLeft:8,padding:"2px 8px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.blue,fontFamily:C.mono,fontSize:"0.62rem",cursor:"pointer"}}>usar esta</button>}</>
: <>IP Tailscale del nodo con el puerto de Mempool. Con https: <span style={{fontFamily:C.mono}}>https://100.x.x.x:4081</span> · con http: <span style={{fontFamily:C.mono}}>http://100.x.x.x:4080</span></>}
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Web de Mempool (para los enlaces ↗) · opcional</div>
<input value={web} onChange={e=>setWeb(e.target.value)} placeholder={webPropuesta||"https://100.x.x.x:4081"}
style={{width:"100%",background:C.bg,border:`1px solid ${webOk?C.borderBright:C.red}`,borderRadius:6,padding:"10px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.8rem",outline:"none",boxSizing:"border-box",marginBottom:8}}/>
<div style={{fontSize:"0.65rem",color:webOk?C.t2:C.red,marginBottom:14,lineHeight:1.6}}>
{webOk
? <>Es la página de Mempool que se abre al pulsar un txid o una dirección. Vacío: se usa <span style={{fontFamily:C.mono,color:C.t1}}>{webPropuesta||"la dirección de arriba"}</span>{/:4083\b/.test(url)?" (el dashboard tiene su propio puerto, 4083; Mempool está en el 4081/4080)":""}.</>
: "Debe empezar por http:// o https://."}
</div>
{/* Tema: antes eran cuatro puntos de color en la cabecera que parecían luces de estado. */}
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Tema de color</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap",marginBottom:16}}>
@@ -192,7 +204,7 @@
{testResult&&<div style={{padding:"8px 12px",borderRadius:6,fontFamily:C.mono,fontSize:"0.72rem",marginBottom:14,background:testResult.ok?C.greenMuted:C.redMuted,color:testResult.ok?C.green:C.red}}>{testResult.msg}</div>}
<div style={{display:"flex",gap:8}}>
<button onClick={testConn} disabled={!url||testing} style={{flex:1,padding:10,background:C.blueMuted,border:`1px solid ${C.blue}40`,borderRadius:6,color:C.blue,fontFamily:C.mono,fontSize:"0.75rem",cursor:"pointer",fontWeight:700}}>{testing?"PROBANDO···":"PROBAR"}</button>
<button onClick={handleSave} disabled={!url} style={{flex:1,padding:10,background:C.greenMuted,border:`1px solid ${C.green}40`,borderRadius:6,color:C.green,fontFamily:C.mono,fontSize:"0.75rem",cursor:"pointer",fontWeight:700}}>GUARDAR</button>
<button onClick={handleSave} disabled={!url||!webOk} style={{flex:1,padding:10,background:C.greenMuted,border:`1px solid ${C.green}40`,borderRadius:6,color:C.green,fontFamily:C.mono,fontSize:"0.75rem",cursor:"pointer",fontWeight:700}}>GUARDAR</button>
<button onClick={onClose} style={{padding:"10px 14px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.75rem",cursor:"pointer"}}>✕</button>
</div>
<DatosGuardados onReinicio={()=>{ try { window.__txokoReiniciar && window.__txokoReiniciar(); } catch {} }}/>