Problem: the hexagonal refactor churns the backend tree for nine more phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper, compose/web image) must move to its own repo first so doc/layout rewrites land once on a backend-only tree. Change: - New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/ (updateURL repointed to oikos-web releases), compose/, own CI (web + desktop jobs), own deploy script (CI-green gate, TOCTOU guard, version-tagged images, prune-to-3), own webhook receiver on :9798 + launchd unit, own compose project publishing the same 8091:80. - Cutover executed on mac-mini in order: oikos stack's web service stopped+removed, oikos-web project brought up on 8091; outer Caddy untouched (targets the published port) — serving + Authentik flow + /wails 404 quirk verified post-cutover. - Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install targets, the compose web service, oikos-web from deploy.sh's fallback prune list; wails + go-keyring dropped from go.mod, vendor synced. - README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now point at the new repo; mbse + mascot design docs carry a path note. Risk: production SPA serving depends on the new pipeline now; rollback is versioned-image re-up of the old web service from a pre-split checkout (port 8091). Desktop builds installed before the split still check dtoro/oikos releases — one manual reinstall, noted in the oikos-web release notes. Verification: go vet, make test (race), make generate-check, golangci (no new findings; baseline down 400→365); post-cutover curls — localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
import{p as W,W as ve,B as L,a8 as z,a as n,g as o,s as x,b as I,c as p,u as m,f as u,R as M,t as T,e as R,y as J,a6 as te,o as fe,af as xe,a7 as k,z as he,m as pe,D as S,ay as ge,az as _e,v as me,w as ye,j as E,aA as we,aB as B,aC as ke,ab as be}from"./index-B5w8gw75.js";import{T as Ae,a as ae,b as re,c as Pe}from"./tabs-trigger-iqr7CeDz.js";import{D as K}from"./DataTable-B-TAV_HV.js";import"./clone-bSRBQ4eT.js";import"./StatusBadgeRenderer-BEdJTFrn.js";import"./select-trigger-BFw7c3mx.js";import"./hidden-input-CbX2doyK.js";import"./on-mount-effect.svelte-Lpx0iWhb.js";var Ce=u('<div class="flex justify-end gap-2"><!> <!></div>');function De(h,e){W(e,!0);let c=ve(e,"deciding",3,null);var d=Ce(),v=p(d);{let i=m(()=>c()===e.row.id);L(v,{size:"sm",get disabled(){return o(i)},onclick:()=>{var a;return(a=e.onApprove)==null?void 0:a.call(e,e.row.id)},children:(a,l)=>{var s=z("Approve");n(a,s)},$$slots:{default:!0}})}var r=x(v,2);{let i=m(()=>c()===e.row.id);L(r,{size:"sm",variant:"destructive",get disabled(){return o(i)},onclick:()=>{var a;return(a=e.onDeny)==null?void 0:a.call(e,e.row.id)},children:(a,l)=>{var s=z("Deny");n(a,s)},$$slots:{default:!0}})}n(h,d),I()}var je=u('<div class="flex justify-end"><!></div>');function $e(h,e){W(e,!0);function c(a){return["pending_approval","approved","running"].includes(a)}var d=je(),v=p(d);{var r=a=>{L(a,{size:"sm",variant:"outline",onclick:()=>{var l;return(l=e.onCancel)==null?void 0:l.call(e,e.row.id)},children:(l,s)=>{var f=z("Cancel");n(l,f)},$$slots:{default:!0}})},i=m(()=>c(e.row.status));M(v,a=>{o(i)&&a(r)})}n(h,d),I()}var Ee=u('<div class="text-xs text-muted-foreground"> </div>'),Te=u('<div class="text-xs text-destructive"> </div>'),Re=u("<div><div> </div> <!> <!></div>");function ze(h,e){W(e,!0);var c=Re(),d=p(c),v=p(d),r=x(d,2);{var i=s=>{var f=Ee(),b=p(f);T(()=>R(b,e.row.summary)),n(s,f)};M(r,s=>{e.row.summary&&s(i)})}var a=x(r,2);{var l=s=>{var f=Te(),b=p(f);T(()=>R(b,e.row.error)),n(s,f)};M(a,s=>{e.row.error&&s(l)})}T(()=>R(v,e.row.verb)),n(h,c),I()}var Me=u('<span class="text-xs text-muted-foreground"> </span>');function Se(h,e){function c(r){if(r==null)return"—";if(r<1e3)return`${r}ms`;const i=Math.round(r/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}var d=Me(),v=p(d);T(r=>R(v,r),[()=>c(e.value)]),n(h,d)}var Be=u("Approvals <!>",1),se=u("<!> <!>",1),We=u('<p class="mt-4 text-xs text-muted-foreground">Recently decided</p> <div class="mt-1"><!></div>',1),Ie=u("<!> <!> <!>",1),Ne=u('<div class="flex h-full flex-col gap-4 p-2"><h1 class="text-lg font-semibold">Operations ledger</h1> <!></div>');function Ve(h,e){W(e,!0);const c=()=>he(ye,"$liveEvents",d),[d,v]=pe();let r=J(te([])),i=J(te([])),a=J(null);async function l(){S(r,await ge(),!0)}async function s(){S(i,await _e(),!0)}fe(()=>{l(),s();const t=me(),g=setInterval(s,5e3);return()=>{t(),clearInterval(g)}}),xe(()=>{const t=c()[0];t&&(t.type.startsWith("approval.")&&l(),t.type.startsWith("execution.")&&t.type!=="execution.output"&&s())});async function f(t,g){S(a,t,!0);const O=await ke(t,g);S(a,null),O?(B.success(`Approval ${g==="approve"?"approved":"denied"}`),l()):B.error("Decision failed")}async function b(t){await we(t)?(B.success("Execution cancelled"),s()):B.error("Cancel failed")}const N=m(()=>o(r).filter(t=>t.status==="pending")),Q=m(()=>o(r).filter(t=>t.status!=="pending")),ne=m(()=>[{key:"subject",header:"Subject",class:"font-mono text-xs",width:"180px",accessor:t=>t.subject??"—",truncate:!0},{key:"action",header:"Action",truncate:!0},{key:"risk_class",header:"Risk",render:"status-badge",renderProps:{kind:"risk"},width:"120px"},{key:"status",header:"Status",render:"status-badge",renderProps:{kind:"execution"},width:"100px"},{key:"expires_at",header:"Expires",render:"date",width:"170px"},{key:"_actions",header:"",render:De,renderProps:{deciding:o(a),onApprove:t=>f(t,"approve"),onDeny:t=>f(t,"deny")},align:"right",headerClass:"text-right",width:"220px"}]),ie=[{key:"subject",header:"Subject",class:"font-mono text-xs",width:"180px",accessor:t=>t.subject??"—",truncate:!0},{key:"action",header:"Action",truncate:!0},{key:"status",header:"Status",render:"status-badge",renderProps:{kind:"execution"},width:"100px"},{key:"decided_at",header:"Decided",render:"date",width:"170px",accessor:t=>t.decided_at??"—"}],oe=[{key:"target",header:"Target",class:"font-mono text-xs",width:"180px",accessor:t=>t.target??"—",truncate:!0},{key:"_action",header:"Action",render:ze,truncate:!0},{key:"risk_class",header:"Risk",render:"status-badge",renderProps:{kind:"risk"},width:"120px"},{key:"status",header:"Status",render:"status-badge",renderProps:{kind:"execution"},width:"110px"},{key:"duration_ms",header:"Duration",render:Se,width:"90px",align:"right"},{key:"created_at",header:"When",render:"relative-time",width:"100px"},{key:"_cancel",header:"",render:$e,renderProps:{onCancel:b},align:"right",headerClass:"text-right",width:"100px"}];var U=Ne(),de=x(p(U),2);k(de,()=>Pe,(t,g)=>{g(t,{value:"approvals",class:"flex flex-1 flex-col overflow-hidden",children:(O,Oe)=>{var V=Ie(),X=E(V);k(X,()=>Ae,(A,P)=>{P(A,{children:(C,Z)=>{var D=se(),j=E(D);k(j,()=>ae,($,_)=>{_($,{value:"approvals",children:(y,F)=>{var w=Be(),G=x(E(w));{var ce=H=>{be(H,{variant:"destructive",class:"ml-1",children:(ue,qe)=>{var ee=z();T(()=>R(ee,o(N).length)),n(ue,ee)},$$slots:{default:!0}})};M(G,H=>{o(N).length&&H(ce)})}n(y,w)},$$slots:{default:!0}})});var q=x(j,2);k(q,()=>ae,($,_)=>{_($,{value:"executions",children:(y,F)=>{var w=z("Activity");n(y,w)},$$slots:{default:!0}})}),n(C,D)},$$slots:{default:!0}})});var Y=x(X,2);k(Y,()=>re,(A,P)=>{P(A,{value:"approvals",class:"flex-1 overflow-auto",children:(C,Z)=>{var D=se(),j=E(D);K(j,{get columns(){return o(ne)},get data(){return o(N)},emptyMessage:"No pending approvals."});var q=x(j,2);{var $=_=>{var y=We(),F=x(E(y),2),w=p(F);{let G=m(()=>o(Q).slice(0,20));K(w,{get columns(){return ie},get data(){return o(G)}})}n(_,y)};M(q,_=>{o(Q).length&&_($)})}n(C,D)},$$slots:{default:!0}})});var le=x(Y,2);k(le,()=>re,(A,P)=>{P(A,{value:"executions",class:"flex-1 overflow-auto",children:(C,Z)=>{K(C,{get columns(){return oe},get data(){return o(i)},emptyMessage:"No activity yet."})},$$slots:{default:!0}})}),n(O,V)},$$slots:{default:!0}})}),n(h,U),I(),v()}export{Ve as default};
|