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>
1 line
8.7 KiB
JavaScript
1 line
8.7 KiB
JavaScript
import"./DsnmJJEf.js";import{i as K}from"./zNh6Oe5P.js";import{p as O,f as U,j as e,r as t,k as s,n as c,u as o,z as at,t as q,v as g,c as h,d as Q,E as mt,D as ut,B as Y,b as Z,g as P}from"./sWNKMed7.js";import{p as T,i as H,s as gt,a as pt}from"./Ccl3fNd2.js";import{c as rt,d as tt,B as xt}from"./DVl4ZBgx.js";import{b as R,B as $,e as ft}from"./cjRLNre3.js";import{e as yt}from"./DA-798Ko.js";import{D as ht,G as et}from"./DCYYzf48.js";import{E as _t}from"./DAWfW-VQ.js";import{S as kt}from"./BJXodF8n.js";import{e as bt,i as wt}from"./BuuPrWMc.js";import{b as Ct}from"./_gFYyMUN.js";var Pt=U('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><h2 class="text-lg font-medium text-gray-900 dark:text-white mb-4"> </h2> <dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2"><div><dt class="text-sm font-medium text-gray-500 dark:text-gray-400">ID</dt> <dd class="mt-1 text-sm text-gray-900 dark:text-white font-mono"> </dd></div> <div><dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Created At</dt> <dd class="mt-1 text-sm text-gray-900 dark:text-white"> </dd></div> <div><dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Updated At</dt> <dd class="mt-1 text-sm text-gray-900 dark:text-white"> </dd></div> <div><dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Status</dt> <dd class="mt-1"><!></dd></div> <div><dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Pool Balancer Type</dt> <dd class="mt-1 text-sm text-gray-900 dark:text-white"> </dd></div> <div><dt class="text-sm font-medium text-gray-500 dark:text-gray-400"> </dt> <dd class="mt-1 text-sm"><a target="_blank" rel="noopener noreferrer" class="text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300"> <svg class="inline w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg></a></dd></div></dl></div></div>');function $t(L,v){O(v,!1);let a=T(v,"entity",8),p=T(v,"entityType",8);function N(){return`${p().charAt(0).toUpperCase()+p().slice(1)} Information`}function n(){if(!a().endpoint?.base_url)return"#";switch(p()){case"repository":const d=a();return`${a().endpoint.base_url}/${d.owner}/${a().name}`;case"organization":return`${a().endpoint.base_url}/${a().name}`;case"enterprise":return`${a().endpoint.base_url}/enterprises/${a().name}`;default:return"#"}}function E(){return`${p().charAt(0).toUpperCase()+p().slice(1)} URL`}function V(){const d=a().pool_balancing_type;if(!d||d===""||d==="none")return"Round Robin (default)";switch(d){case"roundrobin":return"Round Robin";case"pack":return"Pack";default:return d}}K();var m=Pt(),x=e(m),_=e(x),I=e(_,!0);t(_);var k=s(_,2),i=e(k),f=s(e(i),2),b=e(f,!0);t(f),t(i);var u=s(i,2),D=s(e(u),2),M=e(D,!0);t(D),t(u);var w=s(u,2),S=s(e(w),2),G=e(S,!0);t(S),t(w);var r=s(w,2),C=s(e(r),2),l=e(C);{var j=d=>{$(d,{variant:"success",text:"Running"})},z=d=>{$(d,{variant:"error",text:"Stopped"})};H(l,d=>{c(a()),o(()=>a().pool_manager_status?.running)?d(j):d(z,!1)})}t(C),t(r);var B=s(r,2),A=s(e(B),2),y=e(A,!0);t(A),t(B);var W=s(B,2),F=e(W),st=e(F,!0);t(F);var X=s(F,2),J=e(X),ot=e(J);at(),t(J),t(X),t(W),t(k),t(x),t(m),q((d,it,dt,nt,lt,vt,ct)=>{g(I,d),g(b,(c(a()),o(()=>a().id))),g(M,it),g(G,dt),g(y,nt),g(st,lt),rt(J,"href",vt),g(ot,`${ct??""} `)},[()=>o(N),()=>(c(R),c(a()),o(()=>R(a().created_at))),()=>(c(R),c(a()),o(()=>R(a().updated_at))),()=>o(V),()=>o(E),()=>o(n),()=>o(n)]),h(L,m),Q()}var Tt=U('<div class="p-6 text-center"><svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg> <h3 class="mt-2 text-sm font-medium text-gray-900 dark:text-white">No pools configured</h3> <p class="mt-1 text-sm text-gray-500 dark:text-gray-400"> </p> <div class="mt-4"><!></div></div>'),Et=U('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="flex items-center justify-between mb-4"><h2 class="text-lg font-medium text-gray-900 dark:text-white"> </h2> <a class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300">View all pools</a></div> <!></div></div>');function Wt(L,v){O(v,!1);const[a,p]=gt(),N=()=>pt(yt,"$eagerCache",a);let n=T(v,"pools",8),E=T(v,"entityType",8),V=T(v,"entityId",8,""),m=T(v,"entityName",8,"");const x=mt();function _(){x("addPool",{entityType:E(),entityId:V(),entityName:m()})}const I=[{key:"id",title:"ID",flexible:!0,cellComponent:_t,cellProps:{entityType:"pool",showId:!0,fontMono:!0}},{key:"image",title:"Image",flexible:!0,cellComponent:et,cellProps:{field:"image",type:"code",showTitle:!0}},{key:"provider",title:"Provider",cellComponent:et,cellProps:{field:"provider_name"}},{key:"status",title:"Status",cellComponent:kt,cellProps:{statusType:"enabled"}}],k={entityType:"pool",primaryText:{field:"id",isClickable:!0,href:"/pools/{id}",useId:!0,isMonospace:!0},secondaryText:{field:"entity_name",computedValue:r=>ft(r,N())},badges:[{type:"custom",value:r=>({variant:r.enabled?"success":"error",text:r.enabled?"Enabled":"Disabled"})}]};K();var i=Et(),f=e(i),b=e(f),u=e(b),D=e(u);t(u);var M=s(u,2);t(b);var w=s(b,2);{var S=r=>{var C=Tt(),l=s(e(C),4),j=e(l);t(l);var z=s(l,2),B=e(z);xt(B,{variant:"primary",size:"sm",$$events:{click:_},children:(A,y)=>{at();var W=ut("Add Pool");h(A,W)},$$slots:{default:!0}}),t(z),t(C),q(()=>g(j,`No pools configured for this ${E()??""}.`)),h(r,C)},G=r=>{ht(r,{get columns(){return I},get data(){return n()},loading:!1,error:"",searchTerm:"",showSearch:!1,showPagination:!1,currentPage:1,get perPage(){return c(n()),o(()=>n().length)},totalPages:1,get totalItems(){return c(n()),o(()=>n().length)},itemName:"pools",emptyTitle:"No pools configured",get emptyMessage(){return`No pools configured for this ${E()??""}.`},emptyIconType:"cog",get mobileCardConfig(){return k}})};H(w,r=>{c(n()),o(()=>n().length===0)?r(S):r(G,!1)})}t(f),t(i),q(r=>{g(D,`Pools (${c(n()),o(()=>n().length)??""})`),rt(M,"href",r)},[()=>(c(tt),o(()=>tt("/pools")))]),h(L,i),Q(),p()}var It=U('<div class="bg-gray-50 dark:bg-gray-700 p-4 rounded-lg"><div class="flex justify-between items-start"><p class="text-sm text-gray-900 dark:text-white flex-1 mr-4"> </p> <div class="flex items-center space-x-2 flex-shrink-0"><!> <span class="text-xs text-gray-500 dark:text-gray-400"> </span></div></div></div>'),Bt=U('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><h2 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Events</h2> <div class="space-y-3 max-h-96 overflow-y-auto scroll-smooth"></div></div></div>'),Nt=U('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><h2 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Events</h2> <div class="text-center py-8"><svg class="w-12 h-12 text-gray-400 dark:text-gray-500 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg> <p class="text-sm text-gray-500 dark:text-gray-400">No events available</p></div></div></div>');function qt(L,v){O(v,!1);let a=T(v,"events",8),p=T(v,"eventsContainer",12,void 0);K();var N=Y(),n=Z(N);{var E=m=>{var x=Bt(),_=e(x),I=s(e(_),2);bt(I,5,a,wt,(k,i)=>{var f=It(),b=e(f),u=e(b),D=e(u,!0);t(u);var M=s(u,2),w=e(M);{var S=l=>{$(l,{variant:"error",text:"Error"})},G=l=>{var j=Y(),z=Z(j);{var B=y=>{$(y,{variant:"warning",text:"Warning"})},A=y=>{$(y,{variant:"info",text:"Info"})};H(z,y=>{P(i),o(()=>(P(i).event_level||"info").toLowerCase()==="warning")?y(B):y(A,!1)},!0)}h(l,j)};H(w,l=>{P(i),o(()=>(P(i).event_level||"info").toLowerCase()==="error")?l(S):l(G,!1)})}var r=s(w,2),C=e(r,!0);t(r),t(M),t(b),t(f),q(l=>{g(D,(P(i),o(()=>P(i).message))),g(C,l)},[()=>(c(R),P(i),o(()=>R(P(i).created_at)))]),h(k,f)}),t(I),Ct(I,k=>p(k),()=>p()),t(_),t(x),h(m,x)},V=m=>{var x=Nt();h(m,x)};H(n,m=>{c(a()),o(()=>a()&&a().length>0)?m(E):m(V,!1)})}h(L,N),Q()}export{$t as E,Wt as P,qt as a};
|