garm/webapp/assets/_app/immutable/chunks/DAWfW-VQ.js
Gabriel Adrian Samfira 6fee10c737 Fix double creation of pools
This change fixes the creation of pools though the UI. Both the modal and
the page were sending a request to create the pool, leading to double pool.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-08-25 16:12:01 +00:00

1 line
1.9 KiB
JavaScript

import"./DsnmJJEf.js";import{i as R}from"./zNh6Oe5P.js";import{p as q,l as w,a as A,f as x,t as v,c as k,d as B,k as D,j as u,s as _,m as y,r as f,n as m,u as h,g as d,v as U}from"./sWNKMed7.js";import{p as o,i as F}from"./Ccl3fNd2.js";import{c as g,s as G,d as r}from"./DVl4ZBgx.js";var H=x('<div class="text-sm text-gray-500 dark:text-gray-400 truncate"> </div>'),J=x('<div class="w-full min-w-0 text-sm font-medium"><a> </a><!></div>');function V(b,n){q(n,!1);const i=y(),p=y();let e=o(n,"item",8),s=o(n,"entityType",8,"repository"),E=o(n,"showOwner",8,!1),I=o(n,"showId",8,!1),z=o(n,"fontMono",8,!1);function C(){if(!e())return"Unknown";switch(s()){case"repository":return E()?`${e().owner||"Unknown"}/${e().name||"Unknown"}`:e().name||"Unknown";case"organization":case"enterprise":return e().name||"Unknown";case"pool":return I()?e().id||"Unknown":e().name||"Unknown";case"scaleset":return e().name||"Unknown";case"instance":return e().name||"Unknown";default:return e().name||e().id||"Unknown"}}function M(){if(!e())return"#";let t;switch(s()){case"instance":t=e().name;break;default:t=e().id||e().name;break}if(!t)return"#";switch(s()){case"repository":return r(`/repositories/${t}`);case"organization":return r(`/organizations/${t}`);case"enterprise":return r(`/enterprises/${t}`);case"pool":return r(`/pools/${t}`);case"scaleset":return r(`/scalesets/${t}`);case"instance":return r(`/instances/${encodeURIComponent(t)}`);default:return"#"}}w(()=>{},()=>{_(i,C())}),w(()=>{},()=>{_(p,M())}),A(),R();var c=J(),a=u(c),N=u(a,!0);f(a);var O=D(a);{var T=t=>{var l=H(),j=u(l,!0);f(l),v(()=>U(j,(m(e()),h(()=>e().provider_id)))),k(t,l)};F(O,t=>{m(s()),m(e()),h(()=>s()==="instance"&&e()?.provider_id)&&t(T)})}f(c),v(()=>{g(a,"href",d(p)),G(a,1,`block w-full truncate text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 ${z()?"font-mono":""}`),g(a,"title",d(i)),U(N,d(i))}),k(b,c),B()}export{V as E};