openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 1.68 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{It as t,Pt as n,Qt as r,Zt as i,wa as a,xa as o}from"./control-ui-connection-Bfj9beF_.js";import{Nj as s,kb as c,mb as l,wj as u}from"./control-ui-boot-shared-DFTSUQQ0.js";import{n as d,t as f}from"./en-update-actions-BWDrrQf2.js";import{n as p,t as m}from"./en-settings-YsyvL-Mv.js";import{r as h,t as g}from"./custodian-alert-store-BWcohw2R.js";function _(e,t,r){if(!r.isCurrent())return;if(!n(e.gateway.snapshot,`openclaw.chat`,`operator.admin`)){e.navigate(`updates`);return}let o=t.attempt,s=t.reconciledRecord,c=(e,t)=>[t,e].filter(Boolean).join(` · `)||a(`common.unknown`),d=[...s?[`${a(`updates.triage.observedRecord`)}: ${s.id??a(`common.unknown`)} · ${s.timestampMs===null?a(`common.unknown`):new Date(s.timestampMs).toISOString()}`]:[],...o?[`${a(`updates.page.attemptedAt`)}: ${new Date(o.timestampMs).toISOString()}`,`${a(`updates.page.attemptReason`)}: ${o.reason}`,`${a(`updates.page.beforeUpdate`)}: ${c(o.beforeVersion,o.beforeSha)}`,`${a(`updates.page.afterAttempt`)}: ${c(o.afterVersion,o.afterSha)}`,...o.failure?[`${o.failure.step}: ${o.failure.detail}`]:[]]:[t.banner.text]],f=a(t.outcome===`unknown`?`updates.triage.unknownTitle`:`updates.triage.failedTitle`),p=[...d,a(`updates.triage.hostHint`)].map(e=>l(i(e),240));g.present({id:t.id,title:f,facts:p,question:l(a(`updates.triage.question`,{outcome:f,facts:p.join(`
`)}),2400),action:{label:a(`updates.reviewUpdate`),target:{kind:`navigate`,routeId:`updates`}}},r),window.dispatchEvent(new CustomEvent(u,{detail:{open:!0}}))}function v(){return(v=e((()=>{s(),o(),m(),f(),r(),c(),t(),h(),p(),d()})))()}v();export{_ as presentUpdateFailureTriage};