@devtable/settings-form 13.42.10 → 13.42.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/settings-form.es.js
CHANGED
|
@@ -1608,12 +1608,9 @@ function oa({
|
|
|
1608
1608
|
}, ...c }) }),
|
|
1609
1609
|
/* @__PURE__ */ a.jsx(R, { name: "config.port", control: s, render: ({
|
|
1610
1610
|
field: c
|
|
1611
|
-
}) => (
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
width: "8em"
|
|
1615
|
-
}, ...c })
|
|
1616
|
-
) })
|
|
1611
|
+
}) => /* @__PURE__ */ a.jsx(rr, { mb: t.spacing, size: t.size, required: !0, label: r("datasource.db.port"), hideControls: !0, sx: {
|
|
1612
|
+
width: "8em"
|
|
1613
|
+
}, ...c }) })
|
|
1617
1614
|
] }),
|
|
1618
1615
|
/* @__PURE__ */ a.jsx(R, { name: "config.username", control: s, render: ({
|
|
1619
1616
|
field: c
|
|
@@ -6608,7 +6605,7 @@ const As = Je("DataSourceList", ({
|
|
|
6608
6605
|
] })
|
|
6609
6606
|
] })
|
|
6610
6607
|
] });
|
|
6611
|
-
}), ks = () => import("./package-
|
|
6608
|
+
}), ks = () => import("./package-b88b5916.mjs").then(({
|
|
6612
6609
|
version: e
|
|
6613
6610
|
}) => (console.log(`[@devtable/dashboard] version: ${e}`), e));
|
|
6614
6611
|
export {
|
|
@@ -41,4 +41,4 @@ Check the top-level render call using <`+E+">.")}return S}}function fn(o,S){{if(
|
|
|
41
41
|
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
42
42
|
`,e[0].empty=!0)},Yt=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Tr=function(e){for(var t=[[]],n=[e],r=[0],s=[e.length],i=0,l=0,u=[],c=[u];l>-1;){for(;(i=r[l]++)<s[l];){var g=void 0,m=t[l],d=n[l],p=d[i];if(typeof p=="string"?(m=l>0?m:["plain"],g=p):(m=Yt(m,p.type),p.alias&&(m=Yt(m,p.alias)),g=p.content),typeof g!="string"){l++,t.push(m),n.push(g),r.push(0),s.push(g.length);continue}var f=g.split(Er),y=f.length;u.push({types:m,content:f[0]});for(var b=1;b<y;b++)qt(u),c.push(u=[]),u.push({types:m,content:f[b]})}l--,t.pop(),n.pop(),r.pop(),s.pop()}return qt(u),c},Ar=function(e,t){var n=e.plain,r=Object.create(null),s=e.styles.reduce(function(i,l){var u=l.languages,c=l.style;return u&&!u.includes(t)||l.types.forEach(function(g){var m=Se({},i[g],c);i[g]=m}),i},r);return s.root=n,s.plain=Se({},n,{backgroundColor:null}),s};function Ht(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)===-1&&(n[r]=e[r]);return n}var kr=function(e){function t(){for(var n=this,r=[],s=arguments.length;s--;)r[s]=arguments[s];e.apply(this,r),qe(this,"getThemeDict",function(i){if(n.themeDict!==void 0&&i.theme===n.prevTheme&&i.language===n.prevLanguage)return n.themeDict;n.prevTheme=i.theme,n.prevLanguage=i.language;var l=i.theme?Ar(i.theme,i.language):void 0;return n.themeDict=l}),qe(this,"getLineProps",function(i){var l=i.key,u=i.className,c=i.style,g=Ht(i,["key","className","style","line"]),m=g,d=Se({},m,{className:"token-line",style:void 0,key:void 0}),p=n.getThemeDict(n.props);return p!==void 0&&(d.style=p.plain),c!==void 0&&(d.style=d.style!==void 0?Se({},d.style,c):c),l!==void 0&&(d.key=l),u&&(d.className+=" "+u),d}),qe(this,"getStyleForToken",function(i){var l=i.types,u=i.empty,c=l.length,g=n.getThemeDict(n.props);if(g!==void 0){{if(c===1&&l[0]==="plain")return u?{display:"inline-block"}:void 0;if(c===1&&!u)return g[l[0]]}var m=u?{display:"inline-block"}:{},d=l.map(function(p){return g[p]});return Object.assign.apply(Object,[m].concat(d))}}),qe(this,"getTokenProps",function(i){var l=i.key,u=i.className,c=i.style,g=i.token,m=Ht(i,["key","className","style","token"]),d=m,p=Se({},d,{className:"token "+g.types.join(" "),children:g.content,style:n.getStyleForToken(g),key:void 0});return c!==void 0&&(p.style=p.style!==void 0?Se({},p.style,c):c),l!==void 0&&(p.key=l),u&&(p.className+=" "+u),p}),qe(this,"tokenize",function(i,l,u,c){var g={code:l,grammar:u,language:c,tokens:[]};i.hooks.run("before-tokenize",g);var m=g.tokens=i.tokenize(g.code,g.grammar,g.language);return i.hooks.run("after-tokenize",g),m})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var r=this.props,s=r.Prism,i=r.language,l=r.code,u=r.children,c=this.getThemeDict(this.props),g=s.languages[i],m=g!==void 0?this.tokenize(s,l,g,i):[l],d=Tr(m);return u({tokens:d,className:"prism-code language-"+i,style:c!==void 0?c.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(k.Component);const Cr=kr;function Vt({copied:e}){return k.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"1rem",height:"1rem"}},e?k.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):k.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM11 2V2.25C11 2.66421 10.6642 3 10.25 3H4.75C4.33579 3 4 2.66421 4 2.25V2H3.5C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V2.5C12 2.22386 11.7761 2 11.5 2H11Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}Vt.displayName="@mantine/prism/CopyIcon";const jr=e=>({plain:{color:e.colors.gray[4],backgroundColor:e.colors.dark[8]},styles:[{types:["comment"],style:{color:e.colors.gray[6]}},{types:["string","inserted","selector","atrule"],style:{color:e.colors.teal[4]}},{types:["number"],style:{color:e.colors.blue[4]}},{types:["builtin","char","constant","function"],style:{color:e.colors.orange[5]}},{types:["punctuation"],style:{color:e.colors.gray[5]}},{types:["variable"],style:{color:e.colors.gray[5]}},{types:["class-name","attr-name"],style:{color:e.colors.yellow[5]}},{types:["tag","deleted"],style:{color:e.colors.red[6]}},{types:["operator"],style:{color:e.colors.gray[5]}},{types:["boolean"],style:{color:e.colors.red[6]}},{types:["keyword"],style:{color:e.colors.indigo[3]}},{types:["doctype"],style:{color:e.colors.gray[5]}},{types:["url"],style:{color:e.colors.gray[5]}}]}),Or=e=>({plain:{color:e.colors.gray[9],backgroundColor:e.fn.rgba(e.colors.gray[0],.65)},styles:[{types:["comment"],style:{color:e.colors.gray[6]}},{types:["string","inserted"],style:{color:e.colors.indigo[9]}},{types:["number"],style:{color:e.colors.blue[7]}},{types:["builtin","char","constant","function","selector","atrule"],style:{color:e.colors.lime[9]}},{types:["punctuation"],style:{color:e.colors.gray[7]}},{types:["variable"],style:{color:e.colors.violet[9]}},{types:["attr-name"],style:{color:e.colors.green[9]}},{types:["class-name"],style:{color:e.colors.red[9]}},{types:["tag","deleted"],style:{color:e.colors.violet[9]}},{types:["operator"],style:{color:e.colors.red[9]}},{types:["boolean"],style:{color:e.colors.red[9]}},{types:["keyword"],style:{color:e.colors.red[9]}},{types:["doctype"],style:{color:e.colors.gray[7]}},{types:["url"],style:{color:e.colors.gray[7]}}]}),Ir=(e,t)=>t==="dark"?jr(e):Or(e);var Dr=h.createStyles((e,{colorScheme:t,native:n,maxLineSize:r,radius:s})=>({scrollArea:{},root:{position:"relative"},code:{boxSizing:"border-box",position:"relative",fontFamily:e.fontFamilyMonospace,lineHeight:1.7,fontSize:h.rem(13),overflowX:n?"auto":void 0,borderRadius:e.fn.radius(s),padding:`${e.spacing.sm} 0`,"&.mantine-Prism-code":{marginTop:0,marginBottom:0}},copy:{position:"absolute",top:e.spacing.xs,right:e.dir==="ltr"?e.spacing.xs:"unset",left:e.dir==="rtl"?e.spacing.xs:"unset",zIndex:2,"&, &:hover":{backgroundColor:t==="dark"?e.colors.dark[8]:e.colors.gray[0]}},line:{display:"flex",width:"100%",padding:`0 ${e.spacing.md}`},lineNumber:{color:t==="dark"?e.colors.dark[4]:e.colors.gray[4],textAlign:"right",width:`calc(8 * ${h.rem(r)})`,marginRight:e.dir==="ltr"?e.spacing.xs:void 0,marginLeft:e.dir==="rtl"?e.spacing.xs:void 0,userSelect:"none"},lineContent:{width:"100%"}}));const Rr=Dr;var Lr=Object.defineProperty,Nr=Object.defineProperties,$r=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Zt=(e,t,n)=>t in e?Lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,De=(e,t)=>{for(var n in t||(t={}))Wt.call(t,n)&&Zt(e,n,t[n]);if(tt)for(var n of tt(t))Kt.call(t,n)&&Zt(e,n,t[n]);return e},Ye=(e,t)=>Nr(e,$r(t)),Fr=(e,t)=>{var n={};for(var r in e)Wt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tt)for(var r of tt(e))t.indexOf(r)<0&&Kt.call(e,r)&&(n[r]=e[r]);return n};const zr={noCopy:!1,copyLabel:"Copy code",copiedLabel:"Copied",withLineNumbers:!1,trim:!0,highlightLines:{},scrollAreaComponent:h.ScrollArea,getPrismTheme:Ir},ft=k.forwardRef((e,t)=>{const n=h.useComponentDefaultProps("Prism",zr,e),{className:r,children:s,language:i,noCopy:l,classNames:u,styles:c,copyLabel:g,copiedLabel:m,withLineNumbers:d,highlightLines:p,scrollAreaComponent:f,colorScheme:y,trim:b,unstyled:_,radius:w,getPrismTheme:x,variant:T}=n,O=Fr(n,["className","children","language","noCopy","classNames","styles","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","colorScheme","trim","unstyled","radius","getPrismTheme","variant"]),H=b&&typeof s=="string"?s.trim():s,J=H.split(`
|
|
43
43
|
`).length.toString().length,P=h.useMantineTheme(),V=_n.useClipboard(),M=y||P.colorScheme,{classes:te,cx:z}=Rr({colorScheme:M,native:f!==h.ScrollArea,maxLineSize:J,radius:w},{name:"Prism",classNames:u,styles:c,unstyled:_,variant:T});return k.createElement(h.Box,Ye(De({className:z(te.root,r),ref:t},O),{translate:"no"}),!l&&k.createElement(h.Tooltip,{label:V.copied?m:g,position:"left",withArrow:!0,arrowSize:6,offset:6,color:V.copied?"teal":void 0,unstyled:_},k.createElement(h.ActionIcon,{className:te.copy,"aria-label":V.copied?m:g,onClick:()=>V.copy(H),unstyled:_},k.createElement(Vt,{copied:V.copied}))),k.createElement(Cr,Ye(De({},wr),{theme:x(P,M),code:H,language:i}),({className:X,style:q,tokens:ee,getLineProps:U,getTokenProps:ae})=>k.createElement(f,{className:te.scrollArea,dir:"ltr"},k.createElement("pre",{className:z(te.code,X),style:q,dir:"ltr"},ee.map((Q,ne)=>{var ue,ce,pe,xe;if(ne===ee.length-1&&Q.length===1&&Q[0].content===`
|
|
44
|
-
`)return null;const se=ne+1,ge=U({line:Q,key:ne}),we=se in p,fe=M==="dark"?P.fn.rgba(P.fn.themeColor((ue=p[se])==null?void 0:ue.color,9),.25):P.fn.themeColor((ce=p[se])==null?void 0:ce.color,0);return k.createElement("div",Ye(De({},ge),{className:z(te.line,ge.className),style:De({},we?{backgroundColor:fe}:null)}),d&&k.createElement("div",{className:te.lineNumber,style:{color:we?P.fn.themeColor((pe=p[se])==null?void 0:pe.color,M==="dark"?5:8):void 0}},((xe=p[se])==null?void 0:xe.label)||se),k.createElement("div",{className:te.lineContent},Q.map((Ve,Re)=>{var Le,Ee;const Ne=ae({token:Ve,key:Re});return k.createElement("span",Ye(De({},Ne),{style:Ye(De({},Ne.style),{color:we?P.fn.themeColor((Le=p[se])==null?void 0:Le.color,M==="dark"?5:8):(Ee=Ne==null?void 0:Ne.style)==null?void 0:Ee.color})}))})))}).filter(Boolean)))))});ft.displayName="@mantine/prism/Prism";var Pr=h.createStyles((e,{radius:t})=>({tab:{paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,height:h.rem(34),border:`${h.rem(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]}`,borderBottom:0,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderRadius:0,"&:first-of-type":{borderTopLeftRadius:e.radius.sm},"&:not(:first-of-type)":{borderLeft:0},"&:last-of-type":{borderTopRightRadius:e.radius.sm},"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]},"&[data-active]":{color:e.colorScheme==="dark"?e.white:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.fn.rgba(e.colors.gray[0],.65),"&::before":{backgroundColor:"transparent"}}},prism:{borderRadius:e.fn.radius(t),borderTopRightRadius:0,borderTopLeftRadius:0,border:`${h.rem(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,borderTop:0,overflow:"hidden"},code:{borderTopRightRadius:0,borderTopLeftRadius:0,border:0}}));const Xt=Pr;var Br=Object.defineProperty,Mr=Object.defineProperties,Gr=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,en=(e,t,n)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tn=(e,t)=>{for(var n in t||(t={}))Qt.call(t,n)&&en(e,n,t[n]);if(nt)for(var n of nt(t))Jt.call(t,n)&&en(e,n,t[n]);return e},Ur=(e,t)=>Mr(e,Gr(t)),qr=(e,t)=>{var n={};for(var r in e)Qt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nt)for(var r of nt(e))t.indexOf(r)<0&&Jt.call(e,r)&&(n[r]=e[r]);return n};function Yr(e){const{classes:t}=Xt({radius:e.radius});return k.createElement(h.Tabs,Ur(tn({},e),{variant:"outline",classNames:{tab:t.tab},translate:"no"}))}function Hr(e){var t=e,{language:n,children:r,radius:s,noCopy:i,copyLabel:l,copiedLabel:u,withLineNumbers:c,highlightLines:g,scrollAreaComponent:m,trim:d,getPrismTheme:p,colorScheme:f,variant:y}=t,b=qr(t,["language","children","radius","noCopy","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","trim","getPrismTheme","colorScheme","variant"]);const{classes:_}=Xt({radius:s});return k.createElement(h.Tabs.Panel,tn({},b),k.createElement(ft,{language:n,classNames:{root:_.prism,code:_.code},radius:s,noCopy:i,copyLabel:l,copiedLabel:u,withLineNumbers:c,highlightLines:g,scrollAreaComponent:m,trim:d,getPrismTheme:p,colorScheme:f,variant:y},r))}const He=ft;He.Tabs=Yr,He.Tab=h.Tabs.Tab,He.TabsList=h.Tabs.List,He.Panel=Hr;function nn({id:e,onSuccess:t,styles:n=Ie}){const{t:r}=L.useTranslation(),s=Te.useModals(),i=async()=>{if(e){D.showNotification({id:"for-deleting",title:r("common.state.pending"),message:r("global_sql_snippet.state.deleting"),loading:!0,autoClose:!1});try{await Z.sql_snippet.delete(e),D.updateNotification({id:"for-deleting",title:r("common.state.successful"),message:r("global_sql_snippet.state.deleted",{name:e}),color:"green",autoClose:!0}),t()}catch(u){D.updateNotification({id:"for-deleting",title:r("common.state.failed"),message:u.message,color:"red",autoClose:!0})}}},l=()=>s.openConfirmModal({title:r("global_sql_snippet.delete"),labels:{confirm:r("common.actions.confirm"),cancel:r("common.actions.cancel")},onCancel:()=>console.log("Cancel"),onConfirm:i,cancelProps:{size:n.button.size},confirmProps:{color:"red",size:n.button.size}});return a.jsx(h.Button,{size:n.button.size,color:"red",onClick:l,leftIcon:a.jsx(B.IconTrash,{size:20}),children:r("common.actions.edit")})}function Vr({content:e}){return a.jsxs(h.HoverCard,{width:"60vw",shadow:"md",children:[a.jsx(h.HoverCard.Target,{children:a.jsx(h.ActionIcon,{size:16,children:a.jsx(B.IconEye,{})})}),a.jsx(h.HoverCard.Dropdown,{children:a.jsx(He,{language:"sql",noCopy:!0,withLineNumbers:!0,children:e})})]})}const Wr=Ue("DataSourceList",({styles:e=Ie})=>{const{t}=L.useTranslation(),{data:n=[],loading:r,refresh:s}=me.useRequest(async()=>{const{data:i}=await Z.sql_snippet.list({pagination:{page:1,pagesize:10}});return i},{refreshDeps:[]});return a.jsxs(a.Fragment,{children:[a.jsxs(h.Group,{pt:e.spacing,position:"apart",children:[a.jsx(h.Alert,{children:t("global_sql_snippet.description")}),a.jsx(Gt,{onSuccess:s})]}),a.jsxs(h.Box,{mt:e.spacing,sx:{position:"relative"},children:[a.jsx(h.LoadingOverlay,{visible:r}),a.jsxs(h.Table,{horizontalSpacing:e.spacing,verticalSpacing:e.spacing,fontSize:e.size,highlightOnHover:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:t("common.name")}),a.jsx("th",{}),a.jsx("th",{children:t("common.created_at")}),a.jsx("th",{children:t("common.updated_at")}),a.jsx("th",{children:t("common.action")})]})}),a.jsx("tbody",{children:n.map(i=>{const{id:l,content:u,create_time:c,update_time:g}=i;return a.jsxs("tr",{children:[a.jsx("td",{children:l}),a.jsx("td",{width:50,children:a.jsx(Vr,{content:u})}),a.jsx("td",{width:200,children:c}),a.jsx("td",{width:200,children:g}),a.jsx("td",{width:400,children:a.jsxs(h.Group,{position:"left",children:[a.jsx(Ut,{...i,onSuccess:s}),a.jsx(nn,{id:l,onSuccess:s})]})})]},l)})})]})]})]})}),Kr=()=>Promise.resolve().then(()=>Zr).then(({version:e})=>(console.log(`[@devtable/dashboard] version: ${e}`),e)),Zr=Object.freeze(Object.defineProperty({__proto__:null,version:"13.42.
|
|
44
|
+
`)return null;const se=ne+1,ge=U({line:Q,key:ne}),we=se in p,fe=M==="dark"?P.fn.rgba(P.fn.themeColor((ue=p[se])==null?void 0:ue.color,9),.25):P.fn.themeColor((ce=p[se])==null?void 0:ce.color,0);return k.createElement("div",Ye(De({},ge),{className:z(te.line,ge.className),style:De({},we?{backgroundColor:fe}:null)}),d&&k.createElement("div",{className:te.lineNumber,style:{color:we?P.fn.themeColor((pe=p[se])==null?void 0:pe.color,M==="dark"?5:8):void 0}},((xe=p[se])==null?void 0:xe.label)||se),k.createElement("div",{className:te.lineContent},Q.map((Ve,Re)=>{var Le,Ee;const Ne=ae({token:Ve,key:Re});return k.createElement("span",Ye(De({},Ne),{style:Ye(De({},Ne.style),{color:we?P.fn.themeColor((Le=p[se])==null?void 0:Le.color,M==="dark"?5:8):(Ee=Ne==null?void 0:Ne.style)==null?void 0:Ee.color})}))})))}).filter(Boolean)))))});ft.displayName="@mantine/prism/Prism";var Pr=h.createStyles((e,{radius:t})=>({tab:{paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,height:h.rem(34),border:`${h.rem(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]}`,borderBottom:0,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderRadius:0,"&:first-of-type":{borderTopLeftRadius:e.radius.sm},"&:not(:first-of-type)":{borderLeft:0},"&:last-of-type":{borderTopRightRadius:e.radius.sm},"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]},"&[data-active]":{color:e.colorScheme==="dark"?e.white:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.fn.rgba(e.colors.gray[0],.65),"&::before":{backgroundColor:"transparent"}}},prism:{borderRadius:e.fn.radius(t),borderTopRightRadius:0,borderTopLeftRadius:0,border:`${h.rem(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,borderTop:0,overflow:"hidden"},code:{borderTopRightRadius:0,borderTopLeftRadius:0,border:0}}));const Xt=Pr;var Br=Object.defineProperty,Mr=Object.defineProperties,Gr=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,en=(e,t,n)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tn=(e,t)=>{for(var n in t||(t={}))Qt.call(t,n)&&en(e,n,t[n]);if(nt)for(var n of nt(t))Jt.call(t,n)&&en(e,n,t[n]);return e},Ur=(e,t)=>Mr(e,Gr(t)),qr=(e,t)=>{var n={};for(var r in e)Qt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nt)for(var r of nt(e))t.indexOf(r)<0&&Jt.call(e,r)&&(n[r]=e[r]);return n};function Yr(e){const{classes:t}=Xt({radius:e.radius});return k.createElement(h.Tabs,Ur(tn({},e),{variant:"outline",classNames:{tab:t.tab},translate:"no"}))}function Hr(e){var t=e,{language:n,children:r,radius:s,noCopy:i,copyLabel:l,copiedLabel:u,withLineNumbers:c,highlightLines:g,scrollAreaComponent:m,trim:d,getPrismTheme:p,colorScheme:f,variant:y}=t,b=qr(t,["language","children","radius","noCopy","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","trim","getPrismTheme","colorScheme","variant"]);const{classes:_}=Xt({radius:s});return k.createElement(h.Tabs.Panel,tn({},b),k.createElement(ft,{language:n,classNames:{root:_.prism,code:_.code},radius:s,noCopy:i,copyLabel:l,copiedLabel:u,withLineNumbers:c,highlightLines:g,scrollAreaComponent:m,trim:d,getPrismTheme:p,colorScheme:f,variant:y},r))}const He=ft;He.Tabs=Yr,He.Tab=h.Tabs.Tab,He.TabsList=h.Tabs.List,He.Panel=Hr;function nn({id:e,onSuccess:t,styles:n=Ie}){const{t:r}=L.useTranslation(),s=Te.useModals(),i=async()=>{if(e){D.showNotification({id:"for-deleting",title:r("common.state.pending"),message:r("global_sql_snippet.state.deleting"),loading:!0,autoClose:!1});try{await Z.sql_snippet.delete(e),D.updateNotification({id:"for-deleting",title:r("common.state.successful"),message:r("global_sql_snippet.state.deleted",{name:e}),color:"green",autoClose:!0}),t()}catch(u){D.updateNotification({id:"for-deleting",title:r("common.state.failed"),message:u.message,color:"red",autoClose:!0})}}},l=()=>s.openConfirmModal({title:r("global_sql_snippet.delete"),labels:{confirm:r("common.actions.confirm"),cancel:r("common.actions.cancel")},onCancel:()=>console.log("Cancel"),onConfirm:i,cancelProps:{size:n.button.size},confirmProps:{color:"red",size:n.button.size}});return a.jsx(h.Button,{size:n.button.size,color:"red",onClick:l,leftIcon:a.jsx(B.IconTrash,{size:20}),children:r("common.actions.edit")})}function Vr({content:e}){return a.jsxs(h.HoverCard,{width:"60vw",shadow:"md",children:[a.jsx(h.HoverCard.Target,{children:a.jsx(h.ActionIcon,{size:16,children:a.jsx(B.IconEye,{})})}),a.jsx(h.HoverCard.Dropdown,{children:a.jsx(He,{language:"sql",noCopy:!0,withLineNumbers:!0,children:e})})]})}const Wr=Ue("DataSourceList",({styles:e=Ie})=>{const{t}=L.useTranslation(),{data:n=[],loading:r,refresh:s}=me.useRequest(async()=>{const{data:i}=await Z.sql_snippet.list({pagination:{page:1,pagesize:10}});return i},{refreshDeps:[]});return a.jsxs(a.Fragment,{children:[a.jsxs(h.Group,{pt:e.spacing,position:"apart",children:[a.jsx(h.Alert,{children:t("global_sql_snippet.description")}),a.jsx(Gt,{onSuccess:s})]}),a.jsxs(h.Box,{mt:e.spacing,sx:{position:"relative"},children:[a.jsx(h.LoadingOverlay,{visible:r}),a.jsxs(h.Table,{horizontalSpacing:e.spacing,verticalSpacing:e.spacing,fontSize:e.size,highlightOnHover:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:t("common.name")}),a.jsx("th",{}),a.jsx("th",{children:t("common.created_at")}),a.jsx("th",{children:t("common.updated_at")}),a.jsx("th",{children:t("common.action")})]})}),a.jsx("tbody",{children:n.map(i=>{const{id:l,content:u,create_time:c,update_time:g}=i;return a.jsxs("tr",{children:[a.jsx("td",{children:l}),a.jsx("td",{width:50,children:a.jsx(Vr,{content:u})}),a.jsx("td",{width:200,children:c}),a.jsx("td",{width:200,children:g}),a.jsx("td",{width:400,children:a.jsxs(h.Group,{position:"left",children:[a.jsx(Ut,{...i,onSuccess:s}),a.jsx(nn,{id:l,onSuccess:s})]})})]},l)})})]})]})]})}),Kr=()=>Promise.resolve().then(()=>Zr).then(({version:e})=>(console.log(`[@devtable/dashboard] version: ${e}`),e)),Zr=Object.freeze(Object.defineProperty({__proto__:null,version:"13.42.11"},Symbol.toStringTag,{value:"Module"}));C.APIClient=G,C.APIKeyList=yr,C.AccountList=hr,C.AddAPIKey=Bt,C.AddAccount=zt,C.AddDataSource=Nt,C.AddSQLSnippet=Gt,C.DataSourceList=cr,C.DefaultApiClient=wt,C.DeleteAPIKey=Mt,C.DeleteAccount=Pt,C.DeleteDataSource=$t,C.DeleteSQLSnippet=nn,C.FacadeApiClient=Et,C.Login=br,C.SQLSnippetList=Wr,C.UpdateSQLSnippet=Ut,C.configureAPIClient=At,C.facadeApiClient=Tt,C.getVersion=Kr,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|